[codex] Support multiple checkouts in workspace picker#4407
[codex] Support multiple checkouts in workspace picker#4407juliusmarminge wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Needs human review This PR introduces a new user-facing feature (multiple checkout support in the workspace picker) with new UI components, state management, and user interactions. New features that change user-facing behavior warrant human review. You can customize Macroscope's approvability policy. Learn more. |
9800407 to
278333f
Compare
278333f to
56c11f1
Compare
56c11f1 to
a30cf29
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON, but a cloud agent failed to start.
Reviewed by Cursor Bugbot for commit a30cf29. Configure here.
Co-authored-by: codex <codex@users.noreply.github.com>
a30cf29 to
6e9d76d
Compare

Problem
Repository grouping collapses projects with the same canonical repository into one logical project. When two independent clones of that repository are registered on the same environment, the new-thread workspace picker only exposed the representative clone. Users could not select the other checkout or use it as the base for a new worktree.
Root cause
The workspace selector modeled only the workspace mode (
Current checkoutorNew worktree). It did not retain the physical project dimension after the logical repository group was selected, even though draft sessions already support a scoped physical project reference.Fix
Current checkoutandNew worktree…beneath each checkout.Verification
vp fmt --checkon all changed filesvp run --filter @t3tools/web typecheckBranchToolbar.logic.test.tssuite: 39 passing testsvp lintNew worktree…made clone A the active baseCurrent checkoutswitched the physical project to clone BNote
Support multiple checkouts in the workspace picker of the branch toolbar
availableCheckoutsandonWorkspaceChangeprops toBranchToolbarandBranchToolbarEnvModeSelector, enabling per-checkout local/worktree selection when multiple checkouts exist for the same logical project.ChatView, computes the list of logical project checkouts filtered by environment and de-duplicated by normalized path (preferring the active project), then wiresonWorkspaceChangeso selecting a checkout updates the draft thread'sprojectRef,envMode, andstartFromOrigin.buildCheckoutWorkspaceChoicesanddedupeCheckoutOptionsto generate selector entries and remove path duplicates respectively.onWorkspaceChangeis only active in draft mode and when the environment is not locked; single-checkout contexts preserve the original two-option behavior.Macroscope summarized 6e9d76d.
Note
Low Risk
UI and draft-context wiring only; no auth, server, or git execution paths. Wrong selection would affect which project a new draft targets.
Overview
When a logical repository has more than one physical clone on the same environment, the desktop workspace control now lists each checkout instead of only toggling local vs new worktree for the current project.
BranchToolbar.logicaddsdedupeCheckoutOptions(normalized roots, active project wins on duplicates) andbuildCheckoutWorkspaceChoices(per-checkoutlocal/worktreeselect values).ChatViewbuildslogicalProjectCheckoutsfrom the active logical group and wiresonWorkspaceChangefor draft threads soprojectRef,envMode,startFromOrigin, and worktree path stay consistent when switching clone or mode.BranchToolbarEnvModeSelectorgroups the menu by checkout title and abbreviated path, with Current checkout and New worktree… under each group; the trigger showstitle · modewhen multiple checkouts exist. Single-checkout and locked behavior is unchanged; mobile workspace UI is unchanged.Reviewed by Cursor Bugbot for commit 6e9d76d. Bugbot is set up for automated code reviews on this repo. Configure here.