fix: eliminate flash frame between step transitions#567
Conversation
- Remove s.stop() from addAppStep success path so the spinner persists through the async markStep call instead of leaving an empty frame - Add setInitSpinner() to renderInitOnboardingFrame so any running spinner is cleared atomically with the step transition - Move "accessible to all members" info to step 2 where it persists
📝 WalkthroughWalkthroughThis PR reorganizes the onboarding spinner and logging behavior by centralizing spinner state management into Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/init/command.ts (1)
1075-1086:⚠️ Potential issue | 🟠 MajorStop the spinner when
markStepfails after a successful app add.If app creation succeeds but
markStep(...)throws, the spinner remains active while the error propagates, leaving stale spinner UI on failure exit.Suggested fix
try { await addAppInternal(currentAppId, options, organization, true) } catch (innerError) { s.stop(`App add failed ❌`) throw innerError } - await markStep(organization.gid, apikey, 'add-app', currentAppId) - return currentAppId + try { + await markStep(organization.gid, apikey, 'add-app', currentAppId) + return currentAppId + } + catch (markError) { + s.stop('Could not save onboarding progress ❌') + throw markError + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/init/command.ts` around lines 1075 - 1086, The spinner started via pSpinner() (variable s) is stopped only on addAppInternal errors; if markStep(organization.gid, apikey, 'add-app', currentAppId) throws after a successful add, the spinner remains active — ensure s.stop() is always called by wrapping the markStep call (and the return) in a try/catch/finally or by adding a try around markStep that calls s.stop() in both success and error paths; reference pSpinner(), s, addAppInternal, markStep, organization.gid, apikey, and currentAppId when making the change so the spinner is stopped before propagating any error or returning the currentAppId.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/init/command.ts`:
- Around line 1075-1086: The spinner started via pSpinner() (variable s) is
stopped only on addAppInternal errors; if markStep(organization.gid, apikey,
'add-app', currentAppId) throws after a successful add, the spinner remains
active — ensure s.stop() is always called by wrapping the markStep call (and the
return) in a try/catch/finally or by adding a try around markStep that calls
s.stop() in both success and error paths; reference pSpinner(), s,
addAppInternal, markStep, organization.gid, apikey, and currentAppId when making
the change so the spinner is stopped before propagating any error or returning
the currentAppId.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7df5c782-a7c4-44b5-bb74-caf0e21f4cf1
📒 Files selected for processing (2)
src/init/command.tssrc/init/ui.ts



Summary
s.stop()fromaddAppStepsuccess path — spinner persists through the asyncmarkStepcall instead of leaving an empty frame that Ink renderssetInitSpinner()torenderInitOnboardingFrameso any running spinner is cleared atomically withclearInitLogs()+setInitScreen()on step transitionTest plan
node dist/index.js ithrough app add — no flash between step 1 completing and step 2 appearing✅ App <id> added — accessible to all members of your organizationpersistentlySummary by CodeRabbit