Problem
The engine doesn't own sidebar visibility or active panel. Each backend maintains its own:
- TUI:
TuiSidebar { visible, active_panel: TuiPanel } — local struct with its own enum
- GTK:
self.sidebar_visible: bool, self.active_panel: SidebarPanel — local fields
This forces ~200 lines of mapping in each backend:
TuiPanel ↔ engine focus flags sync (sync_sidebar_focus())
window_nav_overflow → sidebar focus (backend-level)
dap_wants_sidebar → set visible (backend-level)
ext_panel_focus_pending → set panel + visible (backend-level)
- Activity bar click → sidebar state mapping (~100 lines per backend)
Proposed fix
Add to Engine:
sidebar_visible: bool
active_sidebar: SidebarPanel
Engine::set_sidebar_panel(panel) / Engine::toggle_sidebar()
Remove TuiPanel enum and TuiSidebar struct. Remove GTK-local sidebar fields. Backends become thin "if engine says show sidebar, show it" wiring.
This also makes window_nav_overflow, dap_wants_sidebar, and ext_panel_focus_pending engine-internal — no backend flag-checking needed.
Impact
~200 lines removed per backend. Prerequisite for zero-effort Windows backend.
Context
Identified in Session 370 backend dedup audit (Tier 4 — architectural).
Problem
The engine doesn't own sidebar visibility or active panel. Each backend maintains its own:
TuiSidebar { visible, active_panel: TuiPanel }— local struct with its own enumself.sidebar_visible: bool,self.active_panel: SidebarPanel— local fieldsThis forces ~200 lines of mapping in each backend:
TuiPanel↔ engine focus flags sync (sync_sidebar_focus())window_nav_overflow→ sidebar focus (backend-level)dap_wants_sidebar→ set visible (backend-level)ext_panel_focus_pending→ set panel + visible (backend-level)Proposed fix
Add to Engine:
sidebar_visible: boolactive_sidebar: SidebarPanelEngine::set_sidebar_panel(panel)/Engine::toggle_sidebar()Remove
TuiPanelenum andTuiSidebarstruct. Remove GTK-local sidebar fields. Backends become thin "if engine says show sidebar, show it" wiring.This also makes
window_nav_overflow,dap_wants_sidebar, andext_panel_focus_pendingengine-internal — no backend flag-checking needed.Impact
~200 lines removed per backend. Prerequisite for zero-effort Windows backend.
Context
Identified in Session 370 backend dedup audit (Tier 4 — architectural).