Skip to content

fix(header): 账号菜单不再在指针移出头像时关闭 - #933

Merged
xiaocheny214 merged 1 commit into
1024XEngineer:mainfrom
johnnyzhang-eng:fix/account-menu-unreachable-by-mouse
Sep 3, 2026
Merged

fix(header): 账号菜单不再在指针移出头像时关闭#933
xiaocheny214 merged 1 commit into
1024XEngineer:mainfrom
johnnyzhang-eng:fix/account-menu-unreachable-by-mouse

Conversation

@johnnyzhang-eng

Copy link
Copy Markdown
Contributor

Summary

移除账号区域的 onPointerLeave={accountMenu.close}。菜单是点击打开的,却按 hover 菜单的方式关闭;而菜单绝对定位在区域外(8px 垂直空隙 + 向左探出约 66px),鼠标从头像走向菜单必然先离开区域,菜单在指针到达前就关掉,「账号中心」「修改密码」「退出登录」三项鼠标点不到。

关闭仍由区域外 pointerdownEscape、焦点移出、点击菜单项四条路径覆盖。

原测试断言「指针移出即关闭」,改为断言「指针移出后保持打开」,并在用例名里写清为什么。

Verification

真实构建产物 + 真实鼠标轨迹(Chromium 1440×900,从头像中心分 20 步移到「账号中心」):

未修复:点开=open → 移到菜单项上=closed → 点击无效,仍停在 /workspace
本 PR :点开=open → 移到菜单项上=open   → 点击进入 /account

新增的回归用例在未修复代码上失败(expected 'closing' to be 'open'),在本 PR 上通过。

  • npm run format:check
  • npm run lint
  • npm run typecheck
  • npm run test:coverage(89 files / 1387 tests passed)
  • npm run build

Closes #932

鼠标从头像走到菜单必然经过两者之间的空隙,pointerleave 让菜单
在指针到达之前就关闭,账号中心、修改密码、退出登录三项鼠标点不到。
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
windup Ready Ready Preview Sep 3, 2026 6:03am UTC

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the complete fixed diff for the account-menu dismissal contract and its regression coverage. Removing onPointerLeave correctly preserves the menu while the pointer traverses the gap to the absolutely positioned menu, while outside pointerdown, Escape, focus exit, and item selection still provide close paths. I found no actionable correctness, compatibility, or maintainability issues introduced by this PR.

Verification: git diff --check passed. The targeted test could not run in this checkout because frontend dependencies are unavailable and vitest returned Permission denied.

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #933   +/-   ##
=======================================
  Coverage   91.27%   91.27%           
=======================================
  Files         193      193           
  Lines       13204    13204           
=======================================
  Hits        12052    12052           
  Misses       1152     1152           
Flag Coverage Δ
backend 91.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@johnnyzhang-eng

Copy link
Copy Markdown
Contributor Author

补一条部署信息:windup.xin 当前发的还是 8-29 那次构建(/assets/workflow-Ct_ZmcW0.js 里能直接看到 onPointerLeave:h.close),main 上 8-31 的 #767 也还没上去,所以这个 PR 合了之后还需要一次重新构建部署才能到用户手上。

@xiaocheny214

Copy link
Copy Markdown
Contributor

补一条部署信息:windup.xin 当前发的还是 8-29 那次构建(/assets/workflow-Ct_ZmcW0.js 里能直接看到 onPointerLeave:h.close),main 上 8-31 的 #767 也还没上去,所以这个 PR 合了之后还需要一次重新构建部署才能到用户手上。

可以。我会手动部署一下。

@xiaocheny214
xiaocheny214 self-requested a review September 3, 2026 06:51
@xiaocheny214
xiaocheny214 merged commit eac3101 into 1024XEngineer:main Sep 3, 2026
10 checks passed
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.

[Bug]: 登录后账号菜单点开即关,鼠标够不到里面的三项

2 participants