)]}'
{
  "commit": "b5739403b1b6ec6fac909b258bd47ce5a338940e",
  "tree": "0dcc652908a7978912d1e5c20d6b95431da2a6e0",
  "parents": [
    "364f741483c1bd2c18cb3ff2ad255c9042c5362d"
  ],
  "author": {
    "name": "Philip Zeyliger",
    "email": "philip@bold.dev",
    "time": "Mon Jun 02 07:04:34 2025 -0700"
  },
  "committer": {
    "name": "Philip Zeyliger",
    "email": "philip@bold.dev",
    "time": "Mon Jun 02 07:04:34 2025 -0700"
  },
  "message": "Add end session user feedback survey with skaband client coordination\n\nImplement comprehensive end session feedback system with thumbs up/down rating,\noptional text comments, and proper coordination with skaband clients to ensure\nfeedback delivery before process termination.\n\n- Add EndFeedback struct with Happy boolean and Comment string fields\n- Extend Agent struct with endFeedback field and GetEndFeedback/SetEndFeedback methods\n- Update State struct to include End field for exposing feedback in API\n- Modify /end handler to accept survey data (happy, comment fields)\n- Add skaband client coordination with WaitGroup and wait_for_end parameter\n\n- Replace simple window.confirm with custom modal dialog\n- Create comprehensive survey UI with thumbs up/down buttons\n- Add optional textarea for detailed feedback\n- Implement proper button state management and validation\n- Maintain existing redirect behavior after successful end request\n\n- Track clients connecting with /stream?wait_for_end\u003dtrue parameter\n- Use WaitGroup to coordinate end session messaging\n- Proper WaitGroup management with conditional defer to prevent double-decrement\n- Smart timeout handling: measure elapsed time and ensure minimum 100ms response delay\n- Wait up to 2 seconds for waiting clients, timeout gracefully if needed\n\n**Survey Dialog Features:**\n- Modal overlay with centered positioning and backdrop click handling\n- Visual feedback for thumbs up/down selection with color coding\n- Expandable textarea for optional detailed comments\n- Cancel option to abort end session process\n- Proper event handling and cleanup\n\n**State Management:**\n- EndFeedback data flows through Agent -\u003e State -\u003e SSE streams\n- Clients waiting for end automatically receive feedback via state updates\n- WaitGroup ensures coordinated shutdown after notification delivery\n- Exactly one Done() call per Add() to prevent race conditions\n\n**API Contract:**\nPOST /end now accepts:\n{\n  \"reason\": \"user requested end of session\",\n  \"happy\": true,  // optional boolean\n  \"comment\": \"Great experience!\"  // optional string\n}\n\n**Error Handling:**\n- Survey submission proceeds even if rating not selected (null happy value)\n- Empty comments are handled gracefully\n- Network failures fall back to existing error reporting\n- Proper resource cleanup and thread-safe operations\n\n**Testing:**\n- Added comprehensive unit tests for EndFeedback functionality\n- Updated mockAgent to implement new CodingAgent interface methods\n- All existing tests continue to pass\n- Manual API testing confirmed survey data flows correctly\n\nThis enhances user experience by collecting valuable feedback while maintaining\nrobust session termination and proper coordination with external monitoring\nsystems via the skaband protocol.\n\nCo-Authored-By: sketch \u003chello@sketch.dev\u003e\nChange-ID: s16561e134e8e81aak\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "438d326d1409417f31f9cbf31f7488b4af5d6924",
      "old_mode": 33188,
      "old_path": "loop/agent.go",
      "new_id": "5e28bfc731573c48cc577121fac468dc96a1f5a8",
      "new_mode": 33188,
      "new_path": "loop/agent.go"
    },
    {
      "type": "modify",
      "old_id": "e62947e37b8defd723ef9a4aa0fa54390fbb8839",
      "old_mode": 33188,
      "old_path": "loop/server/loophttp.go",
      "new_id": "53776aa170ff114debb55a33d0d8c4c0c8eb2558",
      "new_mode": 33188,
      "new_path": "loop/server/loophttp.go"
    },
    {
      "type": "modify",
      "old_id": "cedf6aa7f17331e1dcf60571e8a3656f51dba742",
      "old_mode": 33188,
      "old_path": "loop/server/loophttp_test.go",
      "new_id": "54cfcd30e0af1b0a11b9a88805a50623708d7a91",
      "new_mode": 33188,
      "new_path": "loop/server/loophttp_test.go"
    },
    {
      "type": "modify",
      "old_id": "53cc96f06e3478d1b3f9179579078b179c05adc6",
      "old_mode": 33188,
      "old_path": "webui/src/types.ts",
      "new_id": "5bb9f55cce3438db0a37eb0c5e74cb07b56f2d1a",
      "new_mode": 33188,
      "new_path": "webui/src/types.ts"
    },
    {
      "type": "modify",
      "old_id": "0659241d8bddddc9ab8e6afd3434cc1e4b3619af",
      "old_mode": 33188,
      "old_path": "webui/src/web-components/sketch-app-shell.ts",
      "new_id": "43ae3bde52e335931b535773df9088356bc9d88f",
      "new_mode": 33188,
      "new_path": "webui/src/web-components/sketch-app-shell.ts"
    }
  ]
}
