Skip to content

fix(ai-chat-turbo-engine): keep the peek across the gap to a row submenu - #283

Merged
CYoJkoY merged 2 commits into
mainfrom
dev/282-peek-approach-margin
Dec 4, 2026
Merged

CYoJkoY merged 2 commits into
mainfrom
dev/282-peek-approach-margin

Conversation

@CYoJkoY

@CYoJkoY CYoJkoY commented Dec 4, 2026

Copy link
Copy Markdown
Owner

Result

探出面板不再在走向历史记录二级菜单时误收回,补上 0.23.19 仍漏掉的三种情况。

Why 0.23.19 still failed

按矩形位置认领(32px 邻居 + 指针罩住)在三个真实场景里失效:

  • 行菜单与它弹出的子菜单常隔 40px 以上,32px 认不出这次交接;
  • 指针停在两个框之间时命中页面空白,withinPeekBand 判否,宽限点着;
  • 站点提前按最终位置挂好菜单(opacity: 0 或排在视口外),探出开始时的快照把它当成页面原有弹层,真正打开后被永久拒绝。

Change

  • SIDEBAR_PEEK_APPROACH_MARGIN_PX = 96:pointerout 明确指向的目标按 96px 交接余量认领,随机页面浮层走不到这条路径(它们不是从面板离开的 related target)。
  • withinPeekLayers():指针落在已认领层 96px 走廊内也算仍在面板上,慢速跨过空隙不触发收回。
  • AdoptPeekLayerOptions { margin, vouched }:指针落在框内、或离开面板时走向的框,由指针自证,跳过「页面原有弹层」否决;几何仍是相邻或罩住指针。
  • isVisiblePopover() 拒绝 opacity: 0 与完全在视口外的矩形,预挂菜单不再进快照。
  • 保留原有负向约束:宽度 ≥ 视口 60% 的壳、文档流中的应用外壳、页面自己已打开的可见弹层仍然不认领。

Evidence

  • 新增 4 条回归用例,在 0.23.19 的 sidebar-peek.ts 上全部失败,修复后全部通过:
    • keeps the peek when the pointer pauses in the gap beside a menu
    • adopts a row menu the site parked transparent before the peek
    • adopts a row menu the site parked off screen before the peek
    • adopts the box a departure from the peek walks into
  • pnpm check 全绿:62 文件 / 975 用例 / build 成功。
  • 版本 0.23.20,文档与版本记录同步。

Not verified

没有在真实站点上手动复现(本次只有 DOM 级用例)。

Closes #282

A row menu and the flyout it opens often sit more than 32px apart, and the
gap hits page blank space, so the adoption threshold missed the hand-off and
the hide delay armed mid-gesture. Widen adoption for the target a departure
names, treat the 96px corridor around an adopted layer as still the peek, and
stop recording parked-transparent or off-screen menus as page-owned popovers.
@CYoJkoY
CYoJkoY merged commit 5276c88 into main Dec 4, 2026
1 check passed
@CYoJkoY
CYoJkoY deleted the dev/282-peek-approach-margin branch December 4, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sidebar peek still collapses across a wide gap or a pre-parked menu

1 participant