Skip to content

fix(tray): macOS 菜单栏图标因 mouse-enter 消失 - #637

Merged
vastsa merged 1 commit into
mainfrom
fix/macos-tray-native-status-item
Sep 19, 2026
Merged

vastsa merged 1 commit into
mainfrom
fix/macos-tray-native-status-item

Conversation

@vastsa

@vastsa vastsa commented Sep 19, 2026

Copy link
Copy Markdown
Owner

原因

#636 给托盘加了 mouse-enter,用来在悬停时重试失败的 Host 读取。

macOS 上监听这个事件会把原生 NSStatusItem 换成自定义 view,菜单栏图标消失,左键也不再弹出挂上的菜单。再叠加上 darwin 去掉了 click 还原窗口,看起来就像「没有托盘了」。

修复

  • macOS 不再监听 mouse-enter / right-click,继续用 setContextMenu 的原生菜单栏 extra
  • Windows/Linux 仍可悬停/右键重试
  • macOS 刷新仍走会话/收件箱事件

验证

node --test apps/desktop/test/close-behavior-tray.test.mjs 10/10

#636 subscribed to mouse-enter so a failed Host read could retry on hover.
On macOS that event replaces NSStatusItem with a custom view, which hides
the extra and stops the attached menu. Gate hover/right-click retry to
Windows/Linux; macOS still refreshes from session and inbox events.
Copilot AI lite review requested due to automatic review settings September 19, 2026 07:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vastsa
vastsa merged commit 7e8a3fc into main Sep 19, 2026
3 of 4 checks passed
@vastsa
vastsa deleted the fix/macos-tray-native-status-item branch September 19, 2026 07:58
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.

2 participants