Skip to content

feat(apollo-react): add ExpressionEditor field type for NodeManifestPanel#793

Open
1980computer wants to merge 1 commit into
mainfrom
add-expression-editor
Open

feat(apollo-react): add ExpressionEditor field type for NodeManifestPanel#793
1980computer wants to merge 1 commit into
mainfrom
add-expression-editor

Conversation

@1980computer

Copy link
Copy Markdown
Collaborator

Summary

Adds an ExpressionEditor custom field type for use with NodeManifestPanel via MetadataForm's plugin/custom component system.

Previously implemented as a standalone ExpressionField.tsx (removed in #760 during the FormSchema migration). This PR re-introduces expression editing as a proper type: 'custom' field, backed by Monaco/CodeMirror.

What this will add

  • ExpressionEditor — custom MetadataForm field component registered via the plugin system
  • Supports expr mode (JavaScript/TypeScript) and json mode (JSON template)
  • Mode switcher pill (Expr / JSON)
  • Integrates with Monaco/CodeMirror editors already in use in flow-workbench
  • ExpressionEditor story added to Node Property Panel

Depends on

Not yet included

  • Variable binding / {x} bind button — Phase 2

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jun 8, 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 17, 2026, 12:45:57 PM
apollo-docs 🟢 Ready Preview, Logs Jun 17, 2026, 12:45:57 PM
apollo-landing ⚠️ Skipped N/A, Logs Jun 17, 2026, 12:45:57 PM
apollo-vertex 🟢 Ready Preview, Logs Jun 17, 2026, 12:45:57 PM

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Dependency License Review

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

@1980computer 1980computer marked this pull request as ready for review June 8, 2026 17:28
@1980computer 1980computer force-pushed the add-expression-editor branch from ee7c2f6 to da95c64 Compare June 10, 2026 20:20
@1980computer 1980computer force-pushed the add-properties-panel-form-manifest branch 3 times, most recently from 8ef5f19 to 9577354 Compare June 10, 2026 23:01
@1980computer 1980computer force-pushed the add-expression-editor branch from da95c64 to bd8104b Compare June 11, 2026 00:03
@CalinaCristian CalinaCristian force-pushed the add-properties-panel-form-manifest branch 4 times, most recently from c6a7eab to cfc1b2f Compare June 11, 2026 12:43
Base automatically changed from add-properties-panel-form-manifest to ia-and-panel-nodes June 11, 2026 14:15
Base automatically changed from ia-and-panel-nodes to main June 12, 2026 01:19
Copilot AI review requested due to automatic review settings June 17, 2026 15:24
@1980computer 1980computer force-pushed the add-expression-editor branch from bd8104b to cd91c52 Compare June 17, 2026 15:24
@github-actions github-actions Bot added app:storybook size:XXL 1,000+ changed lines. labels Jun 17, 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

This PR introduces new canvas UI components and Storybook updates in apollo-react, notably a new NodePropertyPanel (manifest-driven MetadataForm rendering) and a new ProbeCard (floating debug watch/inspect card). It also adds a standalone ExpressionField demoed in Storybook, but does not appear to implement the PR description’s promised MetadataForm “custom field type” (type: 'custom') backed by Monaco/CodeMirror.

Changes:

  • Added ProbeCard (draggable/resizable watch list UI) plus supporting hooks and unit tests.
  • Added NodePropertyPanel (renders a node’s FormSchema from NodeRegistryProvider, with single-page + multi-step tab support) plus tests and stories.
  • Added ExpressionField (read-only code display + mode toggle) and a Storybook “Expression Editor” story, and updated Storybook nav ordering.

Reviewed changes

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

Show a summary per file
File Description
packages/apollo-react/src/canvas/components/ProbeCard/useLatestRef.ts Adds a small “latest value” ref hook using an isomorphic layout effect.
packages/apollo-react/src/canvas/components/ProbeCard/useDragSession.ts Adds a reusable window-listener-based mouse drag session hook with cleanup.
packages/apollo-react/src/canvas/components/ProbeCard/ProbeResizeHandles.tsx Adds resize handle UI that wires into useDragSession.
packages/apollo-react/src/canvas/components/ProbeCard/ProbeCard.tsx Introduces the ProbeCard component (watch list rendering + drag/resize + wheel forwarding + keyboard delete).
packages/apollo-react/src/canvas/components/ProbeCard/ProbeCard.test.tsx Adds unit tests covering keyboard shortcuts, wheel forwarding, and drag cleanup behavior.
packages/apollo-react/src/canvas/components/ProbeCard/index.ts Exports ProbeCard and related public types.
packages/apollo-react/src/canvas/components/NodePropertyPanel/NodePropertyPanel.types.ts Defines NodePropertyPanelProps.
packages/apollo-react/src/canvas/components/NodePropertyPanel/NodePropertyPanel.tsx Implements manifest-driven FormSchema rendering with tabs for multi-step forms.
packages/apollo-react/src/canvas/components/NodePropertyPanel/NodePropertyPanel.test.tsx Adds unit tests for title bar, close behavior, empty states, and multi-step tab rendering.
packages/apollo-react/src/canvas/components/NodePropertyPanel/NodePropertyPanel.stories.tsx Adds extensive Storybook stories for NodePropertyPanel and an “Expression Editor” demo using ExpressionField.
packages/apollo-react/src/canvas/components/NodePropertyPanel/index.ts Re-exports NodePropertyPanel and ExpressionField APIs.
packages/apollo-react/src/canvas/components/NodePropertyPanel/ExpressionField.tsx Adds a read-only code display component with mode toggle and UI chrome.
packages/apollo-react/src/canvas/components/NodePropertiesPanel/NodePropertiesPanel.stories.tsx Adds a new “Inspector” canvas story variant and supporting imports.
packages/apollo-react/src/canvas/components/index.ts Re-exports ProbeCard and NodePropertyPanel from the canvas components barrel.
apps/storybook/.storybook/preview.tsx Updates Storybook sidebar ordering to include “Node Property Panel”.

Comment on lines +21 to +29
/**
* ExpressionField — syntax-highlighted expression editor with mode switcher.
*
* Phase 1: read-only display with Expr / JSON mode toggle, undo/redo chrome,
* AI assist button, and Insert variable affordance.
*
* Phase 2: live editing via Monaco/CodeMirror with variable binding ({x} pill),
* real-time validation, and IntelliSense.
*/
Comment on lines +13 to +18
/** Short description shown below the editor. */
description?: string;
/** Called when the expression value changes (Phase 2 — editing not yet wired). */
onChange?: (value: string) => void;
/** Called when the user switches between expr and json modes. */
onModeChange?: (mode: ExpressionMode) => void;
Comment on lines +103 to +124
<button
type="button"
onClick={() => onModeChange?.('expr')}
className="rounded px-2 py-0.5 text-[11px] transition"
style={{
color: activeMode === 'expr' ? 'var(--foreground)' : 'var(--foreground-subtle)',
fontWeight: activeMode === 'expr' ? 600 : 400,
}}
>
expr
</button>
<button
type="button"
onClick={() => onModeChange?.('json')}
className="rounded px-2 py-0.5 text-[11px] transition"
style={{
color: activeMode === 'json' ? 'var(--foreground)' : 'var(--foreground-subtle)',
fontWeight: activeMode === 'json' ? 600 : 400,
}}
>
json
</button>
@github-actions

github-actions Bot commented Jun 17, 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 34.8% 0.0% (0/42) 45.94 MB 69.59 MB +3.0 KB
@uipath/apollo-wind 38.2% 315.6 KB 2.14 MB +14 B
@uipath/ap-chat 85.8% 43.36 MB 55.68 MB ±0

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

@1980computer 1980computer force-pushed the add-expression-editor branch from cd91c52 to 68ad46b Compare June 17, 2026 15:44
@github-actions github-actions Bot added size:L 100-499 changed lines. and removed app:storybook size:XXL 1,000+ changed lines. labels Jun 17, 2026
Scaffolds four Storybook stories for the Node Property Panel expression
editor variants:

- Editor Full: expanded panel with toolbar, mode switcher, undo/redo,
  AI assist, and Insert variable affordance
- Editor Compact: collapsed field rows that expand inline on click
- Editor Inline: single-line fx inputs with variable pill support
- Inline Editing: node title and description editable directly in the
  identity row (click to edit, Enter/blur to confirm)

Downgrades Storybook app Vite from 8 to 7 to resolve a pre-bundling
incompatibility between Vite 8, MUI, and Emotion that caused all story
previews to show a white screen.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@1980computer 1980computer force-pushed the add-expression-editor branch from 68ad46b to fa02c32 Compare June 17, 2026 19:32
Copilot AI review requested due to automatic review settings June 17, 2026 19:32
@github-actions github-actions Bot added app:storybook size:XXL 1,000+ changed lines. and removed size:L 100-499 changed lines. labels Jun 17, 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 3 out of 4 changed files in this pull request and generated 4 comments.

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

Comment on lines +5 to +13
const meta: Meta = {
title: 'Components/Panels/Node Property Panel',
parameters: {
layout: 'fullscreen',
},
};

export default meta;
type Story = StoryObj;
Comment on lines +82 to +87
<button
type="button"
className="grid size-7 place-items-center rounded-lg text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground"
>
<Sparkles size={12} />
</button>
Comment on lines 38 to 42
"storybook": "^10.4.1",
"tailwindcss": "^4.1.17",
"typescript": "^5.9.3",
"vite": "^8.0.0",
"vite": "^7.3.5",
"vite-plugin-svgr": "^4.5.0"
Comment on lines +10 to +17
/** Editor mode — JavaScript expression or JSON template. Defaults to 'expr'. */
mode?: ExpressionMode;
/** Short description shown below the editor. */
description?: string;
/** Called when the expression value changes (Phase 2 — editing not yet wired). */
onChange?: (value: string) => void;
/** Called when the user switches between expr and json modes. */
onModeChange?: (mode: ExpressionMode) => void;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants