Skip to content

refactor: Simplified key bindings controller#2167

Merged
rkaraivanov merged 3 commits intomasterfrom
rkaraivanov/simplify-keybindings-controller
Mar 30, 2026
Merged

refactor: Simplified key bindings controller#2167
rkaraivanov merged 3 commits intomasterfrom
rkaraivanov/simplify-keybindings-controller

Conversation

@rkaraivanov
Copy link
Copy Markdown
Member

Description

  • Dropped the keydownRepeat option in favor of a single repeat option that applies to all key events.
  • Removed some helper functions and simplified the parseKeys function to use a single pass.
  • Updated the affected components to use the new repeat option.

Type of Change

  • Refactoring (code improvements without functional changes)

Checklist

  • My code follows the project's coding standards
  • I have tested my changes locally
  • I have updated documentation if needed

- Dropped the `keydownRepeat` option in favor of a
single `repeat` option that applies to all key events.
- Removed some helper functions and simplified the
`parseKeys` function to use a single pass.
- Updated the affected components to use the new `repeat` option.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the shared key bindings controller API by removing the keydownRepeat trigger and introducing a single repeat option, then updates affected components/controllers to use the new option.

Changes:

  • Replace keydownRepeat with repeat in the key bindings controller options and update matching logic.
  • Simplify parseKeys() to a single-pass implementation using partition().
  • Update keybinding defaults in components/controllers that previously relied on keydownRepeat.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/components/select/select.ts Updates select keybinding defaults to use repeat: true.
src/components/radio/radio.ts Updates radio keybinding defaults to use repeat: true.
src/components/dropdown/dropdown.ts Updates dropdown keybinding defaults to use repeat: true.
src/components/date-time-input/date-time-input.ts Updates date-time-input keybinding defaults to use repeat: true.
src/components/common/util.ts Adds documentation for asArray() and partition().
src/components/common/controllers/key-bindings.ts Refactors keybinding triggers/repeat behavior and simplifies key parsing.
src/components/combo/controllers/navigation.ts Updates combo navigation binding defaults to use repeat: true.
src/components/calendar/calendar.ts Updates calendar keybinding defaults to use repeat: true.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

@rkaraivanov rkaraivanov merged commit d9786b8 into master Mar 30, 2026
11 checks passed
@rkaraivanov rkaraivanov deleted the rkaraivanov/simplify-keybindings-controller branch March 30, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants