Skip to content

feat(apollo-react): don't change node shape when collapsed [MST-12493]#925

Open
Holychung wants to merge 5 commits into
mainfrom
feat/keep-shape-on-collapse
Open

feat(apollo-react): don't change node shape when collapsed [MST-12493]#925
Holychung wants to merge 5 commits into
mainfrom
feat/keep-shape-on-collapse

Conversation

@Holychung

@Holychung Holychung commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Problem

resolveDisplay squared a rectangle node whenever it was collapsed (getCollapsedShape). Agents were the only collapsible nodes, and design (UiPath/flow-workbench MST-12167) wants a collapsed agent to keep its footprint — only hide artifacts and show the stacked affordance, not shrink to a square.

Change

  • resolveDisplay no longer transforms shape on collapse — the shape is kept (resolved from instance override or manifest) whether expanded or collapsed. isStacked and artifact-handle hiding are unchanged.
  • Removed the now-dead collapse-shape helpers: getCollapsedShape, getCollapsedSize, getExpandedShape.
  • Renamed collapse.tsnode-size.ts — the file now only holds getExpandedSize (shape → default node size, used by add-node alignment + layout), which is not collapse-related.

⚠️ BREAKING CHANGE

getCollapsedShape, getCollapsedSize, and getExpandedShape are removed from the public @uipath/apollo-react/canvas API. They only supported the collapse↔shape tying being removed. The only in-tree consumer (flow-workbench) is updated in tandem to drop them. getExpandedSize + the size constants remain (re-exported from node-size). → should land as a major version bump.

Tests / storybook

Resolver tests updated (collapsed shape unchanged; instance override honored). BaseNode → "Stacked Treatment" demos a collapsed rectangle staying a wide pill + stacked. Verified end-to-end via a local link into flow-workbench (collapsed agent = pill + stacked).

Driven by UiPath/flow-workbench MST-12167.

Copilot AI review requested due to automatic review settings July 16, 2026 22:55
@github-actions

github-actions Bot commented Jul 16, 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 17, 2026, 11:37:08 AM
apollo-docs 🟢 Ready Preview, Logs Jul 17, 2026, 11:37:08 AM
apollo-landing 🟢 Ready Preview, Logs Jul 17, 2026, 11:37:08 AM
apollo-vertex 🟢 Ready Preview, Logs Jul 17, 2026, 11:37:08 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Holychung Holychung changed the title feat(canvas): add keepShapeOnCollapse to preserve node shape when collapsed feat(apollo-react): add keepShapeOnCollapse to preserve node shape when collapsed Jul 16, 2026
Copilot AI review requested due to automatic review settings July 16, 2026 23:53
@Holychung
Holychung force-pushed the feat/keep-shape-on-collapse branch from c3ee110 to 9aab2f1 Compare July 16, 2026 23:53
@github-actions github-actions Bot added size:M 30-99 changed lines. and removed size:S 10-29 changed lines. labels Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

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

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 4 out of 4 changed files in this pull request and generated no new comments.

@github-actions

github-actions Bot commented Jul 16, 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 37.2% 100.0% (6/6) 7.38 MB 28.15 MB −498 B
@uipath/apollo-wind 40.3% 395.2 KB 2.57 MB +14 B
@uipath/ap-chat 85.8% 43.43 MB 55.92 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.

resolveDisplay squared a rectangle node whenever it was collapsed
(getCollapsedShape). Agents were the only collapsible nodes, and design wants
them to keep their footprint when collapsed — only hide artifacts and show the
stacked affordance. Collapsing now never changes a node's shape.

Removes getCollapsedShape and the shape-squaring branch in resolveDisplay;
isStacked and artifact-handle hiding are unaffected.
@Holychung Holychung changed the title feat(apollo-react): add keepShapeOnCollapse to preserve node shape when collapsed feat(apollo-react): don't change node shape when collapsed Jul 17, 2026
Copilot AI review requested due to automatic review settings July 17, 2026 13:01
@Holychung
Holychung force-pushed the feat/keep-shape-on-collapse branch from 9aab2f1 to 945523a Compare July 17, 2026 13:01

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 4 out of 4 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

packages/apollo-react/src/canvas/utils/collapse.ts:26

  • getExpandedShape (and its docstring) still assumes the legacy rectangle→square collapse transformation, but that helper has been removed and collapse no longer changes shapes. Keeping this conversion will incorrectly turn genuinely-square nodes into rectangles and is misleading for callers.
 * Transform a collapsed shape back to its expanded form.
 * Square nodes expand to rectangle (since rectangle → square when collapsing).
 * Other shapes remain unchanged.
 */
export const getExpandedShape = (collapsedShape?: NodeShape): NodeShape | undefined => {

Comment thread packages/apollo-react/src/canvas/utils/manifest-resolver.ts
@Holychung
Holychung requested a review from akraminakib July 17, 2026 14:34
…splay

Addresses review: the shape was pinned to manifestDisplay.shape, dropping
instance/node-data display.shape overrides. Resolve it from
context.display.shape ?? manifestDisplay.shape (collapse still never changes it).
Also drops spaced em dashes from the Stacked Treatment story copy.
Copilot AI review requested due to automatic review settings July 17, 2026 14:36

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 4 out of 4 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

packages/apollo-react/src/canvas/utils/collapse.ts:28

  • getExpandedShape (and its doc) still assumes the old behavior where rectangle nodes collapsed to square and then expanded back to rectangle. Since this PR makes collapsing preserve shape, this helper is now misleading and its squarerectangle transformation is inconsistent with the new contract. Consider making it a no-op (or removing it if truly unused) so future callers don't reintroduce shape changes via these utilities.
/**
 * Transform a collapsed shape back to its expanded form.
 * Square nodes expand to rectangle (since rectangle → square when collapsing).
 * Other shapes remain unchanged.
 */
export const getExpandedShape = (collapsedShape?: NodeShape): NodeShape | undefined => {
  return collapsedShape === 'square' ? 'rectangle' : (collapsedShape ?? undefined);
};

Comment thread packages/apollo-react/src/canvas/utils/collapse.ts
…dShape

With collapse no longer tied to shape, these helpers are dead in apollo.
collapse.ts now holds only the node default-sizing helper (getExpandedSize)
and its size constants.
Copilot AI review requested due to automatic review settings July 17, 2026 15:30
@github-actions github-actions Bot added size:L 100-499 changed lines. and removed size:M 30-99 changed lines. labels Jul 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 4 out of 4 changed files in this pull request and generated no new comments.

@Holychung Holychung changed the title feat(apollo-react): don't change node shape when collapsed feat(apollo-react): don't change node shape when collapsed [MST-12493] Jul 17, 2026
Copilot AI review requested due to automatic review settings July 17, 2026 17:08

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 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread packages/apollo-react/src/canvas/utils/index.ts
The file only holds the shape to default-size helper now (getExpandedSize),
not collapse logic. Renamed for clarity; export names kept so consumers
(flow-workbench) don't break.

BREAKING CHANGE: getCollapsedShape, getCollapsedSize, and getExpandedShape are
removed from the public canvas/utils API. They only supported the removed
collapse-to-shape tying (collapse no longer changes a node's shape).
getExpandedSize and the size constants are unaffected.
@Holychung
Holychung force-pushed the feat/keep-shape-on-collapse branch from e46844e to d97bbed Compare July 17, 2026 18:31
@Holychung
Holychung requested a review from akraminakib July 17, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:apollo-react size:L 100-499 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants