layouts
All repositories: gitoria
5.0 KB
# Report 009 — menu marks the current page (worker D3)Branch w9-menu-current from 0573eed. Not merged, not deployed.## FoundPath matching already existed (exact or `href + '/'` prefix → `a.current` + `aria-current="page"`, others "false") and `current` already is the host's say. What was missing: the marker was accent text colour only (no non-colour marker) and the sidebar nav had only a background; no count; no per-item say.## Changed- `theme/shell/main-menu.hl`: marked link = accent text + surface background + a bar in the accent (`boxShadow inset`, left bar on the phone/sidebar, bottom bar in the header from 60rem; no border → check-theme stays 0). Items may carry `count` → `span.count` badge (accent bg, `--color-accent-text`), and `current = true` (overrides the path). Label stays plain text. Backwards compatible: label/href-only items behave as before (no badge, same match).- `theme/shell/app-sidebar.hl`: `nav a[aria-current="page"]` gets the same bar.- Showcase: tracker demo carries `count = 12` on Shows and flags Series `current = true` on the all-titles page (no path match). Docs `docs/layouts/main-menu.md`.- **Derive path: touched.** `build()` (the function behind `rows`, the hybriel#190 spot) now also computes `count`, `has` (a `View if` needs a row field, not an expression), and reads `it.current`. I added no null guard and did not work around #190; a patch that nulls `items` still hits `build` as before.- Contrast (computed in the gate from real computed styles): accent #569bd4 on surface rgb(35,40,45) ≈ 5.7:1 text and bar; badge text darker on accent ≥ 4.5. Other accents (palette light colours) are all lighter than blue-dark except red #f44747 (~4.6:1 on the surface) — not individually measured.## Gate (headless Chrome, ports 8760–8764)- New theme: tests/browser.mjs **300 passed, 0 failed** (285 + 15 new; display audit part of it, 0 issues; check-theme 0 problems).- Old theme (0573eed theme + the same new test file): 293/7. Failing on old: marker beyond colour (1280 header), sidebar nav marker, item.current override, count badge (2 checks), 390 sidebar marker, 390 badge. The "marker moves" click checks pass on old too (path matching already worked) — they only guard against regression.- New checks: real mouse clicks at 1280 (Components → click Shells → click Docs; page below a section; /read marks Docs; tracker: Series (host flag) → click Movies) and 390 (open sidebar, click Shells, reopen, marker moved; badge in the phone menu, tap ≥ 44).## NOT done- **E2E in lisbeth's real Chrome (9223) was NOT run** (quota stop). Only headless gate clicks. Do it before accepting.- Shots (headless, I cannot view PNGs): /media/STORAGE/claude-scratch/atlas/D3/shots/ — `gate-{1280,390}-menu-*.png` (new), `old-1280-menu-shells.png`, `old-390-menu-components.png` (old). Logs: D3/logs-new.txt, D3/logs-old.txt.- Other accents' contrast not measured one by one.## Apps that carry the theme (need a re-copy of theme/shell/main-menu.hl + app-sidebar.hl, Atlas does it)gitoria (theme dbe3de7), tickets (moved onto the theme in X2: can then drop "Inbox (n)" from the label → `count = n`, and pass `current`), notes (theme move still open per usage.md), calendar (soon). Tracker older theme. Old items keep working.## E2E in lisbeth's real Chrome (worker D4) — DONEtests/e2e-menu-current.mjs (CDP 9223 via tunnel, ONE existing tab picked from /json, real Input.dispatchMouseEvent clicks, run under the lisbeth.lock flock, tab left at about:blank, localStorage accent reset). App on a copy-free showcase (no data), port 8760 (new, 159b1d5) and 8761 (old, 0573eed).- **New code: 33 ok / 0 FAIL** at 1280 and 390 (phone: toggle opens the sidebar, taps in the main menu, reopen).- Marker moves with each click: 1280 Components → Shells → Docs → Components; /components/pagination marks Components (menu) and Pagination (sidebar); 390 Components → Shells → Docs; tracker Series → Movies at both widths. Always exactly one `aria-current="page"`.- Visible bar: box-shadow present; for all 8 accents (blue-dark 4.98, green-dark 7.29, yellow 10.52, orange 5.62, **red 4.13**, purple 5.34, blue-light 9.97, green-light 8.75) bar and text ≥ 3:1 on the surface, at 1280 and 390 (red is the lowest, passes ≥ 3). Accents set by real clicks on the swatches.- Tracker demo: `current = true` marks Series (no path match) at both widths; Shows carries badge 12 (label plain, text ≥ 4.5:1, tap height ≥ 44 at 390).- **Old code (0573eed)**: bar check FAILS (box-shadow none, bar 1.00:1), the run then stops at the missing badge/switcher path — the test can fail.- Nothing needed fixing; no theme source changed, so the gate stays 300/0 (not re-run; only the new tests/e2e file was added).- Correction to the earlier note: red is ~4.1:1 (not 4.6) on the surface, still ≥ 3.- Shots (I cannot view PNGs, so I did not look at them): /media/STORAGE/claude-scratch/atlas/D3/shots/e2e-new-{1280-1-components,1280-2-shells,1280-3-pagination,1280-4-tracker-badge,390-1-components,390-2-shells,390-3-docs-red-after-reset,390-4-tracker-badge,390-5-tracker-movies}.png and e2e-old-1280-1-components.png.
Branches
Latest commits
- e631791buser-menu: nest child and compound selectors in Stylemre
- 69604944three-pane: nest child and compound selectors in Stylemre
- 3e389b83main-menu: nest child and compound selectors in Stylemre
- 05413975list-first: nest child and compound selectors in Stylemre
- c545b642content-first: nest child and compound selectors in Stylemre
- eae2be7aapp-sidebar: nest child selectors and document caller-slot gapmre
- 69c9f784Record LY7 slot nesting blocker and minimal repromre
- b1d4f379app-header: nest child and compound selectors in Stylemre
- 6385ff8eRecord LY7 style formatting proof and review statusmre
- 0100f51etracker-demo: format Style with nested rules and bare mediamre
- 5f82554enotes-demo: format Style with nested rules and bare mediamre
- 3dc27d78mail-demo: format Style with nested rules and bare mediamre
- cf9648afhome: format Style with nested rules and bare mediamre
- 846a6242user-menu: format Style with nested rules and bare mediamre
- 4d58708cthree-pane: format Style with nested rules and bare mediamre
- 0bbfc553main-menu: format Style with nested rules and bare mediamre
- 7755199dlist-first: format Style with nested rules and bare mediamre
- 35199303content-first: format Style with nested rules and bare mediamre
- 00f6e698app-sidebar: format Style with nested rules and bare mediamre
- bb2f29c9app-header: format Style with nested rules and bare mediamre