tui: premium loading + error polish; restore multi-line pull layer log#63
Closed
deveshctl wants to merge 3 commits into
Closed
tui: premium loading + error polish; restore multi-line pull layer log#63deveshctl wants to merge 3 commits into
deveshctl wants to merge 3 commits into
Conversation
Loading screen now shows an elapsed timer and a three-step Pull -> Export -> Parse rail with per-phase glyphs (down arrow, filled square, equiv, check). Cache hits hold a brief 'loaded from cache' line with 'ready in 0.3s' readout so warm runs are visibly cached rather than blinking past. Error screen renders inside a bordered panel matching the loading screen, with a recovery hint when one is obvious. Daemon-unreachable errors (both TUI and CLI paths) suggest passing a saved archive path instead. File viewer loading screen mirrors the main loading vocabulary: phase glyph, target path (mid-truncated for long paths), elapsed time, and a 'Press Esc to close' hint. Binary and empty file empty states lead with a glyph and the same close hint. Status bar pins ? help to the rightmost slot in every focus mode and collapses to its key alone when space is tight. Transient status messages now colour-code by outcome: green for success (Copied!, Saved:, Jumped), red for errors.
ineffassign flagged the throwaway first := initial value before the if/else overwrote it. Declare as var and assign in branches.
…layer log The loading and error panels both kept their content fixed against the left border with a hard-coded two-space indent. The surrounding panel was centered on screen, but the title, stepper, hints, and pull detail all rendered flush-left inside it — a visible regression once the premium border landed. Center every rendered row inside its panel via a new display-width-aware helper, drop the manual indentation, and let the panel grow to fit its own content rather than reserving a fixed 12/9-row floor. While in there, restore the multi-line pull progress log the same polish pass had collapsed to a single line. As LayersDone steps forward the model now appends one snapshot per newly-completed layer, capped at five visible rows so a 100-layer pull cannot push the panel off-screen. Completed rows render dim with a full bar; the in-flight layer renders in accent with live progress. Existing pull-progress invariants (bytes-total never clipped, panel width never exceeds the terminal, bar dropped below four cells) are preserved. Stepper rail, elapsed timer, phase glyphs, cache-hit hold, CLI recovery hints, narrow-terminal protections, progress-width clamping, file-viewer loading screen, status-bar color system, and overlay/full-screen exit vocabulary all behave unchanged.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Owner
Author
|
Closing for now — the error-polish work here overlaps with the just-merged #77 and the branch conflicts with main. Will remake against current main later. |
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.
Premium polish pass for the TUI loading and error screens, plus restoration of the multi-line pull progress log.
What changed
Loading screen layout — centered content
Both the loading and error panels were wrapped in a centered border, but the content inside (title, stepper, pull detail, hints) used a hard-coded two-space indent and rendered flush-left. The fix introduces a display-width-aware
centerLinehelper, drops the manual indentation, and lets each panel grow to fit its own content rather than reserving a fixed minimum height. Result: every row sits on the panel midline.Multi-line pull progress log
Earlier polish work collapsed the pull progress to a single overwritten line. This restores the running history: as
LayersDoneadvances, the model appends one snapshot per newly-completed layer, rendered dim with a full bar above the in-flight layer (accent, live progress). Capped at five visible rows so a 100-layer pull cannot push the panel off-screen. Falls back gracefully when the daemon reports no byte totals.Error panel — same centering treatment
✕ Errortitle, error body, recovery hint, and exit hint all align to the panel midline. Recovery hints forErrDaemonNotRunningandErrNoEngineFoundare preserved verbatim.What stays the same
Every premium-polish behaviour shipped on this branch is preserved end-to-end: the stepper rail, the
elapsed M:SStimer, per-phase glyphs (↓ ▣ ≡ ✓), the cache-hit hold (~300 ms withready in 0.Xs), the file-viewer loading/binary/empty states, the?-pinned status bar with success/error colour coding, the CLI recovery hints, the narrow-terminal protections (panel never exceeds terminal width, bytes-total never mid-truncated, progress bar dropped below 4 cells), and the consistent exit vocabulary (Press q or Esc to exit.on full-screen states,Press Esc to closeon overlays).Tests added
TestViewLoadingLayerLogShowsMultipleLines— multipleLayer N/rows plus the in-flight row appear together.TestViewLoadingContentCentered— at width 80, the◆ layerxtitle has meaningful leading padding.TestPullLayerLogAppendsOnLayersDoneIncrease— drivesprogressMsgupdates and verifies snapshots accumulate (including a 1→3 jump appending two entries in order).TestViewErrorContentCentered— the✕ Errortitle is not flush-left.All existing loading, error, status-bar, file-viewer, and progress-bar tests still pass.
Verification
Verified against a real Docker daemon (multi-layer pull, cache hit, cache bypass with
--no-cache), against an OCI / docker-save archive, and under daemon-down conditions to exercise the error path. Cross-compile matrix and unit tests are green on CI for linux/darwin/windows × amd64/arm64.