Skip to content

Conversation

@colin-grant-work
Copy link
Contributor

What it does

#16660 revealed a general weakness in the keybinding prioritization system: there was no way for it to prioritize DOM focus in cases where multiple keybindings were active according to globally set context keys.

#16668 provided an ad hoc fix for the quick input system. This PR provides a more general fix for the keybinding system by allowing the keybinding to prioritize keybindings that use context keys defined in contexts applied to the focused DOM element or its parents. It then applies such a local keybinding context to the QuickInput system to address #16660.

It also addresses a long-standing FIXME to improve keybinding lookup times by building a TernarySearchTree for lookup rather than iterating over all defined keybindings.

How to test

  1. Quick command panel not closing when pressing escape #16660 should still be fixed - if you reveal notifications and focus a quick input and hit Esc, the quick input close command should be triggered rather than the notification hide command.
  2. Other keybinding behavior should continue to work as expected.

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

@github-project-automation github-project-automation bot moved this to Waiting on reviewers in PR Backlog Dec 16, 2025
@colin-grant-work colin-grant-work force-pushed the feature/keybinding-locality branch from 3e53c74 to 4ee1fe3 Compare December 16, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting on reviewers

Development

Successfully merging this pull request may close these issues.

2 participants