From 9436ff7cf658ef93bd1db6167b6afb5807a4ba4b Mon Sep 17 00:00:00 2001 From: pterw Date: Fri, 30 Oct 2026 22:13:04 -0400 Subject: [PATCH 01/12] docs(playbook): Record PR #281 and open the UI Minors side task Section 3 still described the weekly chart geometry branch as awaiting its PR after PR #281 merged. Record the merge and open the owner-approved side task that bundles the UI audit's deferred Minors on fix/ui-audit-minors. The smoothing defect that headed that list is already fixed on main. --- docs/agents/PLAYBOOK.md | 62 +++++++++---------- .../PLAYBOOK_EXECUTION_LOG_ARCHIVE.md | 22 +++++++ 2 files changed, 51 insertions(+), 33 deletions(-) diff --git a/docs/agents/PLAYBOOK.md b/docs/agents/PLAYBOOK.md index 6f6d0be9..1cea428b 100644 --- a/docs/agents/PLAYBOOK.md +++ b/docs/agents/PLAYBOOK.md @@ -69,17 +69,20 @@ See FINDINGS F-DOCSYNC-3. ## 3. Active batch + next action -- **Weekly chart geometry side task:** The owner approved the in-file - geometry design and its bounded Rule 3 exception on 2026-10-30. Work runs - on `refactor/weekly-chart-geometry` in a clean worktree from `main`; - WT003 is owner-authorized advisory for this side task. The approved plan - is `docs/superpowers/plans/2026-10-30-weekly-chart-geometry.md`. - The stronger rendered-geometry and midpoint checks are committed. - Drawing, selection and composition tests now use the geometry module; - the full suite and frontend gate pass. The independent whole-branch review - is complete, with its sole README-date finding fixed. The branch is ready - for the implementation commit and template PR; publication state lives - in the PR. +- **UI audit Minors side task (owner, 2026-10-31):** branch + `fix/ui-audit-minors`, cut from `main` at `18a4242d`. It bundles the minor + findings that the 2026-10-27 UI audit's reviews deferred into one bug-fix + PR: collect them, check each against current `main`, triage each row with + the owner (fix, defer with a finding id, or drop), then plan and land the + accepted fixes. The streamgraph smoothing defect that headed the list + (negative band thickness beside a one-week spike) is already fixed on + `main` by PR #280's `streamSafeSegments`, with a curve-sampling test. The + owner also asked for the streamgraph's bottom month labels to match the + heatmap's month labels in typeface and size. + +- **Weekly chart geometry side task:** Complete and merged as PR #281, merge + commit `18a4242d`. The execution record is + `docs/superpowers/plans/2026-10-30-weekly-chart-geometry.md`. - **Listening view side task:** Complete and merged as PR #280, merge commit `c1ca5f18`. Independent F-SWE-8 work stays gated. The execution record is @@ -200,6 +203,21 @@ non-current operational logs. Older dated entries live in +### 2026-10-31 - Record the merged chart work and open the UI Minors side task + +Section 3 still described the weekly chart geometry branch as awaiting its +PR, although PR #281 merged on 2026-10-30 (merge commit `18a4242d`). This +entry records that merge and opens the UI audit Minors side task on +`fix/ui-audit-minors`, which the owner approved on 2026-10-31. Docs only: no +runtime, test or dependency change. The smoothing defect that headed the +deferred list was checked against `main` first. Codex's case (53 weeks, one +artist with 100 plays in week 26 only) now gives a minimum band thickness of +0 rather than -11.11, so it is not part of this side task's work. + +Validation: the full suite measured **3108 passed**; pre-commit on all +files and the final docsync check pass. Next: collect and triage the deferred +Minors, then write the plan. + ### 2026-10-30 - Make weekly chart geometry own drawing and selection Extract the connected calculation into the approved in-file geometry model. @@ -259,25 +277,3 @@ suite measured **3113 passed** in 198.05 seconds. Baseline hooks passed; final docsync and hooks are rerun after this entry is rendered. Forward guidance and execution checkboxes live in `docs/superpowers/plans/2026-10-30-weekly-chart-geometry.md`. - -### 2026-10-29 - Reconcile Listening design notes after bot review - -The owner authorized opening PR #280 after green CI and fixing bot concerns. -Quality Gate run `40880774113` succeeded at 014c6d75; the PR left draft and the -template checklist was updated. Codex completed without findings. Graphify's -three inline coupling advisories were checked against source and the base; -the shared fixture and interaction assertions remain cohesive. Replied with -that evidence and resolved the threads without metric-driven refactoring. -Its additional helper advisories concern residual-only coverage. - -The documentation check found old Heatmap copy and a width-only result -description in the current reconciliation table. Correct four current rows -to reference source owners and the approved Listening follow-up. Preserve -the frozen snapshots and dated sections. The full suite measured -**3113 passed** in 145.79 seconds; no tests or runtime code changed. Repository -hooks and final docsync passed before the focused documentation commit. -After pushing, verify the new head's CI and bot feedback and fast-forward -the owner preview. Qlty's status passes but its description reports 13 -blocking issues; the detailed list requires separate login and has not been -validated. The execution record is -`docs/superpowers/plans/2026-10-28-streamgraph-context-halo.md`. diff --git a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md index 5a88b8dc..b89149b1 100644 --- a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md +++ b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md @@ -9,6 +9,28 @@ Read helpers: - `rg -n "^### 20" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` - `rg -n "" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` +### 2026-10-29 - Reconcile Listening design notes after bot review + +The owner authorized opening PR #280 after green CI and fixing bot concerns. +Quality Gate run `40880774113` succeeded at 014c6d75; the PR left draft and the +template checklist was updated. Codex completed without findings. Graphify's +three inline coupling advisories were checked against source and the base; +the shared fixture and interaction assertions remain cohesive. Replied with +that evidence and resolved the threads without metric-driven refactoring. +Its additional helper advisories concern residual-only coverage. + +The documentation check found old Heatmap copy and a width-only result +description in the current reconciliation table. Correct four current rows +to reference source owners and the approved Listening follow-up. Preserve +the frozen snapshots and dated sections. The full suite measured +**3113 passed** in 145.79 seconds; no tests or runtime code changed. Repository +hooks and final docsync passed before the focused documentation commit. +After pushing, verify the new head's CI and bot feedback and fast-forward +the owner preview. Qlty's status passes but its description reports 13 +blocking issues; the detailed list requires separate login and has not been +validated. The execution record is +`docs/superpowers/plans/2026-10-28-streamgraph-context-halo.md`. + ### 2026-10-29 - Verify Listening profile guards and prepare the handoff The owner requested Listening blur verification, review of uncommitted files From 8dc99ba4904a822a8c9439d26bfa141b5fd72676 Mon Sep 17 00:00:00 2001 From: pterw Date: Fri, 30 Oct 2026 23:01:21 -0400 Subject: [PATCH 02/12] docs(plan): Define the UI audit Minors bug fixes The owner accepted a triage of the UI audit's deferred Minors. Record the chosen rows with their evidence in a spec and slice the fixes into eleven atomic tasks, four of which land only after an owner preview. The plan's one review found a pointer-focus gap and a false export claim; both are fixed here. Validation: `pytest -q` -- **3108 passed**. --- docs/agents/PLAYBOOK.md | 41 ++-- .../PLAYBOOK_EXECUTION_LOG_ARCHIVE.md | 18 ++ .../plans/2026-10-31-ui-audit-minors.md | 222 +++++++++++++++++ .../2026-10-31-ui-audit-minors-design.md | 230 ++++++++++++++++++ 4 files changed, 492 insertions(+), 19 deletions(-) create mode 100644 docs/superpowers/plans/2026-10-31-ui-audit-minors.md create mode 100644 docs/superpowers/specs/2026-10-31-ui-audit-minors-design.md diff --git a/docs/agents/PLAYBOOK.md b/docs/agents/PLAYBOOK.md index 1cea428b..6fb14768 100644 --- a/docs/agents/PLAYBOOK.md +++ b/docs/agents/PLAYBOOK.md @@ -78,7 +78,11 @@ See FINDINGS F-DOCSYNC-3. (negative band thickness beside a one-week spike) is already fixed on `main` by PR #280's `streamSafeSegments`, with a curve-sampling test. The owner also asked for the streamgraph's bottom month labels to match the - heatmap's month labels in typeface and size. + heatmap's month labels in typeface and size. The owner accepted the triage + on 2026-10-31. The spec is + `docs/superpowers/specs/2026-10-31-ui-audit-minors-design.md` and the plan + is `docs/superpowers/plans/2026-10-31-ui-audit-minors.md`; four of its + visual tasks land only after the owner sees before-and-after screenshots. - **Weekly chart geometry side task:** Complete and merged as PR #281, merge commit `18a4242d`. The execution record is @@ -203,6 +207,23 @@ non-current operational logs. Older dated entries live in +### 2026-10-31 - Plan the UI audit Minors bug fixes + +The deferred Minors from the 2026-10-27 UI audit's reviews were checked +against `main` by a read-only audit. Of 79 rows, 43 were still true, and the +owner accepted a triage of them on 2026-10-31. The spec records each chosen +row with its evidence and lists the deferred and dropped rows. The plan +slices the fixes into eleven atomic tasks: stream panel keyboard and +screen-reader behaviour, gate-helper fixes, two CSS tidy-ups, and four +visual changes that land only after the owner previews them (panel header +size, key spacing, month labels, vertical centring). One plan review found +two Important issues: a focus rule that also caught pointer focus, and a +false claim about the saved image. Both were fixed with its eight Minors +before this commit. Docs only. + +Validation: the full suite measured **3108 passed**; pre-commit on all +files and the final docsync check pass. + ### 2026-10-31 - Record the merged chart work and open the UI Minors side task Section 3 still described the weekly chart geometry branch as awaiting its @@ -259,21 +280,3 @@ repoint the current Listening status to its observed merge, preserving the dated execution records. The owner-approved deviations stay as recorded in the design. The next step is the geometry module and test migration in `docs/superpowers/plans/2026-10-30-weekly-chart-geometry.md`. - -### 2026-10-30 - Approve the weekly chart geometry side task - -The owner selected the first architecture-review proposal and approved the -in-file geometry model. Record the design and two-step implementation plan -before moving runtime calculation: protect the current rendered geometry, -then deepen its calculation and migrate the consumers and composition test. -This is a side task, not a new Batch 23 work package. - -The owner explicitly permits this two-copy consolidation as a bounded -exception to global Rule 3, a clean worktree from main with WT003 advisory, -and one final independent review rather than per-commit/task reviews. -All other gates and the PR template still apply. The original preview and -its unrelated owner files remain outside this branch. The clean-worktree -suite measured **3113 passed** in 198.05 seconds. Baseline hooks passed; -final docsync and hooks are rerun after this entry is rendered. Forward -guidance and execution checkboxes live in -`docs/superpowers/plans/2026-10-30-weekly-chart-geometry.md`. diff --git a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md index b89149b1..4131637d 100644 --- a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md +++ b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md @@ -9,6 +9,24 @@ Read helpers: - `rg -n "^### 20" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` - `rg -n "" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` +### 2026-10-30 - Approve the weekly chart geometry side task + +The owner selected the first architecture-review proposal and approved the +in-file geometry model. Record the design and two-step implementation plan +before moving runtime calculation: protect the current rendered geometry, +then deepen its calculation and migrate the consumers and composition test. +This is a side task, not a new Batch 23 work package. + +The owner explicitly permits this two-copy consolidation as a bounded +exception to global Rule 3, a clean worktree from main with WT003 advisory, +and one final independent review rather than per-commit/task reviews. +All other gates and the PR template still apply. The original preview and +its unrelated owner files remain outside this branch. The clean-worktree +suite measured **3113 passed** in 198.05 seconds. Baseline hooks passed; +final docsync and hooks are rerun after this entry is rendered. Forward +guidance and execution checkboxes live in +`docs/superpowers/plans/2026-10-30-weekly-chart-geometry.md`. + ### 2026-10-29 - Reconcile Listening design notes after bot review The owner authorized opening PR #280 after green CI and fixing bot concerns. diff --git a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md new file mode 100644 index 00000000..51bf68c1 --- /dev/null +++ b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md @@ -0,0 +1,222 @@ +# UI Audit Minors Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Fix the triaged UI audit Minors: a safer streamgraph hover panel, consistent chart and key spacing, and sturdier gate helpers. + +**Architecture:** Follow the approved [design](../specs/2026-10-31-ui-audit-minors-design.md). No schema change, no new dependency, no new module. Each task is one atomic commit. + +**Tech Stack:** Existing browser JavaScript, SVG, CSS, Python pytest and the repository Playwright gate. + +## Global Constraints + +- The design owns the behaviour, the numbers and the owner's rulings C1-C6. Read it before a task brief; the task text here names tests and commands, not implementation code. +- The SDD workspace `constraints.md` binds every task: Rules R1-R14 (landing, tests, scope, PREVIEW) and the Gates block. This plan cites them and does not restate them. +- Lean tests (R9): extend an existing test before adding one; red against the unchanged code, then green; docstrings in GIVEN/WHEN/THEN form; no wording or constant pins. "No need to excessively guard every UI element" (owner, 2026-10-31). +- A "gate check" below is a function in `scripts/dev/_frontend_gate_*.py` run by `frontend_gate.py`. Its red run is the gate against the unchanged runtime; its green run is the gate after the change. +- PREVIEW tasks follow R14: Firefox screenshots, light and dark, before and after, saved to the scratch directory and listed in the report; the controller shows them to the owner; the task lands only on the owner's word. A rejected one is dropped, not reworked. +- Commit subjects are exact. The landing follows R1-R5 (PLAYBOOK, Section 4 entry, docsync, Validation line); `static/css/tailwind.css` is also Touched when the drift hook rewrites it. A code-phase patch never carries `tailwind.css`: the hook can rewrite it for any CSS or JS task (so for T3, T4, T7 and T8 in the same wave), and the landing, one task at a time, regenerates it and stages it with that task. + +## Dispatch + +Wave rule: two tasks in the same wave never share a file. `After` is "the predecessor has landed", because the next code phase is cut from the landed head. + +| Wave | Tasks (peak agents) | Why this order | +|---|---|---| +| 1 | T1 font parser, T2 pause cleanup, T3 `desktop` query, T4 footer gap (4 agents) | Unrelated files; none is PREVIEW | +| 2 | T5 stream gate hygiene, T6 panel header 13px (2 agents) | T5 opens `_frontend_gate_stream.py` first; T6 is css only | +| 3 | T7 panel behaviour, T8 key ramp spacing (2 agents) | T7 follows T5 (same gate file); T8 follows T6 (same `heatmap.css`) | +| 4 | T9 month labels (1 agent) | Follows T7 (`heatmap.js` and the stream gate) | +| 5 | T10 centring (1 agent) | Follows T9 (`heatmap.js`); the owner decides T9 first | +| 6 | T11 plan record (serial) | Ticks boxes and records commits | + +Peak: 4 agents, in wave 1. Waves 2-5 are at most 2, which also keeps the browser lock short. + +Landing order: T1, T2, T3, T4, T5, T7 land as their code phases finish (not PREVIEW). T6, T8, T9 and T10 land only after the owner's word on their screenshots. A PREVIEW task that waits blocks only the tasks that name it in `After`: T10 waits for the owner's decision on T9 (landed or dropped) so its code phase starts from the right head, and T8 for T6 for the same reason. All landings run one at a time in `C:/ssw/u8` (constraints, Shared files). + +Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `pre-commit`, `docsync-check`, and `frontend-gate` or `results-behavior` where the task says). Do not copy it. + +## Delivery sequence + +- [ ] Task 1: keep a numeric font weight after `normal`. +- [ ] Task 2: clear the stored pause choice on every exit. +- [ ] Task 3: reuse the `desktop` media query in `index.js`. +- [ ] Task 4: share the footer gap as one custom property. +- [ ] Task 5: stream gate reports an empty stream and always cleans up. +- [ ] Task 6 (PREVIEW): scrubber panel header at 13px. +- [ ] Task 7: dismissible, focus-safe stream panel. +- [ ] Task 8 (PREVIEW): heatmap key ramp spacing at the reference's 12px. +- [ ] Task 9 (PREVIEW): stream month labels match the heatmap's. +- [ ] Task 10 (PREVIEW): centre the stream in its plot band. +- [ ] Task 11: record the execution. + +## Task 1: Keep a numeric font weight after `normal` + +**Wave:** 1. **After:** none. **Mode:** code. +**Touches:** `scripts/dev/_frontend_gate_theme.py`, `tests/scripts/dev/test_frontend_gate_theme.py`. +**Commit:** `fix(gate): Keep a numeric font weight when normal follows it`. +**Closes:** audit row 3. + +**Behaviour:** In `_split_canvas_font`, a `normal` token no longer resets an earlier numeric weight. `600 normal 26px x` gives weight 600; `bold` still gives 700; a string with no weight token still gives 400. `_NAMED_WEIGHTS` keeps `bold` only. + +**Extends:** the parametrized `test_a_saved_headline_drawn_at_another_weight_is_reported` (the `("drawn", "family", "drawn_weight")` cases). + +- [ ] Add the case `("600 normal 18px x", "x", "600")` to that parametrize list. Keep `("normal 18px x", "x", "400")` as the neutral check (it cannot fail alone, which is why the new case carries the defect). +- [ ] RED: `"" -m pytest -q -p no:cacheprovider tests/scripts/dev/test_frontend_gate_theme.py -k "another_weight"` fails on the new case with `400 != 600` (or the weight reported as 400). GREEN: the same command passes after the change. Quote both lines. +- [ ] Acceptance: the whole file `tests/scripts/dev/test_frontend_gate_theme.py` passes; the three `suite-*` gates, `pre-commit` and `docsync-check` pass (this commit changes only `scripts/dev` and `tests`, so `frontend-gate` is not required). + +## Task 2: Clear the stored pause choice on every exit + +**Wave:** 1. **After:** none. **Mode:** code. +**Touches:** `scripts/dev/_frontend_gate_spotlight_photo.py`, `tests/scripts/dev/test_frontend_gate_spotlight_photo.py`. +**Commit:** `fix(gate): Clear the stored pause choice on every exit`. +**Closes:** audit row 40. + +**Behaviour:** `_pause_hold_failures` stores `ss-motion=still` for the probe page through an init script (`_STORE_PAUSE_JS`); today only the Play click clears it. After the change the probe removes the stored `ss-motion` key in its own `finally`, before it closes the page, whichever path it took. A cleanup that itself raises must not hide the original failure: if the page never navigated there is nothing stored, so the cleanup is skipped or tolerates that case; the implementer picks the shorter of the two and says which. The test asserts the behaviour (the `ss-motion` key is removed before the page closes), not the exact script string. + +**Extends:** `test_the_hold_check_focuses_then_hovers_and_counts_the_periods`, whose mock page already records `add_init_script`, `click` and `evaluate` calls. Add one new test beside it, `test_an_early_return_leaves_no_stored_pause_choice`, because the existing test drives the full path (Play clicked) and the early return is a different scenario that cannot be a parametrization of it without hiding which assertion guards what. + +- [ ] New test, GIVEN `_open_spotlight_card` returns an error string, WHEN `_pause_hold_failures` runs on the mock page, THEN it returns that error and the page evaluated a removal of `ss-motion` (found by the key name in the mock's `evaluate` calls, without pinning the script text) before closing. +- [ ] RED against the unchanged helper: the removal call is absent. GREEN after the change. Quote both. The existing test still passes unchanged. +- [ ] Acceptance: `tests/scripts/dev/test_frontend_gate_spotlight_photo.py` passes; `suite-*`, `pre-commit`, `docsync-check` pass. This commit touches `scripts/dev/_frontend_gate*`, so `frontend-gate` also passes. + +## Task 3: Reuse the `desktop` media query in `index.js` + +**Wave:** 1. **After:** none. **Mode:** code. +**Touches:** `static/js/index.js`. +**Commit:** `refactor(ui): Reuse the desktop media query in index.js`. +**Closes:** audit row 13. + +**Behaviour:** `positionForm` reads `desktop.matches` instead of building `matchMedia('(min-width: 860px)')` again. The `const desktop` declaration moves above `positionForm` so it is plainly initialised before any call (every call is at or after the `ResizeObserver` setup today, so this is for the reader, not a fix). No behaviour change, so no new test (R9, C6): the home layout checks of the frontend gate already cross 860px. + +- [ ] `git grep -n "min-width: 860px" static/js/index.js` shows the query once. +- [ ] Acceptance: `frontend-gate` passes (record its last line); `suite-*`, `pre-commit`, `docsync-check` pass. No `results-behavior` run needed (the commit touches neither `results.html`, `results.js` nor the behaviour tests). + +## Task 4: Share the footer gap as one custom property + +**Wave:** 1. **After:** none. **Mode:** code. +**Touches:** `static/css/shell.css`, `static/css/index.css`. +**Commit:** `refactor(css): Share the footer gap as one custom property`. +**Closes:** audit row 17. + +**Behaviour:** Declare one custom property for the 1.5rem footer gap in `shell.css`'s `:root` block. `.page-footer-extras` (bottom padding) and `.index-grid .index-hero` (`padding-bottom`) both read it; the comment in `index.css` that names "`static/css/shell.css` (.page-footer-extras, 1.5rem)" now names the property. The computed values do not change (1.5rem = 24px at the root size). No new test: the gate's existing equality check (`footerGap` against the pause button's `gap` in `_measure_home_pause`) is the guard and stays untouched. + +- [ ] The two footer-gap declarations (`.page-footer-extras` bottom padding, `.index-grid .index-hero` `padding-bottom`) read the custom property, and the property is declared once. `git grep -n "1.5rem"` still shows unrelated uses, and `shell.css` repeats `1.5rem` in the mobile theme slot's `padding: 1rem 1rem 1.5rem`; those are left alone, so the check is by reading those two declarations, not by counting hits. +- [ ] Acceptance: `frontend-gate` passes and its layout section reports the same pause gap as before (quote the line); `suite-*`, `pre-commit` (re-stage any `tailwind.css` rewrite), `docsync-check` pass. + +## Task 5: Stream gate reports an empty stream and always cleans up + +**Wave:** 2. **After:** none (starts the stream gate file). **Mode:** code. +**Touches:** `scripts/dev/_frontend_gate_stream.py`. +**Commit:** `fix(gate): Report an empty stream and always run its cleanup`. +**Closes:** audit rows 23 and 30. Merged into one task because both are small fixes to the same file with no browser-behaviour change; the reason to keep them out of Task 7 is L1 (one concern per commit). + +**Behaviour (row 23):** In `_paint_failures`, when `reading["fills"]` is empty the contrast line (`min(ratios)`, `max(ratios)`) is not evaluated, and the existing failure "the stream draws no artist layers in the {theme} theme" is returned instead of an exception. + +**Behaviour (row 30):** The `finally` in `check_stream_is_one_keyboard_tab_stop` runs all three cleanup steps (remove the sentinel, restore the viewport, delete the seeded job) even when an earlier one raises; the first error still surfaces. + +No test file exists for this module and none is added (C6, "no need to excessively guard every UI element"). The evidence is a temporary probe, not retained: + +- [ ] RED/GREEN for row 23: call `_paint_failures` with a hand-built reading whose `fills` is empty (a one-off script in the scratch directory): it raises `ValueError` before the change and returns the named failure after. Quote both. +- [ ] Row 30: read the changed `finally` against the three steps; show with the same kind of probe (a stub page whose first evaluate raises) that the viewport restore and `jobs.delete` still run after the change. Quote the probe output. +- [ ] Acceptance: `frontend-gate` passes (its `[stream ...]` lines unchanged); `suite-*`, `pre-commit`, `docsync-check` pass. + +## Task 6 (PREVIEW): Scrubber panel header at 13px + +**Wave:** 2. **After:** none. **Mode:** code. +**Touches:** `static/css/heatmap.css`. +**Commit:** `fix(ui): Set the scrubber panel header to 13px`. +**Closes:** audit row 25. + +**Behaviour:** `.stream-panel-header` changes from `--text-label-sm` (0.75rem = 12px, `tailwind.src.css`) to `--text-label` (0.8125rem = 13px, same file), the size the design reference gives (`.superpowers/sdd/2026-10-27-ui-audit-v6/design/reference-v6-notes.md`, line 107: stream panel "header 13px muted"). The header is `white-space: nowrap; width: max-content`, so the panel's measured width, and therefore where `showWeek` flips or lifts it, grows slightly; the stream gate's panel checks (inside the chart, fixed side at the checked weeks) must still pass. If one fails, report it; do not loosen it. + +**Tests:** none new (a font-size value is not a behaviour to pin; C6). The existing stream hover checks are the guard. + +- [ ] PREVIEW (R14): save before and after Firefox screenshots, light and dark, of the panel shown at week 30 and week 40 to the scratch directory (suffix `-6`); list the paths in the report. +- [ ] Report the computed header font size from the browser (13px expected) and the contrast of the header colour (`--stream-muted`) against the panel in both themes (min and max; the colour is unchanged, so this must equal the existing `[stream colours]` label line). +- [ ] Acceptance: `frontend-gate` passes; `suite-*`, `pre-commit`, `docsync-check` pass. Lands only on the owner's word. + +## Task 7: Dismissible, focus-safe stream panel + +**Wave:** 3. **After:** Task 5. **Mode:** code. +**Touches:** `static/js/heatmap.js`, `scripts/dev/_frontend_gate_stream.py`. +**Commit:** `fix(ui): Make the stream panel dismissible and focus-safe`. +**Closes:** audit rows 1, 26, 27, 28 and 29. One task because rows 26-28 live in the same handlers (`handleStreamFocus`, `handleStreamBlur`, `handleStreamKey`, the `pointerleave` wiring) and rows 29 and 1 are the gate check and the typo in that same code; splitting would have two commits fight over the same lines. + +**Behaviour:** + +- Row 1: `showWeek`'s guard reads `state.shown && state.shown.week`. +- Keyboard focus (rows 26 and 28), decided once: the stream svg matches `:focus-visible` (owner ruling C11). The svg is `tabindex=0`, so a click or tap focuses it too; that focus is not keyboard focus. The heatmap cells already ask the same question the same way (`syncFocusIndicators`, `matches(':focus-visible')`). Chromium turns `:focus-visible` on for a clicked element at the first key without a focus event (the comment at `syncFocusIndicators`), so the live region is also re-decided in `handleStreamKey`, not only in `handleStreamFocus`. +- Row 26: the panel is a live region (`aria-live="polite"`) only while the stream has keyboard focus: set when it gains keyboard focus (before `showStreamCursor` fills the panel), removed when it loses focus, absent at draw. A pointer scrub, or a click or tap focus, announces nothing. The first announcement on focus is not asserted (screen readers differ); the gate checks the attribute only. +- Row 27: Escape, pressed with the stream focused, hides the panel, ring, guide and dimming, keeps focus, and stores the keyboard position first, so the next arrow key shows the panel again from the same week and layer. It does not `preventDefault` for other keys. +- Row 28: `pointerleave` and `pointercancel` clear the week only when the stream does not have keyboard focus (as defined above). With keyboard focus, the shown week stays and the keys continue from it. After a click or tap, the leave still clears the panel, ring and dimming. +- Row 29: the keyboard check records whether each arrow press reached `window` with `defaultPrevented` set, and fails when one did not. + +**Extends (no new gate function):** `check_stream_is_one_keyboard_tab_stop` (rows 26-29), and `check_stream_hover_shows_panel_and_ring` (or the existing hover check that reads `_READ_HOVER_JS`; the implementer names the one it extends) for the row 26 unfocused case. + +- [ ] Focus method (C11): the gate's existing `page.locator(_STREAM).focus()` calls (`_frontend_gate_stream.py` lines about 445, 1328 and 1385) are programmatic, and whether script focus matches `:focus-visible` depends on the browser's last-interaction rule, which reading cannot settle. In each browser the gate runs, read `matches(':focus-visible')` on the stream right after the existing `.focus()` call, in the sequences the checks use (a prior `mouse.move` only, no click). If it is false anywhere, focus that step with `page.keyboard.press("Tab")` instead (the check's first step already tabs in) and say so in the report. Do not weaken the rule to make `.focus()` pass. +- [ ] Row 29, in the keyboard check: install a bubbling `keydown` listener on `window` before the first press and keep it through the whole check, so it covers the dense-week-end presses and every key of the `_KEY_STEPS` walk (Home, End and the edge clamps included); assert `defaultPrevented` was true for each. Failure text names the key. +- [ ] Click then leave (C11, new case, in the keyboard check or the hover check, the implementer says which): with the stream blurred, `page.locator(_STREAM).click()` on a plotted point, then `page.mouse.move(*_OUTSIDE)`; assert the panel, ring, guide and dimming are cleared (the `_cleared_after` helper, "after a click and a pointer leave") and `aria-live` on `#stream-panel` is not `polite`. Against the unchanged `heatmap.js` this fails on `aria-live` (it is always `polite` today); the panel clear already holds there and is the guard against a "any focus" rule, which would leave it up. +- [ ] Row 27: after the dense-week-end step, press Escape: the panel is hidden (`hidden` attribute or no `.stream-panel-row` visible), the ring and guide are gone, `document.activeElement` is still the stream; press `ArrowRight` and assert the panel shows week 7 (one right of the stored week 6) with the same row. +- [ ] Row 28: change the existing "after pointer leave" step. The sequence `_hover(page, _START_WEEK)`, `page.mouse.move(*_OUTSIDE)`, `ArrowUp` runs with the stream focused, so after the fix the panel stays on week `_START_WEEK` (26) after the mouse leaves, and `ArrowUp` moves from the pointer's row: expected `_step_failures(page, _START_WEEK, , ...)` where the pointer row is `rows["hovered"]` from `_PANEL_ROWS_JS` read right after the hover. The old expectation (week 6, row `_ARTIST_COUNT - 1`) was the defect. Keep a separate unfocused case: with the stream blurred, a pointer leave still clears everything (the existing `_cleared_after` helper). +- [ ] Row 26: unfocused pointer hover, `aria-live` on `#stream-panel` is not `polite`; after `Tab` into the stream it is `polite`; after the blur it is not. +- [ ] RED: write the new assertions first, run `"" C:/ssw/tools/with_browser_lock.py "" scripts/dev/frontend_gate.py` against the unchanged `heatmap.js`; quote the failing lines (one per row 26, 27, 28, and the click-then-leave case). For row 29, prove the check can fail with a throwaway edit that removes `event.preventDefault()` in `handleStreamKey` in the scratch worktree only; quote the failing line and revert it before the patch. +- [ ] GREEN: the same gate passes after the `heatmap.js` change. Quote the last line. +- [ ] Acceptance: `frontend-gate` passes (both engines, all profiles); `suite-*`, `pre-commit` (re-stage hook rewrites), `docsync-check` pass. The pure `streamKeyTarget` tests in `tests/frontend/test_heatmap_pure_functions.py` are unchanged and still pass (the key map is not touched). + +## Task 8 (PREVIEW): Heatmap key ramp spacing at the reference's 12px + +**Wave:** 3. **After:** Task 6 (same file, `static/css/heatmap.css`). **Mode:** code. +**Touches:** `static/css/heatmap.css`. +**Commit:** `fix(ui): Tighten the heatmap key's ramp spacing`. +**Closes:** audit row 5. + +**Behaviour:** Remove `.hm-preview__ramp`'s own `margin-top` (`calc(0.875rem * var(--index-scale, 1))`). The ramp is a grid child of `.index-key`, whose `gap` is `calc(0.75rem * var(--index-scale, 1))`, so the space under the last row becomes that gap alone: 12px at scale 1 and about 12.9px at 1920 (scale 1.075), where it is `1.625rem * scale` (26px at scale 1, about 28px at 1920) today. 12px is the reference's `display:grid; gap:12px` (`.superpowers/sdd/2026-10-27-ui-audit-v6/design/reference-v6-notes.md`, line 20); the page's own scaling rule is kept. The ramp's height is untouched. + +**Tests:** none new (C6). The home layout checks of the frontend gate must still pass; the key's height changes by about 14px and the album key (`data-mode-key="album"`) shares the grid track, so the gate's stable-height checks are the guard. + +- [ ] PREVIEW (R14): before and after Firefox screenshots of the home page in heatmap mode, light and dark, at 1920x1080 and 1280x720; scratch suffix `-8`. Report the measured pixel gap between the last key row and the ramp (before about 28px and after about 12.9px at 1920). +- [ ] Acceptance: `frontend-gate` passes; `suite-*`, `pre-commit`, `docsync-check` pass. Lands only on the owner's word. + +## Task 9 (PREVIEW): Stream month labels match the heatmap's + +**Wave:** 4. **After:** Task 7. **Mode:** code. +**Touches:** `static/js/heatmap.js`, `scripts/dev/_frontend_gate_stream.py`. +**Commit:** `fix(ui): Match the stream month labels to the heatmap's`. +**Closes:** owner ruling C2. + +**Behaviour:** The stream's bottom month labels, created in `drawStream`, get the same four label attributes as the heatmap's month labels: `font-size` 9.5, `LABEL_FONT_STACK`, `font-variant` small-caps, `letter-spacing` 0.12em. The text and `x` stay as now (cloned from the heatmap's labels). The font size was already equal in viewBox units and in rendered size (both SVGs share `svgWidth` and are `width: 100%` in `#heatmap-grid`); what differs on screen is small capitals and tracking, which the change adds. The saved image changes too (C12): `streamAsImage` overwrites only `font-family` and copies `font-variant` and `letter-spacing`, so the saved stream's month labels gain small capitals and tracking, as the saved heatmap's already have. That is the wanted outcome; the export code needs no edit, but it is checked. + +**Extends:** the stream alignment reading (`_READ_ALIGNMENT_JS`, which already returns `months` and `gridMonths` per label) and `_alignment_failures` in `check_stream_aligns_with_grid_columns`. Add to the reading each label's `fontFamily`, `fontVariant`, `letterSpacing` and rendered font size in CSS px (computed `font-size` times the SVG's `clientWidth / viewBox width`), and fail when the stream's labels differ from the heatmap's on any of the four. The comparison fails closed: if `gridMonths` is empty, or the two label counts differ, it returns a named failure before comparing per label, never an index error. + +- [ ] RED: add the comparison, run the frontend gate against the unchanged `heatmap.js`; quote the failure (variant and tracking differ). GREEN: passes after the change. Quote the last line. +- [ ] PREVIEW (R14): before and after Firefox screenshots, light and dark, of the heatmap with its stream at 1920x1080 and 1280x720, scratch suffix `-9`; report the rendered label size in CSS px at each width for both charts. State whether the end-anchored last label still sits inside the SVG (the existing `inside` field). +- [ ] PREVIEW, saved image (C12): save the stream's image through the page's save control (or run `streamAsImage` the way `check_stream_is_in_saved_image` does), crop the month-label row, and save the crop, light and dark, before and after, at 1920x1080 (suffix `-9`). Report that the labels show small capitals and tracking and that the last label is not clipped at the image edge. +- [ ] Acceptance: `frontend-gate` passes, including `check_stream_is_in_saved_image` (green, last label unclipped); `suite-*`, `pre-commit`, `docsync-check` pass. Lands only on the owner's word. If rejected, drop the task; Task 10 then starts from the head without it. + +## Task 10 (PREVIEW): Centre the stream in its plot band + +**Wave:** 5. **After:** Task 9. **Mode:** code. +**Touches:** `static/js/heatmap.js`, `tests/frontend/test_heatmap_pure_functions.py`. +**Commit:** `fix(ui): Centre the streamgraph in its plot band`. +**Closes:** owner ruling C3. + +**Behaviour:** `streamFit` always shifts the baseline so the outer envelope (`high` and `low`, which already include the halo and Bezier-control margins) is centred on the band's centre line: after the shift `high` and `-low` are equal. The scale rule is unchanged: the tallest week is `STREAM_PEAK` tall, capped so the extent fits `STREAM_BAND`. The current rule (shift only when the stack overflows) is replaced, not kept as a branch. + +**Extends (edits, not adds):** `test_stream_stack_stays_inside_the_band`. Its `moved` flag and the `ordinary-data-keeps-its-look` id assert that ordinary data is left unmoved; under C3 that is the defect. Replace the `moved` parameter with a `capped` flag (the scale is the extent cap, not the peak scale) and assert, for every case, that the extent is centred (`low + high` is zero within 1e-9) as well as inside the band. `capped=True` is for the case whose scale is the extent cap: `scale-capped-by-the-stack-extent` for certain. For the other three, the implementer reads `fit["scale"]` against `streamScale(totals)` once on the unchanged code (the shift does not change the scale) and sets `capped` where they differ, naming the result in the report; the plan does not guess it. Add `residual` to the test's `streamFit` call for one case (the existing `test_stream_fit_contains_symmetric_context_halo` parametrization shows a residual that exercises the halo), or add that residual case to the centring assertion, so a shift computed without the halo and Bezier margins fails. Rename the ids to match. `test_stream_fit_contains_symmetric_context_halo` already asserts the halo bounds stay inside the band and must pass unchanged. Other pure tests that hard-code a baseline (`test_smoothed_stream_encloses_artists_without_clipping`, the `hitAt` tests) are run and, where the shift moves a hand-derived number, corrected from first principles, never by copying the new output. + +- [ ] RED: edit the test first and run `"" -m pytest -q -p no:cacheprovider tests/frontend/test_heatmap_pure_functions.py -k "inside_the_band"`; it fails on the ordinary-data case (extent not centred). GREEN: passes after the change. Quote both. +- [ ] Run the whole file `tests/frontend/test_heatmap_pure_functions.py`; list any other test that needed a corrected number and why. +- [ ] PREVIEW (R14): before and after Firefox screenshots, light and dark, of the stream on the owner's data shape (the gate's seeded 53-week job is the stand-in unless the controller supplies the real payload) at 1920x1080; scratch suffix `-10`. Report the measured vertical offset of the stack's centre from the band centre, before (about 10px low expected) and after (0). +- [ ] Acceptance: `frontend-gate` passes (the alignment check's plot-band containment holds); `suite-*`, `pre-commit`, `docsync-check` pass. Lands only on the owner's word; if rejected, drop it. + +## Task 11: Record the UI audit Minors execution + +**Wave:** 6. **After:** every landed or dropped task above. **Mode:** serial. +**Touches:** `docs/superpowers/plans/2026-10-31-ui-audit-minors.md`, plus the landing bookkeeping files R1 names (the PLAYBOOK Section 4 entry and whatever `doc_state_sync.py --fix` rewrites). The controller's landing makes those, as for every other task; the implementer edits only the plan. +**Commit:** `docs(plan): Record the UI audit Minors execution`. + +- [ ] Tick each delivery-sequence box whose task landed. For a dropped PREVIEW task, leave the box unticked and write "dropped on the owner's word, " beside it. +- [ ] Add a short "Execution record" section: one line per task with its commit short SHA and subject, the PREVIEW decisions with the date, and the final head's gate results (`frontend-gate` and `results-behavior` last lines, the `pytest -q` count). +- [ ] The landing's own bookkeeping (R1 Section 4 entry, `doc_state_sync.py --fix`, Validation line) follows the constraints; this commit edits only the plan. +- [ ] Acceptance: the Gates block passes at the final head, with `frontend-gate` and `results-behavior` both run. diff --git a/docs/superpowers/specs/2026-10-31-ui-audit-minors-design.md b/docs/superpowers/specs/2026-10-31-ui-audit-minors-design.md new file mode 100644 index 00000000..5111b165 --- /dev/null +++ b/docs/superpowers/specs/2026-10-31-ui-audit-minors-design.md @@ -0,0 +1,230 @@ +# UI audit Minors bug-fix design + +Last updated: 2026-10-31 + +## Decision and authority + +The UI audit's deferred Minors were triaged on 2026-10-31 (79 rows, read-only +audit of `main` at 18a4242d). The owner accepted the triage and ruled on the +open questions. This is a side task before Batch 23 WP-1, not a batch work +package. The implementation plan is +[the UI audit Minors plan](../plans/2026-10-31-ui-audit-minors.md). + +Every row below was re-read against the code at 9436ff7c (the audit's code +is unchanged: 9436ff7c differs from 18a4242d only in PLAYBOOK and its +archive). Line numbers are for 9436ff7c and will move; the plan cites names. + +### Owner rulings + +- C1 "Okay, everything looks good to me. Green, row 39 is fine to drop. No + need to excessively guard every UI element." +- C2 The streamgraph's month labels match the heatmap's: "These should be + fixed for consistency then. I also noticed the font size for the months is + different, so that should be standarized." +- C3 Centring: "a preview would be nice before rendering a decision." The + candidate centres the stack's outer envelope in the plot band. PREVIEW: + lands only on the owner's word; if rejected it is dropped, not reworked. +- C4 Tooltip row order is "a non-issue"; the Aug-Sep zero-listening hairline + stays. +- C5 Row 24 (the "Job context not found" warning) is closed in the + workspace's Gates block, not in app code. +- C6 Lean suites: tests only for behaviour this PR changes; extend existing + tests first. + +PREVIEW items (C2, C3, rows 25 and 5) land only on the owner's word after +before/after Firefox screenshots (workspace rule R14). Each is its own commit, +so a rejection drops it alone. + +## In scope + +### A. Streamgraph hover panel (`static/js/heatmap.js`, `scripts/dev/_frontend_gate_stream.py`) + +**Row 1.** `showWeek`'s duplicate guard reads `state.shown &&state.shown.week` +(`heatmap.js:2091`). Add the space. No behaviour change. + +**Row 26.** The panel carries `aria-live="polite"` for its whole life +(`heatmap.js:1959`, set in `drawStream`) and `showWeek` rewrites it for every +week change (`:2133`, `fillStreamPanel`), so a pointer scrub announces +continuously. After the fix the panel is a live region only while the stream +holds keyboard focus: set in `handleStreamFocus`, removed in +`handleStreamBlur`. "Keyboard focus" is defined once for rows 26 and 28: the +stream svg matches `:focus-visible`. The svg is `tabindex="0"`, so a click or +tap focuses it too, and that focus must not count (it would leave the panel +stuck after the pointer leaves, and make pointer scrubbing announce). The +rule is `:focus-visible` rather than "focus that a key produced" because the +heatmap cells already use it for the same question +(`syncFocusIndicators`, `heatmap.js:2474`), and Firefox supports it. Chromium +turns `:focus-visible` on for a clicked element at the first key without a +focus event (the same comment), so the live region is also decided again at +each handled key press, not only in `handleStreamFocus`. The region is set +before the panel is filled (`showStreamCursor`), so the first fill is +announced where the screen reader allows; the first-focus announcement is not +asserted. A pointer scrub with no keyboard focus announces nothing; a keyboard +user hears one polite announcement per key press, which is what they asked +for. Why not drop the region outright: keyboard users would then hear +nothing when they arrow between weeks, and the stream is `role="application"`. +Why not debounce: it adds a timer and a settle rule nothing else needs. + +**Row 27.** Escape does not dismiss the panel (`handleStreamKey`, +`heatmap.js:2036-2043`; Escape appears only at `:2516` and `:2572` for +tooltips). Content on hover or focus must be dismissible (WCAG 1.4.13). After +the fix Escape, pressed while the stream has focus, hides the panel, ring, +guide and dimming but keeps focus and remembers the keyboard position, so the +next arrow key shows the panel again from where it was. + +**Row 28.** `pointerleave` and `pointercancel` call `clearWeek` +(`heatmap.js:1974-1975`) even while the stream has focus, and +`handleStreamPointer` (`:1980-1988`) never writes `state.cursor`. A keyboard +user whose pointer drifts off loses the panel, ring and dimming, and the keys +resume at the older keyboard week. After the fix a pointer leave while the +stream has keyboard focus (`:focus-visible`, as row 26) changes nothing: the +panel stays on the last shown week and the keys continue from it +(`streamKeyState` already prefers `state.shown`). A pointer leave without +keyboard focus still clears everything, as now. That includes a stream focused +by a click or tap: the pointer leave (a lift ends in one on touch) clears the +panel, ring and dimming, and the live region stays off. + +**Row 29.** The keyboard gate never asserts an arrow key was consumed, so a +regression that lets arrows scroll the page would pass (no `scrollY` or +`scrollTop` read in `_frontend_gate_stream.py`; `_step_failures` checks +position only). After the fix the keyboard check records, with a bubbling +`keydown` listener on `window`, whether each arrow press arrived with +`defaultPrevented` set, and fails when one did not. This reads the consumption +itself rather than `scrollY`, because the page may not scroll at the gate's +viewport and a scroll read would then pass vacuously. It extends the existing +`check_stream_is_one_keyboard_tab_stop`, and covers every press the check +makes: the dense-week-end presses and the whole `_KEY_STEPS` walk (Home, End +and the edge clamps included), since the listener costs the same either way. + +**Row 30.** That check's `finally` (`_frontend_gate_stream.py`, last lines of +`check_stream_is_one_keyboard_tab_stop`) runs `page.evaluate(_REMOVE_SENTINEL_JS)`, +`page.set_viewport_size(original)` and `jobs.delete(job_id)` in sequence, so a +raising first step skips the other two and leaks a seeded job. After the fix +each cleanup step runs even when an earlier one raises. + +**Row 23.** `_paint_failures` appends "the stream draws no artist layers in +the {theme} theme" when `reading["fills"]` is empty, then evaluates +`min(ratios)` of an empty list (`_frontend_gate_stream.py`, the `[stream +colours]` print), which raises `ValueError` before the failures return. After +the fix the contrast line is computed only when there are layers, and the +named failure is returned. + +### B. Visual consistency (PREVIEW) + +**C2 month labels.** The heatmap's month labels are created with +`font-size 9.5`, `LABEL_FONT_STACK`, `font-variant small-caps` and +`letter-spacing 0.12em` (`heatmap.js:1750-1753`). The stream's bottom labels +get `font-size 9.5` and `LABEL_FONT_STACK` only (`drawStream`, `:1899`). After +the fix both carry the same four attributes. The text is the same string. +Finding that differs from the owner's note: the font size is already equal. +`drawStream` is called with the grid's own `svgWidth` (`:1808`), so both +viewBoxes are as wide as each other, both SVGs are `width: 100%` in +`#heatmap-grid` (`heatmap.css`, `#heatmap-grid svg`), and 9.5 units render at +the same CSS size in both. What the owner sees as a size difference is the +missing `small-caps` (the heatmap's "Jan" draws with small capitals) and +tracking; the fix removes both differences. The gate asserts the rendered size +and the style attributes are equal, so a future scale difference is caught. +The saved image does change (owner ruling C12). `gridAsImage` and +`streamAsImage` overwrite only `font-family` on the month labels +(`heatmap.js:743-749`, `:765-767`) and copy the other attributes, so the saved +stream's month labels gain small capitals and 0.12em tracking, matching the +saved heatmap's labels, which already carry both. That is the wanted outcome. +The tracking also widens the end-anchored last label, so the task checks it is +not clipped in the saved image. Evidence for the on-screen end-anchored last +label: it keeps its existing `inside` check in the alignment reading. + +**C3 centring.** `streamFit` shifts the baseline only when the stack overflows +the band: `shift = high > half ? half - high : Math.max(0, -half - low)` +(`heatmap.js:289`), so ordinary data sits wherever the wiggle baseline leaves +it, about 10px low on the owner's data. After the fix the shift always centres +the outer envelope: `high` and `low` already include the halo margins and the +Bezier-control margins, so the shift is the amount that makes `high` and +`-low` equal. The scale rule is unchanged (the tallest week is `STREAM_PEAK` +tall, capped so the extent fits `STREAM_BAND`). The existing test +`test_stream_stack_stays_inside_the_band` asserts that ordinary data is left +unmoved (`ordinary-data-keeps-its-look`); under C3 that expectation is the +defect, so the test is edited, not extended. The centring assertion also +gets one case that passes `residual`, because the production path does, and a +shift computed without the halo and Bezier margins would pass the cases that +do not. + +**Row 25.** `.stream-panel-header` uses `--text-label-sm` (12px, +`heatmap.css:568`, `tailwind.src.css:36`). The design reference says 13px +(`.superpowers/sdd/2026-10-27-ui-audit-v6/design/reference-v6-notes.md`, line +107: stream panel "header 13px muted"). `--text-label` is `0.8125rem`, which is 13px +(`tailwind.src.css:37`). After the fix the header uses `--text-label`. The +header is `white-space: nowrap; width: max-content`, so the panel's measured +need in `showWeek` grows with it; the stream gate's panel checks must still +pass. + +**Row 5.** The heatmap key's ramp keeps `margin-top: calc(0.875rem * +var(--index-scale, 1))` (`heatmap.css:201`) and is also a grid child of +`.index-key`, whose `gap` is `calc(0.75rem * var(--index-scale, 1))` +(`index.css:376`), so it sits `1.625rem * scale` (26px at scale 1, about 28px +at 1920) under the last row where the reference gives 12px +(`.superpowers/sdd/2026-10-27-ui-audit-v6/design/reference-v6-notes.md`, line +20: key block "`display:grid; gap:12px`"). After the fix the ramp's own +margin is removed and only the key's gap remains: 12px at scale 1, about 12.9px +at 1920, which keeps the page's own scaling rule. The ramp's 8px height is +unchanged. + +**Row 17 (no visual change).** The 1.5rem footer gap is written twice: +`.index-grid .index-hero { padding-bottom: 1.5rem }` (`index.css:143`, comment +at `:139`) and `.page-footer-extras { padding: 1rem 1rem 1.5rem }` +(`shell.css:615`), guarded only by the gate's equality check. After the fix +one custom property declared in `shell.css`'s `:root` carries the value and +both rules read it. The gate's equality check stays as it is. + +### C. Gate helpers + +**Row 3.** `_split_canvas_font` (`_frontend_gate_theme.py`, `_NAMED_WEIGHTS = +{"bold": "700", "normal": "400"}`) lets a `normal` token reset an earlier +numeric weight: `600 normal 26px x` gives 400. In the canvas font shorthand +`normal` stands for "no change" in any slot. After the fix `normal` leaves the +weight alone and only `bold` sets one. The existing case `("normal 18px x", +"x", "400")` cannot fail if `normal` were ignored (400 is the default), so it +stays only as the neutral check and the new case carries the defect. + +**Row 40.** `_pause_hold_failures` (`_frontend_gate_spotlight_photo.py`) +stores `ss-motion=still` through an init script, and only the Play click +clears it. An early return after `_open_spotlight_card` reports an error, or a +failing click, leaves the choice in the shared context's `localStorage` for +later probes. After the fix the probe clears the stored choice in its own +`finally`, whatever path it took. + +### D. Row 13 + +`positionForm` in `static/js/index.js` writes `matchMedia('(min-width: +860px)')` (`:634`); `const desktop = matchMedia('(min-width: 860px)')` is +declared later at `:652`. After the fix `positionForm` reads `desktop.matches`, +and the declaration moves above `positionForm` so no reader has to check that +every call happens after line 652 (they do: the first call is at `:702`). No +behaviour change. + +## Rows not planned + +- 4, 19, 43: deferred to the findings triage (owner ruling). +- 21, 22: deferred to the docs rewrite (owner ruling). +- 24: closed in the workspace Gates block (C5). +- 39: dropped by the owner's word (C1); C4 settles the tooltip-order and + hairline questions. +- 2, 6-12, 14-16, 18, 20, 31-38, 41, 42: dropped as triaged (C1). +- 44-79: FIXED or OBSOLETE in the audit, and the audit's Notes; not in scope. +- No in-scope row was found false against 9436ff7c. One premise is corrected: + C2's "the two SVGs scale differently" does not hold (see C2); the fix is the + same. + +## Verification and definition of done + +1. Each gate or pure test that is new or edited is shown red against the + unchanged code, then green (workspace R9). Rows 1, 13 and 17 change no + behaviour and add no test. +2. Gate checks for rows 26-29 and C2 are written before the code that + satisfies them; the frontend gate is run against the unchanged + `heatmap.js` to show them red. +3. Every commit passes the workspace Gates block; the final head also passes + `frontend-gate` and `results-behavior`. +4. PREVIEW tasks save Firefox screenshots, light and dark, before and after, + and land only on the owner's word (R14). A rejected one is dropped. +5. One whole-branch review is requested after the last landing, if the owner + asks for it. From b0b58267a4b59947e8cda4e26045c945f1acab48 Mon Sep 17 00:00:00 2001 From: pterw Date: Fri, 30 Oct 2026 23:25:21 -0400 Subject: [PATCH 03/12] fix(gate): Keep a numeric font weight when normal follows it The canvas font parser treated `normal` as weight 400, so a shorthand like `600 normal 26px` read as 400 and the saved-image headline check could misreport the drawn weight. `normal` is no longer a weight token. Also correct two earlier Section 4 headings from the UTC date to the local commit date, 2026-10-30. Validation: `pytest -q` -- **3109 passed**. --- .claude/SESSION_CONTEXT.md | 6 +-- config/docsync.toml | 2 +- docs/agents/FINDINGS.md | 2 +- docs/agents/PLAYBOOK.md | 42 +++++++++---------- .../PLAYBOOK_EXECUTION_LOG_ARCHIVE.md | 17 ++++++++ .../plans/2026-10-31-ui-audit-minors.md | 8 ++-- scripts/dev/_frontend_gate_theme.py | 2 +- tests/scripts/dev/test_frontend_gate_theme.py | 1 + 8 files changed, 47 insertions(+), 33 deletions(-) diff --git a/.claude/SESSION_CONTEXT.md b/.claude/SESSION_CONTEXT.md index 18230f1d..f981ac88 100644 --- a/.claude/SESSION_CONTEXT.md +++ b/.claude/SESSION_CONTEXT.md @@ -9,7 +9,7 @@ Last updated: 2026-10-30 | Item | Value | |------|-------| | Branch | See PLAYBOOK Section 3 for the active worktree branch. | -| Tests | **3108 passing** across 104 tracked test modules | +| Tests | **3109 passing** across 104 tracked test modules | | Coverage | 89% (2026-08-20 run, `pytest --cov=scrobblescope`) | | Pre-commit | See PLAYBOOK Section 4's latest validation and deviations. | | Batches 0-20 | **All complete.** PLAYBOOK Section 2 has the index: title, definition and log per batch. | @@ -47,7 +47,7 @@ Last updated: 2026-10-30 - Current-batch entries in active log block: 0. - Completed work packages in current-batch entries: none. - Next expected work package: WP-0. -- Latest validated test count: **3108 passed**. +- Latest validated test count: **3109 passed**. - Newest current-batch entry: none. @@ -303,7 +303,7 @@ results-release-checks.js polls GET /api/release_checks?job_id=... --- -## 6. Test structure (3108 tests) +## 6. Test structure (3109 tests) The per-file breakdown used to live here as a 40-row table. It was removed on 2026-08-26: nothing read it, only the total is gated, and it diff --git a/config/docsync.toml b/config/docsync.toml index acedef7b..12698d87 100644 --- a/config/docsync.toml +++ b/config/docsync.toml @@ -739,4 +739,4 @@ allow_files = ["docs/history/*", "docs/logarchive/*", "docs/superpowers/*", "CLA grandfathered = [] [test_count] -pinned = 3108 +pinned = 3109 diff --git a/docs/agents/FINDINGS.md b/docs/agents/FINDINGS.md index 0d794218..3597101a 100644 --- a/docs/agents/FINDINGS.md +++ b/docs/agents/FINDINGS.md @@ -3,7 +3,7 @@ Last updated: 2026-10-30 Status: Batch 23 is active, opened 2026-09-21; Batch 22 closed 2026-09-20. PLAYBOOK Section 3 owns the current work order. -3108 tests across 104 tracked test modules. +3109 tests across 104 tracked test modules. **Rotation policy:** resolved and no-action findings rotate to `docs/history/findings/FINDINGS_ARCHIVE.md` at the next `doc_state_sync.py --fix` once their lifecycle record is checked (the diff --git a/docs/agents/PLAYBOOK.md b/docs/agents/PLAYBOOK.md index 6fb14768..b9244598 100644 --- a/docs/agents/PLAYBOOK.md +++ b/docs/agents/PLAYBOOK.md @@ -69,7 +69,7 @@ See FINDINGS F-DOCSYNC-3. ## 3. Active batch + next action -- **UI audit Minors side task (owner, 2026-10-31):** branch +- **UI audit Minors side task (owner, 2026-10-30):** branch `fix/ui-audit-minors`, cut from `main` at `18a4242d`. It bundles the minor findings that the 2026-10-27 UI audit's reviews deferred into one bug-fix PR: collect them, check each against current `main`, triage each row with @@ -79,7 +79,7 @@ See FINDINGS F-DOCSYNC-3. `main` by PR #280's `streamSafeSegments`, with a curve-sampling test. The owner also asked for the streamgraph's bottom month labels to match the heatmap's month labels in typeface and size. The owner accepted the triage - on 2026-10-31. The spec is + on 2026-10-30. The spec is `docs/superpowers/specs/2026-10-31-ui-audit-minors-design.md` and the plan is `docs/superpowers/plans/2026-10-31-ui-audit-minors.md`; four of its visual tasks land only after the owner sees before-and-after screenshots. @@ -207,11 +207,24 @@ non-current operational logs. Older dated entries live in -### 2026-10-31 - Plan the UI audit Minors bug fixes +### 2026-10-30 - Keep a numeric font weight after `normal` in the gate + +The frontend gate's canvas font parser read `600 normal 26px x` as weight +400, because the `normal` token reset the weight set just before it. The +saved-image headline check could then report a wrong drawn weight. `normal` +is no longer treated as a weight token, so a numeric weight stands, `bold` +still maps to 700 and a string with no weight stays 400. This closes audit +row 3 of the UI audit Minors. No deviations. Existing test edited: +`test_a_saved_headline_drawn_at_another_weight_is_reported` (one case +added, `600 normal 18px x`). + +Validation: `pytest -q` -- **3109 passed**. + +### 2026-10-30 - Plan the UI audit Minors bug fixes The deferred Minors from the 2026-10-27 UI audit's reviews were checked against `main` by a read-only audit. Of 79 rows, 43 were still true, and the -owner accepted a triage of them on 2026-10-31. The spec records each chosen +owner accepted a triage of them on 2026-10-30. The spec records each chosen row with its evidence and lists the deferred and dropped rows. The plan slices the fixes into eleven atomic tasks: stream panel keyboard and screen-reader behaviour, gate-helper fixes, two CSS tidy-ups, and four @@ -224,12 +237,12 @@ before this commit. Docs only. Validation: the full suite measured **3108 passed**; pre-commit on all files and the final docsync check pass. -### 2026-10-31 - Record the merged chart work and open the UI Minors side task +### 2026-10-30 - Record the merged chart work and open the UI Minors side task Section 3 still described the weekly chart geometry branch as awaiting its PR, although PR #281 merged on 2026-10-30 (merge commit `18a4242d`). This entry records that merge and opens the UI audit Minors side task on -`fix/ui-audit-minors`, which the owner approved on 2026-10-31. Docs only: no +`fix/ui-audit-minors`, which the owner approved on 2026-10-30. Docs only: no runtime, test or dependency change. The smoothing defect that headed the deferred list was checked against `main` first. Codex's case (53 weeks, one artist with 100 plays in week 26 only) now gives a minimum band thickness of @@ -263,20 +276,3 @@ implementation commit is ready for a template PR. CI and publication state will be recorded there, without merging. The plan records final review and publication guidance: `docs/superpowers/plans/2026-10-30-weekly-chart-geometry.md`. - -### 2026-10-30 - Protect weekly chart geometry before extraction - -Extend the existing browser alignment check with actual path extents, -plot bounds and one shifted-spike fixture. Extend the existing nearest-week -test with the exact midpoint. No runtime, test module or permanent check -family is added. The plan's first implementation step protects current -behavior before its calculation moves. - -The pure harness passed 147 tests. Chromium and Firefox passed the affected -alignment check; both rejected a temporary out-of-band halo and passed -again after restoration. The full suite measured **3113 passed** in 210.85 -seconds. Final hooks and docsync run before the test-only commit. Also -repoint the current Listening status to its observed merge, preserving the -dated execution records. The owner-approved deviations stay -as recorded in the design. The next step is the geometry module and test -migration in `docs/superpowers/plans/2026-10-30-weekly-chart-geometry.md`. diff --git a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md index 4131637d..2dd208b9 100644 --- a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md +++ b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md @@ -9,6 +9,23 @@ Read helpers: - `rg -n "^### 20" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` - `rg -n "" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` +### 2026-10-30 - Protect weekly chart geometry before extraction + +Extend the existing browser alignment check with actual path extents, +plot bounds and one shifted-spike fixture. Extend the existing nearest-week +test with the exact midpoint. No runtime, test module or permanent check +family is added. The plan's first implementation step protects current +behavior before its calculation moves. + +The pure harness passed 147 tests. Chromium and Firefox passed the affected +alignment check; both rejected a temporary out-of-band halo and passed +again after restoration. The full suite measured **3113 passed** in 210.85 +seconds. Final hooks and docsync run before the test-only commit. Also +repoint the current Listening status to its observed merge, preserving the +dated execution records. The owner-approved deviations stay +as recorded in the design. The next step is the geometry module and test +migration in `docs/superpowers/plans/2026-10-30-weekly-chart-geometry.md`. + ### 2026-10-30 - Approve the weekly chart geometry side task The owner selected the first architecture-review proposal and approved the diff --git a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md index 51bf68c1..f9cd7ffa 100644 --- a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md +++ b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md @@ -38,7 +38,7 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p ## Delivery sequence -- [ ] Task 1: keep a numeric font weight after `normal`. +- [x] Task 1: keep a numeric font weight after `normal`. - [ ] Task 2: clear the stored pause choice on every exit. - [ ] Task 3: reuse the `desktop` media query in `index.js`. - [ ] Task 4: share the footer gap as one custom property. @@ -61,9 +61,9 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p **Extends:** the parametrized `test_a_saved_headline_drawn_at_another_weight_is_reported` (the `("drawn", "family", "drawn_weight")` cases). -- [ ] Add the case `("600 normal 18px x", "x", "600")` to that parametrize list. Keep `("normal 18px x", "x", "400")` as the neutral check (it cannot fail alone, which is why the new case carries the defect). -- [ ] RED: `"" -m pytest -q -p no:cacheprovider tests/scripts/dev/test_frontend_gate_theme.py -k "another_weight"` fails on the new case with `400 != 600` (or the weight reported as 400). GREEN: the same command passes after the change. Quote both lines. -- [ ] Acceptance: the whole file `tests/scripts/dev/test_frontend_gate_theme.py` passes; the three `suite-*` gates, `pre-commit` and `docsync-check` pass (this commit changes only `scripts/dev` and `tests`, so `frontend-gate` is not required). +- [x] Add the case `("600 normal 18px x", "x", "600")` to that parametrize list. Keep `("normal 18px x", "x", "400")` as the neutral check (it cannot fail alone, which is why the new case carries the defect). +- [x] RED: `"" -m pytest -q -p no:cacheprovider tests/scripts/dev/test_frontend_gate_theme.py -k "another_weight"` fails on the new case with `400 != 600` (or the weight reported as 400). GREEN: the same command passes after the change. Quote both lines. +- [x] Acceptance: the whole file `tests/scripts/dev/test_frontend_gate_theme.py` passes; the three `suite-*` gates, `pre-commit` and `docsync-check` pass (this commit changes only `scripts/dev` and `tests`, so `frontend-gate` is not required). ## Task 2: Clear the stored pause choice on every exit diff --git a/scripts/dev/_frontend_gate_theme.py b/scripts/dev/_frontend_gate_theme.py index aaaec167..73f2b0c7 100644 --- a/scripts/dev/_frontend_gate_theme.py +++ b/scripts/dev/_frontend_gate_theme.py @@ -954,7 +954,7 @@ def _plain_family(value: str | None) -> str: return (value or "").replace('"', "").replace("'", "").replace(" ", "") -_NAMED_WEIGHTS = {"bold": "700", "normal": "400"} +_NAMED_WEIGHTS = {"bold": "700"} def _is_size_token(token: str) -> bool: diff --git a/tests/scripts/dev/test_frontend_gate_theme.py b/tests/scripts/dev/test_frontend_gate_theme.py index e6c4d33a..724a2ac8 100644 --- a/tests/scripts/dev/test_frontend_gate_theme.py +++ b/tests/scripts/dev/test_frontend_gate_theme.py @@ -131,6 +131,7 @@ def test_a_canvas_font_with_style_weight_and_size_matches_on_family( ("26px degular, sans-serif", "degular, sans-serif", "400"), ("bold 18px x", "x", "700"), ("normal 18px x", "x", "400"), + ("600 normal 18px x", "x", "600"), ('italic 600 18px/1.2 "a b"', '"a b"', "600"), ("bold 600 18px x", "x", "600"), ("x, serif", "x, serif", None), From a6764f883ada518acedad6483e05b3623e36605f Mon Sep 17 00:00:00 2001 From: pterw Date: Fri, 30 Oct 2026 23:44:44 -0400 Subject: [PATCH 04/12] fix(gate): Report an empty stream and always run its cleanup With no drawn layers min() on the contrast ratios raised before the named failure; the contrast line is now skipped then. The keyboard check's cleanup ran sequentially, so a raising first step skipped the viewport restore and the job delete; each step now runs in a nested finally and the first error still surfaces. Closes audit rows 23 and 30. Existing tests edited: none. Validation: `pytest -q` -- **3109 passed**. --- docs/agents/PLAYBOOK.md | 39 +++++++------------ .../PLAYBOOK_EXECUTION_LOG_ARCHIVE.md | 25 ++++++++++++ .../plans/2026-10-31-ui-audit-minors.md | 8 ++-- scripts/dev/_frontend_gate_stream.py | 19 +++++---- 4 files changed, 55 insertions(+), 36 deletions(-) diff --git a/docs/agents/PLAYBOOK.md b/docs/agents/PLAYBOOK.md index b9244598..86c06098 100644 --- a/docs/agents/PLAYBOOK.md +++ b/docs/agents/PLAYBOOK.md @@ -207,6 +207,20 @@ non-current operational logs. Older dated entries live in +### 2026-10-30 - Report an empty stream and always run its cleanup + +The stream gate's paint check called `min()` on the contrast ratios before +reporting a stream with no drawn layers, so an empty stream raised a +ValueError instead of the named failure. The contrast line is now skipped +when there are no ratios, and the failure "the stream draws no artist +layers" is returned. The keyboard check's cleanup ran its three steps in +sequence, so a raising first step skipped the viewport restore and the job +delete; each step now runs in a nested `finally` and the first error still +surfaces. This closes audit rows 23 and 30 of the UI audit Minors. No +deviations. Existing tests edited: none. + +Validation: `pytest -q` -- **3109 passed**. + ### 2026-10-30 - Keep a numeric font weight after `normal` in the gate The frontend gate's canvas font parser read `600 normal 26px x` as weight @@ -251,28 +265,3 @@ artist with 100 plays in week 26 only) now gives a minimum band thickness of Validation: the full suite measured **3108 passed**; pre-commit on all files and the final docsync check pass. Next: collect and triage the deferred Minors, then write the plan. - -### 2026-10-30 - Make weekly chart geometry own drawing and selection - -Extract the connected calculation into the approved in-file geometry model. -Drawing, pointer selection and composition tests consume that model; its -numeric stack and coordinate conversion stay private. Migrate existing -behavior tests and remove superseded hooks and a constant-pin assertion. -The suite drops five redundant cases, with no new test module or dependency. -The developer README links to the interface owner. Scope and owner-approved -exceptions remain those in the design; no further deviation is introduced. - -The focused harness passed 142 tests. The full suite measured **3108 passed** -in 227.30 seconds; a later unused test-hook removal passed the focused -harness again. Chromium and Firefox each matched the exact old runtime's -paths, ranks, columns, 51 pointer cases and 30 keyboard outcomes across six -seeded fixtures. The full frontend gate passed 58 checks in 89 runs across -both engines and desktop, mobile and wide-touch profiles. The frozen-source -full suite then passed again in 205.55 seconds. Independent final code/spec -and standards reviews completed whole-file reads and found only a stale -README date, now corrected and re-reviewed. Archive rotation preserved -existing dated entries exactly. All hooks and final docsync pass; the -implementation commit is ready for a template PR. CI and publication state -will be recorded there, without merging. -The plan records final review and publication guidance: -`docs/superpowers/plans/2026-10-30-weekly-chart-geometry.md`. diff --git a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md index 2dd208b9..28b012d7 100644 --- a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md +++ b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md @@ -9,6 +9,31 @@ Read helpers: - `rg -n "^### 20" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` - `rg -n "" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` +### 2026-10-30 - Make weekly chart geometry own drawing and selection + +Extract the connected calculation into the approved in-file geometry model. +Drawing, pointer selection and composition tests consume that model; its +numeric stack and coordinate conversion stay private. Migrate existing +behavior tests and remove superseded hooks and a constant-pin assertion. +The suite drops five redundant cases, with no new test module or dependency. +The developer README links to the interface owner. Scope and owner-approved +exceptions remain those in the design; no further deviation is introduced. + +The focused harness passed 142 tests. The full suite measured **3108 passed** +in 227.30 seconds; a later unused test-hook removal passed the focused +harness again. Chromium and Firefox each matched the exact old runtime's +paths, ranks, columns, 51 pointer cases and 30 keyboard outcomes across six +seeded fixtures. The full frontend gate passed 58 checks in 89 runs across +both engines and desktop, mobile and wide-touch profiles. The frozen-source +full suite then passed again in 205.55 seconds. Independent final code/spec +and standards reviews completed whole-file reads and found only a stale +README date, now corrected and re-reviewed. Archive rotation preserved +existing dated entries exactly. All hooks and final docsync pass; the +implementation commit is ready for a template PR. CI and publication state +will be recorded there, without merging. +The plan records final review and publication guidance: +`docs/superpowers/plans/2026-10-30-weekly-chart-geometry.md`. + ### 2026-10-30 - Protect weekly chart geometry before extraction Extend the existing browser alignment check with actual path extents, diff --git a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md index f9cd7ffa..f79f5587 100644 --- a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md +++ b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md @@ -42,7 +42,7 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p - [ ] Task 2: clear the stored pause choice on every exit. - [ ] Task 3: reuse the `desktop` media query in `index.js`. - [ ] Task 4: share the footer gap as one custom property. -- [ ] Task 5: stream gate reports an empty stream and always cleans up. +- [x] Task 5: stream gate reports an empty stream and always cleans up. - [ ] Task 6 (PREVIEW): scrubber panel header at 13px. - [ ] Task 7: dismissible, focus-safe stream panel. - [ ] Task 8 (PREVIEW): heatmap key ramp spacing at the reference's 12px. @@ -117,9 +117,9 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p No test file exists for this module and none is added (C6, "no need to excessively guard every UI element"). The evidence is a temporary probe, not retained: -- [ ] RED/GREEN for row 23: call `_paint_failures` with a hand-built reading whose `fills` is empty (a one-off script in the scratch directory): it raises `ValueError` before the change and returns the named failure after. Quote both. -- [ ] Row 30: read the changed `finally` against the three steps; show with the same kind of probe (a stub page whose first evaluate raises) that the viewport restore and `jobs.delete` still run after the change. Quote the probe output. -- [ ] Acceptance: `frontend-gate` passes (its `[stream ...]` lines unchanged); `suite-*`, `pre-commit`, `docsync-check` pass. +- [x] RED/GREEN for row 23: call `_paint_failures` with a hand-built reading whose `fills` is empty (a one-off script in the scratch directory): it raises `ValueError` before the change and returns the named failure after. Quote both. +- [x] Row 30: read the changed `finally` against the three steps; show with the same kind of probe (a stub page whose first evaluate raises) that the viewport restore and `jobs.delete` still run after the change. Quote the probe output. +- [x] Acceptance: `frontend-gate` passes (its `[stream ...]` lines unchanged); `suite-*`, `pre-commit`, `docsync-check` pass. ## Task 6 (PREVIEW): Scrubber panel header at 13px diff --git a/scripts/dev/_frontend_gate_stream.py b/scripts/dev/_frontend_gate_stream.py index 45f5ed00..bdc52aee 100644 --- a/scripts/dev/_frontend_gate_stream.py +++ b/scripts/dev/_frontend_gate_stream.py @@ -565,10 +565,11 @@ def _paint_failures(reading, theme: str) -> list[str]: frame = _rgb(reading["frame"]) ratios = [_contrast_ratio(_rgb(fill), frame) for fill in reading["fills"].values()] label_ratio = _contrast_ratio(_rgb(reading["label"]), frame) - print( - f"[stream colours] {theme}: layer vs frame min {min(ratios):.2f} " - f"max {max(ratios):.2f}, label vs frame {label_ratio:.2f}" - ) + if ratios: + print( + f"[stream colours] {theme}: layer vs frame min {min(ratios):.2f} " + f"max {max(ratios):.2f}, label vs frame {label_ratio:.2f}" + ) if label_ratio < _FLOOR_TEXT: failures.append( f"the section label is {label_ratio:.2f}:1 against the frame in the " @@ -1387,9 +1388,13 @@ def check_stream_is_one_keyboard_tab_stop(page, base_url: str) -> list[str]: failures.extend(_cleared_after(page, "after blur")) failures.extend(_blur_resize_failures(page, original)) finally: - page.evaluate(_REMOVE_SENTINEL_JS) - page.set_viewport_size(original) - jobs.delete(job_id) + try: + page.evaluate(_REMOVE_SENTINEL_JS) + finally: + try: + page.set_viewport_size(original) + finally: + jobs.delete(job_id) return failures From 9929f34817d421f147825a8cf6dc9e0dbfdf6cc7 Mon Sep 17 00:00:00 2001 From: pterw Date: Sat, 31 Oct 2026 00:18:03 -0400 Subject: [PATCH 05/12] fix(gate): Clear the stored pause choice on every exit The paused-hold probe stored ss-motion=still and only the Play click cleared it, so an early return left the choice in the shared browser context. The probe now removes the key in its finally, before closing the page, tolerating a page that never navigated. Validation: `pytest -q` -- **3111 passed**. --- .claude/SESSION_CONTEXT.md | 6 ++-- config/docsync.toml | 2 +- docs/agents/FINDINGS.md | 2 +- docs/agents/PLAYBOOK.md | 29 +++++++++---------- .../PLAYBOOK_EXECUTION_LOG_ARCHIVE.md | 15 ++++++++++ .../plans/2026-10-31-ui-audit-minors.md | 8 ++--- scripts/dev/_frontend_gate_spotlight_photo.py | 8 +++++ .../dev/test_frontend_gate_spotlight_photo.py | 20 +++++++++++++ 8 files changed, 66 insertions(+), 24 deletions(-) diff --git a/.claude/SESSION_CONTEXT.md b/.claude/SESSION_CONTEXT.md index f981ac88..a6a846b3 100644 --- a/.claude/SESSION_CONTEXT.md +++ b/.claude/SESSION_CONTEXT.md @@ -9,7 +9,7 @@ Last updated: 2026-10-30 | Item | Value | |------|-------| | Branch | See PLAYBOOK Section 3 for the active worktree branch. | -| Tests | **3109 passing** across 104 tracked test modules | +| Tests | **3111 passing** across 104 tracked test modules | | Coverage | 89% (2026-08-20 run, `pytest --cov=scrobblescope`) | | Pre-commit | See PLAYBOOK Section 4's latest validation and deviations. | | Batches 0-20 | **All complete.** PLAYBOOK Section 2 has the index: title, definition and log per batch. | @@ -47,7 +47,7 @@ Last updated: 2026-10-30 - Current-batch entries in active log block: 0. - Completed work packages in current-batch entries: none. - Next expected work package: WP-0. -- Latest validated test count: **3109 passed**. +- Latest validated test count: **3111 passed**. - Newest current-batch entry: none. @@ -303,7 +303,7 @@ results-release-checks.js polls GET /api/release_checks?job_id=... --- -## 6. Test structure (3109 tests) +## 6. Test structure (3111 tests) The per-file breakdown used to live here as a 40-row table. It was removed on 2026-08-26: nothing read it, only the total is gated, and it diff --git a/config/docsync.toml b/config/docsync.toml index 12698d87..538b467a 100644 --- a/config/docsync.toml +++ b/config/docsync.toml @@ -739,4 +739,4 @@ allow_files = ["docs/history/*", "docs/logarchive/*", "docs/superpowers/*", "CLA grandfathered = [] [test_count] -pinned = 3109 +pinned = 3111 diff --git a/docs/agents/FINDINGS.md b/docs/agents/FINDINGS.md index 3597101a..b07e1aa2 100644 --- a/docs/agents/FINDINGS.md +++ b/docs/agents/FINDINGS.md @@ -3,7 +3,7 @@ Last updated: 2026-10-30 Status: Batch 23 is active, opened 2026-09-21; Batch 22 closed 2026-09-20. PLAYBOOK Section 3 owns the current work order. -3109 tests across 104 tracked test modules. +3111 tests across 104 tracked test modules. **Rotation policy:** resolved and no-action findings rotate to `docs/history/findings/FINDINGS_ARCHIVE.md` at the next `doc_state_sync.py --fix` once their lifecycle record is checked (the diff --git a/docs/agents/PLAYBOOK.md b/docs/agents/PLAYBOOK.md index 86c06098..8cd95e71 100644 --- a/docs/agents/PLAYBOOK.md +++ b/docs/agents/PLAYBOOK.md @@ -207,6 +207,20 @@ non-current operational logs. Older dated entries live in +### 2026-10-31 - Clear the stored pause choice on every exit + +The spotlight photo gate's paused-hold probe stores `ss-motion=still` +through an init script, and only the Play click removed it, so an early +return left the choice in the shared browser context. The probe's `finally` +now removes the `ss-motion` key before it closes the page. The removal is +wrapped in `contextlib.suppress(PlaywrightError)` (shorter than tracking +navigation state), so a page that never navigated cannot hide the original +failure. This closes audit row 40 of the UI audit Minors. No deviations. +Existing tests edited: none (one test added, +`test_an_early_return_leaves_no_stored_pause_choice`). + +Validation: `pytest -q` -- **3111 passed**. + ### 2026-10-30 - Report an empty stream and always run its cleanup The stream gate's paint check called `min()` on the contrast ratios before @@ -250,18 +264,3 @@ before this commit. Docs only. Validation: the full suite measured **3108 passed**; pre-commit on all files and the final docsync check pass. - -### 2026-10-30 - Record the merged chart work and open the UI Minors side task - -Section 3 still described the weekly chart geometry branch as awaiting its -PR, although PR #281 merged on 2026-10-30 (merge commit `18a4242d`). This -entry records that merge and opens the UI audit Minors side task on -`fix/ui-audit-minors`, which the owner approved on 2026-10-30. Docs only: no -runtime, test or dependency change. The smoothing defect that headed the -deferred list was checked against `main` first. Codex's case (53 weeks, one -artist with 100 plays in week 26 only) now gives a minimum band thickness of -0 rather than -11.11, so it is not part of this side task's work. - -Validation: the full suite measured **3108 passed**; pre-commit on all -files and the final docsync check pass. Next: collect and triage the deferred -Minors, then write the plan. diff --git a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md index 28b012d7..7c00e710 100644 --- a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md +++ b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md @@ -9,6 +9,21 @@ Read helpers: - `rg -n "^### 20" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` - `rg -n "" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` +### 2026-10-30 - Record the merged chart work and open the UI Minors side task + +Section 3 still described the weekly chart geometry branch as awaiting its +PR, although PR #281 merged on 2026-10-30 (merge commit `18a4242d`). This +entry records that merge and opens the UI audit Minors side task on +`fix/ui-audit-minors`, which the owner approved on 2026-10-30. Docs only: no +runtime, test or dependency change. The smoothing defect that headed the +deferred list was checked against `main` first. Codex's case (53 weeks, one +artist with 100 plays in week 26 only) now gives a minimum band thickness of +0 rather than -11.11, so it is not part of this side task's work. + +Validation: the full suite measured **3108 passed**; pre-commit on all +files and the final docsync check pass. Next: collect and triage the deferred +Minors, then write the plan. + ### 2026-10-30 - Make weekly chart geometry own drawing and selection Extract the connected calculation into the approved in-file geometry model. diff --git a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md index f79f5587..83527d7b 100644 --- a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md +++ b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md @@ -39,7 +39,7 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p ## Delivery sequence - [x] Task 1: keep a numeric font weight after `normal`. -- [ ] Task 2: clear the stored pause choice on every exit. +- [x] Task 2: clear the stored pause choice on every exit. - [ ] Task 3: reuse the `desktop` media query in `index.js`. - [ ] Task 4: share the footer gap as one custom property. - [x] Task 5: stream gate reports an empty stream and always cleans up. @@ -76,9 +76,9 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p **Extends:** `test_the_hold_check_focuses_then_hovers_and_counts_the_periods`, whose mock page already records `add_init_script`, `click` and `evaluate` calls. Add one new test beside it, `test_an_early_return_leaves_no_stored_pause_choice`, because the existing test drives the full path (Play clicked) and the early return is a different scenario that cannot be a parametrization of it without hiding which assertion guards what. -- [ ] New test, GIVEN `_open_spotlight_card` returns an error string, WHEN `_pause_hold_failures` runs on the mock page, THEN it returns that error and the page evaluated a removal of `ss-motion` (found by the key name in the mock's `evaluate` calls, without pinning the script text) before closing. -- [ ] RED against the unchanged helper: the removal call is absent. GREEN after the change. Quote both. The existing test still passes unchanged. -- [ ] Acceptance: `tests/scripts/dev/test_frontend_gate_spotlight_photo.py` passes; `suite-*`, `pre-commit`, `docsync-check` pass. This commit touches `scripts/dev/_frontend_gate*`, so `frontend-gate` also passes. +- [x] New test, GIVEN `_open_spotlight_card` returns an error string, WHEN `_pause_hold_failures` runs on the mock page, THEN it returns that error and the page evaluated a removal of `ss-motion` (found by the key name in the mock's `evaluate` calls, without pinning the script text) before closing. +- [x] RED against the unchanged helper: the removal call is absent. GREEN after the change. Quote both. The existing test still passes unchanged. +- [x] Acceptance: `tests/scripts/dev/test_frontend_gate_spotlight_photo.py` passes; `suite-*`, `pre-commit`, `docsync-check` pass. This commit touches `scripts/dev/_frontend_gate*`, so `frontend-gate` also passes. ## Task 3: Reuse the `desktop` media query in `index.js` diff --git a/scripts/dev/_frontend_gate_spotlight_photo.py b/scripts/dev/_frontend_gate_spotlight_photo.py index 26c88868..11994b12 100644 --- a/scripts/dev/_frontend_gate_spotlight_photo.py +++ b/scripts/dev/_frontend_gate_spotlight_photo.py @@ -11,6 +11,7 @@ from __future__ import annotations +import contextlib import json from scripts.dev._frontend_gate_shared import MIGRATED_PAGES @@ -843,6 +844,9 @@ def spotlight_remeasure_failures(state: dict) -> list[str]: #: from a paused home page would have it. _STORE_PAUSE_JS = "localStorage.setItem('ss-motion', 'still');" +#: Clears that choice so no exit path leaves it in the shared context. +_CLEAR_PAUSE_JS = "localStorage.removeItem('ss-motion');" + #: The animation names on the header bars, which a paused page must rest. _BAR_NAMES_JS = """() => [ ...document.querySelectorAll( @@ -857,6 +861,7 @@ def _pause_hold_failures(page, url: str) -> list[str]: the header bars rest; clicking Play animations resumes the rotation from the card shown (U29). Runs on a page of its own so the stored choice cannot leak into the other phases.""" + from playwright.sync_api import Error as PlaywrightError from playwright.sync_api import TimeoutError as PlaywrightTimeoutError probe = page.context.new_page() @@ -895,6 +900,9 @@ def _pause_hold_failures(page, url: str) -> list[str]: failures.append("spotlight did not resume after Play animations") return failures finally: + # Tolerates a page that never navigated, which has no storage to clear. + with contextlib.suppress(PlaywrightError): + probe.evaluate(_CLEAR_PAUSE_JS) probe.close() diff --git a/tests/scripts/dev/test_frontend_gate_spotlight_photo.py b/tests/scripts/dev/test_frontend_gate_spotlight_photo.py index f715d29f..53dfa924 100644 --- a/tests/scripts/dev/test_frontend_gate_spotlight_photo.py +++ b/tests/scripts/dev/test_frontend_gate_spotlight_photo.py @@ -523,6 +523,26 @@ def test_the_hold_check_focuses_then_hovers_and_counts_the_periods() -> None: page.click.assert_called_once_with(".motion-toggle") +def test_an_early_return_leaves_no_stored_pause_choice() -> None: + """GIVEN the card cannot be opened on the paused probe page, WHEN the + pause check returns that error, THEN the stored motion choice was removed + before the page closed.""" + page = _hold_mock_page() + with patch( + "scripts.dev._frontend_gate_spotlight_photo._open_spotlight_card", + return_value="no card", + ): + failures = _frontend_gate_spotlight_photo._pause_hold_failures(page, "u") + assert failures == ["no card"] + names = [c[0] for c in page.method_calls] + removal = [ + i + for i, c in enumerate(page.method_calls) + if c[0] == "evaluate" and "ss-motion" in str(c.args) + ] + assert removal and removal[-1] < names.index("close") + + def test_a_window_with_a_swap_and_steady_opacity_passes() -> None: assert ( _frontend_gate_spotlight_photo.spotlight_fade_failures(_steady_samples()) == [] From b2a5f60054c8ad255ef954ffe468b42e92324de5 Mon Sep 17 00:00:00 2001 From: pterw Date: Sat, 31 Oct 2026 00:55:55 -0400 Subject: [PATCH 06/12] fix(ui): Make the stream panel dismissible and focus-safe The stream panel was always a live region, Escape did not dismiss it, a pointer leave dropped the week while the keys were driving it, and the gate never checked that arrow keys were consumed. The live region now exists only while the stream has keyboard focus, Escape hides the panel and keeps the position, and a leave clears the week only without keyboard focus. The keyboard check asserts each arrow press was consumed, and covers click-then-leave and Escape. Validation: `pytest -q` -- **3111 passed**. --- docs/agents/PLAYBOOK.md | 41 ++++++---- .../PLAYBOOK_EXECUTION_LOG_ARCHIVE.md | 17 ++++ .../plans/2026-10-31-ui-audit-minors.md | 20 ++--- scripts/dev/_frontend_gate_stream.py | 77 ++++++++++++++++++- static/js/heatmap.js | 44 ++++++++++- 5 files changed, 164 insertions(+), 35 deletions(-) diff --git a/docs/agents/PLAYBOOK.md b/docs/agents/PLAYBOOK.md index 8cd95e71..16893102 100644 --- a/docs/agents/PLAYBOOK.md +++ b/docs/agents/PLAYBOOK.md @@ -207,6 +207,30 @@ non-current operational logs. Older dated entries live in +### 2026-10-31 - Make the stream panel dismissible and focus-safe + +The stream panel was always a live region, so a pointer scrub announced +every week. Escape did not dismiss it, a pointer leave dropped the week +while the keys were driving it, and the gate never checked that arrow keys +were consumed. `aria-live` is now set only while the stream has keyboard +focus (`:focus-visible`, so a click or tap does not count), decided on +focus and again at the first key, because Chromium turns `:focus-visible` +on after a click without a focus event. Escape hides the panel, ring, +guide and dimming, keeps focus and stores the position so the next arrow +resumes from it. Pointer leave and cancel clear the week only without +keyboard focus. `showWeek`'s guard lost its missing space. The keyboard +check now watches `window` for each arrow key reaching it with +`defaultPrevented`, and gained the click-then-leave, Escape and +unfocused-hover cases. The gate's three `.focus()` calls already match +`:focus-visible` in Chromium (the only engine the stream checks run on), so +they stay. This closes audit rows 1, 26, 27, 28 and 29 of the UI audit +Minors. Deviation: Escape calls `preventDefault` only when it dismissed a +panel. Existing tests edited: the gate check +`check_stream_is_one_keyboard_tab_stop` (its "after pointer leave" +expectation changed from week 6 to week 26 as the brief requires). + +Validation: `pytest -q` -- **3111 passed**. + ### 2026-10-31 - Clear the stored pause choice on every exit The spotlight photo gate's paused-hold probe stores `ss-motion=still` @@ -247,20 +271,3 @@ row 3 of the UI audit Minors. No deviations. Existing test edited: added, `600 normal 18px x`). Validation: `pytest -q` -- **3109 passed**. - -### 2026-10-30 - Plan the UI audit Minors bug fixes - -The deferred Minors from the 2026-10-27 UI audit's reviews were checked -against `main` by a read-only audit. Of 79 rows, 43 were still true, and the -owner accepted a triage of them on 2026-10-30. The spec records each chosen -row with its evidence and lists the deferred and dropped rows. The plan -slices the fixes into eleven atomic tasks: stream panel keyboard and -screen-reader behaviour, gate-helper fixes, two CSS tidy-ups, and four -visual changes that land only after the owner previews them (panel header -size, key spacing, month labels, vertical centring). One plan review found -two Important issues: a focus rule that also caught pointer focus, and a -false claim about the saved image. Both were fixed with its eight Minors -before this commit. Docs only. - -Validation: the full suite measured **3108 passed**; pre-commit on all -files and the final docsync check pass. diff --git a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md index 7c00e710..065c8b20 100644 --- a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md +++ b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md @@ -9,6 +9,23 @@ Read helpers: - `rg -n "^### 20" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` - `rg -n "" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` +### 2026-10-30 - Plan the UI audit Minors bug fixes + +The deferred Minors from the 2026-10-27 UI audit's reviews were checked +against `main` by a read-only audit. Of 79 rows, 43 were still true, and the +owner accepted a triage of them on 2026-10-30. The spec records each chosen +row with its evidence and lists the deferred and dropped rows. The plan +slices the fixes into eleven atomic tasks: stream panel keyboard and +screen-reader behaviour, gate-helper fixes, two CSS tidy-ups, and four +visual changes that land only after the owner previews them (panel header +size, key spacing, month labels, vertical centring). One plan review found +two Important issues: a focus rule that also caught pointer focus, and a +false claim about the saved image. Both were fixed with its eight Minors +before this commit. Docs only. + +Validation: the full suite measured **3108 passed**; pre-commit on all +files and the final docsync check pass. + ### 2026-10-30 - Record the merged chart work and open the UI Minors side task Section 3 still described the weekly chart geometry branch as awaiting its diff --git a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md index 83527d7b..3d89f8bb 100644 --- a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md +++ b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md @@ -44,7 +44,7 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p - [ ] Task 4: share the footer gap as one custom property. - [x] Task 5: stream gate reports an empty stream and always cleans up. - [ ] Task 6 (PREVIEW): scrubber panel header at 13px. -- [ ] Task 7: dismissible, focus-safe stream panel. +- [x] Task 7: dismissible, focus-safe stream panel. - [ ] Task 8 (PREVIEW): heatmap key ramp spacing at the reference's 12px. - [ ] Task 9 (PREVIEW): stream month labels match the heatmap's. - [ ] Task 10 (PREVIEW): centre the stream in its plot band. @@ -154,15 +154,15 @@ No test file exists for this module and none is added (C6, "no need to excessive **Extends (no new gate function):** `check_stream_is_one_keyboard_tab_stop` (rows 26-29), and `check_stream_hover_shows_panel_and_ring` (or the existing hover check that reads `_READ_HOVER_JS`; the implementer names the one it extends) for the row 26 unfocused case. -- [ ] Focus method (C11): the gate's existing `page.locator(_STREAM).focus()` calls (`_frontend_gate_stream.py` lines about 445, 1328 and 1385) are programmatic, and whether script focus matches `:focus-visible` depends on the browser's last-interaction rule, which reading cannot settle. In each browser the gate runs, read `matches(':focus-visible')` on the stream right after the existing `.focus()` call, in the sequences the checks use (a prior `mouse.move` only, no click). If it is false anywhere, focus that step with `page.keyboard.press("Tab")` instead (the check's first step already tabs in) and say so in the report. Do not weaken the rule to make `.focus()` pass. -- [ ] Row 29, in the keyboard check: install a bubbling `keydown` listener on `window` before the first press and keep it through the whole check, so it covers the dense-week-end presses and every key of the `_KEY_STEPS` walk (Home, End and the edge clamps included); assert `defaultPrevented` was true for each. Failure text names the key. -- [ ] Click then leave (C11, new case, in the keyboard check or the hover check, the implementer says which): with the stream blurred, `page.locator(_STREAM).click()` on a plotted point, then `page.mouse.move(*_OUTSIDE)`; assert the panel, ring, guide and dimming are cleared (the `_cleared_after` helper, "after a click and a pointer leave") and `aria-live` on `#stream-panel` is not `polite`. Against the unchanged `heatmap.js` this fails on `aria-live` (it is always `polite` today); the panel clear already holds there and is the guard against a "any focus" rule, which would leave it up. -- [ ] Row 27: after the dense-week-end step, press Escape: the panel is hidden (`hidden` attribute or no `.stream-panel-row` visible), the ring and guide are gone, `document.activeElement` is still the stream; press `ArrowRight` and assert the panel shows week 7 (one right of the stored week 6) with the same row. -- [ ] Row 28: change the existing "after pointer leave" step. The sequence `_hover(page, _START_WEEK)`, `page.mouse.move(*_OUTSIDE)`, `ArrowUp` runs with the stream focused, so after the fix the panel stays on week `_START_WEEK` (26) after the mouse leaves, and `ArrowUp` moves from the pointer's row: expected `_step_failures(page, _START_WEEK, , ...)` where the pointer row is `rows["hovered"]` from `_PANEL_ROWS_JS` read right after the hover. The old expectation (week 6, row `_ARTIST_COUNT - 1`) was the defect. Keep a separate unfocused case: with the stream blurred, a pointer leave still clears everything (the existing `_cleared_after` helper). -- [ ] Row 26: unfocused pointer hover, `aria-live` on `#stream-panel` is not `polite`; after `Tab` into the stream it is `polite`; after the blur it is not. -- [ ] RED: write the new assertions first, run `"" C:/ssw/tools/with_browser_lock.py "" scripts/dev/frontend_gate.py` against the unchanged `heatmap.js`; quote the failing lines (one per row 26, 27, 28, and the click-then-leave case). For row 29, prove the check can fail with a throwaway edit that removes `event.preventDefault()` in `handleStreamKey` in the scratch worktree only; quote the failing line and revert it before the patch. -- [ ] GREEN: the same gate passes after the `heatmap.js` change. Quote the last line. -- [ ] Acceptance: `frontend-gate` passes (both engines, all profiles); `suite-*`, `pre-commit` (re-stage hook rewrites), `docsync-check` pass. The pure `streamKeyTarget` tests in `tests/frontend/test_heatmap_pure_functions.py` are unchanged and still pass (the key map is not touched). +- [x] Focus method (C11): the gate's existing `page.locator(_STREAM).focus()` calls (`_frontend_gate_stream.py` lines about 445, 1328 and 1385) are programmatic, and whether script focus matches `:focus-visible` depends on the browser's last-interaction rule, which reading cannot settle. In each browser the gate runs, read `matches(':focus-visible')` on the stream right after the existing `.focus()` call, in the sequences the checks use (a prior `mouse.move` only, no click). If it is false anywhere, focus that step with `page.keyboard.press("Tab")` instead (the check's first step already tabs in) and say so in the report. Do not weaken the rule to make `.focus()` pass. +- [x] Row 29, in the keyboard check: install a bubbling `keydown` listener on `window` before the first press and keep it through the whole check, so it covers the dense-week-end presses and every key of the `_KEY_STEPS` walk (Home, End and the edge clamps included); assert `defaultPrevented` was true for each. Failure text names the key. +- [x] Click then leave (C11, new case, in the keyboard check or the hover check, the implementer says which): with the stream blurred, `page.locator(_STREAM).click()` on a plotted point, then `page.mouse.move(*_OUTSIDE)`; assert the panel, ring, guide and dimming are cleared (the `_cleared_after` helper, "after a click and a pointer leave") and `aria-live` on `#stream-panel` is not `polite`. Against the unchanged `heatmap.js` this fails on `aria-live` (it is always `polite` today); the panel clear already holds there and is the guard against a "any focus" rule, which would leave it up. +- [x] Row 27: after the dense-week-end step, press Escape: the panel is hidden (`hidden` attribute or no `.stream-panel-row` visible), the ring and guide are gone, `document.activeElement` is still the stream; press `ArrowRight` and assert the panel shows week 7 (one right of the stored week 6) with the same row. +- [x] Row 28: change the existing "after pointer leave" step. The sequence `_hover(page, _START_WEEK)`, `page.mouse.move(*_OUTSIDE)`, `ArrowUp` runs with the stream focused, so after the fix the panel stays on week `_START_WEEK` (26) after the mouse leaves, and `ArrowUp` moves from the pointer's row: expected `_step_failures(page, _START_WEEK, , ...)` where the pointer row is `rows["hovered"]` from `_PANEL_ROWS_JS` read right after the hover. The old expectation (week 6, row `_ARTIST_COUNT - 1`) was the defect. Keep a separate unfocused case: with the stream blurred, a pointer leave still clears everything (the existing `_cleared_after` helper). +- [x] Row 26: unfocused pointer hover, `aria-live` on `#stream-panel` is not `polite`; after `Tab` into the stream it is `polite`; after the blur it is not. +- [x] RED: write the new assertions first, run `"" C:/ssw/tools/with_browser_lock.py "" scripts/dev/frontend_gate.py` against the unchanged `heatmap.js`; quote the failing lines (one per row 26, 27, 28, and the click-then-leave case). For row 29, prove the check can fail with a throwaway edit that removes `event.preventDefault()` in `handleStreamKey` in the scratch worktree only; quote the failing line and revert it before the patch. +- [x] GREEN: the same gate passes after the `heatmap.js` change. Quote the last line. +- [x] Acceptance: `frontend-gate` passes (both engines, all profiles); `suite-*`, `pre-commit` (re-stage hook rewrites), `docsync-check` pass. The pure `streamKeyTarget` tests in `tests/frontend/test_heatmap_pure_functions.py` are unchanged and still pass (the key map is not touched). ## Task 8 (PREVIEW): Heatmap key ramp spacing at the reference's 12px diff --git a/scripts/dev/_frontend_gate_stream.py b/scripts/dev/_frontend_gate_stream.py index bdc52aee..3a60bef2 100644 --- a/scripts/dev/_frontend_gate_stream.py +++ b/scripts/dev/_frontend_gate_stream.py @@ -1175,6 +1175,65 @@ def check_stream_reduced_motion(page, base_url: str) -> list[str]: _FADE_MS = 300 +#: Every keydown that reaches window, and whether it was consumed. +_WATCH_KEYS_JS = """() => { + window.__streamGateKeys = []; + window.addEventListener('keydown', (event) => { + window.__streamGateKeys.push([event.key, event.defaultPrevented]); + }); +}""" + +_NAV_KEYS = ("ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End") + +_READ_LIVE_JS = ( + "() => document.querySelector('#stream-panel').getAttribute('aria-live')" +) + + +def _live_failures(page, polite: bool, when: str) -> list[str]: + """The panel is a polite live region only while the stream has keyboard focus.""" + live = page.evaluate(_READ_LIVE_JS) + if (live == "polite") != polite: + return [f"{when}: the panel's aria-live is {live!r}, polite expected: {polite}"] + return [] + + +def _unconsumed_key_failures(page) -> list[str]: + keys = page.evaluate("() => window.__streamGateKeys") + unconsumed = dict.fromkeys( + key for key, prevented in keys if key in _NAV_KEYS and not prevented + ) + return [ + f"{key} reached window without defaultPrevented, so the page may scroll" + for key in unconsumed + ] + + +def _pointer_failures(page) -> list[str]: + """Hover and a click then a leave, with the stream blurred, announce nothing.""" + failures = [] + _hover(page, _START_WEEK) + failures.extend(_live_failures(page, False, "hovering the unfocused stream")) + point = _point_in_layer(page, _START_WEEK) + page.mouse.click(point["x"], point["y"]) + page.mouse.move(*_OUTSIDE) + failures.extend(_cleared_after(page, "after a click and a pointer leave")) + failures.extend(_live_failures(page, False, "after a click and a pointer leave")) + return failures + + +def _escape_failures(page) -> list[str]: + """Escape hides the panel and keeps focus; the next arrow resumes from there.""" + page.keyboard.press("Escape") + wait_for_settled(page) + failures = _cleared_failures(page, "after Escape") + if not page.evaluate(_ACTIVE_JS)["isStream"]: + failures.append("Escape moved focus off the stream") + page.keyboard.press("ArrowRight") + failures.extend(_step_failures(page, 7, _ARTIST_COUNT, "ArrowRight after Escape")) + return failures + + def _cleared_after(page, when: str) -> list[str]: wait_for_settled(page) page.wait_for_timeout(_FADE_MS) @@ -1350,9 +1409,12 @@ def check_stream_is_one_keyboard_tab_stop(page, base_url: str) -> list[str]: try: _open_heatmap(page, base_url, job_id, _GRID_DESKTOP) page.mouse.move(*_OUTSIDE) - failures = _tab_to_stream(page) - if failures: - return failures + page.evaluate(_WATCH_KEYS_JS) + failures = _pointer_failures(page) + tab_failures = _tab_to_stream(page) + if tab_failures: + return failures + tab_failures + failures.extend(_live_failures(page, True, "after Tab into the stream")) failures.extend(_outline_failures(page)) failures.extend(_walk_failures(page)) page.keyboard.press("Home") @@ -1361,12 +1423,17 @@ def check_stream_is_one_keyboard_tab_stop(page, base_url: str) -> list[str]: for _ in range(_ARTIST_COUNT + 1): page.keyboard.press("ArrowDown") failures.extend(_step_failures(page, 6, _ARTIST_COUNT, "dense week end")) + failures.extend(_escape_failures(page)) _hover(page, _START_WEEK) + pointer_row = page.evaluate(_PANEL_ROWS_JS)["hovered"] page.mouse.move(*_OUTSIDE) page.keyboard.press("ArrowUp") failures.extend( - _step_failures(page, 6, _ARTIST_COUNT - 1, "after pointer leave") + _step_failures( + page, _START_WEEK, max(pointer_row - 1, 0), "after pointer leave" + ) ) + failures.extend(_unconsumed_key_failures(page)) if page.evaluate(_STOPS_IN_STREAM_JS) != 1: failures.append("the stream holds more than one tab stop") # The sentinel is added only now: in flow, it would add height below @@ -1384,8 +1451,10 @@ def check_stream_is_one_keyboard_tab_stop(page, base_url: str) -> list[str]: ) failures.extend(_cleared_after(page, "after Shift+Tab left the stream")) page.locator(_STREAM).focus() + failures.extend(_live_failures(page, True, "after focusing the stream")) page.locator(_STREAM).blur() failures.extend(_cleared_after(page, "after blur")) + failures.extend(_live_failures(page, False, "after blur")) failures.extend(_blur_resize_failures(page, original)) finally: try: diff --git a/static/js/heatmap.js b/static/js/heatmap.js index d64cfddc..2becbd71 100644 --- a/static/js/heatmap.js +++ b/static/js/heatmap.js @@ -1956,7 +1956,6 @@ var panel = document.createElement('div'); panel.id = 'stream-panel'; panel.className = 'stream-panel'; - panel.setAttribute('aria-live', 'polite'); panel.hidden = true; gridContainer.appendChild(panel); @@ -1972,10 +1971,32 @@ svg.addEventListener('blur', handleStreamBlur); svg.addEventListener('keydown', handleStreamKey); ['pointerleave', 'pointercancel'].forEach(function (type) { - svg.addEventListener(type, clearWeek); + svg.addEventListener(type, handleStreamLeave); }); } + // Keyboard focus, as :focus-visible draws it: the svg is a tab stop, so a + // click or tap focuses it too, and that is not keyboard focus. + function streamHasKeyboardFocus(state) { + return document.activeElement === state.svg && state.svg.matches(':focus-visible'); + } + + // The panel announces its rewrites only while the keys drive it, so a + // pointer scrub says nothing. Set before the panel is filled. + function syncStreamLive(state) { + if (streamHasKeyboardFocus(state)) { + state.panel.setAttribute('aria-live', 'polite'); + } else { + state.panel.removeAttribute('aria-live'); + } + } + + // With keyboard focus the shown week stays, so the keys continue from it. + function handleStreamLeave() { + if (streamState && streamHasKeyboardFocus(streamState)) return; + clearWeek(); + } + // Map the pointer to a week and the layer under it, then show them. function handleStreamPointer(event) { var state = streamState; @@ -2020,6 +2041,7 @@ function handleStreamFocus() { var state = streamState; if (!state) return; + syncStreamLive(state); if (state.shown) { state.cursor = streamKeyState(state); } else { @@ -2028,7 +2050,10 @@ } function handleStreamBlur() { - if (streamState) streamState.cursor = null; + if (streamState) { + streamState.cursor = null; + streamState.panel.removeAttribute('aria-live'); + } clearWeek(); } @@ -2036,6 +2061,17 @@ function handleStreamKey(event) { var state = streamState; if (!state || event.altKey || event.ctrlKey || event.metaKey) return; + if (event.key === 'Escape') { + // Keep the keyboard position, so the next arrow key shows it again. + if (!state.shown) return; + state.cursor = streamKeyState(state); + event.preventDefault(); + clearWeek(); + return; + } + // Chromium turns :focus-visible on for a clicked svg at the first key, + // without a focus event. + syncStreamLive(state); var target = streamKeyTarget(event.key, streamKeyState(state), streamDims(state)); if (!target) return; event.preventDefault(); @@ -2088,7 +2124,7 @@ function showWeek(week, hoverId) { var state = streamState; if (!state) return; - if (state.shown &&state.shown.week === week && state.shown.hoverId === hoverId) return; + if (state.shown && state.shown.week === week && state.shown.hoverId === hoverId) return; removeStreamMarks(); state.shown = { week: week, hoverId: hoverId }; From 951158184a867da31dcc5dfcef70a733b7a6b7d0 Mon Sep 17 00:00:00 2001 From: pterw Date: Sat, 31 Oct 2026 01:14:35 -0400 Subject: [PATCH 07/12] refactor(ui): Reuse the desktop media query in index.js positionForm built the same 860px query the desktop const already holds. It now reads the const, which is declared above positionForm so it is plainly initialised before any call. No behaviour change. Closes audit row 13 of the UI audit Minors. Validation: `pytest -q` -- **3111 passed**. --- docs/agents/PLAYBOOK.md | 23 ++++++++----------- .../PLAYBOOK_EXECUTION_LOG_ARCHIVE.md | 13 +++++++++++ .../plans/2026-10-31-ui-audit-minors.md | 6 ++--- static/js/index.js | 5 ++-- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/docs/agents/PLAYBOOK.md b/docs/agents/PLAYBOOK.md index 16893102..6312ee73 100644 --- a/docs/agents/PLAYBOOK.md +++ b/docs/agents/PLAYBOOK.md @@ -207,6 +207,16 @@ non-current operational logs. Older dated entries live in +### 2026-10-31 - Reuse the desktop media query in index.js + +`positionForm` in `static/js/index.js` built the same 860px media query +that the `desktop` const already holds. It now reads `desktop.matches`, +and the const is declared above `positionForm` so it is plainly +initialised before any call. No behaviour change. This closes audit row 13 +of the UI audit Minors. No deviations. Existing tests edited: none. + +Validation: `pytest -q` -- **3111 passed**. + ### 2026-10-31 - Make the stream panel dismissible and focus-safe The stream panel was always a live region, so a pointer scrub announced @@ -258,16 +268,3 @@ surfaces. This closes audit rows 23 and 30 of the UI audit Minors. No deviations. Existing tests edited: none. Validation: `pytest -q` -- **3109 passed**. - -### 2026-10-30 - Keep a numeric font weight after `normal` in the gate - -The frontend gate's canvas font parser read `600 normal 26px x` as weight -400, because the `normal` token reset the weight set just before it. The -saved-image headline check could then report a wrong drawn weight. `normal` -is no longer treated as a weight token, so a numeric weight stands, `bold` -still maps to 700 and a string with no weight stays 400. This closes audit -row 3 of the UI audit Minors. No deviations. Existing test edited: -`test_a_saved_headline_drawn_at_another_weight_is_reported` (one case -added, `600 normal 18px x`). - -Validation: `pytest -q` -- **3109 passed**. diff --git a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md index 065c8b20..0d05358c 100644 --- a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md +++ b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md @@ -9,6 +9,19 @@ Read helpers: - `rg -n "^### 20" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` - `rg -n "" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` +### 2026-10-30 - Keep a numeric font weight after `normal` in the gate + +The frontend gate's canvas font parser read `600 normal 26px x` as weight +400, because the `normal` token reset the weight set just before it. The +saved-image headline check could then report a wrong drawn weight. `normal` +is no longer treated as a weight token, so a numeric weight stands, `bold` +still maps to 700 and a string with no weight stays 400. This closes audit +row 3 of the UI audit Minors. No deviations. Existing test edited: +`test_a_saved_headline_drawn_at_another_weight_is_reported` (one case +added, `600 normal 18px x`). + +Validation: `pytest -q` -- **3109 passed**. + ### 2026-10-30 - Plan the UI audit Minors bug fixes The deferred Minors from the 2026-10-27 UI audit's reviews were checked diff --git a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md index 3d89f8bb..9a207f7b 100644 --- a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md +++ b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md @@ -40,7 +40,7 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p - [x] Task 1: keep a numeric font weight after `normal`. - [x] Task 2: clear the stored pause choice on every exit. -- [ ] Task 3: reuse the `desktop` media query in `index.js`. +- [x] Task 3: reuse the `desktop` media query in `index.js`. - [ ] Task 4: share the footer gap as one custom property. - [x] Task 5: stream gate reports an empty stream and always cleans up. - [ ] Task 6 (PREVIEW): scrubber panel header at 13px. @@ -89,8 +89,8 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p **Behaviour:** `positionForm` reads `desktop.matches` instead of building `matchMedia('(min-width: 860px)')` again. The `const desktop` declaration moves above `positionForm` so it is plainly initialised before any call (every call is at or after the `ResizeObserver` setup today, so this is for the reader, not a fix). No behaviour change, so no new test (R9, C6): the home layout checks of the frontend gate already cross 860px. -- [ ] `git grep -n "min-width: 860px" static/js/index.js` shows the query once. -- [ ] Acceptance: `frontend-gate` passes (record its last line); `suite-*`, `pre-commit`, `docsync-check` pass. No `results-behavior` run needed (the commit touches neither `results.html`, `results.js` nor the behaviour tests). +- [x] `git grep -n "min-width: 860px" static/js/index.js` shows the query once. +- [x] Acceptance: `frontend-gate` passes (record its last line); `suite-*`, `pre-commit`, `docsync-check` pass. No `results-behavior` run needed (the commit touches neither `results.html`, `results.js` nor the behaviour tests). ## Task 4: Share the footer gap as one custom property diff --git a/static/js/index.js b/static/js/index.js index 664a610a..f1a23456 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -617,6 +617,7 @@ document.addEventListener('DOMContentLoaded', () => { const formWell = document.querySelector('.index-form'); const formComposition = document.querySelector('.index-form__inner'); const header = document.querySelector('.site-header'); + const desktop = matchMedia('(min-width: 860px)'); /** Lift the centred composition by up to 2.5rem, bounded below the header. * The lift gives way first as space runs out: it never takes the gap above @@ -631,7 +632,7 @@ document.addEventListener('DOMContentLoaded', () => { * margins cannot loop. */ function positionForm() { - if (!matchMedia('(min-width: 860px)').matches + if (!desktop.matches || formComposition.querySelector('.is-mode-switching')) return; const height = formComposition.getBoundingClientRect().height; if (!height) return; @@ -649,8 +650,6 @@ document.addEventListener('DOMContentLoaded', () => { const albumSection = document.getElementById('album-form-section'); const thresholds = document.querySelector('.disclosure'); - const desktop = matchMedia('(min-width: 860px)'); - /** Hold the composition at the default album form's height (desktop only). * The heatmap form is shorter; without a floor the centred composition * would move when the mode changes. Measured only in album mode with every From d278349c36aa415f421b39849bf432dc05da909a Mon Sep 17 00:00:00 2001 From: pterw Date: Sat, 31 Oct 2026 01:17:16 -0400 Subject: [PATCH 08/12] refactor(css): Share the footer gap as one custom property Two 1.5rem literals held the footer gap (the footer row padding in shell.css and the home hero bottom padding in index.css), kept equal only by a gate equality check. One --shell-footer-gap property now feeds both; computed values are unchanged. Validation: `pytest -q` -- **3111 passed**. --- docs/agents/PLAYBOOK.md | 26 +++++++++---------- .../PLAYBOOK_EXECUTION_LOG_ARCHIVE.md | 14 ++++++++++ .../plans/2026-10-31-ui-audit-minors.md | 6 ++--- static/css/index.css | 6 ++--- static/css/shell.css | 5 +++- 5 files changed, 36 insertions(+), 21 deletions(-) diff --git a/docs/agents/PLAYBOOK.md b/docs/agents/PLAYBOOK.md index 6312ee73..d384c847 100644 --- a/docs/agents/PLAYBOOK.md +++ b/docs/agents/PLAYBOOK.md @@ -207,6 +207,18 @@ non-current operational logs. Older dated entries live in +### 2026-10-31 - Share the footer gap as one custom property + +The footer gap was two 1.5rem literals, the footer row's bottom padding in +`static/css/shell.css` and the home hero's `padding-bottom` in +`static/css/index.css`, kept equal only by a gate equality check. One +`--shell-footer-gap` property, declared once in `shell.css`'s `:root`, +now feeds both, and the `index.css` comment names it. Computed values are +unchanged. This closes audit row 17 of the UI audit Minors. No +deviations. Existing tests edited: none. + +Validation: `pytest -q` -- **3111 passed**. + ### 2026-10-31 - Reuse the desktop media query in index.js `positionForm` in `static/js/index.js` built the same 860px media query @@ -254,17 +266,3 @@ Existing tests edited: none (one test added, `test_an_early_return_leaves_no_stored_pause_choice`). Validation: `pytest -q` -- **3111 passed**. - -### 2026-10-30 - Report an empty stream and always run its cleanup - -The stream gate's paint check called `min()` on the contrast ratios before -reporting a stream with no drawn layers, so an empty stream raised a -ValueError instead of the named failure. The contrast line is now skipped -when there are no ratios, and the failure "the stream draws no artist -layers" is returned. The keyboard check's cleanup ran its three steps in -sequence, so a raising first step skipped the viewport restore and the job -delete; each step now runs in a nested `finally` and the first error still -surfaces. This closes audit rows 23 and 30 of the UI audit Minors. No -deviations. Existing tests edited: none. - -Validation: `pytest -q` -- **3109 passed**. diff --git a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md index 0d05358c..cf0b821a 100644 --- a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md +++ b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md @@ -9,6 +9,20 @@ Read helpers: - `rg -n "^### 20" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` - `rg -n "" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` +### 2026-10-30 - Report an empty stream and always run its cleanup + +The stream gate's paint check called `min()` on the contrast ratios before +reporting a stream with no drawn layers, so an empty stream raised a +ValueError instead of the named failure. The contrast line is now skipped +when there are no ratios, and the failure "the stream draws no artist +layers" is returned. The keyboard check's cleanup ran its three steps in +sequence, so a raising first step skipped the viewport restore and the job +delete; each step now runs in a nested `finally` and the first error still +surfaces. This closes audit rows 23 and 30 of the UI audit Minors. No +deviations. Existing tests edited: none. + +Validation: `pytest -q` -- **3109 passed**. + ### 2026-10-30 - Keep a numeric font weight after `normal` in the gate The frontend gate's canvas font parser read `600 normal 26px x` as weight diff --git a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md index 9a207f7b..f6522932 100644 --- a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md +++ b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md @@ -41,7 +41,7 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p - [x] Task 1: keep a numeric font weight after `normal`. - [x] Task 2: clear the stored pause choice on every exit. - [x] Task 3: reuse the `desktop` media query in `index.js`. -- [ ] Task 4: share the footer gap as one custom property. +- [x] Task 4: share the footer gap as one custom property. - [x] Task 5: stream gate reports an empty stream and always cleans up. - [ ] Task 6 (PREVIEW): scrubber panel header at 13px. - [x] Task 7: dismissible, focus-safe stream panel. @@ -101,8 +101,8 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p **Behaviour:** Declare one custom property for the 1.5rem footer gap in `shell.css`'s `:root` block. `.page-footer-extras` (bottom padding) and `.index-grid .index-hero` (`padding-bottom`) both read it; the comment in `index.css` that names "`static/css/shell.css` (.page-footer-extras, 1.5rem)" now names the property. The computed values do not change (1.5rem = 24px at the root size). No new test: the gate's existing equality check (`footerGap` against the pause button's `gap` in `_measure_home_pause`) is the guard and stays untouched. -- [ ] The two footer-gap declarations (`.page-footer-extras` bottom padding, `.index-grid .index-hero` `padding-bottom`) read the custom property, and the property is declared once. `git grep -n "1.5rem"` still shows unrelated uses, and `shell.css` repeats `1.5rem` in the mobile theme slot's `padding: 1rem 1rem 1.5rem`; those are left alone, so the check is by reading those two declarations, not by counting hits. -- [ ] Acceptance: `frontend-gate` passes and its layout section reports the same pause gap as before (quote the line); `suite-*`, `pre-commit` (re-stage any `tailwind.css` rewrite), `docsync-check` pass. +- [x] The two footer-gap declarations (`.page-footer-extras` bottom padding, `.index-grid .index-hero` `padding-bottom`) read the custom property, and the property is declared once. `git grep -n "1.5rem"` still shows unrelated uses, and `shell.css` repeats `1.5rem` in the mobile theme slot's `padding: 1rem 1rem 1.5rem`; those are left alone, so the check is by reading those two declarations, not by counting hits. +- [x] Acceptance: `frontend-gate` passes and its layout section reports the same pause gap as before (quote the line); `suite-*`, `pre-commit` (re-stage any `tailwind.css` rewrite), `docsync-check` pass. ## Task 5: Stream gate reports an empty stream and always cleans up diff --git a/static/css/index.css b/static/css/index.css index 6e1d933d..33a589c0 100644 --- a/static/css/index.css +++ b/static/css/index.css @@ -135,12 +135,12 @@ html { /* The button's own 2.75rem box stands in for the column's bottom padding (the more specific selector keeps the scaled padding below from - restoring it). What remains is the footer row's bottom padding in - static/css/shell.css (.page-footer-extras, 1.5rem), so the button sits + restoring it). What remains is the footer row's bottom padding, the + --shell-footer-gap property in static/css/shell.css, so the button sits as far above the viewport's foot as the footer button does on the results page. The gate compares the two. */ .index-grid .index-hero { - padding-bottom: 1.5rem; + padding-bottom: var(--shell-footer-gap); } .index-hero__motion { diff --git a/static/css/shell.css b/static/css/shell.css index d10588c2..cf6289e9 100644 --- a/static/css/shell.css +++ b/static/css/shell.css @@ -27,6 +27,9 @@ --shell-selected-outline: #775ab5; --shell-height: clamp(4.25rem, 2.96875vw, 4.75rem); --shell-control-gap: 0.75rem; + /* Space under the footer row; the home hero reads it too, so the home + button and the footer button sit equally far above the viewport. */ + --shell-footer-gap: 1.5rem; /* The same stack as --font-sans in tailwind.src.css, repeated because an unmigrated page never loads the compiled sheet and would resolve var(--font-sans) to nothing. This file already duplicates the palette @@ -617,7 +620,7 @@ body { justify-content: center; align-items: center; gap: 0.75rem; - padding: 1rem 1rem 1.5rem; + padding: 1rem 1rem var(--shell-footer-gap); margin-top: 0.5rem; opacity: 0; animation: ss-footer-extras-in 1.2s ease 0.6s forwards; From c1e00655f6e4e5eb4645aab1b796d466f7f0de93 Mon Sep 17 00:00:00 2001 From: pterw Date: Sat, 31 Oct 2026 01:20:48 -0400 Subject: [PATCH 09/12] fix(ui): Tighten the heatmap key's ramp spacing The ramp carried its own 0.875rem top margin on top of the key's 0.75rem grid gap, leaving about 28px under the last row at 1920. The reference is a 12px grid gap; dropping the margin leaves the gap alone, scaled by --index-scale (12.9px at 1920). The owner previewed and kept the change. Closes audit row 5. Validation: `pytest -q` -- **3111 passed**. --- docs/agents/PLAYBOOK.md | 27 +++++++++---------- .../PLAYBOOK_EXECUTION_LOG_ARCHIVE.md | 14 ++++++++++ .../plans/2026-10-31-ui-audit-minors.md | 6 ++--- static/css/heatmap.css | 1 - 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/docs/agents/PLAYBOOK.md b/docs/agents/PLAYBOOK.md index d384c847..52b95e34 100644 --- a/docs/agents/PLAYBOOK.md +++ b/docs/agents/PLAYBOOK.md @@ -207,6 +207,19 @@ non-current operational logs. Older dated entries live in +### 2026-10-31 - Tighten the heatmap key's ramp spacing + +`.hm-preview__ramp` in `static/css/heatmap.css` carried its own +`margin-top` of 0.875rem on top of the `.index-key` grid gap, leaving +about 28px under the last key row at 1920. The margin is removed, so the +gap alone (0.75rem times `--index-scale`) remains: 12.9px at 1920, 12px +at scale 1, matching the reference's 12px grid gap. The ramp's height is +unchanged. The owner previewed the change and kept it (C15). This closes +audit row 5 of the UI audit Minors. No deviations. Existing tests +edited: none. + +Validation: `pytest -q` -- **3111 passed**. + ### 2026-10-31 - Share the footer gap as one custom property The footer gap was two 1.5rem literals, the footer row's bottom padding in @@ -252,17 +265,3 @@ panel. Existing tests edited: the gate check expectation changed from week 6 to week 26 as the brief requires). Validation: `pytest -q` -- **3111 passed**. - -### 2026-10-31 - Clear the stored pause choice on every exit - -The spotlight photo gate's paused-hold probe stores `ss-motion=still` -through an init script, and only the Play click removed it, so an early -return left the choice in the shared browser context. The probe's `finally` -now removes the `ss-motion` key before it closes the page. The removal is -wrapped in `contextlib.suppress(PlaywrightError)` (shorter than tracking -navigation state), so a page that never navigated cannot hide the original -failure. This closes audit row 40 of the UI audit Minors. No deviations. -Existing tests edited: none (one test added, -`test_an_early_return_leaves_no_stored_pause_choice`). - -Validation: `pytest -q` -- **3111 passed**. diff --git a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md index cf0b821a..5ea6683b 100644 --- a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md +++ b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md @@ -9,6 +9,20 @@ Read helpers: - `rg -n "^### 20" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` - `rg -n "" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` +### 2026-10-31 - Clear the stored pause choice on every exit + +The spotlight photo gate's paused-hold probe stores `ss-motion=still` +through an init script, and only the Play click removed it, so an early +return left the choice in the shared browser context. The probe's `finally` +now removes the `ss-motion` key before it closes the page. The removal is +wrapped in `contextlib.suppress(PlaywrightError)` (shorter than tracking +navigation state), so a page that never navigated cannot hide the original +failure. This closes audit row 40 of the UI audit Minors. No deviations. +Existing tests edited: none (one test added, +`test_an_early_return_leaves_no_stored_pause_choice`). + +Validation: `pytest -q` -- **3111 passed**. + ### 2026-10-30 - Report an empty stream and always run its cleanup The stream gate's paint check called `min()` on the contrast ratios before diff --git a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md index f6522932..86ba1e7c 100644 --- a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md +++ b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md @@ -45,7 +45,7 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p - [x] Task 5: stream gate reports an empty stream and always cleans up. - [ ] Task 6 (PREVIEW): scrubber panel header at 13px. - [x] Task 7: dismissible, focus-safe stream panel. -- [ ] Task 8 (PREVIEW): heatmap key ramp spacing at the reference's 12px. +- [x] Task 8 (PREVIEW): heatmap key ramp spacing at the reference's 12px. - [ ] Task 9 (PREVIEW): stream month labels match the heatmap's. - [ ] Task 10 (PREVIEW): centre the stream in its plot band. - [ ] Task 11: record the execution. @@ -175,8 +175,8 @@ No test file exists for this module and none is added (C6, "no need to excessive **Tests:** none new (C6). The home layout checks of the frontend gate must still pass; the key's height changes by about 14px and the album key (`data-mode-key="album"`) shares the grid track, so the gate's stable-height checks are the guard. -- [ ] PREVIEW (R14): before and after Firefox screenshots of the home page in heatmap mode, light and dark, at 1920x1080 and 1280x720; scratch suffix `-8`. Report the measured pixel gap between the last key row and the ramp (before about 28px and after about 12.9px at 1920). -- [ ] Acceptance: `frontend-gate` passes; `suite-*`, `pre-commit`, `docsync-check` pass. Lands only on the owner's word. +- [x] PREVIEW (R14): before and after Firefox screenshots of the home page in heatmap mode, light and dark, at 1920x1080 and 1280x720; scratch suffix `-8`. Report the measured pixel gap between the last key row and the ramp (before about 28px and after about 12.9px at 1920). +- [x] Acceptance: `frontend-gate` passes; `suite-*`, `pre-commit`, `docsync-check` pass. Lands only on the owner's word. ## Task 9 (PREVIEW): Stream month labels match the heatmap's diff --git a/static/css/heatmap.css b/static/css/heatmap.css index 6b5213d0..819d5dae 100644 --- a/static/css/heatmap.css +++ b/static/css/heatmap.css @@ -198,7 +198,6 @@ .hm-preview__ramp { display: block; height: calc(0.5rem * var(--index-scale, 1)); - margin-top: calc(0.875rem * var(--index-scale, 1)); border-radius: 2px; /* The gradient is set by static/js/heatmap.js from ROCKET_STOPS, the one place the seven-stop ramp is defined. Writing the stops here as well From e463f22e7bc4194e3465646749796daedb221a57 Mon Sep 17 00:00:00 2001 From: pterw Date: Sat, 31 Oct 2026 01:33:19 -0400 Subject: [PATCH 10/12] fix(ui): Match the stream month labels to the heatmap's The stream's bottom month labels lacked the heatmap labels' small capitals and 0.12em tracking, so the two month rows looked different at the same rendered size. The stream labels now take both attributes; the saved image gains them too, since the export already copies them. The stream alignment gate compares family, variant, tracking and rendered size against the heatmap and fails closed on empty or mismatched label sets. The owner previewed and kept the change. Validation: `pytest -q` -- **3111 passed**. --- docs/agents/PLAYBOOK.md | 43 ++++++++----------- .../PLAYBOOK_EXECUTION_LOG_ARCHIVE.md | 24 +++++++++++ .../plans/2026-10-31-ui-audit-minors.md | 10 ++--- scripts/dev/_frontend_gate_stream.py | 21 ++++++++- static/js/heatmap.js | 1 + 5 files changed, 68 insertions(+), 31 deletions(-) diff --git a/docs/agents/PLAYBOOK.md b/docs/agents/PLAYBOOK.md index 52b95e34..9ecc9822 100644 --- a/docs/agents/PLAYBOOK.md +++ b/docs/agents/PLAYBOOK.md @@ -207,6 +207,25 @@ non-current operational logs. Older dated entries live in +### 2026-10-31 - Match the stream month labels to the heatmap's + +The stream's bottom month labels, created in `drawStream` in +`static/js/heatmap.js`, carried only font-size and the font stack. They +now also take the heatmap labels' `font-variant` small-caps and +`letter-spacing` 0.12em, so the two charts' month rows read the same +(rendered size was already equal: both SVGs share `svgWidth` at +`width: 100%`). The saved image gains the same styling, because +`streamAsImage` already copies those two attributes; the export code is +unedited and the last label stays inside the image. The stream alignment +check in `scripts/dev/_frontend_gate_stream.py` now reads each label's +family, variant, tracking and rendered size, and fails when the stream +differs from the heatmap, failing closed on empty or mismatched label +sets. The owner previewed and kept the change (C16). This closes audit +owner ruling C2 of the UI audit Minors. No deviations. Existing tests +edited: none. + +Validation: `pytest -q` -- **3111 passed**. + ### 2026-10-31 - Tighten the heatmap key's ramp spacing `.hm-preview__ramp` in `static/css/heatmap.css` carried its own @@ -241,27 +260,3 @@ initialised before any call. No behaviour change. This closes audit row 13 of the UI audit Minors. No deviations. Existing tests edited: none. Validation: `pytest -q` -- **3111 passed**. - -### 2026-10-31 - Make the stream panel dismissible and focus-safe - -The stream panel was always a live region, so a pointer scrub announced -every week. Escape did not dismiss it, a pointer leave dropped the week -while the keys were driving it, and the gate never checked that arrow keys -were consumed. `aria-live` is now set only while the stream has keyboard -focus (`:focus-visible`, so a click or tap does not count), decided on -focus and again at the first key, because Chromium turns `:focus-visible` -on after a click without a focus event. Escape hides the panel, ring, -guide and dimming, keeps focus and stores the position so the next arrow -resumes from it. Pointer leave and cancel clear the week only without -keyboard focus. `showWeek`'s guard lost its missing space. The keyboard -check now watches `window` for each arrow key reaching it with -`defaultPrevented`, and gained the click-then-leave, Escape and -unfocused-hover cases. The gate's three `.focus()` calls already match -`:focus-visible` in Chromium (the only engine the stream checks run on), so -they stay. This closes audit rows 1, 26, 27, 28 and 29 of the UI audit -Minors. Deviation: Escape calls `preventDefault` only when it dismissed a -panel. Existing tests edited: the gate check -`check_stream_is_one_keyboard_tab_stop` (its "after pointer leave" -expectation changed from week 6 to week 26 as the brief requires). - -Validation: `pytest -q` -- **3111 passed**. diff --git a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md index 5ea6683b..87469068 100644 --- a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md +++ b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md @@ -9,6 +9,30 @@ Read helpers: - `rg -n "^### 20" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` - `rg -n "" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` +### 2026-10-31 - Make the stream panel dismissible and focus-safe + +The stream panel was always a live region, so a pointer scrub announced +every week. Escape did not dismiss it, a pointer leave dropped the week +while the keys were driving it, and the gate never checked that arrow keys +were consumed. `aria-live` is now set only while the stream has keyboard +focus (`:focus-visible`, so a click or tap does not count), decided on +focus and again at the first key, because Chromium turns `:focus-visible` +on after a click without a focus event. Escape hides the panel, ring, +guide and dimming, keeps focus and stores the position so the next arrow +resumes from it. Pointer leave and cancel clear the week only without +keyboard focus. `showWeek`'s guard lost its missing space. The keyboard +check now watches `window` for each arrow key reaching it with +`defaultPrevented`, and gained the click-then-leave, Escape and +unfocused-hover cases. The gate's three `.focus()` calls already match +`:focus-visible` in Chromium (the only engine the stream checks run on), so +they stay. This closes audit rows 1, 26, 27, 28 and 29 of the UI audit +Minors. Deviation: Escape calls `preventDefault` only when it dismissed a +panel. Existing tests edited: the gate check +`check_stream_is_one_keyboard_tab_stop` (its "after pointer leave" +expectation changed from week 6 to week 26 as the brief requires). + +Validation: `pytest -q` -- **3111 passed**. + ### 2026-10-31 - Clear the stored pause choice on every exit The spotlight photo gate's paused-hold probe stores `ss-motion=still` diff --git a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md index 86ba1e7c..2b78b21a 100644 --- a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md +++ b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md @@ -46,7 +46,7 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p - [ ] Task 6 (PREVIEW): scrubber panel header at 13px. - [x] Task 7: dismissible, focus-safe stream panel. - [x] Task 8 (PREVIEW): heatmap key ramp spacing at the reference's 12px. -- [ ] Task 9 (PREVIEW): stream month labels match the heatmap's. +- [x] Task 9 (PREVIEW): stream month labels match the heatmap's. - [ ] Task 10 (PREVIEW): centre the stream in its plot band. - [ ] Task 11: record the execution. @@ -189,10 +189,10 @@ No test file exists for this module and none is added (C6, "no need to excessive **Extends:** the stream alignment reading (`_READ_ALIGNMENT_JS`, which already returns `months` and `gridMonths` per label) and `_alignment_failures` in `check_stream_aligns_with_grid_columns`. Add to the reading each label's `fontFamily`, `fontVariant`, `letterSpacing` and rendered font size in CSS px (computed `font-size` times the SVG's `clientWidth / viewBox width`), and fail when the stream's labels differ from the heatmap's on any of the four. The comparison fails closed: if `gridMonths` is empty, or the two label counts differ, it returns a named failure before comparing per label, never an index error. -- [ ] RED: add the comparison, run the frontend gate against the unchanged `heatmap.js`; quote the failure (variant and tracking differ). GREEN: passes after the change. Quote the last line. -- [ ] PREVIEW (R14): before and after Firefox screenshots, light and dark, of the heatmap with its stream at 1920x1080 and 1280x720, scratch suffix `-9`; report the rendered label size in CSS px at each width for both charts. State whether the end-anchored last label still sits inside the SVG (the existing `inside` field). -- [ ] PREVIEW, saved image (C12): save the stream's image through the page's save control (or run `streamAsImage` the way `check_stream_is_in_saved_image` does), crop the month-label row, and save the crop, light and dark, before and after, at 1920x1080 (suffix `-9`). Report that the labels show small capitals and tracking and that the last label is not clipped at the image edge. -- [ ] Acceptance: `frontend-gate` passes, including `check_stream_is_in_saved_image` (green, last label unclipped); `suite-*`, `pre-commit`, `docsync-check` pass. Lands only on the owner's word. If rejected, drop the task; Task 10 then starts from the head without it. +- [x] RED: add the comparison, run the frontend gate against the unchanged `heatmap.js`; quote the failure (variant and tracking differ). GREEN: passes after the change. Quote the last line. +- [x] PREVIEW (R14): before and after Firefox screenshots, light and dark, of the heatmap with its stream at 1920x1080 and 1280x720, scratch suffix `-9`; report the rendered label size in CSS px at each width for both charts. State whether the end-anchored last label still sits inside the SVG (the existing `inside` field). +- [x] PREVIEW, saved image (C12): save the stream's image through the page's save control (or run `streamAsImage` the way `check_stream_is_in_saved_image` does), crop the month-label row, and save the crop, light and dark, before and after, at 1920x1080 (suffix `-9`). Report that the labels show small capitals and tracking and that the last label is not clipped at the image edge. +- [x] Acceptance: `frontend-gate` passes, including `check_stream_is_in_saved_image` (green, last label unclipped); `suite-*`, `pre-commit`, `docsync-check` pass. Lands only on the owner's word. If rejected, drop the task; Task 10 then starts from the head without it. ## Task 10 (PREVIEW): Centre the stream in its plot band diff --git a/scripts/dev/_frontend_gate_stream.py b/scripts/dev/_frontend_gate_stream.py index 3a60bef2..ac2ca190 100644 --- a/scripts/dev/_frontend_gate_stream.py +++ b/scripts/dev/_frontend_gate_stream.py @@ -155,6 +155,13 @@ def _seed_job( } centres.sort((a, b) => a.left - b.left); const box = stream.getBoundingClientRect(); + const labelStyle = (label, svg) => { + const css = getComputedStyle(label); + return { fontFamily: css.fontFamily, fontVariant: css.fontVariant, + letterSpacing: css.letterSpacing, + fontPx: Math.round(parseFloat(css.fontSize) * svg.clientWidth + / svg.viewBox.baseVal.width * 100) / 100 }; + }; const lines = Array.from(stream.querySelectorAll('.stream-gridline')); return { layers: stream.querySelectorAll('path.stream-layer').length, @@ -182,13 +189,15 @@ def _seed_job( months: Array.from(stream.querySelectorAll('.stream-month-label')).map(label => { const bounds = label.getBoundingClientRect(); return { text: label.textContent, x: Number(label.getAttribute('x')), + style: labelStyle(label, stream), below: Number(label.getAttribute('y')) > Number(lines[0].getAttribute('y2')), inside: bounds.left >= box.left - 0.5 && bounds.right <= box.right + 0.5 && bounds.bottom <= box.bottom + 0.5 }; }), lineX: lines.map(line => Number(line.getAttribute('x1'))), gridMonths: Array.from(grid.querySelectorAll('.heatmap-month-label')).map(label => - ({ text: label.textContent, x: Number(label.getAttribute('x')) })), + ({ text: label.textContent, x: Number(label.getAttribute('x')), + style: labelStyle(label, grid) })), }; }""" @@ -249,7 +258,9 @@ def _alignment_failures(reading: dict | None, width: int) -> list[str]: f"plot {plot_top:.3f}..{plot_bottom:.3f}" ) months = reading["months"] - if len(months) != len(reading["gridMonths"]) or len(reading["lineX"]) != len( + if not reading["gridMonths"]: + failures.append(f"the heatmap has no month labels to compare at {width}px") + elif len(months) != len(reading["gridMonths"]) or len(reading["lineX"]) != len( months ): failures.append( @@ -269,6 +280,12 @@ def _alignment_failures(reading: dict | None, width: int) -> list[str]: failures.append( f"bottom month is misplaced at {width}px: {label}, {grid_month}" ) + if label["style"] != grid_month["style"]: + failures.append( + f"stream month label style differs from the heatmap's at " + f"{width}px: {label['style']}, {grid_month['style']}" + ) + break return failures diff --git a/static/js/heatmap.js b/static/js/heatmap.js index 2becbd71..2e82a541 100644 --- a/static/js/heatmap.js +++ b/static/js/heatmap.js @@ -1897,6 +1897,7 @@ 'class': 'stream-month-label', x: x, y: STREAM_LABEL_H + STREAM_BAND + STREAM_AXIS_H - 6, 'font-size': '9.5', 'font-family': LABEL_FONT_STACK, + 'font-variant': 'small-caps', 'letter-spacing': '0.12em', 'text-anchor': Number(x) > svgWidth - 24 ? 'end' : 'start', fill: frameColour('--stream-muted'), 'aria-hidden': 'true', }); From 122a06bd6aaaf3e9e08a131b3f7c39b33dd4ae06 Mon Sep 17 00:00:00 2001 From: pterw Date: Sat, 31 Oct 2026 02:27:21 -0400 Subject: [PATCH 11/12] fix(ui): Centre the streamgraph in its plot band streamFit moved the baseline only when the stack overflowed the plot band, so ordinary data sat about 10px low. It now always centres the outer envelope, halo and Bezier-control margins included, on the band's centre line. The owner viewed it on their own data and kept it. Validation: `pytest -q` -- **3113 passed**. --- .claude/SESSION_CONTEXT.md | 6 +- config/docsync.toml | 2 +- docs/agents/FINDINGS.md | 2 +- docs/agents/PLAYBOOK.md | 28 +++--- .../PLAYBOOK_EXECUTION_LOG_ARCHIVE.md | 10 +++ .../plans/2026-10-31-ui-audit-minors.md | 10 +-- static/js/heatmap.js | 7 +- tests/frontend/test_heatmap_pure_functions.py | 87 +++++++++++++++---- 8 files changed, 112 insertions(+), 40 deletions(-) diff --git a/.claude/SESSION_CONTEXT.md b/.claude/SESSION_CONTEXT.md index a6a846b3..d256a413 100644 --- a/.claude/SESSION_CONTEXT.md +++ b/.claude/SESSION_CONTEXT.md @@ -9,7 +9,7 @@ Last updated: 2026-10-30 | Item | Value | |------|-------| | Branch | See PLAYBOOK Section 3 for the active worktree branch. | -| Tests | **3111 passing** across 104 tracked test modules | +| Tests | **3113 passing** across 104 tracked test modules | | Coverage | 89% (2026-08-20 run, `pytest --cov=scrobblescope`) | | Pre-commit | See PLAYBOOK Section 4's latest validation and deviations. | | Batches 0-20 | **All complete.** PLAYBOOK Section 2 has the index: title, definition and log per batch. | @@ -47,7 +47,7 @@ Last updated: 2026-10-30 - Current-batch entries in active log block: 0. - Completed work packages in current-batch entries: none. - Next expected work package: WP-0. -- Latest validated test count: **3111 passed**. +- Latest validated test count: **3113 passed**. - Newest current-batch entry: none. @@ -303,7 +303,7 @@ results-release-checks.js polls GET /api/release_checks?job_id=... --- -## 6. Test structure (3111 tests) +## 6. Test structure (3113 tests) The per-file breakdown used to live here as a 40-row table. It was removed on 2026-08-26: nothing read it, only the total is gated, and it diff --git a/config/docsync.toml b/config/docsync.toml index 538b467a..252e1f72 100644 --- a/config/docsync.toml +++ b/config/docsync.toml @@ -739,4 +739,4 @@ allow_files = ["docs/history/*", "docs/logarchive/*", "docs/superpowers/*", "CLA grandfathered = [] [test_count] -pinned = 3111 +pinned = 3113 diff --git a/docs/agents/FINDINGS.md b/docs/agents/FINDINGS.md index b07e1aa2..294a34e4 100644 --- a/docs/agents/FINDINGS.md +++ b/docs/agents/FINDINGS.md @@ -3,7 +3,7 @@ Last updated: 2026-10-30 Status: Batch 23 is active, opened 2026-09-21; Batch 22 closed 2026-09-20. PLAYBOOK Section 3 owns the current work order. -3111 tests across 104 tracked test modules. +3113 tests across 104 tracked test modules. **Rotation policy:** resolved and no-action findings rotate to `docs/history/findings/FINDINGS_ARCHIVE.md` at the next `doc_state_sync.py --fix` once their lifecycle record is checked (the diff --git a/docs/agents/PLAYBOOK.md b/docs/agents/PLAYBOOK.md index 9ecc9822..e15f8dd4 100644 --- a/docs/agents/PLAYBOOK.md +++ b/docs/agents/PLAYBOOK.md @@ -207,6 +207,24 @@ non-current operational logs. Older dated entries live in +### 2026-10-31 - Centre the streamgraph in its plot band + +`streamFit` in `static/js/heatmap.js` shifted the baseline only when the +stack's outer envelope overflowed the plot band, so ordinary data sat +about 10px low. It now always shifts by half the sum of the envelope's +high and low edges (halo and Bezier-control margins included), so the +envelope is centred on the band's centre line. The scale rule is +unchanged. The owner viewed this build on their own data and kept it +(C18); it closes audit owner ruling C3 of the UI audit Minors. One review +fix round added a case where a Bezier control point overshoots the +envelope, checked against an independent Python oracle, so a shift that +ignores the control margins fails. No deviations. Existing tests edited: +`test_stream_stack_stays_inside_the_band` (the `moved` flag became +`capped`, every case now asserts `low + high` is zero, and ids were +renamed). + +Validation: `pytest -q` -- **3113 passed**. + ### 2026-10-31 - Match the stream month labels to the heatmap's The stream's bottom month labels, created in `drawStream` in @@ -250,13 +268,3 @@ unchanged. This closes audit row 17 of the UI audit Minors. No deviations. Existing tests edited: none. Validation: `pytest -q` -- **3111 passed**. - -### 2026-10-31 - Reuse the desktop media query in index.js - -`positionForm` in `static/js/index.js` built the same 860px media query -that the `desktop` const already holds. It now reads `desktop.matches`, -and the const is declared above `positionForm` so it is plainly -initialised before any call. No behaviour change. This closes audit row 13 -of the UI audit Minors. No deviations. Existing tests edited: none. - -Validation: `pytest -q` -- **3111 passed**. diff --git a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md index 87469068..2b89bdc6 100644 --- a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md +++ b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md @@ -9,6 +9,16 @@ Read helpers: - `rg -n "^### 20" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` - `rg -n "" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` +### 2026-10-31 - Reuse the desktop media query in index.js + +`positionForm` in `static/js/index.js` built the same 860px media query +that the `desktop` const already holds. It now reads `desktop.matches`, +and the const is declared above `positionForm` so it is plainly +initialised before any call. No behaviour change. This closes audit row 13 +of the UI audit Minors. No deviations. Existing tests edited: none. + +Validation: `pytest -q` -- **3111 passed**. + ### 2026-10-31 - Make the stream panel dismissible and focus-safe The stream panel was always a live region, so a pointer scrub announced diff --git a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md index 2b78b21a..145fe7b8 100644 --- a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md +++ b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md @@ -47,7 +47,7 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p - [x] Task 7: dismissible, focus-safe stream panel. - [x] Task 8 (PREVIEW): heatmap key ramp spacing at the reference's 12px. - [x] Task 9 (PREVIEW): stream month labels match the heatmap's. -- [ ] Task 10 (PREVIEW): centre the stream in its plot band. +- [x] Task 10 (PREVIEW): centre the stream in its plot band. - [ ] Task 11: record the execution. ## Task 1: Keep a numeric font weight after `normal` @@ -205,10 +205,10 @@ No test file exists for this module and none is added (C6, "no need to excessive **Extends (edits, not adds):** `test_stream_stack_stays_inside_the_band`. Its `moved` flag and the `ordinary-data-keeps-its-look` id assert that ordinary data is left unmoved; under C3 that is the defect. Replace the `moved` parameter with a `capped` flag (the scale is the extent cap, not the peak scale) and assert, for every case, that the extent is centred (`low + high` is zero within 1e-9) as well as inside the band. `capped=True` is for the case whose scale is the extent cap: `scale-capped-by-the-stack-extent` for certain. For the other three, the implementer reads `fit["scale"]` against `streamScale(totals)` once on the unchanged code (the shift does not change the scale) and sets `capped` where they differ, naming the result in the report; the plan does not guess it. Add `residual` to the test's `streamFit` call for one case (the existing `test_stream_fit_contains_symmetric_context_halo` parametrization shows a residual that exercises the halo), or add that residual case to the centring assertion, so a shift computed without the halo and Bezier margins fails. Rename the ids to match. `test_stream_fit_contains_symmetric_context_halo` already asserts the halo bounds stay inside the band and must pass unchanged. Other pure tests that hard-code a baseline (`test_smoothed_stream_encloses_artists_without_clipping`, the `hitAt` tests) are run and, where the shift moves a hand-derived number, corrected from first principles, never by copying the new output. -- [ ] RED: edit the test first and run `"" -m pytest -q -p no:cacheprovider tests/frontend/test_heatmap_pure_functions.py -k "inside_the_band"`; it fails on the ordinary-data case (extent not centred). GREEN: passes after the change. Quote both. -- [ ] Run the whole file `tests/frontend/test_heatmap_pure_functions.py`; list any other test that needed a corrected number and why. -- [ ] PREVIEW (R14): before and after Firefox screenshots, light and dark, of the stream on the owner's data shape (the gate's seeded 53-week job is the stand-in unless the controller supplies the real payload) at 1920x1080; scratch suffix `-10`. Report the measured vertical offset of the stack's centre from the band centre, before (about 10px low expected) and after (0). -- [ ] Acceptance: `frontend-gate` passes (the alignment check's plot-band containment holds); `suite-*`, `pre-commit`, `docsync-check` pass. Lands only on the owner's word; if rejected, drop it. +- [x] RED: edit the test first and run `"" -m pytest -q -p no:cacheprovider tests/frontend/test_heatmap_pure_functions.py -k "inside_the_band"`; it fails on the ordinary-data case (extent not centred). GREEN: passes after the change. Quote both. +- [x] Run the whole file `tests/frontend/test_heatmap_pure_functions.py`; list any other test that needed a corrected number and why. +- [x] PREVIEW (R14): before and after Firefox screenshots, light and dark, of the stream on the owner's data shape (the gate's seeded 53-week job is the stand-in unless the controller supplies the real payload) at 1920x1080; scratch suffix `-10`. Report the measured vertical offset of the stack's centre from the band centre, before (about 10px low expected) and after (0). +- [x] Acceptance: `frontend-gate` passes (the alignment check's plot-band containment holds); `suite-*`, `pre-commit`, `docsync-check` pass. Lands only on the owner's word; if rejected, drop it. ## Task 11: Record the UI audit Minors execution diff --git a/static/js/heatmap.js b/static/js/heatmap.js index 2e82a541..23ad432f 100644 --- a/static/js/heatmap.js +++ b/static/js/heatmap.js @@ -246,8 +246,8 @@ /** * Scale and baseline that keep every layer inside the plot band. The scale * makes the tallest week STREAM_PEAK tall, or less when the wiggle swings - * the stack's extent past STREAM_BAND; the baseline moves by the least - * amount that brings the extent back inside (none for ordinary data). + * the stack's extent past STREAM_BAND; the baseline always moves so the + * outer envelope (halo and Bezier margins included) is centred on the band. */ function streamFit(layers, baseline, residual) { const weeks = baseline.length; @@ -285,8 +285,7 @@ let scale = streamScale(totals); if (scale <= 0) return { scale: 0, baseline: baseline }; scale = Math.min(scale, STREAM_BAND / (high - low)); - const half = STREAM_BAND / 2 / scale; - const shift = high > half ? half - high : Math.max(0, -half - low); + const shift = -(high + low) / 2; return { scale: scale, baseline: baseline.map(function (g) { return g + shift; }), diff --git a/tests/frontend/test_heatmap_pure_functions.py b/tests/frontend/test_heatmap_pure_functions.py index f2a01eac..8bb0835e 100644 --- a/tests/frontend/test_heatmap_pure_functions.py +++ b/tests/frontend/test_heatmap_pure_functions.py @@ -809,11 +809,45 @@ def test_stream_scale(js_page, totals, expected): CODEX_LAYERS = [[1000 if t == 26 else 0 for t in range(53)]] + [[20] * 53] * 10 +def _bezier_control_extent(layers, baseline, residual): + """Count-space bounds of the smoothed band's Catmull-Rom control points.""" + weeks = len(baseline) + total = [sum(layer[t] for layer in layers) for t in range(weeks)] + upper = [baseline[t] + total[t] for t in range(weeks)] + lows, highs = [], [] + for t in range(weeks - 1): + before, after = max(0, t - 1), min(weeks - 1, t + 2) + safe = any( + c[t] + (c[t + 1] - c[before]) / 6 < 0 + or c[t + 1] - (c[after] - c[t]) / 6 < 0 + for c in layers + ) + lows += [ + baseline[t] + if safe + else baseline[t] + (baseline[t + 1] - baseline[before]) / 6, + baseline[t + 1] + if safe + else baseline[t + 1] - (baseline[after] - baseline[t]) / 6, + ] + highs += [ + upper[t] if safe else upper[t] + (upper[t + 1] - upper[before]) / 6, + upper[t + 1] if safe else upper[t + 1] - (upper[after] - upper[t]) / 6, + ] + margins = [ + (2 * residual[t] + residual[t + 1]) / 24, + (residual[t] + 2 * residual[t + 1]) / 24, + ] + lows = lows[:-2] + [lows[-2] - margins[0], lows[-1] - margins[1]] + highs = highs[:-2] + [highs[-2] + margins[0], highs[-1] + margins[1]] + return min(lows), max(highs) + + @pytest.mark.parametrize( - ("layers", "moved"), + ("layers", "capped", "residual"), [ - (STREAM_LAYER_SETS[0], False), - (CODEX_LAYERS, True), + (STREAM_LAYER_SETS[0], False, None), + (CODEX_LAYERS, False, None), ( [ [0, 30], @@ -827,29 +861,50 @@ def test_stream_scale(js_page, totals, expected): [217, 381], ], True, + None, + ), + ([[0, 35, 34], [50, 0, 18]], False, None), + ([[5, 0, 7], [2, 0, 1]], True, [0, 80, 10000]), + ( + [[22, 0, 49, 32, 0], [46, 0, 0, 37, 0], [36, 0, 19, 35, 0]], + True, + [14, 9, 16, 6, 0], ), - ([[0, 35, 34], [50, 0, 18]], True), ], ids=[ - "ordinary-data-keeps-its-look", - "sharp-mix-change-stays-in-band", + "ordinary-data-is-centred", + "sharp-mix-change-is-centred", "scale-capped-by-the-stack-extent", - "stack-pushed-off-the-top-shifts-down", + "stack-pushed-off-the-top-is-centred", + "halo-margins-count-toward-the-centre", + "bezier-control-overshoot-counts-toward-the-centre", ], ) -def test_stream_stack_stays_inside_the_band(js_page, layers, moved): +def test_stream_stack_stays_inside_the_band(js_page, layers, capped, residual): + """Centre the stack's outer envelope in the plot band. + + GIVEN artist counts, with and without a residual halo, + WHEN the stream is fitted to the band, + THEN the envelope sits inside the band with equal room above and below. + """ band = js_page.evaluate("() => window.__scrobbleHeatmapTestHooks.STREAM_BAND") plain = _hook(js_page, "streamBaseline", layers) - fit = _hook(js_page, "streamFit", layers, plain) - stack = _hook(js_page, "stackLayers", layers, fit["baseline"], fit["scale"]) - low = min(band_[t]["y0"] for band_ in stack for t in range(len(plain))) - high = max(band_[t]["y1"] for band_ in stack for t in range(len(plain))) + fit = _hook(js_page, "streamFit", layers, plain, residual) + totals = [sum(layer[t] for layer in layers) for t in range(len(plain))] + assert (fit["scale"] != _hook(js_page, "streamScale", totals)) == capped + if residual is None: + stack = _hook(js_page, "stackLayers", layers, fit["baseline"], fit["scale"]) + low = min(band_[t]["y0"] for band_ in stack for t in range(len(plain))) + high = max(band_[t]["y1"] for band_ in stack for t in range(len(plain))) + else: + envelope = _hook(js_page, "streamEnvelope", layers, fit["baseline"], residual) + low = min(bounds["lower"] for bounds in envelope) * fit["scale"] + high = max(bounds["upper"] for bounds in envelope) * fit["scale"] + c_low, c_high = _bezier_control_extent(layers, fit["baseline"], residual) + low, high = min(low, c_low * fit["scale"]), max(high, c_high * fit["scale"]) print(f"extent {low:.2f}..{high:.2f} against +-{band / 2:.2f}") assert -band / 2 - 1e-9 <= low and high <= band / 2 + 1e-9 - assert (fit["baseline"] != plain) == moved - if not moved: - totals = [sum(layer[t] for layer in layers) for t in range(len(plain))] - assert fit["scale"] == _hook(js_page, "streamScale", totals) + assert low + high == pytest.approx(0, abs=1e-9) @pytest.mark.parametrize( From 0970bd29c684d814c56f58457d598b80035378cb Mon Sep 17 00:00:00 2001 From: pterw Date: Sat, 31 Oct 2026 02:49:26 -0400 Subject: [PATCH 12/12] docs(plan): Record the UI audit Minors execution Tick the plan's delivery boxes for the landed tasks, mark Task 6 as dropped on the owner's word and note Task 9b (added, then dropped as already satisfied). Add an Execution record: each task's commit, review outcome, the owner's preview decisions, the deviations and the gate results at the final head. results-behavior is still owed there. Validation: `pytest -q` -- **3113 passed** (docs only, count unchanged). --- docs/agents/PLAYBOOK.md | 35 +++++++++------- .../PLAYBOOK_EXECUTION_LOG_ARCHIVE.md | 12 ++++++ .../plans/2026-10-31-ui-audit-minors.md | 42 ++++++++++++++++--- .../2026-10-31-ui-audit-minors-design.md | 2 + 4 files changed, 72 insertions(+), 19 deletions(-) diff --git a/docs/agents/PLAYBOOK.md b/docs/agents/PLAYBOOK.md index e15f8dd4..4a76d371 100644 --- a/docs/agents/PLAYBOOK.md +++ b/docs/agents/PLAYBOOK.md @@ -81,8 +81,9 @@ See FINDINGS F-DOCSYNC-3. heatmap's month labels in typeface and size. The owner accepted the triage on 2026-10-30. The spec is `docs/superpowers/specs/2026-10-31-ui-audit-minors-design.md` and the plan - is `docs/superpowers/plans/2026-10-31-ui-audit-minors.md`; four of its - visual tasks land only after the owner sees before-and-after screenshots. + is `docs/superpowers/plans/2026-10-31-ui-audit-minors.md`. The plan is + fully executed (nine commits; the owner dropped the panel-header task) and + the PR is ready for review; the execution record is in the plan. - **Weekly chart geometry side task:** Complete and merged as PR #281, merge commit `18a4242d`. The execution record is @@ -207,6 +208,24 @@ non-current operational logs. Older dated entries live in +### 2026-10-31 - Record the UI audit Minors execution + +Side task, no batch tag: close the UI audit Minors plan +(`docs/superpowers/plans/2026-10-31-ui-audit-minors.md`) on +`fix/ui-audit-minors`. Nine tasks landed in nine commits, each approved in +review (the plan had one fix round, and Task 10 had one). The owner dropped +Task 6 (the 13px panel header, "I was not seeing a difference"), kept +Tasks 8, 9 and 10 after previews, and added then dropped Task 9b (the label +colour already matched). The plan ticks its boxes and gains an Execution +record with each task's commit, review outcome, preview decision, the +gate-script landings that went alone, the stack of Tasks 3, 4 and 8, and the +intermittent gate failures that were re-run green. The spec gains a one-line +outcome for Task 6's row. `results-behavior` is still owed at the final head. + +Deviations: none. Edited existing tests: none. Docs only. + +Validation: `pytest -q` -- **3113 passed**. + ### 2026-10-31 - Centre the streamgraph in its plot band `streamFit` in `static/js/heatmap.js` shifted the baseline only when the @@ -256,15 +275,3 @@ audit row 5 of the UI audit Minors. No deviations. Existing tests edited: none. Validation: `pytest -q` -- **3111 passed**. - -### 2026-10-31 - Share the footer gap as one custom property - -The footer gap was two 1.5rem literals, the footer row's bottom padding in -`static/css/shell.css` and the home hero's `padding-bottom` in -`static/css/index.css`, kept equal only by a gate equality check. One -`--shell-footer-gap` property, declared once in `shell.css`'s `:root`, -now feeds both, and the `index.css` comment names it. Computed values are -unchanged. This closes audit row 17 of the UI audit Minors. No -deviations. Existing tests edited: none. - -Validation: `pytest -q` -- **3111 passed**. diff --git a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md index 2b89bdc6..1bacd4ff 100644 --- a/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md +++ b/docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md @@ -9,6 +9,18 @@ Read helpers: - `rg -n "^### 20" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` - `rg -n "" docs/logarchive/PLAYBOOK_EXECUTION_LOG_ARCHIVE.md` +### 2026-10-31 - Share the footer gap as one custom property + +The footer gap was two 1.5rem literals, the footer row's bottom padding in +`static/css/shell.css` and the home hero's `padding-bottom` in +`static/css/index.css`, kept equal only by a gate equality check. One +`--shell-footer-gap` property, declared once in `shell.css`'s `:root`, +now feeds both, and the `index.css` comment names it. Computed values are +unchanged. This closes audit row 17 of the UI audit Minors. No +deviations. Existing tests edited: none. + +Validation: `pytest -q` -- **3111 passed**. + ### 2026-10-31 - Reuse the desktop media query in index.js `positionForm` in `static/js/index.js` built the same 860px media query diff --git a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md index 145fe7b8..e05c13d0 100644 --- a/docs/superpowers/plans/2026-10-31-ui-audit-minors.md +++ b/docs/superpowers/plans/2026-10-31-ui-audit-minors.md @@ -43,12 +43,14 @@ Gates: see the `## Gates` block in the workspace `constraints.md` (`suite-*`, `p - [x] Task 3: reuse the `desktop` media query in `index.js`. - [x] Task 4: share the footer gap as one custom property. - [x] Task 5: stream gate reports an empty stream and always cleans up. -- [ ] Task 6 (PREVIEW): scrubber panel header at 13px. +- [ ] Task 6 (PREVIEW): scrubber panel header at 13px. Dropped on the owner's word, 2026-10-30 (C14); its boxes below stay unticked. - [x] Task 7: dismissible, focus-safe stream panel. - [x] Task 8 (PREVIEW): heatmap key ramp spacing at the reference's 12px. - [x] Task 9 (PREVIEW): stream month labels match the heatmap's. - [x] Task 10 (PREVIEW): centre the stream in its plot band. -- [ ] Task 11: record the execution. +- [x] Task 11: record the execution. + +Task 9b (added by the owner, then dropped): after keeping Task 9 the owner asked that the stream's month labels also take the heatmap's label colour (C17). Task 9b was cut and a code phase run, then dropped without landing: both colours already resolve to the same value, `#6c6676` in the light theme and `#908a9a` in the dark theme (C19), so there was no change to make and no RED to write. There is no commit and no box for it. ## Task 1: Keep a numeric font weight after `normal` @@ -217,6 +219,36 @@ No test file exists for this module and none is added (C6, "no need to excessive **Commit:** `docs(plan): Record the UI audit Minors execution`. - [ ] Tick each delivery-sequence box whose task landed. For a dropped PREVIEW task, leave the box unticked and write "dropped on the owner's word, " beside it. -- [ ] Add a short "Execution record" section: one line per task with its commit short SHA and subject, the PREVIEW decisions with the date, and the final head's gate results (`frontend-gate` and `results-behavior` last lines, the `pytest -q` count). -- [ ] The landing's own bookkeeping (R1 Section 4 entry, `doc_state_sync.py --fix`, Validation line) follows the constraints; this commit edits only the plan. -- [ ] Acceptance: the Gates block passes at the final head, with `frontend-gate` and `results-behavior` both run. +- [x] Add a short "Execution record" section: one line per task with its commit short SHA and subject, the PREVIEW decisions with the date, and the final head's gate results (`frontend-gate` and `results-behavior` last lines, the `pytest -q` count). Done below; `results-behavior` was not run at the final head (see the record). +- [x] The landing's own bookkeeping (R1 Section 4 entry, `doc_state_sync.py --fix`, Validation line) follows the constraints; this commit edits only the plan. +- [ ] Acceptance: the Gates block passes at the final head, with `frontend-gate` and `results-behavior` both run. `frontend-gate`, `suite-*`, `pre-commit` and `docsync-check` passed at `122a06bd`; `results-behavior` has not been run, so this box stays open until it is. + +## Execution record (2026-10-31) + +Branch `fix/ui-audit-minors`, nine commits from `8dc99ba4` to `122a06bd`. Reviews are in the SDD workspace `reviews/`; every landed task was approved. Dates are local. + +| Task | Commit | Subject | Review | Owner preview | +|---|---|---|---|---| +| 1 | `b0b58267` | fix(gate): Keep a numeric font weight when normal follows it | approved | not a preview task | +| 2 | `9929f348` | fix(gate): Clear the stored pause choice on every exit | approved | not a preview task | +| 3 | `95115818` | refactor(ui): Reuse the desktop media query in index.js | approved | not a preview task | +| 4 | `d278349c` | refactor(css): Share the footer gap as one custom property | approved | not a preview task | +| 5 | `a6764f88` | fix(gate): Report an empty stream and always run its cleanup | approved | not a preview task | +| 6 | none | scrubber panel header at 13px | not landed | dropped, 2026-10-30 (C14) | +| 7 | `b2a5f600` | fix(ui): Make the stream panel dismissible and focus-safe | approved | not a preview task | +| 8 | `c1e00655` | fix(ui): Tighten the heatmap key's ramp spacing | approved | kept (C15) | +| 9 | `e463f22e` | fix(ui): Match the stream month labels to the heatmap's | approved | kept (C16) | +| 9b | none | stream label colour | not landed | dropped, already satisfied (C17, C19) | +| 10 | `122a06bd` | fix(ui): Centre the streamgraph in its plot band | round 1 needs fixes (the Bezier-control guard was missing), round 2 approved | kept after the owner viewed it on their own data (C18) | +| 11 | this commit | docs(plan): Record the UI audit Minors execution | n/a | n/a | + +Plan review: the plan itself had one fix round (`review-plan.md`: the row 28 and 26 focus rule had to key on keyboard focus, the spec's saved-image claim was wrong, and the Minors were folded in; C11 to C13). T6's owner quote: "side-by-side I was not seeing a difference", and its 13px header also widened the panel enough to flip it at week 33 in the stream gate; its patch stays in `task-6-code.patch`. + +Deviations and incidents: + +- T1 and T5, the gate-script landings, went alone, one gate run each. +- T3, T4 and T8 landed as a stack with one gate run at the top (`gates/land-stack`). +- Two intermittent frontend-gate failures (`ERR_NO_BUFFER_SPACE` and F-B23-58) and one intermittent `test_importing_the_app_runs_no_shell_command` failure were re-run green; the runs are kept as evidence for the findings triage. +- A session restart cut short T10's code phase and T9's gate run; both were resumed. + +Gate results at `122a06bd` (`gates/land-10`): `frontend-gate` last line `58 checks passed in 89 runs across chromium, firefox (static assets & tokens canary on firefox); profiles: desktop, mobile, wide touch`; `pytest -q` 905 + 702 + 1506 = 3113 passed across the three suites; `pre-commit` and `docsync-check` as expected. `results-behavior` was not run: no commit touched `results.html`, `results.js` or the behaviour tests, and the gate runs listed no result for it at the final head, so the Gates block's "and the final head" clause is still owed. This commit changes docs only, so the count stays 3113. diff --git a/docs/superpowers/specs/2026-10-31-ui-audit-minors-design.md b/docs/superpowers/specs/2026-10-31-ui-audit-minors-design.md index 5111b165..9ecfa28b 100644 --- a/docs/superpowers/specs/2026-10-31-ui-audit-minors-design.md +++ b/docs/superpowers/specs/2026-10-31-ui-audit-minors-design.md @@ -157,6 +157,8 @@ header is `white-space: nowrap; width: max-content`, so the panel's measured need in `showWeek` grows with it; the stream gate's panel checks must still pass. +Outcome (2026-10-30): dropped on the owner's word (C14); the header stays at 12px. + **Row 5.** The heatmap key's ramp keeps `margin-top: calc(0.875rem * var(--index-scale, 1))` (`heatmap.css:201`) and is also a grid child of `.index-key`, whose `gap` is `calc(0.75rem * var(--index-scale, 1))`