feat(tui): Batch 1 — event bus, AppState, two-panel layout, -T flag - #57
Merged
Conversation
Adds the full scaffold for `Run -T`: - Source/Struct/Event.rs — typed event enum (JobStarted, Line, JobFinished, AllDone) - Source/Struct/Tui.rs — AppState: panel list, log buffers, status, selection, tick - Source/Fn/Tui/mod.rs — terminal init/restore guard + main app loop (crossterm + ratatui) - Source/Fn/Tui/Render.rs — two-panel layout: dir list (left) + log viewer (right) - Source/Fn/Tui/Input.rs — keyboard + mouse click dispatch - Source/Fn/Binary/Command/Sequential.rs — inject Sender<Event>, remove direct println/eprintln - Source/Fn/Binary/Command/Parallel.rs — inject Sender<Event>, remove direct println/eprintln - Source/Fn/Binary/Command.rs — add -T / --Tui flag - Source/Struct/Binary/Command.rs — wire Tui flag through Option and dispatch to Tui::Fn - Source/Struct/Binary/Command/Option.rs — add Tui: bool field - Source/Fn/mod.rs — pub mod Tui - Source/Struct/mod.rs — pub mod Event + Tui - Cargo.toml — add ratatui, crossterm, unicode-width under [tui] feature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Batch 1 — Minimal TUI scaffold
This PR is the first incremental batch toward
Run -T. Everything compiles against the existing codebase with zero behaviour change to the plain CLI path.What changed
Source/Struct/Event.rsJobStarted,Line,JobProgress,JobFinished,IndexLockTimeout,AllDone)Source/Struct/Tui.rsAppState,DirState,Statusenum,SPINNERframes, all nav/scroll helpersSource/Fn/Tui/mod.rsSource/Fn/Tui/Render.rsSource/Fn/Tui/Input.rsSource/Fn/Binary/Command/Sequential.rsSender<Event>, removes allprintln!/eprintln!Source/Fn/Binary/Command/Parallel.rsSource/Fn/Binary/Command.rs-T/--Tuiclap flagSource/Struct/Binary/Command/Option.rsTui: boolfieldSource/Struct/Binary/Command.rsmpscchannel, dispatches toTui::Fnor plain printerSource/Fn/mod.rspub mod TuiSource/Struct/mod.rspub mod Event; pub mod TuiCargo.tomlratatui = "0.29",crossterm = "0.28"How to test locally
Key design decisions
mpsc::unbounded_channel::<Event>.tokio::spawnthat callsprintln!/eprintln!— exact same observable output as before.ratatui/crosstermare unconditional dependencies (not feature-gated) to keep the PR minimal; feature-gating can be a follow-up.TerminalGuardensures the terminal is always restored even on panic.Next batches
rkeypress (daemon-like re-queue), exact click coordinates viaareathreading