feat(apollo-react): don't change node shape when collapsed [MST-12493]#925
feat(apollo-react): don't change node shape when collapsed [MST-12493]#925Holychung wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
c3ee110 to
9aab2f1
Compare
Dependency License Review
License distribution
Excluded packages
|
📊 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 |
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.
…he Stacked Treatment story
9aab2f1 to
945523a
Compare
There was a problem hiding this comment.
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 => {
…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.
There was a problem hiding this comment.
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 tosquareand then expanded back torectangle. Since this PR makes collapsing preserve shape, this helper is now misleading and itssquare→rectangletransformation 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);
};
…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.
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.
e46844e to
d97bbed
Compare
Problem
resolveDisplaysquared 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
resolveDisplayno longer transforms shape on collapse — the shape is kept (resolved from instance override or manifest) whether expanded or collapsed.isStackedand artifact-handle hiding are unchanged.getCollapsedShape,getCollapsedSize,getExpandedShape.collapse.ts→node-size.ts— the file now only holdsgetExpandedSize(shape → default node size, used by add-node alignment + layout), which is not collapse-related.getCollapsedShape,getCollapsedSize, andgetExpandedShapeare removed from the public@uipath/apollo-react/canvasAPI. 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 fromnode-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.