fix(dashboard): persist the status strip across tab swaps (JEF-410)#232
Merged
Merged
Conversation
After the client-only move (JEF-408) the strip was read from the per-tab payload
(`state.data.strip`), and `setActiveTab` nulls `data` on a swap to drop the old
tab's body — which also blanked the strip until the new tab's snapshot landed, so
the persistent honesty header tore down and repainted on every tab switch.
Decouple the strip from the per-tab body: the store now holds a dedicated `strip`
field, updated from every snapshot's global posture and held across a tab swap
(`setActiveTab` clears only `data`). `app.jsx` renders `<StatusStrip strip={state.strip}/>`.
The header is drawn once and reconciles in place; a tab switch no longer blanks it.
First-paint (no snapshot yet) still renders nothing — blank is honest (absent ≠ green).
Tests: the strip updates from each snapshot and survives a tab swap; a strip-less
snapshot never regresses the header to blank.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VtjoJttCvBY4dzCoE4f9vP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After the client-only move (JEF-408, #231), switching tabs made the persistent status strip (the honesty header) blank and repaint.
app.jsxread the strip from the per-tab payloadstate.data.strip, andstore.setActiveTabnullsdataon a swap (to drop the old tab's body before the new one loads) — which also blanked the strip until the new tab's snapshot landed. So the header tore down on every switch. The strip is global posture (identical in every/api/{tab}.jsonpayload), so it should persist.Fix
Decouple the strip from the per-tab body in the store:
Storegets a dedicatedstripfield (initialnull).applySnapshotrefreshesstripfrom the snapshot's global posture (keeps the last value if a snapshot omits it).setActiveTabclears onlydata—stripis deliberately preserved across the swap.app.jsxrenders<StatusStrip strip={state.strip}/>(persistent field).The header is drawn once, stays mounted, and Preact reconciles it in place as posture changes; a tab switch no longer blanks it. First-paint (no snapshot yet) still renders nothing — blank is honest (absent ≠ green), and green still renders only when
strip["all-clear"].Tests
store.test.js: the strip updates from each snapshot and survives asetActiveTab(body cleared, header retained); a strip-less snapshot never regresses the header to blank.npm test→ 86 passed; bundle rebuilt from source.Closes JEF-410. Follow-up to JEF-408 / ADR-0027.
🤖 Generated with Claude Code