fix(web-shell): avoid duplicate inline tag tooltips - #6729
Conversation
|
Thanks for the PR! Template looks good ✓ Problem: Observed bug with linked issue (#6728). When Direction: Aligned — this is a focused UI bug fix that removes duplicate tooltip surfaces and improves accessibility via Size: 11 production lines (10 additions + 1 deletion in Approach: Minimal and well-scoped. Three surgical changes: (1) module-local counter for unique tooltip IDs, (2) suppress native Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:已观测到的 bug,已关联 issue (#6728)。当 方向:对齐——这是一个聚焦的 UI bug 修复,移除了重复提示框并通过 规模:11 行生产代码( 方案:最小且范围清晰。三处精确改动:(1) 模块级计数器生成唯一提示 ID,(2) 渲染自定义提示时抑制原生 进入代码审查 🔍 — Qwen Code · qwen3.7-max |
Code ReviewClean, minimal fix. The approach — suppress native One minor observation: the stderr warning about synchronous React unmount appears in the new test, but it's a pre-existing teardown pattern, not introduced by this change. Test ResultsFull web-shell suite: 87 files, 1,384 tests — all passing ✅ The new test
Real-Scenario TestingThis is a web-shell DOM change (React tooltip in jsdom). No CLI command renders web-shell tooltips — tmux real-scenario testing is not applicable. The DOM regression test is the correct verification path and covers the behavior thoroughly. 中文说明代码审查干净、最小化的修复。方案——渲染自定义提示时抑制原生 一个小观察:新测试中出现了同步 React 卸载的 stderr 警告,但这是已有的拆卸模式,非本次变更引入。 测试结果web-shell 完整套件:87 个文件,1,384 个测试——全部通过 ✅ 新测试
真实场景测试这是 web-shell DOM 变更(jsdom 中的 React 提示)。没有 CLI 命令能渲染 web-shell 提示——tmux 真实场景测试不适用。DOM 回归测试是正确的验证路径,已全面覆盖该行为。 — Qwen Code · qwen3.7-max |
|
This is exactly the kind of PR the gate should let through cleanly. Real bug (linked issue, clear reproduction path), minimal fix (11 production lines), good test coverage (DOM regression test validates all assertions), and an accessibility improvement as a bonus. The approach is the same one I'd take independently: suppress native 1,384 tests pass with no regressions. Ready to ship. ✅ 中文说明这正是审查门应该放行的 PR。真实的 bug(已关联 issue,有清晰的复现路径),最小化的修复(11 行生产代码),良好的测试覆盖(DOM 回归测试验证了所有断言),以及额外的无障碍改进。 方案与我独立设想的完全一致:渲染自定义提示时抑制原生 1,384 个测试全部通过,无回归。可以合并。✅ — Qwen Code · qwen3.7-max |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Reviewed — no blockers. Suggestions are inline.
doudouOUC
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
— qwen3.7-max via Qwen Code /review
…to codex/webshell-tooltip-dedup
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Reviewed — no blockers. Suggestions are inline.
doudouOUC
left a comment
There was a problem hiding this comment.
Reviewed — no blockers. Suggestions are inline.
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
— qwen3.7-max via Qwen Code /review
✅ Local verification — real build & tests (maintainer merge reference)Verified this PR end-to-end in an isolated worktree at the PR head ( Environment: macOS (darwin 24.6.0) · Node 1. What the fix does (confirmed by reading the code)When a WebShell host returns a string (e.g. 2. Test results (on PR head)
3. Before / after proof (the tests really guard the fix)To prove the two new tests aren't vacuous, I reverted only the fix's source hunks in place (keeping the two new tests) to reproduce
4. Behaviour / DOM evidenceRendered with the verbatim 5. One observation (non-blocking)The two new tests emit a React dev warning — "Attempted to synchronously unmount a root while React was already rendering." This is pre-existing and not introduced by this PR: VerdictLGTM — recommend merge. ✅ Focused, correct fix with genuine regression coverage, a real accessibility improvement ( 🇨🇳 中文版本(点击展开)✅ 本地验证 —— 真实构建与测试(供维护者合并参考)我在 PR head( 环境: macOS(darwin 24.6.0)· Node 1. 修复内容(已通过阅读源码确认)当 WebShell 宿主从 2. 测试结果(PR head 上)
3. 修复前 / 后对比证明(测试确实守护了本次修复)为证明这两个新测试并非“永真”测试,我仅就地回退了修复涉及的源码 hunk(同时保留两个新测试),以还原
(截图见上方英文部分) 4. 行为 / DOM 证据使用 (截图见上方英文部分) 5. 一点观察(不阻塞合并)两个新测试会输出一条 React 开发告警 —— “Attempted to synchronously unmount a root while React was already rendering.” 这是既有问题,并非本 PR 引入: 结论LGTM —— 建议合并。 ✅ 修复聚焦、正确,带有真实的回归测试覆盖,并带来实实在在的无障碍性提升( Verified locally by the maintainer in an isolated worktree; screenshots reproduce the widget DOM with verbatim source styling. Not a substitute for CI. |


What this PR does
Makes the native
titletooltip a fallback for inline composer tags instead of rendering it alongside a host-provided custom tooltip. Custom tooltips now receive a unique id and are associated with the tag througharia-describedby.Adds DOM regression coverage for the string-tooltip path introduced in #6578.
Why it's needed
When a WebShell host returns a string from
renderComposerTagTooltip, the value is used for both the native browser tooltip and the custom React tooltip. Hovering an inline tag can therefore display two overlapping tooltip surfaces with the same content. The follow-up also preserves an accessible description after the duplicate native title is removed.Reviewer Test Plan
How to verify
DetailsfromrenderComposerTagTooltip.titleattribute.aria-describedbypoints to it.QWEN_CODE_LANG=en npm run test:ci --workspace @qwen-code/web-shell; all 87 test files and 1,384 tests should pass.Evidence (Before & After)
Before: a string tooltip rendered both the browser-native
titletooltip and the custom WebShell tooltip, which could overlap. After: only the custom tooltip renders, and it is referenced byaria-describedby. This is covered by the focused DOM regression test; no screenshot was captured because plugin/browser integration validation is intentionally outside this follow-up's scope.Tested on
Environment (optional)
Node.js v22.17.1, npm 10.9.2. WebShell package tests, formatting, lint, build, typecheck, and the serve fast-path bundle closure check were run locally. Root
test:cialso exposed unrelated failures in untouched CLI tests on currentmain: one locale-sensitive extension-list assertion (passes withQWEN_CODE_LANG=en) and 12 AuthDialog navigation assertions.Risk & Scope
Linked Issues
Fixes #6728
中文说明
本 PR 做了什么
将行内输入标签的原生
title提示改为兜底逻辑,不再与宿主提供的自定义提示同时渲染。自定义提示现在会获得唯一 id,并通过aria-describedby与标签建立关联。同时为 #6578 引入的字符串提示路径补充了 DOM 回归测试。
为什么需要这个改动
当 WebShell 宿主从
renderComposerTagTooltip返回字符串时,该值此前会同时用于浏览器原生提示和自定义 React 提示。因此,悬停行内标签时可能出现两个内容相同且相互重叠的提示。本次修复在移除重复原生title的同时,也保留了无障碍描述关系。Reviewer Test Plan
如何验证
renderComposerTagTooltip返回类似Details的字符串。title属性。aria-describedby指向该 id。QWEN_CODE_LANG=en npm run test:ci --workspace @qwen-code/web-shell,应通过全部 87 个测试文件、1,384 个测试。证据(修复前后)
修复前:字符串提示会同时渲染浏览器原生
title提示和 WebShell 自定义提示,两者可能重叠。修复后:只渲染自定义提示,并由aria-describedby引用。本行为已有聚焦的 DOM 回归测试覆盖;由于本次跟进明确不包含插件和浏览器集成验证,因此未录制截图。已测试平台
环境(可选)
Node.js v22.17.1,npm 10.9.2。本地已运行 WebShell 包测试、格式化、lint、构建、类型检查以及 serve fast-path bundle 闭包检查。根目录
test:ci还暴露了当前main未改动 CLI 测试中的无关失败:一个受语言环境影响的 extension-list 断言(设置QWEN_CODE_LANG=en后通过)以及 12 个 AuthDialog 导航断言。风险与范围
关联 Issue
Fixes #6728