Repository navigation
Conversation
A draft whose folder was removed outside the app (for example a worktree deleted from a terminal) kept showing the composer, but its Location answered LocationNotFoundError, so no providers, models or agents ever loaded: the model and variant controls stayed hidden with no explanation. The draft view now reads the same Location `missing` signal the session composer uses and replaces the composer with a notice that names the folder and lets the user choose another directory, which moves the draft there. The project selector below stays available too.
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
The fix works. With the PR's e2e setup, the base still shows the composer and a No Git chip with no explanation for a draft whose folder is missing. With this change, the draft shows the notice, and choosing a folder brings back the composer and the model control. All of new-session.spec.ts passes, and the packages/app typecheck passes.
Public API: unchanged. The change is UI-only, and the new i18n keys fall back to English in other locales.
One point to look at: the "Choose directory" button moves the draft through a separate path that skips the project registration the project selector does (see the inline comment).
This overlaps with #50952, which also replaces the draft composer with a panel offering "Choose directory" (plus permission-denied handling and more actions). Maintainers will probably want to pick one approach for the new-session view.
Related: #50951
| project={project} | ||
| workspace={workspace} | ||
| onRelocate={(directory) => { | ||
| if (search.draftId) tabs.updateDraft(search.draftId, { directory, worktree: undefined, branch: undefined }) |
There was a problem hiding this comment.
This moves the draft with a bare tabs.updateDraft. The project selector's add flow (addProject → selectProject in new-session/project/controller.ts) does the same picker + updateDraft, but it also calls projects.open(dir)/projects.touch(dir), keeps the server key, and handles worktree through workspaceSelectionDestination. A folder picked from this notice that isn't a known project won't be registered the way the selector registers it. Could the notice reuse props.project's add action (or selectProject) instead of a separate onRelocate path, so both ways of moving a draft behave the same?


Issue for this PR
Closes #56476
Type of change
What does this PR do?
The draft view now checks the same
location().missingsignal the session composer uses. When the draft's folder is gone, it replaces the composer with a notice showing the path and a "Choose directory" button, which moves the draft there (tabs.updateDraft). The project selector below still works too.Before, the draft kept showing the composer while every location request failed with
LocationNotFoundError, so the composer never left its loading state and the model and variant controls stayed hidden with no explanation.How did you verify your code works?
new-session.spec.ts: a draft on a deleted folder shows the notice; choosing the project folder brings back the composer and model control. The test fails without the change.new-session.spec.tsandsession-location-sync.spec.tspass, apart from two tests that fail the same way ondevon a macOS host.Screenshots / recordings
Checklist
Added by the opencode bot (AI-generated).
Related: #50951