Skip to content

feat(web): add guarded branch switching to chat input - #2670

Merged
bobleer merged 2 commits into
GCWing:1.0.0-explorefrom
bobleer:bob/chat-input-branch-switcher
Aug 29, 2026
Merged

feat(web): add guarded branch switching to chat input#2670
bobleer merged 2 commits into
GCWing:1.0.0-explorefrom
bobleer:bob/chat-input-branch-switcher

Conversation

@bobleer

@bobleer bobleer commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Make the branch chip above the chat input open a searchable branch switcher.
  • Detect checkout conflicts caused by local changes, show affected files and diff stats, and support commit-then-switch.
  • Keep managed worktree and detached-dispatch branch labels read-only, and move the switcher under the Git feature owner.

Type and Areas

Type: Feature / UI/UX / test

Areas: Web UI, Git tooling, internationalization

Motivation / Impact

Users can switch ordinary workspace branches directly from the chat input strip. When checkout would overwrite local changes, the UI explains which files block the switch and offers a safe commit-and-retry path without creating duplicate commits on retry.

Verification

  • Node 22.23.2: npx --yes node@22.23.2 /Users/liwenbo/.npm-global/lib/node_modules/pnpm/bin/pnpm.mjs --dir src/web-ui run test:run — 579 test files and 4184 tests passed.
  • pnpm --dir src/web-ui exec vitest run --maxWorkers=50% src/flow_chat/components/ChatInputWorkspaceStripLayout.test.ts src/tools/git/components/branchSwitchFailure.test.ts src/tools/git/components/BranchQuickSwitch.test.tsx src/flow_chat/components/ChatInputWorkspaceStrip.test.tsx — 61 tests passed.
  • pnpm run check:web — passed.
  • pnpm run i18n:audit — passed with 0 warnings.
  • git diff --check — passed.

Reviewer Notes

Rebased onto upstream/1.0.0-explore at cb87d9c6e. Local UI behavior was exercised. Remote workspace and Peer Device Mode were not exercised end to end; the implementation uses the existing routed Git service rather than direct host APIs. Managed worktrees and detached dispatches remain explicitly read-only in this surface.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@bobleer
bobleer force-pushed the bob/chat-input-branch-switcher branch from 02ad5ed to 9b84d4c Compare August 29, 2026 10:23
@bobleer
bobleer merged commit c409084 into GCWing:1.0.0-explore Aug 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant