feat(shortcuts): add a leader key tree and palette remapping

Expose the multi-key mappings starting at the configured leader key in a
which-key panel, so that continuations are discoverable as soon as the prefix
is pressed. Both the panel and the command palette read the same structured
mapping data, and the palette can now write a new mapping for the selected
action.
This commit is contained in:
BlackAngelTV committed 2026-11-13 08:03:03 +01:00
1 parent dc13716431
commit bfc97997a1
10 files changed
+418 -13

No files matched your search

+9
View File
@@ -2856,6 +2856,15 @@ class Boss:
data = collect_keys_data(get_options())
self.run_kitten_with_metadata('command-palette', input_data=json.dumps(data), window=self.window_for_dispatch)
def show_leader_keymap(self, prefix: Any, definitions: Any = None) -> None:
"""Show the keys available under the leader prefix in the palette overlay."""
from kittens.command_palette.main import collect_leader_data
data = collect_leader_data(get_options(), prefix, definitions)
if not data['leader']['bindings']:
return
self.run_kitten_with_metadata('command-palette', input_data=json.dumps(data), window=self.window_for_dispatch)
@ac(
'tab',
"""