Skip to content

Implement mid-task UI updates#1388

Merged
justin-thurman merged 1 commit into
clack-renderer-featurefrom
CAP-4612
Jun 12, 2026
Merged

Implement mid-task UI updates#1388
justin-thurman merged 1 commit into
clack-renderer-featurefrom
CAP-4612

Conversation

@justin-thurman

@justin-thurman justin-thurman commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds support for tasks to make mid-task UI updates through the task's TaskRenderer.update call, by handing the task a report callback in its dependencies. This will be used to support textual-only updates (like gitInfo noting in the UI that it's skipping a build before calling the skip build GQL mutation) and numeric updates for things like uploading files or taking snapshots (these numeric updates will only work with certain TaskRenderer implementations; currently planning a progress bar renderer, but it's not yet implemented).

Manual QA

This isn't wired up to any migrated tasks yet, so there's not much to test, but I did verify builds still work, and went through the existing auth pending, success, and failure modes. They all still work as expected. The real QA for this will come in the PR that migrates the gitInfo task, which uses this update hook.

📦 Published PR as canary version: 17.4.1--canary.1388.27279488773.0

✨ Test out this PR locally via:

npm install chromatic@17.4.1--canary.1388.27279488773.0
# or 
yarn add chromatic@17.4.1--canary.1388.27279488773.0

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

📦 Package Size: 7132 KB

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.82%. Comparing base (73e4956) to head (fa16300).

Files with missing lines Patch % Lines
node-src/lib/tasks.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##           clack-renderer-feature    #1388      +/-   ##
==========================================================
- Coverage                   82.41%   81.82%   -0.59%     
==========================================================
  Files                         243      241       -2     
  Lines                        4624     4562      -62     
  Branches                     1310     1290      -20     
==========================================================
- Hits                         3811     3733      -78     
- Misses                        700      715      +15     
- Partials                      113      114       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@justin-thurman justin-thurman added patch Auto: Increment the patch version when merged skip-release Auto: Preserve the current version when merged labels Jun 9, 2026
Base automatically changed from CAP-4579 to clack-renderer-feature June 9, 2026 16:36
@justin-thurman justin-thurman force-pushed the CAP-4612 branch 3 times, most recently from 474965e to 540e8c3 Compare June 9, 2026 16:59
@justin-thurman justin-thurman marked this pull request as ready for review June 9, 2026 17:55
@justin-thurman justin-thurman requested a review from a team June 9, 2026 17:55

@jwir3 jwir3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment, otherwise LGTM!

*/
function makeReporter(ctx: Context, renderer: TaskRenderer): TaskReporter {
return (update) => {
if (update.title !== undefined) ctx.title = update.title;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I'm not a big fan of single-line if statements, but I won't hold up review for this. Also, this could be simplified to if (update.title), unless there's some explicit reason you want to test for not undefined.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just to match Listr semantics. Our previous tasks would update the ctx.title in this way too (i.e., allowing the empty string). I'm not sure it will ever be used anywhere, but the individual renderers can decide what to do with the information.

@justin-thurman justin-thurman merged commit a49f8f1 into clack-renderer-feature Jun 12, 2026
20 of 21 checks passed
@justin-thurman justin-thurman deleted the CAP-4612 branch June 12, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Auto: Increment the patch version when merged skip-release Auto: Preserve the current version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants