Summary
Wire the GTK backend to use the SC panel's SidebarSystem (engine layer on #321, TUI on #339), then remove dead code.
What changes
Rendering (gtk/draw.rs)
Replace source_control_to_tree_view() + draw_tree() with populate_sc_sidebar_system() + sidebar.render().
Event routing (gtk/mod.rs)
- Key routing (~line 5566): Replace
handle_sc_key() with dispatch_sc_sidebar_key_unified().
- Click (~line 9012): Keep header/commit/button hit zones. Replace the ~60-line section accumulator walk with
handle_sc_sidebar_ui_event().
- Wire
wire_da_events for the SC DrawingArea → Msg::ScSidebarEvent(UiEvent).
Cleanup (after both backends wired)
- Remove
sc_selected, sc_sections_expanded, sc_has_focus from Engine.
- Remove
sc_flat_len(), sc_flat_to_section_idx(), sc_visual_row_to_flat().
- Remove
source_control_to_tree_view() from render.rs.
- Slim
SourceControlData — remove sections_expanded, selected, has_focus.
- Update
accessors.rs (sidebar_has_focus/clear_sidebar_focus), keys.rs (line 217 gate).
- Remove all
#[allow(dead_code)] from the new SidebarSystem methods.
- Gate win-gui references behind
#[cfg(feature = "win-gui")].
- Update SC tests to use SidebarSystem state.
Key files
src/gtk/draw.rs, src/gtk/mod.rs — GTK rendering + events
src/core/engine/mod.rs — remove old fields
src/core/engine/source_control.rs — remove old helpers
src/core/engine/accessors.rs, keys.rs, buffers.rs, ext_panel.rs — update refs
src/render.rs — remove source_control_to_tree_view
src/core/engine/tests.rs — update SC tests
Prereqs
Testing
cargo test --no-default-features — all tests pass
cargo clippy -- -D warnings — clean (no dead_code allows remain)
- Smoke test GTK: same interactions as TUI, plus mouse hover on buttons, double-click, scrollbar drag
Summary
Wire the GTK backend to use the SC panel's
SidebarSystem(engine layer on #321, TUI on #339), then remove dead code.What changes
Rendering (
gtk/draw.rs)Replace
source_control_to_tree_view()+draw_tree()withpopulate_sc_sidebar_system()+sidebar.render().Event routing (
gtk/mod.rs)handle_sc_key()withdispatch_sc_sidebar_key_unified().handle_sc_sidebar_ui_event().wire_da_eventsfor the SC DrawingArea →Msg::ScSidebarEvent(UiEvent).Cleanup (after both backends wired)
sc_selected,sc_sections_expanded,sc_has_focusfrom Engine.sc_flat_len(),sc_flat_to_section_idx(),sc_visual_row_to_flat().source_control_to_tree_view()from render.rs.SourceControlData— removesections_expanded,selected,has_focus.accessors.rs(sidebar_has_focus/clear_sidebar_focus),keys.rs(line 217 gate).#[allow(dead_code)]from the new SidebarSystem methods.#[cfg(feature = "win-gui")].Key files
src/gtk/draw.rs,src/gtk/mod.rs— GTK rendering + eventssrc/core/engine/mod.rs— remove old fieldssrc/core/engine/source_control.rs— remove old helperssrc/core/engine/accessors.rs,keys.rs,buffers.rs,ext_panel.rs— update refssrc/render.rs— removesource_control_to_tree_viewsrc/core/engine/tests.rs— update SC testsPrereqs
Testing
cargo test --no-default-features— all tests passcargo clippy -- -D warnings— clean (no dead_code allows remain)