Skip to content

fix: close popover when switch menu is cancelled#26

Merged
aqua5230 merged 1 commit into
aqua5230:mainfrom
ericweichun:codex/fix-switch-panel-popover-cancel
Jun 2, 2026
Merged

fix: close popover when switch menu is cancelled#26
aqua5230 merged 1 commit into
aqua5230:mainfrom
ericweichun:codex/fix-switch-panel-popover-cancel

Conversation

@ericweichun
Copy link
Copy Markdown
Contributor

Summary

Fixes a menu bar UI edge case where opening the Switch Panel menu and dismissing it without choosing an item can leave the popover visible but no longer dismissible normally.

The switch menu is shown with a modal NSMenu. When that menu is cancelled, we now close the still-visible popover instead of trying to keep it alive in a broken transient state. Menu item actions mark that an action was taken, so normal panel selection and settings toggles keep their existing behavior.

Test plan

  • .venv/bin/ruff check menubar.py tests/test_menubar.py
  • .venv/bin/mypy menubar.py tests/test_menubar.py
  • .venv/bin/python -m pytest tests/test_menubar.py -q
  • Manually verified in menu bar mode

Notes for reviewer

This intentionally closes the popover only when the switch menu is dismissed without selecting anything. That avoids the previous stuck popover state without adding a close/reopen flash after the menu closes.

Copy link
Copy Markdown

@Jimin78364 Jimin78364 left a comment

Choose a reason for hiding this comment

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

@aqua5230 aqua5230 marked this pull request as ready for review June 2, 2026 09:27
@aqua5230 aqua5230 merged commit b95a5a6 into aqua5230:main Jun 2, 2026
1 check 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.

3 participants