Skip to content

feat(ui): which-key style hint popover for leader chords#58

Merged
killertux merged 2 commits into
mainfrom
feat/leader-hints-popover
May 26, 2026
Merged

feat(ui): which-key style hint popover for leader chords#58
killertux merged 2 commits into
mainfrom
feat/leader-hints-popover

Conversation

@killertux
Copy link
Copy Markdown
Owner

Summary

  • Replicates the imbuia editor's leader-key hint popover: when the user presses <Space> (or <C-w>), a small box appears in the bottom-right corner listing every available follow-up key and its description. The next keystroke either fires the bound action or silently cancels — the existing pending-chord reset already handles dismissal.
  • Leader entries are read live from the keymap, so user overrides in keybindings.toml show up automatically. <C-w> entries are a parallel hardcoded table because those chord keys live in event::translate_window_chord, not in the keymap. g-prefix gets no popover (only one follow-up g, not worth interrupting).
  • Added KeyChord::human() / Chord::human() helpers to render chord notation back to <C-w>, <Space>, etc.
  • Bump to 0.17.2.

Test plan

  • cargo fmt && cargo clippy --all-targets -- -D warnings && cargo test
  • Manual: press <Space> — popover lists r/R/c/e/S/C/n/04 with descriptions; pressing any of them fires the bound action and closes the popup
  • Manual: press <Space> then <Esc> — popup closes, nothing fires
  • Manual: press <C-w> — popover lists h/l/</>

killertux added 2 commits May 26, 2026 11:08
When the user arms a chord (<Space> or <C-w>), a small popover in the
bottom-right corner now lists the available follow-up keys with their
descriptions — same ergonomic as the imbuia editor. It auto-closes
when the next keystroke arrives (the existing pending-chord reset
logic handles dismissal whether the chord fires or is cancelled).

- Leader entries are pulled live from the keymap so user overrides in
  keybindings.toml flow through automatically.
- Ctrl+W entries are a parallel hardcoded table (the chord's keys are
  hardcoded in event::translate_window_chord, not in the keymap).
- Session-switch shortcuts past digit 4 are filtered out to keep the
  popover compact; :session N still works for the rest.
- Bump to 0.17.2.
@killertux killertux merged commit e45be23 into main May 26, 2026
3 checks passed
@killertux killertux deleted the feat/leader-hints-popover branch May 26, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant