Summary
The TUI maintains its own search panel focus flags (TuiSidebar::search_input_mode and TuiSidebar::replace_input_focused) that duplicate the engine's search_panel_form_focus: RefCell<Option<String>>. GTK uses the engine field directly as the single source of truth.
Currently the TUI syncs these flags:
- To engine: at paint time in
render_search_panel() (panels.rs ~764-774)
- From engine: after
handle_search_input_key() calls (mod.rs ~2420-2425)
What needs to change
- Remove
TuiSidebar::search_input_mode and TuiSidebar::replace_input_focused
- Replace all ~15 read sites with
engine.search_panel_form_focus.borrow() checks
- Remove the paint-time sync in
render_search_panel()
- Remove the post-key-handling sync
Context
Filed during #311 (search panel cursor movement). The handle_search_input_key() consolidation made the duplication more visible — the TUI now delegates key dispatch to the engine but still maintains parallel state for focus routing.
Priority
Low — code quality, no user-facing impact.
Summary
The TUI maintains its own search panel focus flags (
TuiSidebar::search_input_modeandTuiSidebar::replace_input_focused) that duplicate the engine'ssearch_panel_form_focus: RefCell<Option<String>>. GTK uses the engine field directly as the single source of truth.Currently the TUI syncs these flags:
render_search_panel()(panels.rs ~764-774)handle_search_input_key()calls (mod.rs ~2420-2425)What needs to change
TuiSidebar::search_input_modeandTuiSidebar::replace_input_focusedengine.search_panel_form_focus.borrow()checksrender_search_panel()Context
Filed during #311 (search panel cursor movement). The
handle_search_input_key()consolidation made the duplication more visible — the TUI now delegates key dispatch to the engine but still maintains parallel state for focus routing.Priority
Low — code quality, no user-facing impact.