Skip to content

fix(workspace): deterministic bootstrap pane id to stop hydration mismatch#195

Open
rotecodefraktion wants to merge 1 commit into
ipapakonstantinou:devfrom
rotecodefraktion:fix/workspace-deterministic-pane-id
Open

fix(workspace): deterministic bootstrap pane id to stop hydration mismatch#195
rotecodefraktion wants to merge 1 commit into
ipapakonstantinou:devfrom
rotecodefraktion:fix/workspace-deterministic-pane-id

Conversation

@rotecodefraktion

Copy link
Copy Markdown

What changed

makePane() used uuidv4() for the very first (pre-rehydration) pane,
so SSR and the client's first render produced different
editor-tabpanel ids, tripping a React hydration mismatch. The
bootstrap pane now uses a fixed BOOTSTRAP_PANE_ID; persisted panes
(real uuids) replace it client-side after rehydration, so there is no
SSR-vs-client id to mismatch.

Why

Eliminates a console hydration warning (and the associated client
re-render) on first load.

How it was tested

  • npm run lint
  • npm run typecheck (clean)
  • npm testworkspaceSplits, workspaceNavHistory, workspaceRecents: 31 pass
  • npm run build
  • Sync change? n/a
  • UI change? No visual change — same layout, only the bootstrap pane id is now deterministic.

Notes

Single-file change (src/stores/workspaceStore.ts).

…match

makePane() used uuidv4() for the very first pane, so the SSR render and
the client's first render produced different editor-tabpanel ids,
tripping a React hydration mismatch. Use a fixed BOOTSTRAP_PANE_ID for
the pre-rehydration pane; persisted panes (real uuids) replace it
client-side after rehydration, so there is no SSR comparison to fail.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant