Skip to content

fix(app): show the missing-folder notice for a new-session draft - #56477

Open
rohankc69 wants to merge 1 commit into
anomalyco:devfrom
rohankc69:draft-missing-folder
Open

rohankc69 wants to merge 1 commit into
anomalyco:devfrom
rohankc69:draft-missing-folder

Conversation

@rohankc69

@rohankc69 rohankc69 commented Oct 17, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #56476

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The draft view now checks the same location().missing signal 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?

  • A new e2e test in 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.ts and session-location-sync.spec.ts pass, apart from two tests that fail the same way on dev on a macOS host.
  • The app typecheck and lint pass.

Screenshots / recordings

opencode-pr-56477-screenshot The draft now shows a "Folder unavailable" notice with the missing path and a "Choose directory" button.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Related: #50951

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.
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Before

After

project={project}
workspace={workspace}
onRelocate={(directory) => {
if (search.draftId) tabs.updateDraft(search.draftId, { directory, worktree: undefined, branch: undefined })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

This branch has not been deployed

No deployments
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.

New-session draft shows no model picker when its folder was deleted

1 participant