Skip to content

fix(web): remember the document pane's tab across a reload - #122

Merged
brianjfox merged 1 commit into
mainfrom
fix/remember-pane-tab
Nov 3, 2026
Merged

brianjfox merged 1 commit into
mainfrom
fix/remember-pane-tab

Conversation

@brianjfox

Copy link
Copy Markdown
Contributor

Closes #121

What

The document pane remembers the tab the person was on, per project, in this browser, and returns to it after a reload.

Why

The pane kept its tab only in component state, so every reload opened the default (the live app once the build has started, else the document furthest along) and the person had to find their place again. Details in #121.

Changes

  • apps/web/src/pages/workspace/artifact-pane.tsx: the pane takes projectId and keeps the tab under sb.paneTab.<projectId> through stored-preference.ts, written on the person's choice, on a document the page opens, and on the pane's own jump to a new draft or concept. On a visit, availableTab says whether the remembered tab can be shown yet; a side tab (live app, manual, themes, draft, concept) is restored once it is there, and a remembered document opens through resolveSelection in place of the default. While a remembered tab waits, the pane's jumps to a new draft or concept hold off; the person choosing anything ends the wait. A remembered tab that is not here falls back to the default as before.
  • apps/web/src/pages/workspace/index.tsx: passes the project id.
  • artifact-pane.test.tsx covers availableTab and the remembered document in resolveSelection.

The pane kept its tab in component state, so a reload opened the default and the person had to find their place again. The tab the person is on is kept per project in this browser, like the other preferences, and restored once it can be shown; the pane's own jumps to a new draft or concept wait for that, and the person's choice always wins.
@brianjfox
brianjfox merged commit 27e9c75 into main Nov 3, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The document pane forgets its tab on a browser reload

1 participant