fix(app): create fresh web sessions in server directory#37607
Open
ndj888 wants to merge 3 commits into
Open
Conversation
added 3 commits
July 18, 2026 09:02
…ects On a fresh `opencode web` start, the "New Session" button in the titlebar silently does nothing and the home page hides its "New Session" buttons. This happens because: 1. `newSessionProject()` in home.tsx relies solely on `projects()` (persisted opened projects), which is empty. 2. `openNewTab()` in titlebar.tsx has a 5-case fallback chain that all fail when no projects are persisted: home selection is empty, layout.projects.list() is empty, and global.ensureServerCtx(conn).projects.list() returns only persisted projects — never server-registered ones. Fix: - home.tsx: add sync data fallback to `newSessionProject` (registered projects from the server API) - titlebar.tsx: add a final fallback that reads server-registered projects from sync.data.project when all other cases fail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #37606
Type of change
What does this PR do?
When the opened-project list is empty, new sessions now fall back to the server startup directory returned by
/path.The home empty state exposes its New Session action, and the titlebar action opens and remembers that directory before creating the draft. Existing selected, recent, and opened-project behavior stays unchanged.
How did you verify your code works?
/new-session?draftId=...for the server startup directory.bun test --preload ./happydom.ts ./src/pages/layout/helpers.test.ts(29 passed).bun run typecheckand Prettier checks.Screenshots / recordings
The browser verification rendered the new-session composer for the server startup directory from a clean storage state.
Checklist