Repository navigation
fix(desktop): 指针移出模型列表时收起打开的行 - #443
Merged
Merged
Conversation
Hovering a row opens its options flyout and keeps the row lit. Only the panel-level mouseleave cleared that state, so a pointer moving from a row down to the Add Models row (or up to the search field) left the row above lit with its flyout still open. The panel's pointermove now ends the hover as soon as the pointer settles outside the list/flyout cluster. Leaving the panel still goes through the 300ms grace period the safe-triangle gap crossing relies on.
Contributor
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
3 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.
Closes #442
根因
悬停一行会打开该行的选项飞出层并点亮该行,但清除这份状态的只有面板级
onMouseLeave(300ms 宽限)。指针从行移到面板底部的Add Models行时,既没离开面板、也没进入另一行,于是没有任何 handler 结束这次 hover——上一行继续高亮,飞出层一直开着。改动
model-selector-control.tsx:面板内已有的onPointerMove(trackPointer)在记录 safe-triangle 轨迹之外,判断落点是否仍在「模型列表 + 飞出层」集群内;若不在(搜索框、Add Models行、面板内边距)且当前有打开的行 →closeFlyoutNow()立即收起(不走宽限)。保留不变:安全三角切换、28px 隐形悬停桥、离开整个面板的 300ms 宽限。「行 → 飞出层」的斜穿路径不经过集群之外,因此不受影响。
.scratch/model-selector/PRD.md悬停意图一节补记该规则。验证
单测(
model-selector-control.test.tsx,先红后绿):悬停最后一行 → 飞出层打开且aria-current=true;移到Add Models→ 飞出层卸载、aria-current清空。真实浏览器(
bun run dev:mock+ Playwright,/design页ModelSelectorControl画廊)逐条核对:data-open=true,aria-current=trueAdd Modelsbun run typecheck/bun run lint/bun run test(1978 passed)/bun run build全绿。