Skip to content

feat(cli): polish installation and upgrade progress UI - #66

Open
yan-ad wants to merge 1 commit into
Blankeos:mainfrom
yan-ad:feat/install-upgrade-ui
Open

yan-ad wants to merge 1 commit into
Blankeos:mainfrom
yan-ad:feat/install-upgrade-ui

Conversation

@yan-ad

@yan-ad yan-ad commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Beautify installation and crabcode upgrade output using the supplied terminal reference: compact current/target version labels, whitespace, and an amber block/dotted progress row. Based directly on upstream main (bf5c111), independent of plugin PR #25.

  • Shell/npm downloads show measured progress when size is known; unknown duration upgrades show Working rather than a fabricated percentage.
  • Respect terminal width, NO_COLOR, TERM=dumb, and redirected output. Diagnostics stay on stderr; no alternate screen or cursor hiding.
  • Keep in-app background upgrades captured and silent.
  • Replace the stale Bash/cargo-first root install.sh with a POSIX prebuilt installer using real release archive names, SHA256 verification, staged atomic binary replacement, and installation receipts.
  • Preserve flat/custom install destinations and historical cargo-dist cargo-home layouts. Reject mismatched receipts and invalid versions, and never silently substitute the latest release for a requested version.
  • Drain npm download streams correctly, report truncation/write errors, and close progress on failure.
  • Add just test-upgrade-ui; extend just test-release with shell installer coverage.

UI preview (plain-text structure)

Installed version: 0.0.14

Installing crabcode version: 0.0.15
鈻堚枅鈻堚枅鈻堚枅鈻堚枅..........................................  17%

This is a layout illustration, not a claim that v0.0.15 was installed. Package-manager upgrades use an indeterminate Working row because those tools do not expose a reliable end-to-end completion percentage. Existing cargo-dist-generated release installer assets are not rewritten.

Validation

  • cargo fmt --all -- --check, git diff --check, cargo check: pass.
  • cargo test --bin crabcode upgrade:: -- --test-threads=1: 25 pass.
  • bun test --timeout 30000 scripts/release-workflow.test.ts scripts/install-ui.test.ts npm/install.test.js: 80 pass. An initial final rerun hit Bun's default 5-second test deadline under concurrent builds; the bounded 30-second rerun passed.
  • cargo build --bin crabcode + bun test scripts/upgrade-ui.test.ts: 13 pass; exercises the compiled CLI in real PTYs and isolated install fixtures.
  • node --test npm/install.test.js: 13 pass.
  • Prettier check for changed JS/TS and sh -n install.sh: pass.
  • Real GitHub v0.0.14 release installed in a disposable directory, checksum verified, and --version confirmed. Host installation untouched.

Full serial Rust unit suite: 1,844 passed, 1 failed, 3 ignored. The failure is ui::components::chat::tests::test_edit_tool_renders_codex_style_diff_summary, which hardcodes /Users/carlo/Desktop/Projects/crabcode/README.md and expects a relative filename on this checkout. The chat source is unchanged in this PR; the same failure was reproduced on unmodified upstream bf5c111 in a separate worktree. Not claiming a globally green suite.

Design audit and limits

Audited after implementation as requested. No further design changes requiring approval: inherited terminal theme, one amber accent, no panels/badges/decorative emoji, actual loading/error/no-op states, and bounded progress widths. Terminal palettes are user-controlled, so universal color contrast cannot be guaranteed; NO_COLOR is supported.

Runtime tested on macOS. Linux/Windows execution and OS-signal cancellation during a download were not specifically exercised. No dependencies added. Do not merge automatically.

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.

1 participant