Skip to content

tui: premium loading + error polish; restore multi-line pull layer log#63

Closed
deveshctl wants to merge 3 commits into
mainfrom
feat/tui-premium-polish
Closed

tui: premium loading + error polish; restore multi-line pull layer log#63
deveshctl wants to merge 3 commits into
mainfrom
feat/tui-premium-polish

Conversation

@deveshctl

Copy link
Copy Markdown
Owner

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 centerLine helper, 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 LayersDone advances, 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.

Layer 1/12 [━━━━━━━━] 0.4 / 4.7 GB
Layer 2/12 [━━━━━━━━] 0.9 / 4.7 GB
Layer 3/12 [━━━━━━━━] 1.2 / 4.7 GB
Layer 4/12 [━━━━━━  ] 1.4 / 4.7 GB

Error panel — same centering treatment
✕ Error title, error body, recovery hint, and exit hint all align to the panel midline. Recovery hints for ErrDaemonNotRunning and ErrNoEngineFound are 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:SS timer, per-phase glyphs (↓ ▣ ≡ ✓), the cache-hit hold (~300 ms with ready 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 close on overlays).

Tests added

  • TestViewLoadingLayerLogShowsMultipleLines — multiple Layer N/ rows plus the in-flight row appear together.
  • TestViewLoadingContentCentered — at width 80, the ◆ layerx title has meaningful leading padding.
  • TestPullLayerLogAppendsOnLayersDoneIncrease — drives progressMsg updates and verifies snapshots accumulate (including a 1→3 jump appending two entries in order).
  • TestViewErrorContentCentered — the ✕ Error title 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.

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-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 79.56656% with 66 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
tui/model.go 79.35% 43 Missing and 15 partials ⚠️
tui/fileview.go 77.77% 4 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

@deveshctl

Copy link
Copy Markdown
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.

@deveshctl deveshctl closed this Jul 12, 2026
@deveshctl deveshctl deleted the feat/tui-premium-polish branch July 12, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants