Fix loading bar persisting on screen after task completion#7060
Draft
nickwesselman wants to merge 1 commit intomainfrom
Draft
Fix loading bar persisting on screen after task completion#7060nickwesselman wants to merge 1 commit intomainfrom
nickwesselman wants to merge 1 commit intomainfrom
Conversation
Contributor
Coverage report
Test suite run success3910 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>
5e8d522 to
ce16c61
Compare
Contributor
Differences in type declarationsWe 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:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/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;
|
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
renderTasksandrenderSingleTask) visible after task completioneraseOnExitoption to therender()wrapper that intercepts stdout writes to track the maximum output height, then erases that many lines after the Ink instance exitseraseOnExit: truetorenderTasksandrenderSingleTaskTest plan
ui.test.ts,SingleTask.test.tsx,Tasks.test.tsx)pnpm shopify kitchen-sink asyncand verify loading bars disappear after each task completesrenderConcurrentoutput (which should NOT erase) still works correctly🤖 Generated with Claude Code