Repository navigation
feat(app): remember debug bar visibility across restarts - #59146
opencode-agent[bot] wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
The approach looks right: the visibility moves into a Store.global the debug extension owns, following the package's stored-state rules. I couldn't run it here because the sandbox has no browser for the web app. Typecheck (tsc -b), the gui-extensions tests and oxlint on the changed files all pass.
Public API: unchanged. The only new thing is the stored key extension.debug.bar, and nothing else reads it.
One thing worth fixing: the bar can now be visible at startup, so its lazy chunk should be preloaded from the stored state (see inline).
Please add a before/after screenshot or a short clip of the bar coming back after a reload, since I couldn't capture one.
| // Window-local; every window starts with the bar hidden. | ||
| const [visible, setVisible] = createSignal(false) | ||
| const bar = ctx.stores.bar | ||
| const visible = () => bar.value.visible |
There was a problem hiding this comment.
Now that the bar can be visible at startup, the first render of window.bottom will hit <Suspense> while ./bar (~740 lines) loads, so the bar pops in after first paint. Per the Performance rules in packages/gui-extensions/AGENTS.md, an area that can be visible at startup should start its preload in setup from the stored state, e.g. if (bar.value.visible) void DebugBar.preload(). It may also be worth preloading it in toggle before turning it on.
Closes #54121
The debug bar's visibility lived in a window-local signal, so it reset to hidden on every launch. It now lives in a
Store.globalowned by the debug extension (extension.debug.bar,{ visible: boolean }, default hidden), so toggling it on keeps it on after a restart or reload.Since the store is app-wide, the toggle now applies to every window rather than just the one it was run in.
Verified with a throwaway Playwright run against the web app: toggle on → reload → still visible → toggle off → reload → still hidden. The same run fails at the first post-reload assertion on
dev.Requested by: @Brendonovich (Brendan via Slack)