Skip to content

feat(app): hide the window with ⌘W - #15

Merged
ahonn merged 1 commit into
ahonn:masterfrom
liukun:feat/cmd-w-hide-window
Oct 4, 2026
Merged

ahonn merged 1 commit into
ahonn:masterfrom
liukun:feat/cmd-w-hide-window

Conversation

@liukun

@liukun liukun commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Closes #12

Summary

Bind ⌘W to hide the window.

  • Escape walks the dismiss cascade and, in vim mode, deliberately stops short of hiding, so :q was the only way to put the note away from the keyboard.
  • ⌘W is the macOS key for closing a window and already closes the Settings window, so it is the natural key here.
  • The new HideWindow action runs the same Intent::Hide as :q and the Hide Window command, closing any open panel before hiding, so the three stay in step. The command is now labelled ⌘W under :.
  • Escape's behaviour is unchanged. Settings still takes ⌘W first through its deeper key context.

Tests

  • cmd_w_hides_the_window_in_every_mode_but_closes_settings_first in e2e/vim.rs: ⌘W resolves to HideWindow in vim normal, vim insert and non-vim mode, and to CloseSettings under the Settings context. It checks keymap resolution only, since the test platform cannot hide a window.
  • the_table_gives_every_surface_the_same_labels now asserts Intent::Hide is labelled ⌘W and :wq (Then[Save, Hide]) has no label.
  • cargo clippy --all-targets -- -D warnings is clean. The five e2e tests that fail on this branch also fail on master at 165bd2c, unrelated to this change.

Escape walks the dismiss cascade and, in vim mode, deliberately stops short of
hiding, leaving :q as the only way to put the note away from the keyboard. ⌘W
is the macOS key for closing a window and already closes Settings, so bind it
to a new HideWindow action that runs the same Hide Window command as :q,
closing any open panel before hiding, and label that command ⌘W.
@ahonn
ahonn merged commit bc887f0 into ahonn:master Oct 4, 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.

Suggestion: ⌘W to hide the window (branch available)

2 participants