feat(dash): braille progress spinner in the job console - #91
Conversation
Job output was forwarded verbatim, so carriage-return progress redraws (pip/tqdm/huggingface) accumulated into one long horizontal line. Keep only the segment after the last CR at ingest, and show an animated braille spinner plus the parsed percentage in the running-job header, driven by a per-tick counter on the ~250ms repaint loop. Adds a pure `ui::spinner` module (frame + percent parsing) with unit tests and a CR-collapse test. Signed-off-by: Michael Roy <michael.roy@amd.com>
rominf
left a comment
There was a problem hiding this comment.
LGTM. Spinner/percentage edge cases are correct — out-of-range and malformed % ("1.2.3%", bare %, "250% load") all resolve to None with no panics, and modulo frame indexing (tick % 10, wrapping_add) is safe. All draw_job_console call sites and both AppState struct-literal sites are updated, new ui/spinner.rs carries the correct MIT SPDX header, and both helpers are unit-tested.
Minor (non-blocking): job_console.rs rescans the output ring each frame for a trailing % — bounded (~1000 cheap ops at ~4 Hz), so fine. Also note last_cr_segment now drops pre-\r content for all emitted lines, not just progress lines — the intended terminal-redraw tradeoff.
Approving.
|
🔴 Automated review · pr-review-watcher · e80f8b8 SummaryCollapses 🚫 Blocking (must fix before merge)None. Non-blocking
|
Integrate parent PR #91 (braille progress spinner in the job console), now merged to main as 63b5864, with PR #92's scrollbar + click-and-drag support. Sole conflict in crates/rocm-dash-tui/src/ui/job_console.rs was the draw_job_console doc comment: kept #92's line documenting the returned scrollbar handles. The function body composes both behaviors — the running-job spinner/percentage header (#91) and the vertical/horizontal scrollbar rendering that returns Vec<ScrollbarHandle> for mouse hit-testing (#92). The ui/mod.rs callsite (auto-merged) passes tick_count and records the returned handles for drag hit-testing. Signed-off-by: Michael Roy <michael.roy@amd.com>
What
Long-running job output was forwarded verbatim, so carriage-return progress redraws (pip / tqdm / huggingface) piled up into one long horizontal line in the job console.
\rat ingest (jobs::last_cr_segment), collapsing a redraw sequence to its final visible state.⠋⠙⠹…) plus the parsed percentage in the running-job status header, driven by atick_countadvanced on the existing ~250ms repaint loop.ui::spinnermodule (spinner_frame+parse_progress_pct).Tests
ui::spinner::tests: frame cycling, percent parsing (incl. rejection of out-of-range / bare%).jobs::tests: CR-collapse + plain-line passthrough.--test-threads=1), clippy-D warningsclean.Notes
Part 1 of 3 for today's dash UX work. The scrollbars PR is stacked on this branch (shared job-console render path).