feat(ui): context- and state-aware bottom keybinding strip (#27)
Per ADR-0051 (closing issue #27): the bottom status line is now a keystrokes-only, state-selected strip. A pure status_bar_bindings() picks the binding set by priority (first match wins): sidebar focus → Ctrl-O next pane · ↑↓/PgUp/PgDn scroll · Esc input completion live → Tab/Shift-Tab cycle · Esc cancel · Enter run history nav → ↑↓ browse · Esc clear · Enter run editing → Esc clear · Ctrl-A/E home/end · Ctrl-W del word · Enter run default (empty) → Ctrl-O sidebar · Tab complete · ↑ history · Enter run The editing state surfaces the #29 readline keys (ADR-0049's deferred advertisement). Typed-command words (mode advanced/simple, the ':' one-shot) and Ctrl-C quit leave the strip; simple mode's empty-input hint gains a '`mode advanced` for SQL' pointer (advanced mode shows none — a switcher knows the way back, and help covers it). Mechanism: status_bar_bindings + a thin renderer (unit-testable); App::is_browsing_history() exposes the private history_cursor; the mode pointer lives in resolve_hint_lines. Catalog: 12 new shortcut labels + panel.hint_mode_advanced (en-US.yaml + keys.rs, validator 1:1), 5 dead strip strings removed. Forks user-chosen: editing state shows #29 keys; quit omitted; no width-drop machinery (longest strip ~65 cols fits; a width-budget test keeps it lean). Modal-aware strip is OOS (pre-existing). Tests: 9 Tier-1 unit (per-state key sets, width budget, mode pointer), 1 Tier-3 rewritten, 15 full-panel snapshots re-accepted (reviewed). 2467 pass / 0 fail / 0 skip, clippy clean.
This commit is contained in:
+13
-5
@@ -446,6 +446,7 @@ pub const KEYS_AND_PLACEHOLDERS: &[(&str, &[&str])] = &[
|
||||
("undo.redo_failed", &["error"]),
|
||||
// ---- Status bar + panels ----
|
||||
("panel.hint_empty", &[]),
|
||||
("panel.hint_mode_advanced", &[]),
|
||||
("panel.hint_title", &[]),
|
||||
("panel.output_title", &[]),
|
||||
("panel.relationships_empty", &[]),
|
||||
@@ -462,18 +463,25 @@ pub const KEYS_AND_PLACEHOLDERS: &[(&str, &[&str])] = &[
|
||||
("save.title_as", &[]),
|
||||
("save.title_save", &[]),
|
||||
// ---- Shortcut hint labels ----
|
||||
("shortcut.advanced_once", &[]),
|
||||
("shortcut.back_to_list", &[]),
|
||||
("shortcut.browse", &[]),
|
||||
("shortcut.browse_path", &[]),
|
||||
("shortcut.cancel", &[]),
|
||||
("shortcut.cancel_one_shot", &[]),
|
||||
("shortcut.clear", &[]),
|
||||
("shortcut.complete", &[]),
|
||||
("shortcut.confirm", &[]),
|
||||
("shortcut.cycle", &[]),
|
||||
("shortcut.del_word", &[]),
|
||||
("shortcut.history", &[]),
|
||||
("shortcut.home_end", &[]),
|
||||
("shortcut.load", &[]),
|
||||
("shortcut.nav", &[]),
|
||||
("shortcut.next_pane", &[]),
|
||||
("shortcut.no", &[]),
|
||||
("shortcut.quit", &[]),
|
||||
("shortcut.run", &[]),
|
||||
("shortcut.scroll", &[]),
|
||||
("shortcut.select", &[]),
|
||||
("shortcut.submit", &[]),
|
||||
("shortcut.switch", &[]),
|
||||
("shortcut.to_input", &[]),
|
||||
("shortcut.yes", &[]),
|
||||
// ---- mode / messages banners ----
|
||||
("messages.set_short", &[]),
|
||||
|
||||
@@ -883,14 +883,21 @@ panel:
|
||||
relationships_title: "Relationships"
|
||||
relationships_empty: "(none)"
|
||||
hint_empty: "Type a command — press Tab for options, `help` for a list"
|
||||
# Mode-discovery pointer appended to the empty-input hint in SIMPLE
|
||||
# mode (ADR-0051): the `mode advanced` switch left the keybinding
|
||||
# strip, so the hint advertises it. Leading separator continues the
|
||||
# prompt line. Advanced mode shows no pointer — users know how they
|
||||
# got there, and `help` covers the way back.
|
||||
hint_mode_advanced: " · `mode advanced` for SQL"
|
||||
# Panel titles for the output and hint panels (rendered inside
|
||||
# the rounded border, hence the leading/trailing space).
|
||||
output_title: "Output"
|
||||
hint_title: "Hint"
|
||||
|
||||
# ---- Shortcut hints (paired with key names in the bottom bar) -------
|
||||
# The bottom strip is keystrokes-only and state-aware (ADR-0051). Labels
|
||||
# pair with a key name in the renderer (e.g. `Enter` + `run`).
|
||||
shortcut:
|
||||
submit: "submit"
|
||||
confirm: "confirm"
|
||||
cancel: "cancel"
|
||||
yes: "Yes"
|
||||
@@ -899,10 +906,19 @@ shortcut:
|
||||
select: "select"
|
||||
browse_path: "browse path"
|
||||
back_to_list: "back to list"
|
||||
switch: "switch"
|
||||
advanced_once: "advanced once"
|
||||
cancel_one_shot: "cancel one-shot"
|
||||
quit: "quit"
|
||||
# Status-strip labels (ADR-0051, issue #27).
|
||||
run: "run"
|
||||
nav: "sidebar"
|
||||
next_pane: "next pane"
|
||||
scroll: "scroll"
|
||||
to_input: "input"
|
||||
cycle: "cycle"
|
||||
browse: "browse"
|
||||
clear: "clear"
|
||||
complete: "complete"
|
||||
history: "history"
|
||||
home_end: "home/end"
|
||||
del_word: "del word"
|
||||
|
||||
# ---- mode / messages banners (app-level commands) -------------------
|
||||
mode:
|
||||
|
||||
Reference in New Issue
Block a user