Skip to content

Add Tasks regression coverage for deferred Ink teardown#7118

Open
dmerand wants to merge 1 commit intofix/progress-bar-clearing-react19from
dlm-ink-root-async-unmount
Open

Add Tasks regression coverage for deferred Ink teardown#7118
dmerand wants to merge 1 commit intofix/progress-bar-clearing-react19from
dlm-ink-root-async-unmount

Conversation

@dmerand
Copy link
Contributor

@dmerand dmerand commented Mar 26, 2026

WHY are these changes introduced?

Part of https://github.com/shop/issues-develop/issues/22483.

#7062 adds deferred Ink teardown for this task-rendering path.

This follow-up keeps the change narrow and makes that behavior easier to trust by adding focused regression coverage around Tasks, where React can otherwise lose the race to flush the final success or failure state before the tree is unmounted.

WHAT is this pull request doing?

  • adds focused Tasks regression coverage for success and failure teardown behavior
  • verifies the loading frame is rendered before completion
  • verifies the final frame is cleared after success and failure
  • does a small cleanup in use-async-and-unmount.ts by centralizing deferred teardown in a helper

How to test your changes?

  • Run the Tasks UI tests and confirm the final frame is cleared after success and failure.

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor Author

dmerand commented Mar 26, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@dmerand dmerand changed the base branch from main to graphite-base/7118 March 26, 2026 20:25
@dmerand dmerand force-pushed the dlm-ink-root-async-unmount branch from 901f2b3 to 35c8ba6 Compare March 26, 2026 20:25
@dmerand dmerand changed the base branch from graphite-base/7118 to fix/progress-bar-clearing-react19 March 26, 2026 20:25
@dmerand dmerand changed the title Defer async Ink teardown in Tasks Add Tasks regression coverage for deferred Ink teardown Mar 26, 2026
@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/components/SingleTask.d.ts
@@ -4,8 +4,9 @@ interface SingleTaskProps<T> {
     title: TokenizedString;
     task: (updateStatus: (status: TokenizedString) => void) => Promise<T>;
     onComplete?: (result: T) => void;
+    onError?: (error: Error) => void;
     onAbort?: () => void;
     noColor?: boolean;
 }
-declare const SingleTask: <T>({ task, title, onComplete, onAbort, noColor }: SingleTaskProps<T>) => React.JSX.Element | null;
+declare const SingleTask: <T>({ task, title, onComplete, onError, onAbort, noColor }: SingleTaskProps<T>) => React.JSX.Element | null;
 export { SingleTask };
\ No newline at end of file

@github-actions
Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 82.29% 15120/18374
🟡 Branches 74.86% 7457/9961
🟢 Functions 81.31% 3798/4671
🟢 Lines 82.68% 14293/17288

Test suite run success

3993 tests passing in 1527 suites.

Report generated by 🧪jest coverage report action from 35c8ba6

@dmerand dmerand marked this pull request as ready for review March 26, 2026 21:41
@dmerand dmerand requested a review from a team as a code owner March 26, 2026 21:41
@github-actions
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

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