Skip to content

Show the workspace inspector per workspace - #608

Open
thiblahute wants to merge 1 commit into
powerfooI:mainfrom
thiblahute:upstream/inspector-per-workspace
Open

thiblahute wants to merge 1 commit into
powerfooI:mainfrom
thiblahute:upstream/inspector-per-workspace

Conversation

@thiblahute

Copy link
Copy Markdown
Collaborator

Summary

Showing or hiding the workspace Inspector (Files, Changes, Commits, Agent History) now applies to the current workspace only. Switching workspaces shows each one's Inspector as it was left there, in that checkout's view, dock and expansion, and a reload brings it back.

Why

The open state was one session-wide value that followed every workspace switch (keepInspectorForWorkspace): opening Changes in one workspace opened it in every workspace visited afterwards, and closing it anywhere closed it everywhere. The view, dock and size were already per checkout; only whether it is shown was not.

What changed

  • web/src/inspectorShown.ts (new): inspectorShown.v1 in localStorage, connection id to the ids of the workspaces whose Inspector was left shown. Validated on read (anything malformed reads as hidden), capped, and a full storage only loses the memory.
  • web/src/App.tsx:
    • commitInspectorState records a user show or hide for that workspace; a hide caused by switching to a workspace that has it hidden is not recorded, so the one left keeps it shown.
    • keepInspectorForWorkspace (desktop) opens the target workspace's Inspector in its checkout's remembered view, or hides it.
    • The focus layout effect follows every switch, and restores the shown Inspector after a reload.
    • Phones are unchanged.
  • scripts/check-web-assets.mjs: initial JS budget 833 to 834 KiB, gzip 257 to 258 KiB. This adds about 1.4 KiB raw to the initial bundle and main sits within 0.7 KiB of the raw ceiling.
  • FEATURES.md (Workspace Inspector) and docs/ARCHITECTURE.md (Workspace resource ownership).

No migration: the open state was never persisted before.

Verification

  • bun test web/src/inspectorShown.test.ts: per connection and workspace, malformed or unwritable storage.
  • bun run format:check, bun run lint, bun run typecheck:bun, bun run build:web, bun run test:quick with an isolated HOME/TMPDIR.
  • Asset budget: initial JS 833.7/834 KiB, gzip 257.1/258 KiB.

Manual checks

  • Show Changes in workspace A, switch to B: hidden there. Show Files in B, switch back to A: Changes is shown in A.
  • Reload while A has it shown: it comes back in A.
  • Hide it in A, switch to B and back: still hidden in A, still shown in B.
  • On a phone, nothing changes.

Showing or hiding Files, Changes, Commits and History now applies to the
workspace you are in only. Switching workspaces shows each one's inspector
as it was left there, in that checkout's view, dock and expansion, and a
reload brings it back. A workspace where it was never shown keeps it
hidden. Phones are unchanged.

The shown state is kept per browser, connection and workspace in
localStorage (inspectorShown.v1); before, one open state followed every
switch.

The initial JS budget goes from 833 to 834 KiB (gzip 257 to 258 KiB):
main sits within half a KiB of both ceilings.
@github-actions github-actions Bot added the enhancement New feature or request label Nov 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant