fix(ui): print next steps before animating the "Next steps" header#343
fix(ui): print next steps before animating the "Next steps" header#343rafa-thayto wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 4cd15ff The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Review limit reached
More reviews will be available in 55 minutes and 49 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
wyattjoh
left a comment
There was a problem hiding this comment.
Clean, well-tested fix for the lone "Next steps" header. One edge case worth noting around tall bodies and terminal scrolling, but it does not regress the prior behavior.
animateHeader redrew only the header line in place, so the 'Next steps' header shimmered alone for the duration of the animation while the steps printed only afterward, making it look hung. Print the whole block up front, then step the cursor back up to sweep the header in place. Covers clerk link, clerk auth login, clerk init, and clerk deploy next-steps.
The cursor-up escape that repositions the header only works when the block fits on screen without scrolling. With a tall next-steps body (~27 lines for deploy), a short terminal scrolls the buffer and the cursor-up no longer lands on the header, corrupting the output. Guard against this by comparing rowsBelow against process.stderr.rows before entering the animation path.
b9c96ef to
4cd15ff
Compare
Summary
The glimmering "Next steps" header animated by redrawing only its own line in place (
\r\x1b[K) for ~450ms, and every caller printed the actual steps after the animation finished. The result was a lone, shimmering "Next steps" with nothing under it — it looked hung/broken.animateHeadernow takes an optionalbody: it prints the whole block (header + steps) up front so everything is visible immediately, then steps the cursor back up to the header and sweeps the highlight in place, restoring the cursor below the block. Backward compatible — without abodyit behaves exactly as before.Wired through the two call sites:
spinner.outro([steps])(coversclerk link,auth login,init, and any gutter next-steps) andclerk deploy.log.applyPrefixis exported so the deploy body keeps its gutter prefix.Verified the real escape sequence ordering:
Test plan
gradient.test.ts: body printed in one write (non-interactive); body rendered before the first in-place redraw with correct cursor up/down (interactive)spinner.test.ts, deploy tests pass; non-interactive /NO_COLOR/ piped output unchanged (single flat write, no cursor escapes)