Skip to content

chore(sidebar): review cleanup — wordmark, isMissingSkip, progress source, checklist race, external-mutation pushes#5

Merged
DustinVK merged 2 commits into
mainfrom
chore/sidebar-cleanup
Jul 3, 2026
Merged

chore(sidebar): review cleanup — wordmark, isMissingSkip, progress source, checklist race, external-mutation pushes#5
DustinVK merged 2 commits into
mainfrom
chore/sidebar-cleanup

Conversation

@DustinVK

@DustinVK DustinVK commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Batched low-risk follow-ups from the sidebar-nav code review (plan/sidebar-cleanup-spec.md, §2 + §4). Six independent items, kept separate from the challenge-flag redesign (plan/challenge-tab-registry-spec.md) so that review stays focused. Does not close Q-016.

Changes

  1. Wordmark (#13).xpg-wordmark 20px → 24px, the STYLEGUIDE §4 floor (below it the tear-strip perforation collapses). Judgment call per §4: kept the wordmark rather than switching to the glyph — a sidebar header has ample room for expurge at 24px.
  2. isMissingSkip (#10) — extracted the skipReason.startsWith('missing:') predicate (duplicated ×4) into one exported isMissingSkip(item) in coordinator.ts, co-located with progressOf. Now used by progressOf, the sidebar checklist, and both options coverage counts. Small unit test added, mirroring coordinator.test.ts.
  3. Header progress source (#9) — the sidebar header now reads the pushed SidebarView's own progress instead of recomputing progressOf from a fresh GET_RUN_STATE. The fetch still runs — it feeds the checklist item list — but no longer the header, so the header can't disagree with the detail. No behavior change (stopped stays total / total).
  4. Checklist fetch-race (#8) — a module generation token drops a stale GET_RUN_STATE paint when a newer refresh (or a no-run clear) has superseded it.
  5. REVERDICT / MARK_SENT sidebar pushes (§4) — both now push the resting view (windowId-guarded, same one-liner handleStopRun uses), so editing a completed item from the dashboard refreshes the sidebar's done/stopped summary. Tactical fix — the push-after-mutation choke-point is left as a separate follow-up.
  6. Defensive windowId warn (#15)console.warn when handleStartRun resolves no windowId (latent; options Start always passes one), so a silently-dead sidebar is diagnosable.

Gate

npm run typecheck && npm test && npm run build all green — 167 tests pass (+2 for isMissingSkip).

Manual verification (needs Firefox)

  • Wordmark reads right at sidebar width.
  • A reverdict from the options dashboard refreshes the sidebar's done/stopped summary.

🤖 Generated with Claude Code

DustinVK and others added 2 commits July 1, 2026 20:27
…urce, checklist race, external-mutation pushes

Batched low-risk follow-ups from the sidebar-nav review (§2 + §4), kept
separate from the challenge-flag redesign. Does not close Q-016.

- wordmark: bump 20px → 24px (STYLEGUIDE §4 floor; below it the tear-strip
  perforation collapses). Reads fine at sidebar width.
- extract isMissingSkip(item) to coordinator.ts; use in progressOf, the
  sidebar checklist, and the two options coverage counts (was duplicated ×4).
  Add a unit test mirroring coordinator.test.ts.
- sidebar header progress now reads the pushed view's own progress instead of
  recomputing progressOf from a fresh GET_RUN_STATE (the fetch still feeds the
  item list). Keeps the header consistent with the detail.
- checklist fetch-race: generation token drops a stale GET_RUN_STATE paint when
  a newer refresh (or a no-run clear) has superseded it.
- REVERDICT / MARK_SENT now push the resting sidebar view (windowId-guarded),
  so editing a completed item from the dashboard refreshes the done/stopped
  summary. Tactical fix; the choke-point is a separate follow-up.
- defensive console.warn when handleStartRun resolves no windowId (#15).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…d header

Two review findings on chore/sidebar-cleanup:

1. Sticky-view break (this branch): handleReverdict pushed the resting
   view (deriveView focus=null) unconditionally, but the handler only
   requires the target be `verdicted` — reachable mid-run. A mid-run
   dashboard re-verdict then clobbered the sidebar's active-tab view with
   `revisit`. Gate both the REVERDICT and MARK_SENT resting-view pushes on
   isComplete(updated) so only genuinely-complete runs refresh the
   done/stopped summary; mid-run the active-item view stands. isComplete
   now imported from ./coordinator.

2. Stopped-header honesty (pre-existing): viewProgress `stopped` returned
   done=total → header "12 / 12 checked" while the detail said "Checked 8
   of 12." Return done=view.checked so the header mirrors the honest
   detail. Sidebar header string only; progressOf/coordinator untouched.

Both edits are in the imperative shell over already-covered pure logic
(isComplete in coordinator.test.ts, view.checked in state.test.ts).
npm test 167 green, typecheck + build clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@DustinVK DustinVK merged commit 84c4b75 into main Jul 3, 2026
2 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.

1 participant