Skip to content

feat(apollo-react): add mocked chip to stage node tasks - #994

Open
jevinkosasih wants to merge 1 commit into
mainfrom
feat/stage-task-mocked-chip
Open

feat(apollo-react): add mocked chip to stage node tasks#994
jevinkosasih wants to merge 1 commit into
mainfrom
feat/stage-task-mocked-chip

Conversation

@jevinkosasih

@jevinkosasih jevinkosasih commented Aug 1, 2026

Copy link
Copy Markdown

Summary

Adds an isMocked flag to StageTaskItem so a stage-node task can render a "Mocked" chip, mirroring the existing mocked-output indicator on BPMN activity nodes.

image image

Testing

  • pnpm typecheck passes (apollo-react)
  • pnpm test passes — StageNode suite 219/219, TaskContent 35/35
  • pnpm lint (Biome) clean on changed files
  • Manual testing / Storybook checked (StageNode → Maximum Task Adornments)
  • Type-safe (no as any / type suppressions added)

Copilot AI review requested due to automatic review settings August 1, 2026 00:50
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Apollo Coded App preview deployments are ready.

Project Status Preview Updated (PT)
apollo-design Ready Preview · Logs Aug 05, 2026, 11:04:35 PM
apollo-docs Ready Preview · Logs Aug 05, 2026, 11:04:35 PM
apollo-landing Ready Preview · Logs Aug 05, 2026, 11:04:35 PM
apollo-vertex Ready Preview · Logs Aug 05, 2026, 11:04:35 PM

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Dependency License Review

  • 1950 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1720
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.3.2 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

Adds an isMocked?: boolean flag to stage node tasks in apollo-react so StageTaskItem can render a “Mocked” indicator chip (with localized tooltip + accessibility labeling), matching the existing mocked-output affordance used elsewhere in the canvas.

Changes:

  • Extended StageTaskItem with an optional isMocked semantic flag.
  • Render a warning-style mocked chip (flask icon) in TaskContent ahead of the execution status icon, wrapped in CanvasTooltip.
  • Added unit tests for mocked chip rendering/accessibility and updated the “Maximum Task Adornments” story to showcase it.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/apollo-react/src/canvas/components/StageNode/TaskContent.tsx Renders a “Mocked” chip with tooltip + ARIA labeling when task.isMocked is set.
packages/apollo-react/src/canvas/components/StageNode/TaskContent.test.tsx Adds coverage ensuring the mocked chip appears/doesn’t appear appropriately and is accessible.
packages/apollo-react/src/canvas/components/StageNode/StageNode.types.ts Adds isMocked?: boolean to StageTaskItem.
packages/apollo-react/src/canvas/components/StageNode/StageNode.stories.tsx Demonstrates the mocked chip in the maximum-adornments example.

Copilot AI review requested due to automatic review settings August 1, 2026 00:54
@github-actions

github-actions Bot commented Aug 1, 2026

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 43.84 MB 57.45 MB ±0
@uipath/apollo-react 38.8% 100.0% (6/6) 7.51 MB 28.86 MB +112 B
@uipath/apollo-wind 420.5 KB 2.73 MB +6 B
@uipath/ap-chat 85.8% 43.45 MB 56.01 MB +58 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.

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@jevinkosasih
jevinkosasih force-pushed the feat/stage-task-mocked-chip branch from f1a728f to 24baf15 Compare August 1, 2026 00:58
Copilot AI review requested due to automatic review settings August 1, 2026 01:34
@jevinkosasih
jevinkosasih force-pushed the feat/stage-task-mocked-chip branch from 24baf15 to 86a6e20 Compare August 1, 2026 01:34
@jevinkosasih
jevinkosasih force-pushed the feat/stage-task-mocked-chip branch from 86a6e20 to 42fedbb Compare August 1, 2026 01:37

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (1)

packages/apollo-react/src/canvas/components/StageNode/TaskContent.tsx:119

  • The new mocked chip tooltip/id don’t match the existing StageNode badge i18n pattern and appear to conflict with the PR description. In this file, other badge tooltips use ids under stage-node.task-badge.* (e.g. stage-node.task-badge.ran-n-times, stage-node.task-badge.rework-time), but the new one uses stage-node.task-mocked. Also, the tooltip copy here is "This node's outputs are mocked" while the PR description calls for tooltip content "Mocked" (and the chip is task-scoped, not node-output-scoped). Consider renaming the message id to align with the badge namespace and adjusting the tooltip copy accordingly, then updating the locale catalogs and tests that assert the exact string.
    const runsTooltip =
      taskExecution?.status === 'InProgress'
        ? _({ id: 'stage-node.task-badge.running-again', message: 'Running again' })
        : _({
            id: 'stage-node.task-badge.ran-n-times',
            message: '{count, plural, one {Ran # time} other {Ran # times}}',
            values: { count: totalRuns },
          });
    const hasRework = !!taskExecution?.retryDuration;
    const reworkTooltip = _({
      id: 'stage-node.task-badge.rework-time',
      message: 'Reworked (+{duration})',
      values: { duration: taskExecution?.retryDuration ?? '' },
    });
    const mockedTooltip = _({ id: 'stage-node.task-mocked', message: "This node's outputs are mocked" });
    const taskStatusFallbackName = hasExecutionStatus ? getStatusName(taskExecution?.status) : '';

Copilot AI review requested due to automatic review settings August 1, 2026 01:37

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (4)

packages/apollo-react/src/canvas/components/StageNode/TaskContent.test.tsx:220

  • This test's expected accessible name should be kept in sync with the mocked chip tooltip/label text (proposed to be "Mocked").
    expect(screen.getByRole('img', { name: "This node's outputs are mocked" })).toBeInTheDocument();

packages/apollo-react/src/canvas/components/StageNode/TaskContent.tsx:118

  • The tooltip/aria-label text for isMocked says "This node's outputs are mocked", but the chip is rendered per task (StageTaskItem.isMocked) and the PR description says the tooltip content should be "Mocked". Consider using a short, task-scoped label for both tooltip and screen readers.
    const mockedTooltip = _({ id: 'stage-node.task-mocked', message: "This node's outputs are mocked" });

packages/apollo-react/src/canvas/locales/en.json:151

  • The new i18n entry for stage-node.task-mocked refers to "node" and "outputs", but this indicator is shown per task. Also, the PR description states the tooltip should read "Mocked". Align the English string with the intended, task-level chip label.
  "stage-node.task-mocked": "This node's outputs are mocked"

packages/apollo-react/src/canvas/components/StageNode/TaskContent.test.tsx:216

  • This assertion can pass even if the tooltip isn't actually wrapping the mocked chip (it only checks that some tooltip with that content exists). It would be more robust to assert on the chip's nearest tooltip wrapper, consistent with the other chip tests in this file. Also update the expected tooltip text to match the updated copy ("Mocked").

This issue also appears on line 220 of the same file.

    const chip = screen.getByTestId(`stage-task-mocked-${baseTask.id}`);
    expect(screen.getByTestId(`stage-task-actions-${baseTask.id}`)).toContainElement(chip);
    expect(
      container.querySelector(`[data-tooltip-content="This node's outputs are mocked"]`)
    ).not.toBeNull();

Copilot AI review requested due to automatic review settings August 1, 2026 01:51
@jevinkosasih
jevinkosasih force-pushed the feat/stage-task-mocked-chip branch from 42fedbb to 240c87a Compare August 1, 2026 01:51

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (3)

packages/apollo-react/src/canvas/components/StageNode/TaskContent.tsx:118

  • The PR description says the tooltip content should be "Mocked", but the implementation/localized string uses "This task's outputs are mocked". Please align the copy with the intended UX (either update the description or change the string and related test expectations) to avoid confusion and inconsistent localization keys.
    const mockedTooltip = _({ id: 'stage-node.task-mocked', message: "This task's outputs are mocked" });

packages/apollo-react/src/canvas/components/StageNode/TaskContent.test.tsx:215

  • This test asserts tooltip presence via a broad container.querySelector(...), which doesn’t guarantee the tooltip is associated with the mocked chip. It’s more robust to assert the mocked chip is wrapped by the CanvasTooltip mock and that wrapper contains the expected data-tooltip-content.
  it('shows the mocked chip in the trailing actions group with an outputs-mocked tooltip when the task is mocked', () => {
    const { container } = renderTaskContent({ task: { isMocked: true } });
    const chip = screen.getByTestId(`stage-task-mocked-${baseTask.id}`);
    expect(screen.getByTestId(`stage-task-actions-${baseTask.id}`)).toContainElement(chip);
    expect(

packages/apollo-react/src/canvas/locales/en.json:36

  • New i18n message id stage-node.task-mocked was added only to en.json, but the canvas locales include many other language catalogs. As-is, non-English locales will fall back to the default message (or display a missing translation), which is inconsistent with other stage-node.* strings that exist across all locale JSON files.
  "stage-node.task-mocked": "This task's outputs are mocked",

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Storybook visual diff

⚠️ Visual changes detected: 8 changed (of 300 compared, 292 unchanged). View report

Baseline is the deployed main Storybook, so changes merged to main after this branch was last updated can also appear here. Logs

Updated (PT): Aug 05, 2026, 11:20:06 PM

Copilot AI review requested due to automatic review settings August 1, 2026 16:14
@jevinkosasih
jevinkosasih force-pushed the feat/stage-task-mocked-chip branch from 240c87a to e12d704 Compare August 1, 2026 16:14

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (1)

packages/apollo-react/src/canvas/components/StageNode/TaskContent.tsx:118

  • PR description says the tooltip content should be "Mocked", but the implementation/localized string uses "This task's outputs are mocked". This is a mismatch that will affect the UI copy, a11y label, and the new tests that assert the tooltip string.
    const mockedTooltip = _({ id: 'stage-node.task-mocked', message: "This task's outputs are mocked" });

Copilot AI review requested due to automatic review settings August 1, 2026 22:21

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (2)

packages/apollo-react/src/canvas/locales/en.json:36

  • New i18n key stage-node.task-mocked was added only to en.json, but the other locale catalogs in packages/apollo-react/src/canvas/locales/*.json appear to keep stage-node keys in sync (e.g. stage-node.task-badge.running-again exists in every locale). As-is, non-English locales will likely show fallback English/missing translation for this tooltip.
  "stage-node.task-mocked": "This task's outputs are mocked",

packages/apollo-react/src/canvas/components/StageNode/TaskContent.tsx:121

  • PR description says the tooltip content should be "Mocked", but the localized string used for stage-node.task-mocked is currently "This task's outputs are mocked". If the shorter tooltip is the intended UX (and matches the chip label), consider updating the message/id value and adjusting the corresponding locale entry/tests, or update the PR description to match the implemented copy.
    const mockedTooltip = _({
      id: 'stage-node.task-mocked',
      message: "This task's outputs are mocked",
    });

Copilot AI review requested due to automatic review settings August 6, 2026 01:14
@jevinkosasih
jevinkosasih force-pushed the feat/stage-task-mocked-chip branch from 2634816 to 94c7f59 Compare August 6, 2026 01:14

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

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (2)

packages/apollo-react/src/canvas/components/StageNode/DraggableTask.tsx:103

  • The PR description says the mocked indicator should render in the trailing actions group (before the execution-status icon). This implementation renders it as an absolute-positioned corner marker (and the new DraggableTask tests explicitly enforce that), so either the PR description needs updating or the chip should be moved into TaskContent’s actions row to match the stated design/ordering.
        taskId={task.id}
        active={!!taskExecution?.breakpoint}
        onToggle={onToggleBreakpoint}
      />
      <TaskMockedChip taskId={task.id} mocked={!!task.isMocked} />

packages/apollo-react/src/canvas/locales/en.json:36

  • A new lingui id is added only to en.json, but the other canvas locale catalogs (e.g. fr.json/ja.json/etc.) don’t include "stage-node.task-mocked". The existing locale files appear to be kept in sync for other keys, so this will leave non-English locales without a translation entry (and may surface missing-translation warnings). Consider adding the key to all locale JSONs (even as an English placeholder) or running the project’s catalog update step so every locale includes it.
  "stage-node.task-mocked": "This task's outputs are mocked",

Copilot AI review requested due to automatic review settings August 6, 2026 04:13
@jevinkosasih
jevinkosasih force-pushed the feat/stage-task-mocked-chip branch from 94c7f59 to 2979349 Compare August 6, 2026 04:13

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

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (2)

packages/apollo-react/src/canvas/locales/en.json:37

  • New locale key stage-node.task-mocked was added only to en.json, but the stage-node.* key set appears to be kept in sync across all canvas locale catalogs (e.g., stage-node.task-badge.running-again exists in every locale file). This will cause non-English locales to fall back to the default English message for this tooltip. Please add stage-node.task-mocked to the other locale JSON files (with appropriate translations or at least a placeholder) to keep catalogs aligned.
  "stage-node.status.warning": "Warning",
  "stage-node.task-badge.ran-n-times": "{count, plural, one {Ran # time} other {Ran # times}}",
  "stage-node.task-badge.running-again": "Running again",
  "stage-node.task-mocked": "This task's outputs are mocked",
  "stage-node.ungroup-parallel-tasks": "Ungroup parallel tasks",

packages/apollo-react/src/canvas/components/StageNode/TaskMockedChip.tsx:29

  • PR description says the mocked indicator should be rendered in TaskContent’s trailing actions group (before the execution-status icon) with tooltip copy "Mocked". The current implementation is a top-right corner marker (absolute positioned) and the copy is "This task's outputs are mocked" (and tests codify that). Please align the implementation with the intended UX, or update the PR description/acceptance criteria to match this corner-marker approach and tooltip copy.
  const label = _({ id: 'stage-node.task-mocked', message: "This task's outputs are mocked" });

  return (
    <CanvasTooltip content={label} placement="top">
      <Badge
        variant="warning"
        role="img"
        aria-label={label}
        className="absolute -top-1.5 -right-1.5 z-10 h-4 w-4 justify-center rounded-full border-warning bg-chip-warning-background p-0 hover:bg-chip-warning-background [&>svg]:size-2.5"

Copilot AI review requested due to automatic review settings August 6, 2026 05:58
@jevinkosasih
jevinkosasih force-pushed the feat/stage-task-mocked-chip branch from 2979349 to 3ebad32 Compare August 6, 2026 05:58
@github-actions github-actions Bot added size:L 100-499 changed lines. and removed size:M 30-99 changed lines. labels Aug 6, 2026

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

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (1)

packages/apollo-react/src/canvas/components/StageNode/tasks/TaskMockedChip.tsx:34

  • CanvasTooltip renders a Radix , which requires its direct child to be a ref-forwarding component or a DOM element. apollo-wind's Badge is a plain function component (no forwardRef), so passing directly can break tooltip positioning/triggering and produces the "Function components cannot be given refs" warning. Wrap the Badge in a DOM element (or switch to a DOM element for the trigger) so TooltipTrigger can attach its ref/handlers reliably.
    <CanvasTooltip content={label} placement="top">
      <Badge
        variant="warning"
        role="img"
        aria-label={label}

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 6, 2026 16:26
@jevinkosasih
jevinkosasih force-pushed the feat/stage-task-mocked-chip branch from 3ebad32 to 0fea243 Compare August 6, 2026 16:26

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

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

Comment on lines +11 to +14
}: {
content: React.ReactNode;
children: React.ReactNode;
}) => (
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.

3 participants