R4.1: icon-button rows in menus (component 1b8d678); three rounds used, last fixes tested

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-13 21:25:30 -04:00
1 parent 0c9e2b0cea
commit 962f274cc6
4 files changed
+18 -1

No files matched your search

+1 -1
View File
@@ -232,7 +232,7 @@
## R4 ElyMark 对齐 Typora(用户 2026-10-13 定:解析、渲染、右键体验不输 Typora 1.14.10;保留块编辑、Typora 默认语法、Typora 快捷键、右键菜单用图标行;逐条做,逐条送审)
- [x] R4.0 前置:`scripts/review.sh` 与本文件头改用 gpt-6-astra(effort max,fast);PRD §14 与 `agents.md` 记下四项决定与 Typora 对照的范围;`TyporaRef` 不入库 — R1 PASS
- [ ] R4.1 组件库:菜单的图标按钮行(`Menu` 一行若干图标按钮,各带名称与快捷键提示、可禁用);键盘可达;选中即运行并关菜单;画廊有例,有测试
- [~] R4.1 组件库:菜单的图标按钮行(`Menu` 一行若干图标按钮,各带名称与快捷键提示、可禁用);键盘可达;选中即运行并关菜单;画廊有例,有测试 — R1 FAIL 三项已修:所标按钮被禁用或移走时改选了别的按钮;带筛选框的菜单左右键被文本框吞掉;禁用按钮不说明不可用。R2 FAIL 两项已修:菜单关后的指针移动越界崩溃;移走中间按钮后右邻顶替被执行(标记认项不认位)。R3 FAIL 两项已修(三轮用尽,未再审):按钮无无障碍的点按动作;方向键所标按钮不进无障碍树(按钮报选中并作活动后代,面板为菜单角色);各有回归测试。组件库 1b8d678 已推送;`check.sh` 的 GPUI Kit 一步(Kit 0.7.3 要 gpui-pre 0.3.9)与五处未动文件的 raw px 早于本条
- [ ] R4.2 组件库:行内扩展照 Typora 默认:`:shortcode:` 表情;行内 HTML 的 `u`、`b`/`strong`、`i`/`em`、`s`/`del`/`strike`、`code`、`kbd`、`mark`、`br`、`a` 按其义显示,其余标签只显示文字;脚注引用为上标数字;`~x~` 仍为删除线
- [ ] R4.3 组件库:块扩展照 Typora 默认:GitHub 提示块(NOTE、TIP、IMPORTANT、WARNING、CAUTION);独占一段的 `[toc]` 画成可按的标题目录;front matter 去掉 `---` 显示在框里;HTML 块按 R4.2 的标签显示,`script`、`style` 不显示;分隔线可见;嵌套无序列表的标记随层级变化
- [ ] R4.4 ElyMark:导出 HTML、纯文本与富文本复制随 R4.2、R4.3,与可视所见一致(表情、提示块、目录、行内 HTML 的同一组标签)
+7
View File
@@ -0,0 +1,7 @@
FAIL
1. ../Ely-GPUI-Components/src/menus/model.rs:155 — Invalidating the highlighted button silently selects a different command. Highlight Paste in a Cut / disabled Copy / Paste row, then have the owner disable Paste or remove it while the menu remains open. `settled` chooses Cut, so Enter executes Cut without the user selecting it. Both runtime probes reproduced `["cut"]` instead of no command. Separate initial/explicit navigation from selection validation: clear the mark when its button disappears or becomes disabled, and require another navigation action before executing anything. Add regressions for both changes.
2. ../Ely-GPUI-Components/src/menus/menu.rs:241 — Horizontal button navigation does not work in `SearchableMenu`. Open the new test fixture's searchable menu with an empty filter, press Right, then Enter: it runs Cut instead of skipping disabled Copy and running Paste. The focused `TextInput` consumes its bound Left/Right actions before this key listener; the menu captures only Up/Down/Enter. Handle horizontal navigation through the corresponding captured actions when a button row is active, or explicitly move focus to that row. Add an unfiltered keyboard-navigation regression; searching for Paste does not exercise this path.
3. ../Ely-GPUI-Components/src/menus/draw.rs:99 — Disabled icon buttons expose no unavailable state to assistive technology. The rendered properties for disabled Copy are only `Node { role: Button, label: "Copy" }`; disabling affects color and mouse handlers alone. A screen reader cannot distinguish unavailable Copy from an enabled command, contrary to PRD UX-12 and the component library's disabled-control rule. Set the localized unavailable description, as `IconButton` does, and test the disabled button's accessible properties.
+5
View File
@@ -0,0 +1,5 @@
FAIL
1. ../Ely-GPUI-Components/src/menus/draw.rs:181 — A pointer move after an icon button closes the menu can crash the application. Click Paste, then move the pointer over that button before the next repaint. `Open::close` has emptied `levels`, but the old mouse-move handler treats the missing level as a different selection and calls `mark`, which indexes `levels[0]` at menu.rs:157. The runtime probe reproduced an index-out-of-bounds panic with two consecutive window events and no intervening paint. Ignore events whose menu level no longer exists, as ordinary menu rows already do, and add this event-order regression.
2. ../Ely-GPUI-Components/src/menus/menu.rs:38 — The round-one selection-invalidation fix still executes another command when a removed button has a successor. In a Cut / Paste / Delete row, highlight Paste, then remove Paste while the menu stays open. Delete shifts into the same column, passes `runs`, and Enter executes Delete without the user selecting it; the runtime probe recorded `["delete"]`. Validate the highlighted command's identity, or clear the mark when the row's membership changes, and require explicit navigation before executing again. Add a regression for removing a middle button; the committed test only truncates the row.
+5
View File
@@ -0,0 +1,5 @@
FAIL
1. ../Ely-GPUI-Components/src/menus/draw.rs:186 — Enabled icon buttons expose no accessible activation action. The handlers are attached only to mouse-down; GPUI advertises Click through a click handler or an explicit accessibility action. In the native Windows probe, UI Automation reports enabled Cut and Paste as Buttons with no Invoke pattern, while a normal Button in the same window exposes Invoke. A screen reader's activation command therefore cannot run Paste, contrary to PRD UX-12. Connect accessible activation to the same choose-and-close operation and add a regression that invokes the button through accessibility and checks that it runs once and closes.
2. ../Ely-GPUI-Components/src/menus/draw.rs:116 — Keyboard selection is exposed only as visual highlighting. Open the icon row, press Down then Right to select Paste: Enter runs Paste, but the native accessibility tree remains unchanged, with neither a focused/active descendant nor a selected state for the icon. GPUI logs that the focused menu element has no accessibility role and that assistive technology will announce the whole window. A screen reader cannot identify the command selected by arrow navigation, contrary to PRD UX-12. Expose the active icon through the menu's accessible focus/selection semantics, including its focus owner, and add a regression checking the announced item after arrow navigation.