Skip to content

TUI: migrate to quadraui ShellApp + run_with_shell (mirrors #493's GTK migration) #595

Description

@JDonaghy

EPIC — parent/tracking issue

Milestone: #9 TUI ShellApp Migration (TUI counterpart to #8 GTK ShellApp Event Dispatch; carved out of #7 Platform-Neutral to keep it bounded).

This is the single largest remaining architectural divergence between the two backends. tui_main::run() (src/tui_main/mod.rs:635) hand-rolls raw-mode/alt-screen bootstrap, ratatui::Terminal construction, and frame timing, then calls one event_loop() (:787, ~2,100 lines) with 32 dispatch sites fused into a single loop { }. None of it goes through quadraui::tui::run / run_with_shell. This epic migrates it onto quadraui::ShellApp + tui::shell_runner::run_with_shell, mirroring GTK's landed #493 migration, so quadraui owns the loop and App only implements setup/render_content/handle/tick. Per GOALS.md, cross-backend divergence is the direct cause of most GTK:/TUI: bug pairs — deleting event_loop() (Stage 6) is the payoff.

Scoping (Stage 0) found this is GTK-B.5-scale, not a quick pick — GTK's equivalent took 9 (B.5) + 13 (B.5b) stages. The three structural gaps and the full staged plan are recorded in PLAN.md ("Staged plan") and the src/tui_main/shell_app.rs module doc.

Migration status

Stage Issue Scope Status
0 (this issue) Dormant TuiShellApp scaffold — setup/tick fully ported, handle partial (accelerators + menu intercept), render_content stubbed; not wired to live entry point ✅ landed 2026-07-23 (branch issue-595-tui-migrate-to-quadraui-shellapp-run-wit)
1 #600 Paint centralization — route rasteriser calls through Backend::draw_*, collapse enter_frame_scope ✅ landed
2 #601 render_content paints for real through &mut dyn Backend — editor windows + tab bars/breadcrumbs into main_content_bounds ⬜ pending (after #600)
2a #607 render_content: paint sidebar panel content (explorer/git/search/debug/settings/ext/AI panels) into sidebar_content_bounds ⬜ pending (after #601)
2b #608 render_content: paint quickfix + bottom panel (terminal/debug output) ⬜ pending (after #601)
2c #609 render_content: window/group dividers, tab-drag overlay, tab-hover tooltip ⬜ pending (after #601)
3 #602 Wire handle mouse dispatch — consume quadraui#467 (DragState/ModalStack accessor) ⬜ pending (after #600/#601)
4 #603 Wire remaining handle key dispatch (dialog/palette/completion/context-menu + #318 Alt-reveal shim) ⬜ pending (after #600/#601)
5 #604 Apply editor cursor placement — consume quadraui#466 ⛔ blocked on quadraui#466 (after #601)
6 #605 Cutover main.rs/tui_bin.rs to run_with_shell; delete event_loop() ⬜ pending (after #602-#604, #607-#609)

Stages 2a/2b/2c were split out while scoping #601: render_content genuinely
cannot reach a raw ratatui::Frame/Buffer (confirmed via TuiBackend's
frame-scope internals — no public accessor exists), so #601 only wires the
subset already reachable through &mut dyn quadraui::Backend trait calls
(editor + tab/breadcrumb bars) and leaves sidebar content, quickfix/bottom
panel, and divider/drag/tooltip painting as explicit follow-ons. All three
block #605 — cutover can't delete event_loop() while those stay unpainted
without violating this epic's own "no change to what gets rendered" non-goal.

Supply-side (quadraui) dependencies

Non-goals

  • No change to what gets rendered or how panels look — pure event-loop/entry-point restructuring.
  • Not waiting on macOS support to start.

References

Dispatch note (2026-08-05)

Work order

Sub-issues

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 requestepicEpic / parent tracking issue for a milestone

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions