Commit Graph
1 Commits
Author SHA1 Message Date
m4ku1337 c0e6851962 fix(menu): close the reduced-motion media query that swallowed the submenu flip (#955)
layout.css opens @media (prefers-reduced-motion: reduce) at line 77 and never
closes it. 36fbc5a deleted the run of 61 lines that started with that brace and
ran to the end of the file (0 insertions, 61 deletions), and b011be1 added the
context-menu submenu rules back below the still-open block (60 insertions). The
file has been one brace short ever since: 13 '{' against 12 '}'.

Everything from line 78 on is therefore a descendant of the media query. The
only rules in that range are the media query's intended child — the center
column's 'transition: none' — and the six rules that consume the
data-dsh-sidebar-submenu attribute menu-flip.ts publishes on <body>: the flip
that keeps a nested submenu inside the viewport, and the visual tether (parent
row highlight, 4px gap, 4px hover corridor). In the default theme none of them
matched, so our "open with" submenu grew past the right edge of a right-docked
workbench; reduce-motion users were the only ones who ever got the flip (#955).

Restoring the brace puts all six back at top level. No rule text changes: the
result is byte-identical to the pre-regression revision 36fbc5a^ (7219 bytes).

tests/css-block-scope.spec.ts pins the property that hid this: menu-flip.spec.tsx
asserts with toContain, which matches selector text wherever it sits, so the
nesting stayed green in every released version from v0.24.1 through v0.26.1, and
on dev (0.27.0) where it still is. The new spec reads block structure instead:
every stylesheet under src/ has to close what it opens, and the six flip/tether
selectors have to open at depth 0. Run against the historical revisions, the spec is red on every
revision that shipped the nesting — v0.24.1 through v0.26.1 and dev — where it
reports "1 unclosed block(s)" and names the flip rules as nested. 36fbc5a is the
commit that lost both the brace and the rules, and it deleted menu-flip.ts with
them, so the spec cannot even load there; with that module stubbed back in, both
assertions fail on its CSS. On 36fbc5a^ and on this branch the spec passes.

Verified on this branch: pnpm exec vitest run tests/css-block-scope.spec.ts
tests/menu-flip.spec.tsx -> 11 passed; pnpm typecheck, pnpm lint clean.
2026-10-17 03:42:23 +08:00