BREAKING: drop KeyborgProps (triggerKeys/dismissKeys) and dismiss timer#176
Open
layershifter wants to merge 1 commit into
Open
BREAKING: drop KeyborgProps (triggerKeys/dismissKeys) and dismiss timer#176layershifter wants to merge 1 commit into
layershifter wants to merge 1 commit into
Conversation
KeyborgProps was the only argument to `createKeyborg`/`createKeyborgCore`, gating two features: * `triggerKeys` — a custom set of keys that should opt the window into keyboard-navigation mode in place of "any non-Tab key on a non-editable element". Never used by any known consumer; the default predicate is already the right behaviour for screen-reader and Tab-driven flows. * `dismissKeys` — a key set that scheduled a 500 ms timer to dismiss keyboard mode if focus did not move (typically wired to Escape). This hand-rolled latch duplicated work consumers already do at the application level. Drop the props interface, the `shouldDismiss`/`scheduleDismiss`/ `dismissTimer`/`_dismissTimeout` machinery, and the `triggerKeys` membership check in `shouldTrigger`. `onKeyDown` collapses to a single guard: enter keyboard mode if not already in it and the key should trigger. `KeyborgProps` was never re-exported from `src/index.mts`, so the public surface stays compatible aside from the (still-typed) extra `createKeyborg` parameter going away. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📊 Bundle size reportUnchanged fixtures
|
mshoho
approved these changes
May 19, 2026
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.

Summary
KeyborgPropswas the only argument tocreateKeyborg/createKeyborgCore, gating two opt-in features:triggerKeys— a custom set of key codes that should enter keyboard-navigation mode in place of the default predicate (any non-Tab key on a non-editable element). No known consumer passes a custom set; the default already covers screen-reader and Tab-driven flows.dismissKeys— a key set that scheduled a 500 ms timer to dismiss keyboard mode if focus did not move (typically wired to Escape). This hand-rolled latch duplicated work consumers already do at the application level.Drops:
KeyborgPropsinterface,triggerKeys/dismissKeysSetconstruction,shouldDismiss/scheduleDismiss/dismissTimer/_dismissTimeout,triggerKeysmembership check inshouldTrigger,dispose.onKeyDowncollapses to a single guard:Public API impact
createKeyborg(win, props?)→createKeyborg(win).KeyborgPropstype is removed.KeyborgPropswas never re-exported fromsrc/index.mts, so it was only reachable via deep imports. Callers passing the second argument hit a type error; callers passing nothing are unaffected. Worth a minor or major bump depending on how strict the maintainers want to be.🤖 Generated with Claude Code