chore(sidebar): review cleanup — wordmark, isMissingSkip, progress source, checklist race, external-mutation pushes#5
Merged
Conversation
…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>
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.
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
.xpg-wordmark20px → 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 forexpurgeat 24px.isMissingSkip(#10) — extracted theskipReason.startsWith('missing:')predicate (duplicated ×4) into one exportedisMissingSkip(item)incoordinator.ts, co-located withprogressOf. Now used byprogressOf, the sidebar checklist, and both options coverage counts. Small unit test added, mirroringcoordinator.test.ts.SidebarView's own progress instead of recomputingprogressOffrom a freshGET_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 staystotal / total).GET_RUN_STATEpaint when a newer refresh (or ano-runclear) has superseded it.windowId-guarded, same one-linerhandleStopRunuses), 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.console.warnwhenhandleStartRunresolves nowindowId(latent; options Start always passes one), so a silently-dead sidebar is diagnosable.Gate
npm run typecheck && npm test && npm run buildall green — 167 tests pass (+2 forisMissingSkip).Manual verification (needs Firefox)
🤖 Generated with Claude Code