Skip to content

feat(apollo-react): add JsonValuePanel schema-aware JSON viewing/editing components#892

Draft
BenGSchulz wants to merge 1 commit into
mainfrom
feat/node-io-panel
Draft

feat(apollo-react): add JsonValuePanel schema-aware JSON viewing/editing components#892
BenGSchulz wants to merge 1 commit into
mainfrom
feat/node-io-panel

Conversation

@BenGSchulz

@BenGSchulz BenGSchulz commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds JsonValuePanel to @uipath/apollo-react/canvas — a generic, schema-aware JSON viewing/editing panel — plus a standalone NodeModeSelect dropdown. Extracted from flow-workbench's node Input/Output properties panels, but deliberately de-node-ified so it can serve as a general "JSON schema + value" surface.

What's included

JsonValuePanel (src/canvas/components/JsonValuePanel/)

  • Merged schema/value tree with inline editing (scalars, enums, booleans, containers-as-JSON), search, consumer-defined filters, expand/collapse, and path/value copy (pathForCopy lets consumers wrap copied paths, e.g. {{path}})
  • Consumer extension points:
    • renderValue custom value cells + RenderValueContext.commit/clear (clear routes through new removeValueAtPath)
    • rowWrapper for row-level integration (e.g. dnd-kit drag sources)
    • extraTabs / defaultTab / onTabChange for host-registered views alongside Schema/JSON
    • jsonView slot, beforeContent, basePath, title* props (PanelTitleBar)
    • decorateNode per-row annotations: label (display text replacing the raw key — key still drives paths/edits), sublabel, leading icon, and chip { label?, icon?, tooltip?, tone? } (icon-only chips render bare with role="img" + tooltip). Search matches decoration labels/sublabels via flattenValueTree's displayTexts option
  • Required-field markers, schema-status decoration (schemaStatusDecoration) as an opt-in
  • Localized via useSafeLingui (canvas.json_value_panel.*; catalog keys added to locales/en.jsonlingui extract does not pick up _() descriptors)

NodeModeSelect (src/canvas/components/NodeModeSelect/)

  • Live / Static / Simulated / Disabled mode dropdown using DropdownMenuRadioGroup
  • DEFAULT_NODE_MODES (English const) + localized useDefaultNodeModes() hook (canvas.node_mode_select.*); options prop for subsetting/overrides

Testing

  • 66 tests passing across the JsonValuePanel folder (tree building/editing, decoration, search, tabs, basePath, clear, rowWrapper, copy) + NodeModeSelect suite
  • tsc --noEmit clean, biome format clean
  • Storybook: Components/Panels/Json Value Panel incl. a new Grouped Sources story demonstrating the decoration API

Notes for reviewers

  • First consumer is flow-workbench's flagged node IO panels (companion PR: UiPath/flow-workbench#2387); currently consumed via a locally packed tarball until this ships in a release
  • ValueTreeNode naming refers to tree nodes, not flow nodes

Copilot AI review requested due to automatic review settings July 7, 2026 06:41
@github-actions

github-actions Bot commented Jul 7, 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 Jul 10, 2026, 02:26:47 PM
apollo-docs 🟢 Ready Preview, Logs Jul 10, 2026, 02:26:47 PM
apollo-landing 🟢 Ready Preview, Logs Jul 10, 2026, 02:26:47 PM
apollo-vertex 🟢 Ready Preview, Logs Jul 10, 2026, 02:26:47 PM

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Dependency License Review

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

@BenGSchulz BenGSchulz added the dev-packages Adds dev package publishing on pushes to this PR label Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📦 Dev Packages

Package Status Updated (PT)
@uipath/apollo-react@4.58.0-pr892.f57faea 🟢 Published Jul 10, 2026, 02:25:51 PM

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 new reusable canvas building blocks to @uipath/apollo-react: a schema-aware JSON inspection/editing panel (JsonValuePanel) with supporting tree/editor utilities, plus a standalone NodeModeSelect dropdown for node execution modes.

Changes:

  • Introduces JsonValuePanel (schema/value merge, inline edits, search/filter, copy path/value, optional decorations, extra tabs) with Storybook stories and comprehensive tests.
  • Adds NodeModeSelect + localized defaults (useDefaultNodeModes) with unit tests and exports.
  • Updates canvas exports and English locale catalog; simplifies NodePropertyPanel stories by removing the older concept output-panel helpers.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/apollo-react/src/canvas/locales/en.json Adds i18n strings for JsonValuePanel and NodeModeSelect.
packages/apollo-react/src/canvas/components/NodePropertyPanel/NodePropertyPanel.stories.tsx Removes the prior “Output Panel helpers” concept code from stories.
packages/apollo-react/src/canvas/components/NodeModeSelect/NodeModeSelect.tsx New node-mode dropdown component with localized defaults hook.
packages/apollo-react/src/canvas/components/NodeModeSelect/NodeModeSelect.test.tsx Tests for accessibility semantics, behavior, and disabled state.
packages/apollo-react/src/canvas/components/NodeModeSelect/index.ts Barrel exports for NodeModeSelect.
packages/apollo-react/src/canvas/components/JsonValuePanel/valueTree.ts Core schema/value merge + flattening/filtering + path helpers + schema decoration helpers.
packages/apollo-react/src/canvas/components/JsonValuePanel/valueTree.test.ts Unit tests for tree building, path helpers, filtering, and decorations.
packages/apollo-react/src/canvas/components/JsonValuePanel/PanelTitleBar.tsx New compact panel title/header row component.
packages/apollo-react/src/canvas/components/JsonValuePanel/JsonValueTreeToolbar.tsx New toolbar for filter/search/collapse-all controls.
packages/apollo-react/src/canvas/components/JsonValuePanel/JsonValueTree.tsx New interactive tree UI (copy/edit/wrap, decoration, custom cells).
packages/apollo-react/src/canvas/components/JsonValuePanel/JsonValuePanel.types.ts Public types for schema/value tree, decorations, tabs, and panel props.
packages/apollo-react/src/canvas/components/JsonValuePanel/JsonValuePanel.tsx New panel component composing toolbar + tree + JSON tab(s).
packages/apollo-react/src/canvas/components/JsonValuePanel/JsonValuePanel.test.tsx Integration-style tests covering editing, copy, search/filter, tabs, and extension points.
packages/apollo-react/src/canvas/components/JsonValuePanel/JsonValuePanel.stories.tsx Storybook stories demonstrating the panel, extensions, and decorations.
packages/apollo-react/src/canvas/components/JsonValuePanel/JsonValueEditor.tsx Inline editors for leaf and container editing (single-line + multiline + JSON).
packages/apollo-react/src/canvas/components/JsonValuePanel/JsonTypeBadge.tsx JSON type badge component with per-type icons/colors and tone overrides.
packages/apollo-react/src/canvas/components/JsonValuePanel/index.ts Barrel exports for all JsonValuePanel building blocks and helpers.
packages/apollo-react/src/canvas/components/JsonValuePanel/clipboard.ts Clipboard helper with async API + legacy fallback.
packages/apollo-react/src/canvas/components/index.ts Exports JsonValuePanel and NodeModeSelect from the canvas components entrypoint.

Comment on lines +159 to +170
<DropdownMenuRadioGroup value={value} onValueChange={onChange}>
{resolvedOptions.map((option) => {
const Icon = option.icon;
return (
<DropdownMenuRadioItem
key={option.value}
value={option.value}
className={cn(
'group flex items-start gap-2 [&>span:first-child]:hidden',
value === option.value && 'text-foreground'
)}
>
Comment on lines +56 to +60
/** Builds the text copied when a field name is clicked. Defaults to the path itself. */
pathForCopy?: (path: string) => string;
/** Called after something is copied to the clipboard. */
onCopy?: (event: CopyEvent) => void;
emptyMessage?: string;
Comment on lines +251 to +259
/**
* Builds the text copied when a field name is clicked. Defaults to the path
* itself; consumers with an expression syntax can wrap it (e.g. `{{path}}`).
*/
pathForCopy?: (path: string) => string;
/** Called after something is copied to the clipboard. */
onCopy?: (event: CopyEvent) => void;
/** Containers at depth >= this start collapsed. Default 1 (roots open). */
defaultCollapsedDepth?: number;
@github-actions

github-actions Bot commented Jul 7, 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 9.0% 43.82 MB 57.31 MB ±0
@uipath/apollo-react 35.6% 71.4% (377/528) 7.31 MB 27.82 MB +41.1 KB
@uipath/apollo-wind 40.3% 395.0 KB 2.57 MB +75 B
@uipath/ap-chat 85.8% 43.41 MB 55.85 MB +581 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.

@BenGSchulz BenGSchulz force-pushed the feat/node-io-panel branch from de0278f to 95f38ee Compare July 7, 2026 22:39
…ing components

Generic JSON schema/value tree panel (inline editing, search, filters, custom
tabs, path copy) plus the node-domain NodeModeSelect with localized default
execution modes.
Copilot AI review requested due to automatic review settings July 10, 2026 21:21
@BenGSchulz BenGSchulz force-pushed the feat/node-io-panel branch from 95f38ee to ad17de4 Compare July 10, 2026 21: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 22 out of 23 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment on lines +535 to +543
const copy = (node: ValueTreeNode, kind: CopyEvent["kind"], text: string) => {
void copyTextToClipboard(text).then((ok) => {
if (!ok) return;
setCopied({ path: node.path, kind });
if (copyTimerRef.current) clearTimeout(copyTimerRef.current);
copyTimerRef.current = setTimeout(() => setCopied(null), 1500);
});
onCopy?.({ kind, path: node.path, text });
};
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