Stage 4a: context menu is pure 7.css; retire the lookalike and the false claim

The menu now renders 7.css's real contract — ul[role=menu] > li[role=menuitem]
> button for actions, input[type=checkbox] + label for the checkable column
toggles, and dividers as .has-divider on the PRECEDING item (7.css draws them
as an ::after bevel, not as a node; the service's separator entries collapse
onto their predecessor at render time). With the markup right, the framework
supplies everything the hand-written version imitated or lacked: the left
gutter stripe, bevelled separators, the gradient selection band, the checked
box, and disabled/submenu styling we previously had none of.

Deleted: the w7-menu lookalike (both the button-slab stripper in `skin` and
the whole hand-authored Aero set in `skinfix`) and its w7-menu/w7-menu-sep
hooks. The "7.css has no menu component" claims in styles.css and
architecture.md were FALSE — dist/gui/menu.css is a full component; the old
markup (div > button) simply matched none of it. Both corrected to state the
real contract and the trap.

Keyboard now follows the platform instead of a highlight class: arrows move
REAL focus between items — 7.css styles :focus-visible identically to :hover,
and keyboard-initiated programmatic focus counts — and Enter/Space activate
buttons natively; only labels need a synthetic click. This also makes the menu
honest to screen readers.

Dark mode: menu.css hardcodes light literals (color:initial, white bevel
halves, the #b3d3f9 checked-box ring); restated in skinfix's dark arm like the
ListView's.

Also fixed, caught BY the harness: the Stage 3 frame sizing rule was keyed on
bare `.window`, forcing 100vh height onto every 7.css window (the harness's
demo windows blew up to full page). It is now keyed on `w7-frame`, a hook only
the three real window roots carry.

Verified zoomed in light and dark against 7.css's reference markup: gutter,
dividers, checkmark box, grey right-aligned accelerator all match; bundle
490.92 kB.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-08-16 03:20:55 +02:00
co-authored by Claude
parent 1f773261a8
commit 0ae2a62229
7 changed files with 152 additions and 153 deletions
+15 -15
View File
@@ -304,22 +304,22 @@ one) as ~20 `--w7-*` overrides, duplicated forced + system like every other
dark block. `--w7-font` is restated as a px `font` shorthand so `data-text`
still scales and 7.css's `pt` shorthand stops resetting weight/line-height.
**Markup hooks** are additive and inert under `modern`: `role="progressbar"`
(+aria) on the transfer bars, `has-scrollbar` on scroll containers (7.css only
styles `::-webkit-scrollbar` under that class), `w7-toolbar` on the three
header rows (their buttons go flat — Explorer's command bar was flat, unlike
dialog push buttons), `w7-btn` on the 10 dialog action buttons, `w7-menu` (+
`w7-menu-sep`) on the HTML context menu.
**Markup hooks**: `role="progressbar"` (+aria) on the transfer bars,
`has-scrollbar` on scroll containers (7.css only styles `::-webkit-scrollbar`
under that class), `w7-toolbar` on the three header rows (their buttons go
flat — Explorer's command bar was flat, unlike dialog push buttons), `w7-btn`
on the 10 dialog action buttons.
**Context menu**: 7.css ships no menu component, so the Aero menu is
hand-authored across both layers — the row `<button>`s lose their push-button
slab in `skin` (needs `revert-layer`), and the slab/border/selection-band paint
is stated in `skinfix`. It is built ONLY from existing `--w7-*` vars (never
literal hex), so the hand-written dark Win7 palette recolours it for free —
the same constraint the dark block documents for itself. The hover and
keyboard-cursor highlights are deliberately given the same band: the component
marks the keyboard cursor with `bg-accent`, which is overridden alongside
`:hover` so the two are indistinguishable, as in a real Win7 menu.
**Context menu**: pure 7.css via its real menu contract —
`ul[role=menu] > li[role=menuitem] > button` for actions,
`input[type=checkbox] + label` for the checkable column toggles, dividers as
`.has-divider` on the PRECEDING item (an `::after` bevel, not a node). The
contract is exact: an earlier iteration rendered `div > button`, matched
nothing, and wrongly concluded "7.css has no menu component" — it has a full
one (`dist/gui/menu.css`), including the gutter stripe, disabled state and
submenu arrows. Keyboard moves REAL focus between items (7.css styles
`:focus-visible` like `:hover`); Enter/Space activate buttons natively. Only
menu.css's hardcoded light literals are restated for dark, in `skinfix`.
**Font**: Segoe UI is absent off Windows and not redistributable. Noto Sans —
the substitute 7.css itself names — is vendored (OFL-1.1, from