Skip to content

feat(app): default new-session directory to workspace folder (#872) - #874

Merged
jeonghun-jj-lee merged 1 commit into
mainfrom
872-default-workspace-dir
Sep 7, 2026
Merged

feat(app): default new-session directory to workspace folder (#872)#874
jeonghun-jj-lee merged 1 commit into
mainfrom
872-default-workspace-dir

Conversation

@jeonghun-jj-lee

Copy link
Copy Markdown
Contributor

Closes #872

Problem

New sessions default their directory to the engine scaffold dir, not a VS Code workspace folder. The sidebar's orphan guard rejects this path, so #841 expand/scroll silently fails.

Fix

Two code paths create drafts — draftDirectory() in tabs.tsx and the navigate bridge in app.tsx. Both now check workspaceProjects() first (the extension's real VS Code folder list) before falling back to server.projects.list() (the engine's scaffold dir).

This is a fork change synced via overlay:

Changes

File What
app.tsx:482-489 Navigate bridge prefers workspaceProjects() for /new-session drafts
tabs.tsx:64-70 draftDirectory() prefers workspaceProjects() over server.projects.list()
amicode-workspace-projects.test.ts 7 new source-pattern tests: preference, fallback, override
manifest.json Hash updates for the 3 overlay files

Test results

  • Fork: 1077 unit + 41 browser = 0 failures
  • Extension: 2794 passed, 0 failures

AC checklist

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…for #872)

Syncs the fork's #872 change into the overlay. Two code paths —
draftDirectory() in tabs.tsx and the navigate bridge in app.tsx — now
check workspaceProjects() first before falling back to
server.projects.list().

Fork PR: harmoniqs/opencode#308
7 new tests in amicode-workspace-projects.test.ts.
@jeonghun-jj-lee
jeonghun-jj-lee force-pushed the 872-default-workspace-dir branch from 03be5d6 to 413be70 Compare September 7, 2026 04:45
@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review September 7, 2026 04:48
@jeonghun-jj-lee
jeonghun-jj-lee merged commit f22e9a6 into main Sep 7, 2026
10 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.

feat(app): default new-session directory to workspace folder when workspace-projects available

1 participant