Merged
Conversation
- Remove `layer` — stored but never used in dispatch - Replace `when: 'mounted'` string enum with `global: boolean` — it was the only meaningful value, so a boolean is clearer - Fix passthrough bug: keys in `passthrough` now `continue` to bubble up rather than silently returning, so tab navigation from capture-mode components actually reaches parent scopes - Add `useGlobalKeybindings(bindings)` hook as the explicit replacement for the `when: 'mounted'` workaround; adds `registerGlobalKeybindings` to FocusStore internally
- Remove layer from KeybindingOptions reference - Replace when:'mounted' with global:boolean in RegisteredKeybinding - Add useGlobalKeybindings section with usage example - Fix passthrough description to reflect actual bubble behaviour - Update priority order list across core-concepts and architecture doc
Previously, global bindings were checked after the path walk, but capture mode returned early inside the loop — so globals were never reached when a capture-mode component (e.g. TextInput) had focus. Restructured dispatch into three passes: 1. Named bindings (walk focused node → root) 2. Global bindings — checked before capture fires 3. Capture mode (onKeypress) — only if no global binding matched The trap boundary still prevents globals from escaping — capture fires immediately on hitting the trap, then returns.
useGlobalKeybindings and the global flag on BindingEntry were solving a problem better handled by registering bindings at the right scope. Unhandled keys bubble naturally to ancestor scopes, so a root-level useKeybindings call serves as an app-wide shortcut handler without any special API. - Delete useGlobalKeybindings hook - Remove registerGlobalKeybindings from FocusStore - Remove global flag from BindingEntry and RegisteredKeybinding - Simplify dispatch: single pass, named bindings walk up the path, pendingCapture deferred until end, trap uses break not return - Simplify useKeybindingRegistry: available is just the branch path
- Remove useGlobalKeybindings section from input.mdx - Remove global field from RegisteredKeybinding reference - Update priority order in core-concepts to reflect simplified dispatch - Update architecture doc dispatch algorithm to match current implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.