Skip to content

#595 Stage 1 — TUI paint centralization: route rasteriser calls through Backend::draw_*, collapse enter_frame_scope #600

Description

@JDonaghy

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

  1. 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.
  2. 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.

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 pipelineenhancementNew feature or requestinfrastructureBuild, CI, distributionstatus:readyRefined and ready to enter the work pipeline

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions