Tier: Ready now (no quadraui gap)
Summary
src/tui_main/mod.rs:2106–2249 has three near-identical KeyCode → engine-string translation blocks — one each for the Extensions sidebar, Settings panel, and Debug sidebar — before dispatching into the engine. Each block re-maps Esc → "Escape", Enter → "Return", BackSpace, Tab, arrow keys, etc. A shared helper would let the per-panel sites collapse to a single function call plus the panel-specific dispatch.
What exists
translate_key() (src/tui_main/mod.rs:3240, ~100 lines) — the general crossterm → engine key translator used by the editor path. The sidebar paths bypass it and rebuild the same map inline.
- Each engine panel-key API already takes a
&str keyname (or (keyname, Option<char>)) — they're already shaped to receive translator output.
What to do
- Extract the common
KeyCode → keyname mapping into a helper (e.g. tui_key_to_engine_name(code) -> Option<String>). It can live in src/tui_main/mod.rs since it's TUI-specific input adaption, OR be promoted to src/render.rs if the same shape is useful for other surfaces.
- Replace the three inline match blocks (Extensions ~30 lines, Settings ~14 lines, Debug ~10 lines) with calls to the helper.
- Verify each panel still dispatches correctly via its existing engine method (
dispatch_ext_sidebar_key_unified, handle_settings_key, handle_dap_sidebar_key).
Files
src/tui_main/mod.rs — ~80 lines removed across the three sidebar blocks (lines 2106–2249).
Dependencies
None. No quadraui gap.
Notes
Part of the TUI convergence backlog (#474). Sister issue to GTK's handle_key_press consolidation (#448). Small standalone refactor — good first issue in the backlog.
Tier: Ready now (no quadraui gap)
Summary
src/tui_main/mod.rs:2106–2249has three near-identicalKeyCode → engine-stringtranslation blocks — one each for the Extensions sidebar, Settings panel, and Debug sidebar — before dispatching into the engine. Each block re-mapsEsc → "Escape",Enter → "Return",BackSpace,Tab, arrow keys, etc. A shared helper would let the per-panel sites collapse to a single function call plus the panel-specific dispatch.What exists
translate_key()(src/tui_main/mod.rs:3240, ~100 lines) — the general crossterm → engine key translator used by the editor path. The sidebar paths bypass it and rebuild the same map inline.&strkeyname (or(keyname, Option<char>)) — they're already shaped to receive translator output.What to do
KeyCode → keynamemapping into a helper (e.g.tui_key_to_engine_name(code) -> Option<String>). It can live insrc/tui_main/mod.rssince it's TUI-specific input adaption, OR be promoted tosrc/render.rsif the same shape is useful for other surfaces.dispatch_ext_sidebar_key_unified,handle_settings_key,handle_dap_sidebar_key).Files
src/tui_main/mod.rs— ~80 lines removed across the three sidebar blocks (lines 2106–2249).Dependencies
None. No quadraui gap.
Notes
Part of the TUI convergence backlog (#474). Sister issue to GTK's
handle_key_pressconsolidation (#448). Small standalone refactor — good first issue in the backlog.