Problem
Both backends implement context menu keyboard navigation (j/k/Up/Down/Escape/Return) by directly mutating cm.selected with wrapping arithmetic:
- GTK:
mod.rs:5428-5483, ~55 lines
- TUI: similar in key dispatch, ~40 lines
Proposed fix
Add Engine::handle_context_menu_key(key: &str) -> bool that handles selection movement, confirm, and dismiss. Backends call it instead of reimplementing navigation.
Context
Identified in Session 370 backend dedup audit.
Problem
Both backends implement context menu keyboard navigation (j/k/Up/Down/Escape/Return) by directly mutating
cm.selectedwith wrapping arithmetic:mod.rs:5428-5483, ~55 linesProposed fix
Add
Engine::handle_context_menu_key(key: &str) -> boolthat handles selection movement, confirm, and dismiss. Backends call it instead of reimplementing navigation.Context
Identified in Session 370 backend dedup audit.