feat(keys): hint mode and plugin keyboard shortcuts - #64
Merged
Merged
Conversation
A symlink target resolves against the link's own directory, so a relative source such as target/release/foo dangled inside the plugins dir and discovery silently skipped the plugin.
Hint mode (`f`) labels every button in a plugin's controls section; typing a label presses it, confirm buttons need two presses. Plugins can declare `keys` per section. Each sits behind a leader (`[keybindings] plugin_leader`, default `space`) so it can never shadow an Aura shortcut. Pressing the leader opens leader mode: a floating panel lists the section's keys and narrows as strokes are typed. Aura reads the strokes itself instead of binding whole GPUI sequences, so it waits until the shortcut completes or Escape, or for `[keybindings] leader_timeout_ms` when set. Clicks, hint labels and plugin keys share one press path. The help overlay lists the plugin's keys; `aura plugin run` prints them and any problems; `aura keys validate` and `aura doctor` warn when the leader collides with a global binding. `keys validate` now prints its warnings when keybindings.toml doesn't exist.
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
Keyboard control for plugin panels, in two layers:
f, actionhint_mode). Every button in a plugin'scontrolssection gets a label (a,s,d… home row first; fixed length so none is a prefix of another). Typing a label presses the button. Confirm buttons arm on the first press and fire on the second. Esc, a click, or any tab/plugin/mode switch leaves hint mode. Works with every existing plugin; no protocol change.keys: [{ keys, action, label, confirm? }]. Each key sits behind a leader ([keybindings] plugin_leader, defaultspace), so a plugin can never shadow an Aura shortcut. Pressing the leader opens a floating panel at the bottom right listing the section's keys; it narrows as strokes are typed. It waits until the shortcut completes or Esc, or for[keybindings] leader_timeout_mswhen set (unset by default).Design and decisions:
docs/plans/plugin-keymaps.md.How it works
key_downlistener reads the keys. Only the leader itself is a GPUI binding (newplugincontext between global and overlay). Aura matches the rest with GPUI'sKeyBinding::match_keystrokesinstead of binding whole sequences, because GPUI forgets a pending sequence after a fixed second, and Esc during one replayed intodismiss.press_plugin_action), soconfirmbehaves the same everywhere. Esc (andq) disarm an armed button before closing anything.aura-core(plugin/keys.rs): the leader goes in front, spellings are canonicalized, bad entries are skipped with warnings, duplicates keep the later entry, and a key that starts another is flagged (the shorter one runs immediately).Also in this PR
fix(plugin):aura plugin add --linknow links to the absolute source path. A relative source (asinstall.sh --linkpasses) left a dangling symlink inside the plugins dir, and discovery silently skipped the plugin.aura keys validatenow prints its warnings whenkeybindings.tomldoesn't exist (it used to exit 1 with no explanation).aura plugin runprints each section's resolved keys and warnings on stderr;aura keys validateandaura doctorwarn when the leader collides with a[global]binding.keybindings.md,plugin-authoring.md,configuration.md,.design/components.md.Testing
./scripts/pre-pr.sh: all checks pass (rustfmt, clippy, test, selectable_text, gitleaks, cargo_audit, build_release).PluginSection.keysround-trip, absolute symlink target.Rfluid/aura-audio-hooks): hint mode,spacepanel, confirm keys.