Skip to content

fix(dashboard): persist the status strip across tab swaps (JEF-410)#232

Merged
thejefflarson merged 1 commit into
mainfrom
thejefflarson/jef-410-persistent-strip
Jul 12, 2026
Merged

fix(dashboard): persist the status strip across tab swaps (JEF-410)#232
thejefflarson merged 1 commit into
mainfrom
thejefflarson/jef-410-persistent-strip

Conversation

@thejefflarson

Copy link
Copy Markdown
Owner

Problem

After the client-only move (JEF-408, #231), switching tabs made the persistent status strip (the honesty header) blank and repaint. app.jsx read the strip from the per-tab payload state.data.strip, and store.setActiveTab nulls data on 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}.json payload), so it should persist.

Fix

Decouple the strip from the per-tab body in the store:

  • Store gets a dedicated strip field (initial null).
  • applySnapshot refreshes strip from the snapshot's global posture (keeps the last value if a snapshot omits it).
  • setActiveTab clears only datastrip is deliberately preserved across the swap.
  • app.jsx renders <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 a setActiveTab (body cleared, header retained); a strip-less snapshot never regresses the header to blank.
  • Full suite: npm test → 86 passed; bundle rebuilt from source.

Closes JEF-410. Follow-up to JEF-408 / ADR-0027.

🤖 Generated with Claude Code

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
@thejefflarson thejefflarson merged commit 8eb5cac into main Jul 12, 2026
5 checks passed
@thejefflarson thejefflarson deleted the thejefflarson/jef-410-persistent-strip branch July 12, 2026 20:25
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