Skip to content

fix(apollo-react): update badge label for retryCount [MST-11251]#868

Open
alextran1 wants to merge 1 commit into
mainfrom
fix/ran-x2-badge-label-rename
Open

fix(apollo-react): update badge label for retryCount [MST-11251]#868
alextran1 wants to merge 1 commit into
mainfrom
fix/ran-x2-badge-label-rename

Conversation

@alextran1

Copy link
Copy Markdown
Contributor

Description

Updated the StageNode task badge to render a human-readable, localized label for retried executions instead of the cryptic x2 suffix. When retryCount > 1, the badge now reads "Ran N times" (or "Running again" while the task is in progress) using the consumer app's Lingui catalog.

Key Changes

  • Replaced the inline generateBadgeText helper with a memoized badgeText derived inside TaskContent so it can resolve translations via useSafeLingui
  • Added stage-node.task-badge.ran-n-times to canvas/locales/en.json with ICU plural form {count, plural, one {Ran # time} other {Ran # times}}
  • Added stage-node.task-badge.running-again to canvas/locales/en.json for the InProgress variant
  • When retryCount > 1, the localized label fully overrides the consumer-supplied badge string. When retryCount is 1 or absent, the consumer's badge string is rendered as-is (must be pre-localized)
  • Documented the new contract on StageTaskExecution.retryCount in StageNode.types.ts
  • Added a TaskContent - badge test suite covering InProgress vs other statuses, plural interpolation, override behavior when retryCount > 1, pass-through when retryCount is 1 or absent, and no-badge cases

Implementation Details

  • Badge rendering is gated on the resolved badgeText instead of taskExecution.badge, so the second row collapses correctly when no label is produced
  • hasSecondRowContent now reads from badgeText to stay consistent with what actually renders
  • useSafeLingui is used so the component degrades gracefully when no I18nProvider is mounted

Copilot AI review requested due to automatic review settings June 29, 2026 23:26
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (PT)
apollo-design 🟢 Ready Preview, Logs Jun 29, 2026, 04:30:39 PM
apollo-docs 🟢 Ready Preview, Logs Jun 29, 2026, 04:30:39 PM
apollo-landing 🟢 Ready Preview, Logs Jun 29, 2026, 04:30:39 PM
apollo-vertex 🟢 Ready Preview, Logs Jun 29, 2026, 04:30:39 PM

@github-actions github-actions Bot added the size:L 100-499 changed lines. label Jun 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

  • 1945 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1715
ISC 89
Apache-2.0 55
BSD-3-Clause 27
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.2.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the StageNode task badge behavior in apollo-react so retried executions show a human-readable label (via Lingui) rather than appending a cryptic xN suffix, and adds tests/docs to lock in the new contract.

Changes:

  • Compute a localized badgeText inside TaskContent (using useSafeLingui) to render “Running again” (InProgress) or “Ran N times” (pluralized) when retryCount > 1.
  • Add new canvas i18n message IDs and document the new StageTaskExecution.retryCount contract.
  • Add a dedicated TaskContent badge test suite covering override/pass-through/no-badge scenarios.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/apollo-react/src/canvas/locales/en.json Adds new message IDs for retry badge labels (plural + in-progress variant).
packages/apollo-react/src/canvas/components/StageNode/TaskContent.tsx Replaces generateBadgeText with localized, memoized badgeText and gates layout off it.
packages/apollo-react/src/canvas/components/StageNode/TaskContent.test.tsx Adds test coverage for retry badge rendering and override behavior.
packages/apollo-react/src/canvas/components/StageNode/StageNode.types.ts Documents retryCount semantics and badge override behavior.

Comment thread packages/apollo-react/src/canvas/locales/en.json
@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core 9.0% 43.82 MB 57.31 MB ±0
@uipath/apollo-react 34.8% 100.0% (10/10) 7.27 MB 27.60 MB +396 B
@uipath/apollo-wind 40.1% 392.4 KB 2.55 MB −2 B
@uipath/ap-chat 85.8% 43.41 MB 55.85 MB +8 B

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:apollo-react size:L 100-499 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants