Skip to content

Allow Escape in modifier combinations - #43

Open
ubf-hunter wants to merge 1 commit into
Travus:mainfrom
ubf-hunter:feat/modified-escape-bindable
Open

Allow Escape in modifier combinations#43
ubf-hunter wants to merge 1 commit into
Travus:mainfrom
ubf-hunter:feat/modified-escape-bindable

Conversation

@ubf-hunter

Copy link
Copy Markdown

Summary

  • checkAccelerator / checkBinding (shared/accelerator.ts) now only treat Escape as reserved when it carries zero modifiers, instead of unconditionally.
  • App.tsx's dismiss-chain handler bails out early when any modifier is held, so Ctrl+Escape etc. fall through to whatever the user bound them to instead of closing dialogs / leaving fullscreen.
  • Updated the accelerator.test.ts case that pinned the old blanket reservation, and added coverage for a modified Escape passing both checkAccelerator and checkBinding (including mid-sequence, e.g. CmdOrCtrl+K CmdOrCtrl+Escape).

Per the issue, the dismiss chain itself is intentionally untouched — it's a five-rung priority chain, not a single action, so it can't move onto the regular keymap.

Closes #37

Test plan

  • npm run typecheck — clean
  • npm run lint — clean
  • npx vitest run — 127 passed

Only bare Escape is reserved system-wide (it's fixed to panel:restore
and owns App.tsx's five-rung dismiss chain). A modified Escape
(Ctrl+Escape, Alt+Shift+Escape, ...) is a different chord and had no
reason to be unbindable — it was swept up because App.tsx's dismiss
handler checked event.key alone, with no modifier guard.

- checkAccelerator / checkBinding (shared/accelerator.ts) now only
  treat Escape as reserved when it carries zero modifiers.
- App.tsx's dismiss-chain handler bails out early when any modifier is
  held, so a modified Escape falls through to whatever the user bound
  it to instead of closing dialogs / leaving fullscreen.
- Updated the accelerator.test.ts case that pinned the old blanket
  reservation, and added coverage for a modified Escape passing both
  checkAccelerator and checkBinding (including mid-sequence).

The dismiss chain itself is intentionally untouched, per the issue:
it is a five-rung priority chain, not a single action, so it can't
move onto the regular keymap.

Closes Travus#37
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.

Allow Escape in modifier combinations

1 participant