Repository navigation
fix(app): prefer exact project directory matches - #55782
udayasree25 wants to merge 2 commits into
Conversation
Resolve the selected project by exact normalized worktree before falling back to sandbox membership or project ID. This keeps sibling clone labels and checkmarks aligned with the selected directory. Co-authored-by: Copilot <[email protected]>
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
Looks good. I reproduced #55351 in the web UI run from source: three clones of one repo, with the other two listed in the app-dev project's sandboxes. On the base, the new-session chip and checkmark stay on app-dev while app-uat and then app-release are selected. With this change they follow the selected directory. The new exact-match tests fail on the base and pass here, and the packages/app type check passes.
Public API: unchanged.
Non-blocking, possibly for a follow-up: the same single find() that matches worktree or sandboxes together is still used in session/session-identity-header.tsx, runtime/extension/mounted-session.ts (listedProject) and home/sessions/records.ts. With sibling clones they could resolve to the canonical entry instead of the exact directory.
Related: #50821


Issue for this PR
Closes #55351
Type of change
What does this PR do?
An earlier canonical project can win on sandbox membership before the resolver reaches the exact selected directory. I'm leaning toward exact-directory precedence here, keeping the server filter and sandbox/project-ID fallbacks; happy to adjust if sandbox matches are intentionally meant to override explicit entries.
If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!
How did you verify your code works?
From
packages/app:bun test --conditions=solid --isolate --preload ./happydom.ts ./src/new-session— passed, 21 tests. Both new exact-match cases fail before the fix; coverage includes Windows separators and sandbox fallback.bun typecheck— passed.From the repository root:
bun run check— passed via the mandatory pre-push gate: lint and all 36 typecheck tasks (Bun 1.4.2, Node 24.22.0).bun x --no-install prettier --check packages/app/src/new-session/project/selector.tsx packages/app/src/new-session/project/selector.test.tsx— passed.git diff --check— passed.Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
Real selector in a temporary Storybook fixture, with
/repo/app-uatselected and shared sandbox metadata. Also verified that selectingapp-releaseupdates both the chip and checkmark. This is component-level browser verification, not a full Desktop end-to-end run.Checklist
If you do not follow this template your PR will be automatically rejected.
Added by the opencode bot (AI-generated).
Related: #50821