Repository navigation
feat(apollo-react): mark guardrail preview chips from the definition's isPreview - #1472
Conversation
…s isPreview With previewChip on, the palette marked every entry and the list every built-in validator row, so taking one validator out of preview took a release of both hosts. The Agents definitions endpoint now sends isPreview on each definition, from its PreviewGuardrailTypes flag (UiPath/Agents#6800), so the backend decides per validator. isPreview is modelled on the wire type, kept by the parser and copied by enrichment. The palette and the list (through the row's resolved definition) skip the chip only when it is false. Absent reads as preview: an older backend, a host that does not map the field yet, or a row whose definition has not resolved keeps today's chip, so deploy order does not matter. previewChip still opts a host in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dependency License Review
License distribution
Excluded packages
|
There was a problem hiding this comment.
🟢 Approval recommended
The narrow change consistently propagates the optional flag, preserves backward compatibility, and includes focused regression coverage with no blocking issues identified.
No open issues 🎉
What changed in this PR
Updates Apollo React’s shared guardrail components to use each definition’s isPreview flag, allowing the backend to control preview badges without coordinated host releases.
Changes:
- Adds optional
isPreviewfields and preserves them through parsing and enrichment. - Hides preview chips only for explicit
false, preserving existing defaults and the host’spreviewChipopt-in. - Adds regression tests and updates documentation. Tests were not executed during this review.
All paths below are relative to packages/apollo-react/src/canvas/components/Guardrails/.
| File | Description |
|---|---|
README.md |
Documents per-definition preview behavior. |
palette-types.ts |
Adds the optional palette preview flag. |
list-types.ts |
Adds the optional list preview flag. |
guardrail-palette.tsx |
Suppresses preview chips for explicit false. |
guardrail-palette.test.tsx |
Covers true, false, and absent preview flags. |
definitions-wire.ts |
Adds the flag to the wire contract. |
definitions-parse.ts |
Accepts the optional boolean during parsing. |
definitions-parse.test.ts |
Tests flag preservation and omission. |
definitions-enrich.ts |
Copies the flag into enriched definitions. |
definitions-enrich.test.ts |
Tests propagation through parsing and enrichment. |
components/guardrail-list-row.tsx |
Uses the resolved definition to gate preview chips. |
components/guardrail-list-row.test.tsx |
Tests explicit flags and unresolved-definition fallback. |
builder-types.ts |
Defines and documents the shared preview flag. |
Review effort: Balanced
Storybook visual diff⏭️ Skipped: the apollo-design preview deployment did not succeed, so no comparison ran. Logs Updated (PT): Oct 26, 2026, 07:11:18 AM |
📊 Coverage + size by packagePer-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.
"Coverage" is each package's own |
Summary
With
previewChipon, the guardrail palette marks every entry and the list every built-in validator row, so taking a validator out of preview needs a release of both hosts. The Agents definitions endpoint now sendsisPreviewon each definition, from itsPreviewGuardrailTypesflag (UiPath/Agents#6800), and this makes the shared components follow it.isPreview?: booleanonGuardrailDefinitionWire,GuardrailDefinition,GuardrailPaletteDefinitionandGuardrailListDefinition; kept byparseGuardrailDefinitionsand copied byenrichGuardrailDefinitions.isPreview: false; the list does the same through the row's resolved definition.previewChipstill opts a host in. README notes updated.Agents and Flow pass the field through and bump to this release in UiPath/Agents#6800 and a Flow PR.
Tests
New cases in
definitions-parse.test.ts,definitions-enrich.test.ts,guardrail-palette.test.tsxandcomponents/guardrail-list-row.test.tsx(true, false, absent). Not run locally yet; CI will.🤖 Generated with Claude Code