)]}'
{
  "commit": "6d3de48ec0ec2fb8f194a11f1711b7128b7d1699",
  "tree": "14325a290001d13a482c116c83ee0b87aa7e36c5",
  "parents": [
    "a1762b94e6ddf5db0a0f6b7a5104fa236855320b"
  ],
  "author": {
    "name": "philip.zeyliger",
    "email": "philip.zeyliger@gmail.com",
    "time": "Tue Jun 10 19:38:14 2025 -0700"
  },
  "committer": {
    "name": "Philip Zeyliger",
    "email": "philip@bold.dev",
    "time": "Tue Jun 10 19:40:16 2025 -0700"
  },
  "message": "feat: add -link-to-github flag with Octocat icon for GitHub branch linking\n\nAdd internal flag to enable GitHub branch linking in both termui and webui\ninterfaces, displaying clickable Octocat icons next to copy icons for pushed\nbranches when working with GitHub repositories.\n\nProblem Analysis:\nWhen sketch pushes branches to GitHub repositories, users had no direct way to\nnavigate from the sketch interface to view those branches on GitHub. Branch\nnames were displayed as plain text in both terminal and web interfaces,\nrequiring users to manually construct GitHub URLs or switch to external tools\nto view their pushed changes on the GitHub platform.\n\nThis created friction in the workflow, especially for teams collaborating on\nGitHub where quick access to branch views, pull request creation, and code\nreview processes are essential parts of the development workflow.\n\nImplementation Changes:\n\n1. Command Line Flag Infrastructure:\n   - Added linkToGitHub bool field to CLIFlags struct\n   - Configured -link-to-github as internal flag with false default\n   - Integrated flag passing through ContainerConfig and AgentConfig chains\n   - Added flag to dockerimg launch command arguments for container mode\n\n2. Agent Interface Enhancement:\n   - Added LinkToGitHub() method to CodingAgent interface\n   - Implemented method in Agent struct returning config.LinkToGitHub\n   - Extended State struct with link_to_github JSON field (with omitempty)\n   - Updated getState() function to include agent\u0027s GitHub linking preference\n   - Updated mockAgent in tests to support new LinkToGitHub() method\n\n3. Terminal UI GitHub Integration:\n   - Added isGitHubRepo() method with regex pattern matching for GitHub URLs\n   - Implemented getGitHubBranchURL() for constructing GitHub branch links\n   - Enhanced commit message display to show GitHub URLs when flag enabled\n   - Updated exit summary to include GitHub links for single and multiple branches\n   - Added regex import for GitHub URL pattern validation\n\n4. Web UI TypeScript Integration:\n   - Added link_to_github field to State interface in types.ts\n   - Enhanced formatGitHubRepo() method to return owner/repo extraction\n   - Implemented getGitHubBranchLink() helper in container status component\n   - Created parallel helper methods in timeline message component\n\n5. Container Status Component Updates:\n   - Added commit-info-container with flexbox layout for proper alignment\n   - Implemented layout: Branch Text → Copy Icon → Octocat Icon\n   - Added 16px clipboard copy icon with opacity states (70% default, 100% on hover)\n   - Integrated 16px Octocat SVG icon as clickable GitHub link\n   - Maintained existing copyCommitInfo click functionality for branch text\n\n6. Timeline Message Component Enhancement:\n   - Added commit-branch-container for consistent layout structure\n   - Implemented same layout pattern: Branch Text → Copy Icon → Octocat Icon\n   - Added 14px clipboard and Octocat icons matching timeline scale\n   - Enhanced CSS with hover states and proper alignment\n   - Preserved existing copyToClipboard functionality for branch text clicks\n\n7. Data Flow Integration:\n   - Updated sketch-timeline component to pass state to message components\n   - Modified sketch-app-shell to provide containerState to timeline\n   - Ensured proper state propagation through component hierarchy\n   - Maintained backward compatibility with existing state management\n\nTechnical Details:\n- GitHub URL detection supports HTTPS, SSH, and git protocol formats\n- Regex patterns: ^https://github\\.com/, ^git@github\\.com:, ^git://github\\.com/\n- Link format: https://github.com/{owner}/{repo}/tree/{branch-name}\n- Internal flag prevents exposure in user-visible help documentation\n- SVG Octocat uses official GitHub icon design with 16-point grid\n- Copy icons use standard clipboard SVG with overlapping rectangles design\n- Event propagation properly stopped to prevent interference with copy actions\n- Conditional rendering ensures icons only appear when GitHub links available\n- Flexbox layout ensures proper alignment across different screen sizes\n- CSS transitions provide smooth hover state animations\n\nBenefits:\n- Direct navigation from sketch UI to GitHub branch views\n- Seamless integration with GitHub-based development workflows\n- Enhanced productivity for teams using GitHub collaboration features\n- Clear functional separation: text copy vs external GitHub link\n- Familiar clipboard icon reinforces copy functionality\n- Improved visual hierarchy guides user interaction patterns\n- Maintains existing copy-to-clipboard functionality as fallback\n- Zero impact on non-GitHub repositories or when flag disabled\n- Consistent experience across terminal and web interfaces\n- Enhanced accessibility with distinct click targets and hover states\n\nTesting:\n- Verified flag parsing and configuration propagation through all layers\n- Confirmed GitHub URL detection works with various GitHub URL formats\n- Tested conditional rendering in both web UI components\n- Validated CSS styling and hover effects for GitHub branch links\n- Ensured backward compatibility with non-GitHub repositories\n- Verified TypeScript compilation with new template structures\n- Confirmed proper icon positioning and spacing in test layouts\n- Validated hover states and opacity transitions function correctly\n- All Go tests and TypeScript compilation successful\n\nThis enhancement bridges the gap between sketch\u0027s development environment and\nGitHub\u0027s collaboration platform, enabling more efficient workflows for teams\nusing GitHub repositories while preserving full functionality for other Git\nhosting solutions. The visual design provides intuitive flow from local\noperations (copy) to external actions (GitHub), creating a more organized\nand user-friendly interface for branch management workflows.\n\nCo-Authored-By: sketch \u003chello@sketch.dev\u003e\nChange-ID: s1c083b45b5401c2bk\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4df1271c4966b49cce8edd7915f5fcb028a9d355",
      "old_mode": 33188,
      "old_path": "cmd/sketch/main.go",
      "new_id": "02ae66c72f9de9f60d64b80984a85098734937c9",
      "new_mode": 33188,
      "new_path": "cmd/sketch/main.go"
    },
    {
      "type": "modify",
      "old_id": "f423bb97cf89ffbba959b6c93bc7630c6426c766",
      "old_mode": 33188,
      "old_path": "dockerimg/dockerimg.go",
      "new_id": "12c65f356cb669e857711ddf0774280aab322b50",
      "new_mode": 33188,
      "new_path": "dockerimg/dockerimg.go"
    },
    {
      "type": "modify",
      "old_id": "2cf2e4c1cfd0e7bef906b4fac92931894d9343a2",
      "old_mode": 33188,
      "old_path": "loop/agent.go",
      "new_id": "628270565c5bf8f6f852841668ed54cdc93228c1",
      "new_mode": 33188,
      "new_path": "loop/agent.go"
    },
    {
      "type": "modify",
      "old_id": "cc5ccc369e89bfc1809d550f6d295312da1b4b7f",
      "old_mode": 33188,
      "old_path": "loop/server/loophttp.go",
      "new_id": "6c2debc0830a66e2a747243e9ed5a99e8e2f81b8",
      "new_mode": 33188,
      "new_path": "loop/server/loophttp.go"
    },
    {
      "type": "modify",
      "old_id": "bb5bd21bf7d8c80a8e5deda224000cad4694e162",
      "old_mode": 33188,
      "old_path": "loop/server/loophttp_test.go",
      "new_id": "5d054fc5b02eb74d0a2037c525bbd68ee59c8a4d",
      "new_mode": 33188,
      "new_path": "loop/server/loophttp_test.go"
    },
    {
      "type": "modify",
      "old_id": "512fa6537562217d401f934f09e8d7290841c76b",
      "old_mode": 33188,
      "old_path": "termui/termui.go",
      "new_id": "48c5f537641987fba361ff374d12e5ea1c451085",
      "new_mode": 33188,
      "new_path": "termui/termui.go"
    },
    {
      "type": "modify",
      "old_id": "2ecd412098cb851c829f05b2f71a91b5b1bd939b",
      "old_mode": 33188,
      "old_path": "webui/src/types.ts",
      "new_id": "f79e35dac83446bba07a154a5a6794bbfcd0cc7c",
      "new_mode": 33188,
      "new_path": "webui/src/types.ts"
    },
    {
      "type": "modify",
      "old_id": "967f502b8ae2e1415d438d4b6f1f942d66589c78",
      "old_mode": 33188,
      "old_path": "webui/src/web-components/sketch-app-shell.ts",
      "new_id": "29e12bad2eca2bad8f0904736f6e2317708c1b78",
      "new_mode": 33188,
      "new_path": "webui/src/web-components/sketch-app-shell.ts"
    },
    {
      "type": "modify",
      "old_id": "0e93604f9ec8e41c11a4c9eb874713b1f94ebba6",
      "old_mode": 33188,
      "old_path": "webui/src/web-components/sketch-container-status.test.ts",
      "new_id": "dd37d1f2932f8c1f367d46642e6d4141642ca18c",
      "new_mode": 33188,
      "new_path": "webui/src/web-components/sketch-container-status.test.ts"
    },
    {
      "type": "modify",
      "old_id": "21993424238abd0d451e93e11e36e3a18eb27a13",
      "old_mode": 33188,
      "old_path": "webui/src/web-components/sketch-container-status.ts",
      "new_id": "560044a104690cebf057592348a64d80882f844d",
      "new_mode": 33188,
      "new_path": "webui/src/web-components/sketch-container-status.ts"
    },
    {
      "type": "modify",
      "old_id": "3fe519f50f51f1f9cea25fe41c1c5db60f98dc0e",
      "old_mode": 33188,
      "old_path": "webui/src/web-components/sketch-timeline-message.ts",
      "new_id": "9ea1cedf05e779dce564330e0adf29f6b87f6dc4",
      "new_mode": 33188,
      "new_path": "webui/src/web-components/sketch-timeline-message.ts"
    },
    {
      "type": "modify",
      "old_id": "3dd17a227aae63f2f0fce6d84956a5664dc1b14b",
      "old_mode": 33188,
      "old_path": "webui/src/web-components/sketch-timeline.ts",
      "new_id": "c450330076f715a63c5cc1fd30cd02b3df0510d3",
      "new_mode": 33188,
      "new_path": "webui/src/web-components/sketch-timeline.ts"
    }
  ]
}
