Skip to content

Move sidebar visibility and active panel state into the engine #385

Description

@JDonaghy

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions