Skip to content

bug(app): blank sidebar panel when navigating directly to a project URL #16837

@minhhieugma

Description

@minhhieugma

Description

When opening the app by navigating directly to a project URL (e.g. clicking a session link from another tab, reloading a project page, or deep-linking), the sidebar panel renders completely blank — no project name, no branch, no session list, no New Session button.

The root cause is in the layout's auto-select createEffect in packages/app/src/pages/layout.tsx. It skips execution when state.autoselect is false, which is always the case when a dir param is already present in the URL (i.e. on direct navigation). This means layout.projects.open() is never called, so layout.projects.list() stays empty, currentProject() returns undefined, and the SidebarPanel renders blank.

The fix is a second createEffect that detects when the URL contains a directory that is not yet in the open projects list and calls openProject(dir, false) to register it without triggering a navigation.

Plugins

No response

OpenCode version

1.2.24

Steps to reproduce

  1. Open opencode web (e.g. opencode web --port 4097)
  2. From the home screen, click on a project to open it — this sets the URL to /<base64-dir>/session
  3. Copy that URL and open it in a new tab (or press Ctrl+R to reload)
  4. Observe: the left sidebar shows no project name, no sessions, no New Session button — completely blank
  5. Refreshing with Ctrl+R does NOT fix it (unlike the workspace-deletion bug in Missing sidebar content #12335)

Expected: the sidebar correctly displays the project corresponding to the directory in the URL.

Screenshot and/or share link

Image

Operating System

Windows 11

Terminal

Microsoft Edge

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwebRelates to opencode on web / desktop

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions