Repository navigation
feat(canvas): open selection toolbar menus on hover - #572
Merged
FayeSpica merged 1 commit intoNov 29, 2026
Merged
Conversation
The node action bar required a click on every labelled menu (presets, marketing tools, layout). Open it when the pointer rests on the label, keep it open while the pointer travels into the menu, and close it when both are left. A pointer-opened menu leaves focus on the label, so hovering never moves the keyboard focus; a click still opens and focuses the first item as before. The delays make a quick pass along the bar open only the label under the pointer. Refs ThinkFlowLab#571
Zhangbo-cn
requested review from
hsliuustc0106 and
princepride
as code owners
November 29, 2026 04:17
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.

背景
实现 #571。选中节点后的操作条里,「预设」「多角度」「智能打光」「营销工具」「工具」等标签都必须先点一下才展开菜单;对比同类工具「鼠标移到标签上自动展开」的交互,每次都要多点一下。
改动
src/canvas/NodeSelectionToolbar.tsxArrowDown/ArrowUp、Enter、Tab等键盘路径不变。src/canvas/SelectionToolbarMenu.tsxfocusOnMount(默认 true,点击路径不变)与onPointerEnter/onPointerLeave,让指针进入菜单时保持打开。验证
tests/browser/selection_toolbar_hover.mjs(已登记 manifest gate lane 与run-browser-suite.mjs):选中图片节点 → 悬停「Marketing tools」→ 断言菜单在无点击情况下出现且焦点未进入菜单 → 指针移入菜单项断言未关闭 → 移出断言关闭 → 点击断言菜单打开且聚焦第一项 →Escape关闭。Selection toolbar opens on hover without stealing focus and still opens on click通过。npm test:1033 passed;check:browser-manifest、tsc --noEmit、vite build通过;context_menu_dismissal回归通过。备注