Part of epic #595 (TUI -> quadraui ShellApp/run_with_shell migration), milestone #9 TUI ShellApp Migration. Stage 1 of the Stage 1-6 work order documented on #595.
Goal
Make the TUI paint path callable through &mut dyn Backend (the only thing ShellApp::render_content ever receives), without changing what is rendered. Pure threading/refactor; the live event_loop() keeps working throughout (Path A style).
Scope
Sweep src/tui_main/render_impl.rs (~2427 lines) + src/tui_main/panels.rs (~1570 lines):
- Convert free-rasteriser calls to trait methods. Several sites (editor, toast stack, drop overlay, tooltip, dialog, context menu, find/replace) call quadraui's free rasteriser functions directly on
frame.buffer_mut() instead of the equivalent Backend::draw_* trait method that already exists and works through &mut dyn Backend. Swap the call site, not the logic — same underlying function either way.
- Collapse
enter_frame_scope. The ~30 backend.enter_frame_scope(frame, ...) / set_current_theme call sites should collapse to one entry, made by each of event_loop()'s two terminal.draw(|frame| ...) closures.
Why
render_content(&self, backend: &mut dyn Backend, ...) never gets a raw ratatui::Frame; the direct-frame.buffer_mut() calls and per-site frame-scope entry are the concrete blockers to painting through the trait (gap 1 in src/tui_main/shell_app.rs module doc). This stage is valuable independently of #595 and is a prereq for Stage 2.
Acceptance
- No behavior/visual change;
cargo test --no-default-features stays green (pure threading).
- No remaining direct
frame.buffer_mut() rasteriser calls in render_impl.rs/panels.rs; enter_frame_scope entered once per draw closure.
Dependencies
None. Unblocks Stage 2. Refs: PLAN.md "Staged plan" Stage 1; shell_app.rs module-doc gap 1.
Part of epic #595 (TUI -> quadraui
ShellApp/run_with_shellmigration), milestone #9 TUI ShellApp Migration. Stage 1 of the Stage 1-6 work order documented on #595.Goal
Make the TUI paint path callable through
&mut dyn Backend(the only thingShellApp::render_contentever receives), without changing what is rendered. Pure threading/refactor; the liveevent_loop()keeps working throughout (Path A style).Scope
Sweep
src/tui_main/render_impl.rs(~2427 lines) +src/tui_main/panels.rs(~1570 lines):frame.buffer_mut()instead of the equivalentBackend::draw_*trait method that already exists and works through&mut dyn Backend. Swap the call site, not the logic — same underlying function either way.enter_frame_scope. The ~30backend.enter_frame_scope(frame, ...)/set_current_themecall sites should collapse to one entry, made by each ofevent_loop()'s twoterminal.draw(|frame| ...)closures.Why
render_content(&self, backend: &mut dyn Backend, ...)never gets a rawratatui::Frame; the direct-frame.buffer_mut()calls and per-site frame-scope entry are the concrete blockers to painting through the trait (gap 1 insrc/tui_main/shell_app.rsmodule doc). This stage is valuable independently of #595 and is a prereq for Stage 2.Acceptance
cargo test --no-default-featuresstays green (pure threading).frame.buffer_mut()rasteriser calls inrender_impl.rs/panels.rs;enter_frame_scopeentered once per draw closure.Dependencies
None. Unblocks Stage 2. Refs: PLAN.md "Staged plan" Stage 1;
shell_app.rsmodule-doc gap 1.