Skip to content

feat(apollo-react): expose caseFlowManifest + handle hover handlers#756

Merged
kittyyueli merged 1 commit into
mainfrom
claude/adoring-brown-ZGpZ5
May 29, 2026
Merged

feat(apollo-react): expose caseFlowManifest + handle hover handlers#756
kittyyueli merged 1 commit into
mainfrom
claude/adoring-brown-ZGpZ5

Conversation

@kittyyueli

@kittyyueli kittyyueli commented May 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Export caseFlowManifest / caseManagementTriggerManifest (with display.shape: 'circle', source-handle showButton: true, and a change-trigger-type design-mode toolbar action) from apollo-react so PO.Frontend can register its case-management canvas against apollo's manifest pipeline.
  • Re-export BaseCanvasModeProvider from the BaseCanvas barrel so hosts that don't mount BaseCanvas can still satisfy BaseNode's useBaseCanvasMode() dependency.
  • Add optional onMouseEnter / onMouseLeave hooks to apollo's BaseNode add-button, threaded through HandleButtonButtonHandleuseButtonHandlesBaseNodeOverrideConfig.onHandleMouseEnter / onHandleMouseLeave, plus parallel canvasEventBus events.

Motivation

PO.Frontend's case-management canvas is moving its trigger node onto apollo's manifest-driven BaseNode (mirroring flow-workbench's FlowBaseNode pattern). These are the apollo-side changes required to make that consumption possible. The hover handlers in particular let PO.Frontend preserve its existing preview-on-hover UX (translucent ghost node next to the + until the user clicks) without forcing flow-workbench to adopt the pattern — every new callback is optional and defaults to a no-op.

What's new

  • canvas/components/CaseFlow/case-flow.manifest.ts (exports caseFlowCategories, caseManagementTriggerManifest, caseFlowManifest), index.ts barrel, surfaced via canvas/components/index.ts.
  • caseManagementTriggerManifest.toolbarExtensions.design — adds the change-trigger-type action so the apollo toolbar renders it when the trigger is selected.
  • Source handle showButton: true on the trigger so BaseNode draws the inline add-next-stage +.
  • BaseCanvasModeProvider re-export from canvas/components/BaseCanvas/index.ts.
  • HandleMouseEvent (in ButtonHandle.tsx) and CanvasHandleMouseEvent (in CanvasEventBus.ts) — new exported payload types.
  • onMouseEnter / onMouseLeave on HandleButton, ButtonHandle, ButtonHandleConfig, and useButtonHandles (per-handle override beats global, same precedence as onAction).
  • BaseNodeOverrideConfig.onHandleMouseEnter / onHandleMouseLeave — consumer-facing callbacks for hosts.
  • canvasEventBus — new 'handle:mouseenter' / 'handle:mouseleave' event types with CanvasHandleMouseEvent payloads.

Backwards compatibility

All new callbacks are optional and have no default behavior — HandleButton only wires the inner onMouseEnter/onMouseLeave props when a host actually supplies them, and canvasEventBus.emit('handle:mouseenter', ...) is a no-op for any consumer that doesn't subscribe. Existing consumers (flow-workbench, agent canvas, coded-agent flow, etc.) are unaffected because no defaults change. Confirmed by running the full vitest suite (1590 tests, all passing).

Test plan

  • tsc --noEmit clean (excluding pre-existing locale-registry / material/components/ap-tool-call errors)
  • vitest passes, including the new tests for HandleButton, ButtonHandle, useButtonHandles, and BaseNode
  • biome lint clean
  • Storybook builds; new WithHoverPreview and WithToolbarAction stories render under Components/CaseFlow/Trigger
  • Visual regression: trigger circle now has a right-side + (new), and the WithHoverPreview story locks the preview affordance. Visual baselines need refresh — please run npm run test:visual -- --update-snapshots.

Demo

Screen.Recording.2026-05-27.at.9.47.02.PM.mov

Generated by Claude Code

@kittyyueli kittyyueli force-pushed the claude/adoring-brown-ZGpZ5 branch 2 times, most recently from 3e3a600 to 9199366 Compare May 28, 2026 05:02
@github-actions

github-actions Bot commented May 28, 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 May 29, 2026, 09:45:18 AM
apollo-docs 🟢 Ready Preview, Logs May 29, 2026, 09:45:18 AM
apollo-landing 🟢 Ready Preview, Logs May 29, 2026, 09:45:18 AM
apollo-ui-react 🟢 Ready Preview, Logs May 29, 2026, 09:45:18 AM
apollo-vertex 🟢 Ready Preview, Logs May 29, 2026, 09:45:18 AM

@github-actions github-actions Bot added pkg:apollo-react size:XL 500-999 changed lines. labels May 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

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

@kittyyueli kittyyueli force-pushed the claude/adoring-brown-ZGpZ5 branch from 9199366 to 8012fb1 Compare May 28, 2026 22:15
Comment thread packages/apollo-react/src/canvas/components/ButtonHandle/ButtonHandle.tsx Outdated
Comment thread packages/apollo-react/src/canvas/utils/CanvasEventBus.ts Outdated
Comment thread packages/apollo-react/src/canvas/utils/CanvasEventBus.ts Outdated
@kittyyueli kittyyueli force-pushed the claude/adoring-brown-ZGpZ5 branch from 8012fb1 to 36bee11 Compare May 29, 2026 05:53
Surface manifest pieces needed by PO.Frontend's case-management canvas to
register `caseFlowManifest` (PR #720), wrap apollo's `BaseNode` in a thin
host-side `CaseBaseNode` renderer, provide the canvas mode that `BaseNode`
reads via `useBaseCanvasMode()`, and expose hover events on the source-handle
`+` add-button so hosts can mount a hover-preview affordance.

- Add `CaseFlow/index.ts` re-exporting the manifest pieces, and surface it
  via `components/index.ts`.
- Add `toolbarExtensions.design` (change-trigger-type) to the trigger
  manifest, mirroring flow-workbench's `triggerToolbarExtensions`.
- Mark the trigger's source handle as `showButton: true` so `BaseNode`
  draws the inline add-next-stage `+` button (host wires the click via
  `onHandleAction`).
- Re-export `BaseCanvasModeProvider` from the BaseCanvas barrel so hosts
  that don't use apollo's `BaseCanvas` (PO.Frontend has its own) can
  still satisfy `BaseNode`'s mode dependency.
- Plumb optional `onMouseEnter` / `onMouseLeave` callbacks through
  `HandleButton` → `ButtonHandle` → `ButtonHandlesBase` →
  `useButtonHandles` → `BaseNodeOverrideConfig.onHandleMouseEnter` /
  `onHandleMouseLeave`, with parallel `handle:mouseenter` /
  `handle:mouseleave` events on `canvasEventBus`. Hosts (e.g.
  PO.Frontend) use these to preview the to-be-created node when the
  cursor enters the `+`, then commit on `onHandleAction`.
@kittyyueli kittyyueli force-pushed the claude/adoring-brown-ZGpZ5 branch from 36bee11 to 8a725aa Compare May 29, 2026 16:40
@kittyyueli kittyyueli merged commit b73d03f into main May 29, 2026
43 checks passed
@kittyyueli kittyyueli deleted the claude/adoring-brown-ZGpZ5 branch May 29, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:apollo-react size:XL 500-999 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants