Repository navigation
Conversation
…bmenu flip (omdsh-dev#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 (omdsh-dev#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.
Author
独立复核摘要(三个互不共享上下文的子代理,各自独立 clone + pnpm install + 实跑)① 复现与审计(不看作者结论,仅凭源码)— PASS
② 对抗性证伪新 spec — PASS(两轮)
③ 完整门禁 +
|
Open
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #955.
现象与根因
src/client/layout.css第 77 行的@media (prefers-reduced-motion: reduce)没有闭合。从第 78 行到文件末尾都在它里面——而这一段里只有两类规则:媒体查询本来就该包住的那条中心列规则,以及消费menu-flip.ts写在<body>上的data-dsh-sidebar-submenu的六条规则(把二级菜单翻回视口内的翻转规则 + 视觉牵引)。默认主题下这六条一条都不匹配,于是右侧栏场景的「打开方式」二级菜单照宿主原始几何向右展开、越过窗口右缘;开着「减少动态效果」的用户反而是唯一能用上翻转的人。回归来源(同一套块扫描逐版本实测):
{/}36fbc5a^(v0.24.1 之前)36fbc5a(2026-09-28)}开头、直到文件末尾)b011be1(同一天,其后)也就是说:这个机制自 v0.24.1 发布起就没生效过。
改动
src/client/layout.css:补回那个}(+1 行,规则文本零改动;修复后与36fbc5a^逐字节相同,7219 字节)。tests/css-block-scope.spec.ts(新增):钉住让这件事一直隐身的那条性质。tests/menu-flip.spec.tsx用的是expect(css).toContain(...)——字符串嵌套与否都命中,所以从 v0.24.1 到 v0.26.1、再到 dev 一直是绿的。新 spec 读块结构:src/下每个样式表都必须闭合它打开的块(多一个}也报);@media不会误伤);layout.css自己写明这条顺序是承重的);[role=menu]不会造成假红;扫描器会整段吃掉引号字符串与url(...)(含未加引号的),字符串或 data URI 里的括号不会误判。验证
src/client/layout.css切回origin/dev、保留新 spec → 2 failed:src\client\layout.css: 1 unclosed block(s)与body[data-dsh-sidebar-submenu] div[role=menu] div[role=menu] is nested instead of top level: expected 1 to be +0。~="left"改名成~="leftx"(点名缺失的选择器)。pnpm build后lib/client.js内联的那份 layout.css 共 7360 字节,未闭合块 0、多余右括号 0,六条规则全部在深度 0。pnpm typecheck、pnpm lint无输出;tests/css-block-scope.spec.ts+tests/menu-flip.spec.tsx+tests/layout-css.spec.ts共 14 passed。git-worktree(30s 超时)与plugin-meta(tar 列表带 CR)在干净的origin/dev上同样失败;另 3 条属于tests/fs-operations.spec.ts在全量并行下的超时级联(共用同一个孤儿 .tmp),单独运行该文件 29/29 通过。本次改动只碰layout.css与一个新 spec 文件,触及不到这条路径。plugin-mount车道(真实 DSH + Playwright)本地未跑。独立复核
三个互不共享上下文、各自 clone + 安装 + 实测的子代理(详细报告见下方评论):① 仅凭源码复现 + diff 审计 → PASS;② 对抗性证伪新 spec → PASS(上面几条加固正是它的发现);③ 完整 CI 门禁并与
dev基线逐条归因 → 本机pnpm test在分支与dev上都不全绿(环境性失败),没有一条能归到本次改动。AI 辅助声明:定位、补丁、测试与上述独立复核均由 AI 助手按用户指令完成,报告中的证据都是原始命令输出。