Skip to content

fix(setup,sync): 1.0 polish round 2 — layout, completion handoff, cancel audit#44

Merged
mswdev merged 2 commits intodevelopfrom
fix/setup-1.0-polish-round-2
May 5, 2026
Merged

fix(setup,sync): 1.0 polish round 2 — layout, completion handoff, cancel audit#44
mswdev merged 2 commits intodevelopfrom
fix/setup-1.0-polish-round-2

Conversation

@mswdev
Copy link
Copy Markdown
Owner

@mswdev mswdev commented May 5, 2026

Summary

Round 2 of post-launch polish, addressing things found in a real user dry-run of ckipper setup. Three parallel investigation agents covered: prompt cancel audit, detected-config layout redesign, wizard completeness review.

Issue 1 — detected configuration layout

Replaced alternating wide-row + indented description rendering with a card-style stack. Each setting becomes two lines + a blank-line separator, in dim color for the description. Long values no longer push source markers out of alignment; empty values render as (empty).

aliases_auto_source    true  (your config)
  Bool. true = installer auto-adds the per-account aliases source line to ~/.zshrc.

default_branch         develop  (your config)
  String. Fallback base branch when origin/HEAD is unset (e.g. main, develop).

Issue 2 — wizard completion handoff

5 minutes of docker build output buried the "Setup complete" message; the wizard then exited silently. Now:

  • _ckipper_setup_offer_image_build records ok/failed/skipped and a colored banner surfaces it on the completion screen.
  • Completion summary lists ckipper worktree rebuild-image, ckipper account sync, ckipper config list, ckipper doctor alongside the existing launch commands.
  • A "Press ENTER to finish setup" prompt anchors the screen (TTY-gated so CI isn't affected).

Issue 1b — per-account aliases auto-source

install.sh writes the source line; a ckipper setup re-run never did. Without it, claude-<account> launchers silently don't work. Added _ckipper_setup_offer_aliases_source with idempotency (skips if already sourced).

Issue 3 — sync-after-2nd-add

Verified by trace: _ckipper_setup_offer_initial_sync already counts accounts AFTER the add and fires when count ≥ 2. No code change.

Issue 4 — docker rebuild CLI

The dedicated command is ckipper worktree rebuild-image — now mentioned in the completion summary and the wizard help so users can find it without re-running setup.

Issue 5 — cancel propagation audit

Agent #1 audited every prompt site. Two unguarded fallback paths (CKIPPER_NO_GUM=1):

  • _ckipper_account_sync_pick_targets_fallback
  • _ckipper_account_sync_pick_types (read-fallback branch)

Both now propagate _core_prompt_input's non-zero rc on cancel. Gum-path multi-select pickers are already protected by the dispatcher's empty-array length check + SPACE/ENTER hint from PR #41.

Test plan

  • make test-unit — 520/520 shell tests pass (+10 new regressions)
  • make lint-shell lint-zsh lint-fmt lint-merge-guards — clean
  • New regressions:
    • Image build status records ok / failed / skipped
    • Completion summary mentions rebuild-image + account sync + failed-banner on failure
    • Aliases-source: skip when already present / append on accept / no write on decline
    • Sync interactive fallbacks: non-zero rc on EOF cancel
  • Manual: detected-config rendering verified against the 7 global keys

mswdev added 2 commits May 4, 2026 19:39
…cel audit

Bundled fixes for issues uncovered when the user actually walked through
`ckipper setup` end-to-end. Three parallel agents investigated cancel-
propagation across the codebase, layout redesign, and wizard
completeness; this commit synthesizes their findings.

Detected configuration layout (Issue 1)
  Replaced the alternating wide-row + indented-description rendering with
  a card-style stack: each setting renders as `<key padded> <value>
  <source>` on one line, with the schema description in dim color on the
  next, separated by blank lines. Removes the column-overflow problem
  (long values used to push the source marker out of alignment) and
  gives the eye a clear stopping point per setting. Empty values now
  render as `(empty)` instead of blank space.

Wizard completion handoff (Issue 2)
  After a 5-minute docker build the old "Setup complete" header was
  buried in scrollback and the wizard exited silently. Now:
   - `_ckipper_setup_offer_image_build` records ok/failed/skipped
     and `_ckipper_setup_print_completion_summary` renders a coloured
     banner so a failed build is impossible to miss.
   - The summary lists `ckipper worktree rebuild-image` and `ckipper
     account sync` alongside the existing get-started commands so users
     can find them later without re-running the full wizard.
   - A "Press ENTER to finish setup" prompt anchors the screen so users
     know setup is over (skipped on non-TTY for CI).

Per-account aliases auto-source (Issue 1b)
  `install.sh` appends the per-account aliases source line to ~/.zshrc,
  but a setup-only re-run never offered to. Added
  `_ckipper_setup_offer_aliases_source` with an idempotency check so
  re-runs don't duplicate the line. Without this, `claude-<account>`
  launchers silently didn't work for users who only ran `ckipper setup`.

Sync-after-2nd-add (Issue 3)
  Verified by trace: `_ckipper_setup_offer_initial_sync` correctly
  counts accounts AFTER the add and fires when count >= 2. No code
  change needed; the existing test covers this path.

Rebuild-image discoverability (Issue 4a)
  `ckipper worktree rebuild-image` is the dedicated CLI; now mentioned
  in the completion summary's Maintenance block. Help text updated to
  list every wizard step including this one.

Cancel propagation audit (Issue 5)
  Agent 1 found two unguarded sites in the sync interactive fallback
  (CKIPPER_NO_GUM=1 path):
   - `_ckipper_account_sync_pick_targets_fallback`
   - `_ckipper_account_sync_pick_types` (read fallback branch)
  Both now `|| return $?` after `_core_prompt_input` to propagate cancel.
  Other sites flagged by the audit (gum --no-limit pickers) are already
  protected by the dispatcher's empty-array length check + SPACE/ENTER
  hint added in PR #41.

Tests
  - 520/520 shell tests pass (+10 over previous baseline).
  - New regressions: image build status (ok/failed/skipped), summary
    mentions rebuild-image + sync + failed-build banner, aliases-source
    skip/append/decline, sync interactive fallback cancel propagation.
  - Lint clean.
Round 3 polish in response to user feedback that the previous card layout
"still looks bad" and that the completion screen "doesn't match the format
as the rest of the setup with the color and stuff."

Detected configuration
  Renders through `gum table -p` with a rounded border tinted to gum's
  prompt-accent pink (212), so the block visually belongs to the same
  wizard as the Yes/No prompt below it. Auto-sizes columns to longest
  value; over-long values (e.g. 50+ char filesystem paths) are
  truncated with `…` to keep the table inside narrow terminals.
  Descriptions intentionally drop out of the summary — they appear as
  labels on the pick-keys-to-customize picker (added in PR #43), where
  they matter most. A dim-text tip below the table points users there.

  Falls back to a plain key/value/source list under CKIPPER_NO_GUM (tests,
  CI, hosts without gum). Same data, no border. Loop locals hoisted out
  of the body to dodge zsh's `local var` echo-on-redeclare quirk.

Completion screen
  Wrapped in `gum style --border rounded --padding "1 2"` with a colored
  build-status row (✓ green / ✗ red / ○ dim) and bold section headers
  inside. Plain fallback path preserved for non-gum environments. Two
  sections — Getting started, Maintenance — each list 3-4 commands so
  users can find `ckipper worktree rebuild-image` and `ckipper account
  sync` without re-running the wizard.

Tests
  - 521/521 pass.
  - Replaced the "renders descriptions inline" regression with two new
    pinning the new contract: descriptions DON'T appear in the summary
    body, and the summary points users at the picker for them.
@mswdev mswdev marked this pull request as ready for review May 5, 2026 01:58
@mswdev mswdev merged commit 93afe7a into develop May 5, 2026
1 check passed
@mswdev mswdev deleted the fix/setup-1.0-polish-round-2 branch May 5, 2026 01:58
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