Summary
Wire the TUI backend to use the SC panel's SidebarSystem (added in the engine layer commit on #321).
What changes
Rendering (tui_main/panels.rs)
Replace the source_control_to_tree_view() + draw_tree() call in render_source_control() with:
engine.sc_sidebar_body_rect.set(q_rect)
render::populate_sc_sidebar_system(engine, theme)
engine.sc_sidebar_system.borrow().render(b, q_rect)
Header, commit input, and button rows remain unchanged.
Key routing (tui_main/mod.rs)
Replace the ~80-line manual key mapping block (lines 2865–2948) with:
let result = engine.dispatch_sc_sidebar_key_unified(key_str, ctrl, unicode);
if matches!(result, ScKeyResult::Unfocused) {
sidebar.has_focus = false;
}
Mouse handling (tui_main/mouse.rs)
- Scroll (~line 1234): Replace
sc_selected ± 3 with scroll UiEvent through handle_cached.
- Click (~line 2478): Replace manual
sc_visual_row_to_flat + sc_selected assignment with click UiEvent through handle_cached + dispatch_sc_sidebar_event(). Keep header/commit/button hit-testing.
Key files
src/tui_main/panels.rs — SC render
src/tui_main/mod.rs — SC key routing
src/tui_main/mouse.rs — SC scroll + click
Prereqs
Testing
cargo test --no-default-features — all tests pass
- Smoke test TUI: navigate j/k, Tab collapse, s/S stage, d discard, c commit, Enter open, q/Esc unfocus, mouse scroll/click, branch picker b/B
Summary
Wire the TUI backend to use the SC panel's
SidebarSystem(added in the engine layer commit on #321).What changes
Rendering (
tui_main/panels.rs)Replace the
source_control_to_tree_view()+draw_tree()call inrender_source_control()with:engine.sc_sidebar_body_rect.set(q_rect)render::populate_sc_sidebar_system(engine, theme)engine.sc_sidebar_system.borrow().render(b, q_rect)Header, commit input, and button rows remain unchanged.
Key routing (
tui_main/mod.rs)Replace the ~80-line manual key mapping block (lines 2865–2948) with:
Mouse handling (
tui_main/mouse.rs)sc_selected ± 3with scroll UiEvent throughhandle_cached.sc_visual_row_to_flat+sc_selectedassignment with click UiEvent throughhandle_cached+dispatch_sc_sidebar_event(). Keep header/commit/button hit-testing.Key files
src/tui_main/panels.rs— SC rendersrc/tui_main/mod.rs— SC key routingsrc/tui_main/mouse.rs— SC scroll + clickPrereqs
Testing
cargo test --no-default-features— all tests pass