Skip to content

Fix loading bar persisting on screen after task completion#7060

Draft
nickwesselman wants to merge 1 commit intomainfrom
fix/erase-loading-bar-on-exit
Draft

Fix loading bar persisting on screen after task completion#7060
nickwesselman wants to merge 1 commit intomainfrom
fix/erase-loading-bar-on-exit

Conversation

@nickwesselman
Copy link
Contributor

Summary

  • Ink 6's unmount flow renders a final frame before the React tree clears, leaving stale loading bar output (from renderTasks and renderSingleTask) visible after task completion
  • Adds an eraseOnExit option to the render() wrapper that intercepts stdout writes to track the maximum output height, then erases that many lines after the Ink instance exits
  • Applies eraseOnExit: true to renderTasks and renderSingleTask

Test plan

  • All 40 existing tests pass (ui.test.ts, SingleTask.test.tsx, Tasks.test.tsx)
  • Run pnpm shopify kitchen-sink async and verify loading bars disappear after each task completes
  • Verify renderConcurrent output (which should NOT erase) still works correctly

🤖 Generated with Claude Code

@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2026

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 82.23% 14945/18174
🟡 Branches 74.67% 7408/9921
🟢 Functions 81.36% 3768/4631
🟢 Lines 82.63% 14132/17103

Test suite run success

3910 tests passing in 1502 suites.

Report generated by 🧪jest coverage report action from ce16c61

Ink 6's unmount flow renders a final frame before the React tree clears,
leaving stale loading bar output on screen. The component's null render
from setIsDone(true) hasn't committed yet due to throttled rendering.

Add an eraseOnExit option to the render() wrapper that intercepts stdout
writes to track the maximum output height, then erases that many lines
after the Ink instance exits. Applied to renderTasks and renderSingleTask.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nickwesselman nickwesselman force-pushed the fix/erase-loading-bar-on-exit branch from 5e8d522 to ce16c61 Compare March 20, 2026 15:22
@github-actions
Copy link
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/private/node/ui.d.ts
@@ -7,7 +7,10 @@ interface RenderOnceOptions {
     renderOptions?: RenderOptions;
 }
 export declare function renderOnce(element: JSX.Element, { logLevel, renderOptions }: RenderOnceOptions): string | undefined;
-export declare function render(element: JSX.Element, options?: RenderOptions): Promise<unknown>;
+interface ExtendedRenderOptions extends RenderOptions {
+    eraseOnExit?: boolean;
+}
+export declare function render(element: JSX.Element, options?: ExtendedRenderOptions): Promise<unknown>;
 export declare class Stdout extends EventEmitter {
     columns: number;
     rows: number;

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