summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Hill <[email protected]>2026-01-16 13:17:22 +0000
committerDavid Hill <[email protected]>2026-01-16 13:17:22 +0000
commit1fd496a5e25c762bdc3cadb261b255485bde3417 (patch)
tree601facf783b047c63d4d80e41b72f3f24f02cf75
parent74d584af342221a5573a10f61061623acb502c56 (diff)
downloadopencode-1fd496a5e25c762bdc3cadb261b255485bde3417.tar.gz
opencode-1fd496a5e25c762bdc3cadb261b255485bde3417.zip
fix: expand workspaces by default when enabled
-rw-r--r--packages/app/src/pages/layout.tsx17
1 files changed, 13 insertions, 4 deletions
diff --git a/packages/app/src/pages/layout.tsx b/packages/app/src/pages/layout.tsx
index e58b2b0c7..b692903c6 100644
--- a/packages/app/src/pages/layout.tsx
+++ b/packages/app/src/pages/layout.tsx
@@ -325,10 +325,19 @@ export default function Layout(props: ParentProps) {
createEffect(() => {
if (!pageReady()) return
if (!layoutReady()) return
- for (const [directory, expanded] of Object.entries(store.workspaceExpanded)) {
- if (layout.sidebar.workspaces(directory)()) continue
- if (!expanded) continue
- setStore("workspaceExpanded", directory, false)
+ const project = currentProject()
+ if (!project) return
+
+ const enabled = layout.sidebar.workspaces(project.worktree)()
+ const dirs = [project.worktree, ...(project.sandboxes ?? [])]
+
+ for (const directory of dirs) {
+ const expanded = store.workspaceExpanded[directory]
+ if (enabled && expanded === undefined) {
+ setStore("workspaceExpanded", directory, true)
+ } else if (!enabled && expanded) {
+ setStore("workspaceExpanded", directory, false)
+ }
}
})