keybind-cheatsheet: focus the search box when the panel opens - #535
Open
UmedjonBA wants to merge 1 commit into
Open
keybind-cheatsheet: focus the search box when the panel opens#535UmedjonBA wants to merge 1 commit into
UmedjonBA wants to merge 1 commit into
Conversation
The panel is opened to look a binding up, so the first keystroke should land in the search box instead of requiring a click there first. The search input takes focus on render, except while a description is being edited - that row's own input keeps the caret. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
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.
Plugin
kenn/keybind-cheatsheetplugin.toml)What it does
Focuses the search box when the panel opens, so the first keystroke starts filtering instead of being swallowed. Right now the panel has to be clicked in the search field first, which is a small but constant friction for the plugin's main use ("what was that shortcut again?").
One line: the search input gets
focus = editingId == nil. The condition keeps the behavior out of the way while a description is being edited in edit mode — that row's own input keeps the caret.Happy to put it behind a setting (e.g.
focus_search_on_open, default on) if you prefer it optional.External dependencies
None.
Testing
Opened the panel and typed immediately (no click): the text lands in the search box and the list filters as expected; the clear button and Escape still behave as before, and edit mode keeps its own input focused.
Note on
focus: it is the property the runtime accepts onui.input—autoFocus,focusedandselectAllare rejected withui tree: 'input' has no prop '…', ignored, so this is the one that works today.Screenshots / Videos
Panel right after opening, with only keystrokes (no click): the search box holds the caret and the list is already filtered.
Checklist
Ready-for-review requirement: Every box in this section must be checked. If any statement is not true, keep the
pull request as Draft. An explanation does not replace a required check.
idafter the/inplugin.tomlexactly.plugin.toml,README.md,thumbnail.webp, andtranslations/en.json.README.mdfollows theREADME template, documents
every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
thumbnail.webpwith the thumbnail generator.versionfollows semver and is bumped in this PR;plugin_apiis the oldest API level this plugin requires.understand that language well enough to review and maintain it (no unreviewed machine/LLM translations).
catalog.toml; CI generates it.Code review attestation
Plugins run as trusted, unsandboxed Luau in the user's session. Confirm:
Ready-for-review requirement: Every attestation below must be checked.
licensedeclared inplugin.toml.Both this and #534 branch off
mainand bump to 0.2.5, since either can land on its own. Whichever you merge first, I will rebase the other and bump its version accordingly — just say the word.