fix(login): keep the browser-login note inside the terminal width (v1.56.1) - #196
Merged
Conversation
….56.1) clack's `note` measures the longest line, pads every line to it and draws the border there. It never wraps and never clamps to the window, so the auth URL - which grew from ~70 to ~330 characters when the install context was added - rendered a box wider than the terminal, which then folded into ragged garbage. The URL now prints as a bare line outside the box, where the terminal soft-wraps it and it stays one copy-pasteable string. Everything that does go in the box is hard-wrapped to the window first, so a deep project path or a long harness list cannot blow it out either. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The count moves to 750+ everywhere it is stated: help text, the copy-paste agent blurb, the guide, the onboarding copy, the skill file and the README. The `one init` banner was `pc.yellow`; it is now the brand lime (#CCFF00). picocolors has no truecolor helper, so `lime()` writes the 24-bit escape itself, gated on picocolors' own colour detection so a piped stdout and NO_COLOR still come out clean, and falling back to green on a terminal that does not advertise truecolor. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Summary
one loginandone init --auth browserdrew a box far wider than the terminal, which the terminal then folded into ragged lines.The cause is in
@clack/prompts:notemeasures the longest line, pads every line out to it, and draws the border there. It never wraps and never clamps to the window. v1.56.0 put the auth URL inside that box, and the same release grew the URL from about 70 characters to about 330 by adding the install context, so the box became roughly 330 columns wide.Two changes:
wrapForNote. The URL was the worst offender but not the only one: a deep project path, or the harness list on a machine with several agents installed, would each overflow an 80-column window on their own.The note's title is shortened too, since clack folds the title into the same width calculation and never wraps it.
Before, on this machine: a 330-column box. After: 75 columns, with the URL on its own line.
Agent mode is unchanged: it still writes the URL to stderr and never boxes anything.
Also in this PR
loginandinit,one guide, the onboarding copy,skills/one/SKILL.mdand the README.one initbanner is the brand lime (#CCFF00) instead of yellow. picocolors has no truecolor helper, solime()writes the 24-bit escape itself. It is gated on picocolors' own colour detection, so a piped stdout orNO_COLORstill prints the banner plain, and it falls back to green on a terminal that does not advertise truecolor. Verified all three: 10 lime escapes on a truecolor TTY, 0 escapes when piped, green whenCOLORTERMis unset.Test plan
wrapForNotegains three cases insrc/commands/login.test.ts: wrapping at a space, leaving short and blank lines alone, and hard-cutting a run with no space in it so a long path still fits.npm run typecheckandnpm run buildpass.npm testis 531 passing; the 6 failures are the pre-existingresolveConfigcases insrc/lib/config.test.tsthat fail on macOS because the temp dir resolves/varvs/private/var. They fail onmaintoo and are untouched here.init --auth browser --projectagainst a sandboxedONE_HOMEand measured the output: every boxed line is 75 columns.Version bumped to 1.56.1 (patch); the lockfile carries the two version fields only, hand-edited per the repo's lockfile rule.
🤖 Generated with Claude Code