Skip to content

Unified sidebar rendering via ScreenLayout #133

Description

@JDonaghy

Context

The editor area, find/replace panel, tab bar, and status bar all render from shared ScreenLayout data — backends just iterate and draw. This is the pattern that makes "test once, works everywhere" possible. The sidebar does NOT follow this pattern: each backend (GTK, TUI, Win-GUI) builds its own sidebar UI independently.

Current state:

Component Renders from ScreenLayout? Clicks centralized?
Editor content ✅ all backends
Find/replace ✅ all backends
Tab bar ✅ all backends TUI ✅, GTK/Win-GUI ❌
Status bar ✅ all backends TUI ✅, GTK/Win-GUI ❌
Sidebar ❌ each backend builds own ❌ each backend has own logic

GTK is the biggest outlier — it uses native GTK widgets (buttons, tree views) for the sidebar while TUI and Win-GUI do coordinate-based rendering and click detection.

Goal

Move sidebar panel content into ScreenLayout so backends become thin drawing loops:

  1. Activity barScreenLayout provides a list of ActivityBarItem { icon, label, panel_id, is_active } entries. Backends iterate and draw icons. Click → resolve_activity_bar_click() (already done in Hit regions for sidebar #42).

  2. Explorer treeScreenLayout provides pre-built rows (ExplorerRow { indent, icon, name, is_dir, is_expanded, is_selected, ... }). Backends iterate and draw. Currently TUI has TuiSidebar.rows and GTK uses a TreeView — both should consume the same data.

  3. Git/debug/extensions/AI panelsScreenLayout already has SourceControlData, DebugSidebarData, ExtSidebarData, AiPanelData. These just need scroll-aware row computation so backends don't recompute positions.

  4. Tab bar + status bar click migration — GTK and Win-GUI still use their own pixel-based hit caches for tab bar (Hit regions for tab bar #40) and status bar (Hit regions for status bar #41) clicks instead of the shared hit regions. Migrate them.

Scope

  • Add sidebar rendering data to ScreenLayout (activity bar items, panel content rows)
  • Migrate GTK sidebar from native widgets to DrawingArea rendering from ScreenLayout data (or keep widgets but drive them from shared data)
  • Migrate GTK/Win-GUI tab bar and status bar clicks to use shared hit regions
  • Ensure all 3 backends produce visually consistent sidebars

Dependencies

Acceptance

A change to sidebar panel rendering or click logic in render.rs / engine/ should work in all backends without per-backend fixes. Testing in one backend gives high confidence for the others.

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

    coordTracked by coord-tui pipelineinfrastructureBuild, CI, distributionstatus:readyRefined and ready to enter the work pipeline

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions