Skip to content

Release 0.97.0

Latest

Choose a tag to compare

@gfargo gfargo released this 05 Dec 16:11

What's Changed

0.97.0 finishes the medium-severity half of the coco ui and CLI design review that 0.96.0 started. Keys mean the same thing on every view, usage errors are one line with exit 2, and a few flags that failed or silently did nothing now work. Three key bindings moved, listed under "Keys that mean one thing".

Highlights

Keys that mean one thing

  • r is refresh on every view. Rebase-onto on the branches view moved to O, and reword in the rebase plan moved to w. Before, r opened a rebase confirm on branches and a reword prompt in the rebase plan.
  • Enter on a branch opens the compare diff against the current branch, like Enter on a commit opens its diff. On the current branch it says there is nothing to compare. Checkout moved to c.
  • D deletes the cursored item on branches, tags, stash and remotes. T, X and x still work. On an empty tags, stash or remotes list D does nothing. It used to fall through to delete-branch and aim at a branch the user wasn't looking at.
  • / opens the filter only on list views. On status, diff, conflicts, blame, file-history, compose, bisect, pull-request, changelog and rebase it says "no filter on the view".
  • Leaving a filtered list clears the filter text, so it can't narrow the view underneath.
  • Fifteen keybinding help rows lost their issue refs and design rationale and now fit in one line of 100 characters or fewer. Before, each ran up to 277 characters and truncated at 80 columns. A test rejects issue refs and long descriptions.

One-line usage errors and readable help

  • A usage error prints one line and a pointer to coco <cmd> --help, and exits 2. It used to print the full help screen and exit 1.
  • -h is an alias for --help. Command help shows the description, the command's own options, then a separate "Global options" group. Top-level help gains examples and a docs link.
  • --color and --no-color are accepted. NO_COLOR, FORCE_COLOR=0 and TERM=dumb turn color off in the plain CLI, which chalk 4 ignored.
  • The missing-key and authentication-failure messages name the provider's real environment variable and the user-level config sources that accept a key. .coco.config.json is not one of them, because it ignores credentials. They also cover local providers and Bedrock, and link the auth docs.
  • coco lint exits 2 when commits fail the --severity gate, matching coco review. Exit 1 stays for a failure of lint itself.

Flags that do what they say

  • coco commit --no-verify and --no-diff work. yargs read them as negations of flags that don't exist and failed with "Unknown argument: verify", so only --noVerify worked.
  • coco log --no-merges hides merge commits. It used to set the unrelated merges flag to false, which was already the default, and the graph kept its merges.
  • A non-numeric value for a number flag is a usage error with exit 2. log -n abc, review --severity high and watch --interval soon fell back to the default with no message.
  • A test fails when a command adds a noX option that isn't covered by the rewrite, so the next one can't regress.

Confirms and edits that stay safe

  • y is ignored for 300 ms on confirms coco raises after an async action: the force-push offer after a rejected push, force-delete, and switch to a new branch. A keystroke typed before the prompt appeared can no longer accept it.
  • r in the changelog view asks before it regenerates, like the other AI workflows.
  • Interactive coco changelog and coco recap print the text you approved or edited. Before, only the success message printed and the edit was lost. The editor prompt names the command, for example "Edit the changelog".
  • The reflog checkout confirm pins the target hash, so a refresh that prepends entries can't point y at another commit.

Frame and list stability

  • The PR view budgets rows from its fixed lines first. With five or more checks at 80x24 the checks used to take half the panel and push the footer off screen. Check names pad by display width instead of padEnd.
  • Issue and PR triage rows stay on screen while r refetches them, instead of clearing to "Loading".
  • Writes to stderr (Logger.error, console.error) show on the status line while coco ui owns the terminal, instead of drawing over the frame. A redirected stderr is left alone.
  • The status line shows the first line of a message, cut to the terminal width, with a "+N more lines" count. A new "Copy last error" palette command copies the full text of the most recent error.
  • ↑/↓, PgUp/PgDn and Home/End do nothing on an empty list view and on views that hide the history list (PR panel, bisect, changelog). They used to move the hidden history cursor and change the inspector.

Internals

  • src/lib/ui/negatedFlags.ts holds NEGATED_FLAG_KEYS and normalizeNegatedFlags, which runs on process.argv before yargs and stops at --.
  • UsageError and rejectNaN(flag) in src/lib/ui/usageFailure.ts turn a failed number coercion into a usage error. The .fail handler also treats yargs' YError as one.
  • isFilterableView and FILTERABLE_VIEWS in inkViewModel.ts decide where / works.
  • Jest transpiles tests instead of type-checking them in every suite, which halves a cold run (about 93s to 48s). A new npm run typecheck runs tsc over the source and the tests, and CI runs it.
  • Test fixtures that built git repos by hand now use @gfargo/git-scenarios 1.7, across the lib, command, agent and git view suites. Its hermetic git config runs once in jest globalSetup, so tests no longer read the developer's global git config. The slowest suites run about twice as fast (context.test.ts 36.9s to 18.3s, repoContext.test.ts 34.0s to 17.1s).
  • A release builds once, after the version bump, and verifyRelease refuses to publish a dist/ built for a different version. The duplicate lint pass and the rebuilds in the pack checks are gone.
  • Routine dependency and toolchain bumps.