- Submenu panel name priority is explicit aria-label > menu content channel > this instance's trigger; an explicit label drops the id reference so it cannot be shadowed. - openAutoFocus and animationend chain with the caller's handlers like keydown and interact-outside, so caller callbacks run and can cancel. - The panel loop falls back to the menu-level shouldFocusWrap and is always passed as a boolean: an undefined -> true update is dropped by the base prop chain, so the menu policy never applied. - Add a jsdom CSSOM polyfill for CSS.escape via vitest setupFiles; the animationend test no longer raises an unhandled error.
3.9 KiB
B01 b474a63 复核
2026-10-24;feat/b01-menu-dropdown / b474a63。检查代码及本地复跑,不依赖交接中“全套通过”的表述。结论:原7项失败均修好;当前仍有原R9子面板透传的3个分支未完成,及1项测试环境异常,暂不合并。本轮未修改实现、未提交/推送。
通过部分
- 原整批20项探针全部通过,R4关闭策略、R6根事件合并、R8独立Menu名称及R9上一轮data/style/禁止Esc探针对应修复有效。
- 浏览器5181默认“复制链接”点击后menu数量0、trigger aria-expanded=false;没有复现默认不关闭回归。截图
/private/tmp/b01-default-close-verified.png。 - 包装组件真实Props消费与typecheck通过。
- 不要求为三级中间层焦点新增自动浏览器断言作为本轮门槛;现有浏览器序列观察和未自动化说明保留,不扩大SSR/水合/Nuxt范围。
剩余实现问题:均属原R9,不新增组件/能力范围
1. [P2] 子面板直接指定的ARIA被覆盖
DropdownSubmenuTrigger虽然先spread domProps,随后又无条件写 aria-label: contentAttrs.label.value / aria-describedby: contentAttrs.describedBy.value。子DropdownMenu没有指定这些值时为undefined,嵌套DropdownPopover传入的显式ARIA被删除。
回归:openConfiguredSubmenu({'aria-label':'Direct submenu name','aria-describedby':'explicit-description'}),实际aria-label=null。应同时保留Menu内容通道和面板调用方的明确属性,遵循约定优先级,并保证aria-labelledby不会意外压过显式名称;不要用undefined覆盖真实调用值。
2. [P2] 子面板openAutoFocus/animationend仍覆盖用户事件
SubContent的domProps中已有调用方onOpenAutoFocus,但后面重新赋值内部函数;onAnimationend也有同样覆盖结构。新增openAutoFocus回调探针调用次数为0(期望1)。根Popover已修的chain合并应等价应用于子面板,保留Vue事件数组与取消语义;不再只针对keydown单点修复。
3. [P2] 子菜单shouldFocusWrap没有传到底层
子DropdownMenu把shouldFocusWrap写进contentAttrs.loop;SubContent只收到panelProps.loop(即嵌套Popover显式loop),没有回退读取contentAttrs.loop,导致菜单级循环配置失效。此次b474a63修改时移除了原loop回退表达式。
新回归:子菜单shouldFocusWrap=true,焦点在First按ArrowUp,期望到Last,实际仍First。恢复明确优先级:面板显式loop→菜单shouldFocusWrap→底层默认;补双向边界及false不循环,别用声明支持代替行为。
以上3个分支均已加入 tests/b01-complete-review.probe.test.ts,现23项中原20项通过、新3项失败。请保持原断言,不删除或改成接受当前行为。
测试环境异常(与产品运行错误分开)
在既有 root popover merges caller handlers for escape, outside, focus and animation 用例派发animationend后,Reka Presence调用CSS.escape,而jsdom环境未提供CSS,抛未捕获TypeError。单独跑B01测试时65项断言通过但命令仍因1个Error失败;完整回归同样出现,不能称完全通过。
修复测试环境的CSS.escape能力/合成AnimationEvent夹具,保持测试可单独运行;不要关闭未捕获错误检查、吞Reka异常或为了测试修改产品行为。这不是新增SSR要求。
最终复跑记录
pnpm test:72文件,71通过/1失败;931项,928通过/3失败,另1个未捕获Error(上述jsdom CSS.escape)。pnpm typecheck通过,git diff --check通过。- 本次没有重做逐像素/读屏/物理触屏或新一轮tarball安装,不把它们描述为已验收。
返修范围仅上述3个子面板分支和测试夹具。修后跑整批23项、B01其他回归及完整测试,并确认无Unhandled Errors;保留已完成的Portal/关闭/事件取消/名称/类型修复。不创建下一组件任务,不合main、不推送。