Skip to content

feat(apollo-react): guardrail remove confirmation dialog [AL-577] - #1149

Open
andreizdrali-uipath wants to merge 2 commits into
mainfrom
feat/apollo-react-guardrail-remove-dialog
Open

andreizdrali-uipath wants to merge 2 commits into
mainfrom
feat/apollo-react-guardrail-remove-dialog

Conversation

@andreizdrali-uipath

@andreizdrali-uipath andreizdrali-uipath commented Sep 10, 2026

Copy link
Copy Markdown

AL-577, the remove-guardrail confirmation dialog: the step both products show before a guardrail
is removed. Fourth member of the shared family in
packages/apollo-react/src/canvas/components/Guardrails/.

One commit over #1139, which is one commit over main. Review the last commit only.

The Jira description is stale. It still says apollo-wind and component-scoped locales, both
superseded. Read it as apollo-react family, strings as lingui ids in the shared canvas catalog.

What ships

File Exports
guardrail-remove-dialog.tsx GuardrailRemoveDialog, GuardrailRemoveDialogProps
i18n.ts (extended) GuardrailRemoveDialogLabels, GUARDRAIL_REMOVE_DIALOG_EN_LABELS, GUARDRAIL_REMOVE_DIALOG_EN_MESSAGES, resolveGuardrailRemoveDialogLabels, useGuardrailRemoveDialogLabels

Plus 5 stories, 20 component tests, i18n.test.ts, a README section and 8
guardrails.remove-dialog.* ids in en.json.

Contract

The host decides which removal is happening and unwinds it; the dialog renders the description of
the outcome. Agents strips the tool from matchNames, drops the Tool scope and then deletes;
Flow calls removeToolFromGuardrail. Both callbacks are intents, so the write, the telemetry and
the close stay with the product and open stays controlled.

Design decisions

  • The impact is four structured props, not a content slot. affected* is what a full removal
    also takes the guardrail off, remaining* is what survives a tool-scoped one. Flow's
    isToolOnAgent branch converges by filling one pair or the other; all four default to empty.
  • Dialog, not AlertDialog, so a corner close button is possible at all. AlertDialog has
    none and cannot be given backdrop dismissal either, since Radix prevents outside interaction
    after spreading consumer props, so offering either would have meant working against the
    primitive. GuardrailFormLayout is already a wind Dialog with a close button. Cost:
    role="alertdialog" becomes role="dialog", and onOpenAutoFocus restores the focus-on-Cancel
    that came free.
  • showCloseButton and closeOnBackdropClick are both opt-in. Adopting the dialog should not
    add a control a product did not have, and a confirmation is a decision that a stray click should
    not discard; Escape and Cancel always dismiss, and everything routes through one onCancel
    path. Wind's closeOnBackdropClick is takeover-only, so the guard is onPointerDownOutside,
    and wind's own close button is always suppressed because its accessible name is a hardcoded
    English "Close".
  • The confirm is a plain Button, not a DialogClose. Closing from inside reports a cancel
    with every confirm, which Flow does today through AlertDialogAction.
  • It takes the accent variant, not destructive. Both products colour this action with the
    accent today and read a red Remove as a regression, so neither button changes colour. A test
    pins it. feat(apollo-react): guardrail list section [AL-575] #1140's text-destructive row button is still consistent: the rule both products
    follow is destructive tint on a ghost trigger, never a filled destructive button.
  • The whole impact is the accessible description, via asChild on DialogDescription, which
    also drops the invalid <p>/<ul>-inside-<p> nesting Flow has today.
  • Scopes arrive raw, localized through formatScope, matching GuardrailList's
    formatScopes. Tools list before scopes, pinned by a test.
  • container picks the portal target, 'body' forcing document.body even under a
    PortalContainerProvider, which is what preserves Agents' escape from its shadow root.
  • No onTrack, despite Confluence §7.5, same call as feat(apollo-react): guardrail list section [AL-575] #1140: the two event taxonomies do not
    overlap and both adapters wrap the intents anyway.

QA-visible per host

  • Flow: nothing changes here. Its dialog has no close button today and gets none by default.
  • Agents needs showCloseButton to keep its corner close button, and closeOnBackdropClick
    to keep backdrop dismissal. Initial focus moves from that button to Cancel.
  • Agents, separately: GuardrailsListingSection.handleRemoveGuardrail passes its two impact
    arrays swapped, so its dialog shows scopes before tools with Llm raw instead of "LLM calls".
    The typed props make that a one-line fix but do not apply it, since the call site is Agents-side.
  • Neither product's English changes.

Strings

Eight guardrails.remove-dialog.* ids in one builder function, the definitions-copy.ts idiom,
added to en.json only. Seven exist in both products with identical English and the eighth,
close, comes from Agents' common.close, so none of this copy is newly written here.

The other thirteen catalogs are chore(l10n): sync from Localization's, and until it runs
useSafeLingui renders the English default, so nothing is missing on screen. i18n.test.ts
asserts English parity with the source through #1139's shared catalog scans.

Verification

Guardrails suite 415 passing, jest-axe plus the focus trap, Escape, both opt-in dismissals and
the portal container. tsc --noEmit, biome lint src, biome format src and the
rslib build clean; no icon churn, no pnpm-lock.yaml change. Tests and stories typechecked with a
throwaway tsconfig, since the package one excludes both. Also checked in a browser at the URL the
visual-diff job snapshots: focus on Cancel, tab order Cancel then Remove then Close once the
close button is on, a backdrop pointer-down leaving the dialog open, and the docs page holding no
dialog and an interactive body.

mergeLabels in i18n.ts is the only pre-existing code touched: a pure refactor of the two
existing resolvers onto one generic merge, byte-identical to the helper #1140 and #1147 each
add
, so the three branches collapse onto one copy instead of four.

Open question

Should formatScope default to the family's own scope labels? Family-wide rather than this
PR's: #1140 and #1149 render raw with an optional formatter, #1147 shows no scopes, and #1161
defaults
scope, action and execution-stage labels. The split is 2-1 with the newer decision on
the defaulting side. Following #1161 here is cheap, three label fields reusing the existing
guardrails.builder.scope-*-label ids so no new catalog entries, but it should change #1140,
#1149 and #1161 together or not at all.

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings September 10, 2026 13:08
@andreizdrali-uipath andreizdrali-uipath added the dev-packages Adds dev package publishing on pushes to this PR label Sep 10, 2026
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Apollo Coded App preview deployments are ready.

Project Status Preview Updated (PT)
apollo-design Ready Preview · Logs Sep 17, 2026, 04:28:29 AM
apollo-docs Ready Preview · Logs Sep 17, 2026, 04:28:29 AM
apollo-landing Ready Preview · Logs Sep 17, 2026, 04:28:29 AM
apollo-vertex Ready Preview · Logs Sep 17, 2026, 04:28:29 AM

@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

  • 1937 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1708
ISC 88
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

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

📦 Dev Packages

Package Status Updated (PT)
@uipath/apollo-react@6.47.4-pr1149.2337dde 🟢 Published Sep 17, 2026, 04:28:22 AM

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.

🟡 Changes recommended

The dialog list keys can collide and must be made unique before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a shared Apollo React guardrail removal confirmation dialog with structured impact messaging, localization, controlled lifecycle, and accessibility support.

Changes:

  • Added the dialog, stories, tests, and public exports.
  • Added localized labels and catalog parity coverage.
  • Documented guardrail removal behavior and integration contracts.
File summaries
File Review summary
pnpm-lock.yaml Reviewed; no final comment.
packages/apollo-wind/src/index.ts Reviewed; no final comment.
packages/apollo-wind/src/components/ui/textarea.tsx Reviewed; no final comment.
packages/apollo-wind/src/components/ui/select.tsx Reviewed; no final comment.
packages/apollo-wind/src/components/ui/info-tooltip.tsx Reviewed; no final comment.
packages/apollo-wind/src/components/ui/info-tooltip.test.tsx Reviewed; no final comment.
packages/apollo-wind/src/components/ui/index.ts Reviewed; no final comment.
packages/apollo-wind/src/components/forms/validation-converter.ts Reviewed; no final comment.
packages/apollo-wind/src/components/forms/string-list-field.tsx Reviewed; no final comment.
packages/apollo-wind/src/components/forms/metadata-form.stories.tsx Reviewed; no final comment.
packages/apollo-wind/src/components/forms/index.ts Reviewed; no final comment.
packages/apollo-wind/src/components/forms/form-schema.ts Reviewed; no final comment.
packages/apollo-wind/src/components/forms/field-renderer.tsx Reviewed; no final comment.
packages/apollo-react/src/test/setup.ts Reviewed; no final comment.
packages/apollo-react/src/i18n/index.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/index.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/utils.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/use-guardrail-definitions.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/types.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/render-parameter-bridge.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/index.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/i18n.test.ts Reviewed catalog parity coverage; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/guardrail-validator-form.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/guardrail-remove-dialog.tsx Moderate (2 votes): raw list keys can collide across item kinds or repeated values; use unique keys.
packages/apollo-react/src/canvas/components/Guardrails/guardrail-remove-dialog.test.tsx Reviewed dialog behavior and accessibility coverage; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/guardrail-remove-dialog.stories.tsx Reviewed dialog stories; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/guardrail-form-layout.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/guardrail-form-layout.test.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/guardrail-form-layout.stories.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/form-schema-builder.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/definitions-wire.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/definitions-parse.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/definitions-parity.test.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/definitions-copy.test.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/parameter-label.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/mixed-scopes-banner.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/mixed-scopes-banner.test.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/map-enum-field.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/guardrail-status-banner.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/guardrail-status-banner.test.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/guardrail-scope-selector.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/guardrail-scope-selector.test.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/guardrail-chip.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/guardrail-chip.test.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/guardrail-action-section.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/guardrail-action-section.test.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/field-shell.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/field-shell.test.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/components/enum-list-chips-field.tsx Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/builder-utils.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/builder-utils.test.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/builder-types.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/__fixtures__/host-copy-baselines.ts Reviewed; no final comment.
packages/apollo-react/src/canvas/components/Guardrails/__fixtures__/definitions-wire.fixtures.ts Reviewed; no final comment.
packages/apollo-react/package.json Reviewed; no final comment.
Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 85/86 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 10, 2026 13:18
@github-actions

github-actions Bot commented Sep 10, 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 42.01 MB 50.16 MB ±0
@uipath/apollo-react 45.5% 89.4% (261/292) 7.71 MB 29.83 MB +35.4 KB
@uipath/apollo-ui-icons 2.86 MB 6.96 MB ±0
@uipath/apollo-wind 464.5 KB 2.93 MB −31 B
@uipath/ap-chat 85.8% 43.94 MB 56.79 MB +1.5 KB

"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.

🔵 Needs a closer look

Three moderate findings remain regarding impact ordering, list-key uniqueness, and the ru catalog orphan scan.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file

Suppressed comments (3)

Previously missed (1) — in code that hasn't changed since the last review.

packages/apollo-react/src/canvas/components/Guardrails/guardrail-remove-dialog.tsx:85

  • ImpactList renders toolNames before scopes, but the dialog contract requires scopes to precede tools. With affectedToolNames={['Send email']} and affectedScopes={['Llm']}, this still produces Send email, LLM calls instead of the promised scope-first order; render the scope items before the tool items and update the order assertions.

packages/apollo-react/src/canvas/components/Guardrails/guardrail-remove-dialog.tsx:89

  • These keys come from two independent arrays rendered as siblings in the same <ul>. A tool named Agent, Llm, or Tool can therefore collide with a scope key (and repeated values collide within either array), producing duplicate-key warnings and potentially stale item reconciliation when the impact changes. Prefix the keys by source and include an index, or otherwise generate unique keys for both maps.
    packages/apollo-react/src/canvas/components/Guardrails/i18n.test.ts:107
  • The orphan-id check claims to cover every catalog, but this locale list omits ru, which is still a checked-in catalog. A stale guardrails.remove-dialog.* entry in ru.json would pass unnoticed; include ru in this orphan scan while keeping it out of the translated-coverage check because it intentionally falls back to English.
  • Files reviewed: 85/86 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Storybook visual diff

⚠️ Visual changes detected: 8 changed, 9 added (of 405 compared, 388 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): Sep 17, 2026, 04:44:55 AM

Copilot AI review requested due to automatic review settings September 11, 2026 08:34
@andreizdrali-uipath
andreizdrali-uipath force-pushed the feat/apollo-react-guardrail-remove-dialog branch from 7db5698 to d816880 Compare September 11, 2026 08:34
Comment thread packages/apollo-wind/src/components/forms/metadata-form.test.tsx Fixed

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.

🔵 Needs a closer look

The dialog currently renders tool names before scopes; update the component and its test before approval.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file

Suppressed comments (1)

packages/apollo-react/src/canvas/components/Guardrails/guardrail-remove-dialog.tsx:90

  • The dialog contract says scopes should appear before tool names in the impact list, but this renders toolNames first and scopes second. Once the adapters pass the corrected arrays, users will still see the list in the wrong order (and guardrail-remove-dialog.test.tsx currently locks in that order); render the scopes before the tools and update the expectation.
  • Files reviewed: 102/103 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 11, 2026 09:40

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.

🔵 Needs a closer look

Two moderate dialog issues remain: impact ordering and duplicate list keys.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file

Suppressed comments (2)

packages/apollo-react/src/canvas/components/Guardrails/guardrail-remove-dialog.tsx:96

  • The impact list is rendered in tool-first order, but the corrected host contract calls for scopes before tools. With affectedScopes={['Llm']} and affectedToolNames={['Send email']}, this produces Send email, then LLM calls instead of the intended scope-first order; the story/test currently encode that regression as well. Render the scope entries before the tool entries and update the expected order.
    packages/apollo-react/src/canvas/components/Guardrails/guardrail-remove-dialog.tsx:95
  • toolNames and scopes share the same <ul>, but their keys use the same index-value format. If a tool name equals a scope at the same index (for example, a tool named Agent alongside the Agent scope), React emits duplicate-key warnings and can reconcile the wrong <li> when the impact changes. Prefix the key by list kind so the two namespaces cannot collide.
  • Files reviewed: 102/103 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 11, 2026 10:33

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.

🟢 Approval recommended

No unresolved blocking issues remain in the reviewed changes.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 102/103 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 11, 2026 12:19

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.

🔵 Needs a closer look

Two unresolved moderate findings remain: add overlay non-dismissal coverage and reconcile the required destructive confirm variant.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file

Suppressed comments (2)

packages/apollo-react/src/canvas/components/Guardrails/guardrail-remove-dialog.tsx:141

  • The component contract documents that backdrop/outside clicks must not dismiss this destructive confirmation, but the dialog suite only covers Cancel and Escape. Please add an interaction test that clicks the overlay and asserts onCancel is not called and the alert dialog remains open; otherwise a Radix/wind behavior change could silently reintroduce dismissal.
    packages/apollo-react/src/canvas/components/Guardrails/guardrail-remove-dialog.tsx:191
  • This implementation intentionally renders the remove action with the default accent variant, but the PR's stated “What ships” contract and QA-visible behavior require Button variant="destructive". Please reconcile the shipped behavior with the PR/design decision before merge: either restore the destructive variant or update the description and acceptance criteria to the accent behavior.
  • Files reviewed: 102/103 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 11, 2026 12:42

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.

🟡 Changes recommended

The claimed localized dialog behavior is not delivered because non-English catalogs lack the new IDs and the localization test runs only with the English locale.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 27/27 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread packages/apollo-react/src/canvas/locales/en.json
Copilot AI review requested due to automatic review settings September 17, 2026 07:50
@andreizdrali-uipath
andreizdrali-uipath force-pushed the feat/apollo-react-guardrail-remove-dialog branch from 35f022d to 3e03845 Compare September 17, 2026 07:50

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.

🟢 Approval recommended

The shared components, localization plumbing, portal behavior, and interaction tests show no blocking defects.

Review details
  • Files reviewed: 27/27 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 17, 2026 07:56
@andreizdrali-uipath
andreizdrali-uipath force-pushed the feat/apollo-react-guardrail-remove-dialog branch from 3e03845 to 7dc4948 Compare September 17, 2026 07:56
@andreizdrali-uipath
andreizdrali-uipath force-pushed the feat/apollo-react-guardrail-remove-dialog branch from 7dc4948 to 5d281a7 Compare September 17, 2026 07:59

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.

🟢 Approval recommended

The reviewed UI, localization, definition APIs, and accompanying tests are internally consistent with no blocking defect found.

Review details
  • Files reviewed: 27/27 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 17, 2026 08:03

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.

🟢 Approval recommended

The reviewed changes are well-tested and contain no objective correctness issues.

Review details
  • Files reviewed: 27/27 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 17, 2026 08:31
@andreizdrali-uipath
andreizdrali-uipath force-pushed the feat/apollo-react-guardrail-remove-dialog branch from 5d281a7 to 6ecfa96 Compare September 17, 2026 08:31

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.

🔵 Needs a closer look

The shared destructive-removal flow changes dismissal behavior and needs final product confirmation of the documented Agents and scope-formatting decisions.

Review details
  • Files reviewed: 27/27 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 17, 2026 09:42
@andreizdrali-uipath
andreizdrali-uipath force-pushed the feat/apollo-react-guardrail-remove-dialog branch from 6ecfa96 to e853347 Compare September 17, 2026 09:42

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.

🟡 Changes recommended

The implementation uses a plain dialog with a default corner close button, conflicting with the stated AlertDialog contract and Agents dismissal behavior.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 27/27 changed files
  • Comments generated: 1
  • Review effort level: Lite

Add `GuardrailRemoveDialog`, the confirmation step before a guardrail is
removed, with the impact of the removal spelled out: what a full removal also
takes the guardrail off, or what survives when only one tool is detached.

Both products already ask the same question about those same two situations and
differ only in how they compute them, so the impact arrives as four structured
props (`affected*`, `remaining*`) rather than a content slot. Flow's
`isToolOnAgent` branch converges here by filling one pair or the other. Pass
neither and the dialog is the question on its own.

Deciding which removal is happening, and unwinding it, stays host-side: Agents
strips the tool from `matchNames`, drops the `Tool` scope and then deletes,
Flow calls `removeToolFromGuardrail`, and neither belongs in the package. Both
callbacks are intents, so the write, the telemetry and the close stay with the
host and `open` stays controlled.

Built on wind's `Dialog` rather than `AlertDialog`, to match the rest of the
family. `AlertDialog` carries `role="alertdialog"` and focuses its cancel
control for free, but it has no corner close button and no way to add backdrop
dismissal: Radix prevents outside interaction after spreading consumer props,
so neither is reachable. `GuardrailFormLayout` is already a wind `Dialog` with
a close button, and both products' own remove dialogs offer some way out of the
corner, so consistency won. What the switch costs is made back explicitly:
`onOpenAutoFocus` names Cancel so initial focus is a decision rather than a
consequence of markup order, and the description still carries the whole impact
through `aria-describedby`.

`showCloseButton` and `closeOnBackdropClick` are both opt-in, off by default.
Adopting the dialog should not add a control a product did not have, and a
confirmation is a decision that a stray click on the backdrop should not
discard; Escape and Cancel always dismiss. Agents asks for the close button,
Flow leaves it off. Wind's prop of
the same name only applies to `variant="takeover"`, so the guard here is
`onPointerDownOutside`. Wind's own built-in close button is suppressed because
its accessible name is a hardcoded English "Close", which would be the only
untranslated string in the family; the replacement takes its label from the
catalog and sits last in the DOM, so a keyboard user reaches the decision
before the escape hatch.

Two things the host dialogs get wrong today are fixed by construction. The
confirm button is a plain `Button`, not a close: closing from inside would
report a cancel with every confirm, which Flow's dialog does through
`AlertDialogAction`. And `DialogDescription` takes `asChild` over a `<div>`, so
the impact blocks are part of the description the dialog announces instead of
`<p>`/`<ul>` nested inside a `<p>`.

A third becomes a one-line fix rather than being fixed here: Agents' listing
section passes its two impact arrays swapped, which the typed props make
obvious but do not correct, since the call site is not this package's.

The confirm button takes the default accent variant. Both products colour this
action with the accent today and both read a red Remove as a regression when
they tested the shared dialog; the dialog carries the weight of the action
through its title and impact lines instead. A test pins it.

Scopes arrive as raw wire values and localize through `formatScope`, the same
idiom the list section uses: scope vocabulary is product-owned and both
products already hold the mapping. `container` picks the portal target, so
Agents keeps the `document.body` escape its shadow-root host needs while Flow's
dialog stays in place.

Eight `guardrails.remove-dialog.*` lingui ids. Seven are harvested from the two
products' own catalogs where the English already matched in both, and `close`
comes from Agents' `common.close`, so none of this copy is newly invented here.
English only, like the rest of the package: `chore(l10n): sync from
Localization` owns the other thirteen catalogs. The i18n test uses the family's
shared catalog scans (`__fixtures__/catalog-coverage`), and `mergeLabels` is
the same helper the sibling list and palette branches add, byte-identical so
the three of them merge without a conflict.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 17, 2026 11:18
@andreizdrali-uipath
andreizdrali-uipath force-pushed the feat/apollo-react-guardrail-remove-dialog branch from e853347 to 1173f1e Compare September 17, 2026 11:18

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.

🟡 Changes recommended

showCloseButton defaults to false even though the PR contract says it must default to true for Flow and Agents.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 27/27 changed files
  • Comments generated: 1
  • Review effort level: Lite

@andreizdrali-uipath
andreizdrali-uipath marked this pull request as ready for review September 17, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-packages Adds dev package publishing on pushes to this PR pkg:apollo-react size:XXL 1,000+ changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants