Repository navigation
fix(apollo-react): keep a cleared node name empty instead of the manifest label [MST-17199] - #1453
Conversation
…fest label [MST-17199] Clearing a BaseNode's label inline deleted display.label, so resolveDisplay fell back to the manifest label and the node showed its type name again. Store label: '' instead; resolveDisplay already keeps it and NodeLabel shows the empty-label placeholder. An empty subLabel is still dropped. Behavior change: clearing a name no longer resets it to the type name. A consumer that wants the reset must delete display.label itself. ContainerNode keeps its reset-on-clear behavior for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dependency License Review
License distribution
Excluded packages
|
bryan-uipath
left a comment
There was a problem hiding this comment.
thanks for making the change here @snuziale !
📊 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 |
Problem
Found by Maestro Flow in MST-17199. Flow works around it in flow-workbench#5404.
BaseNode'shandleLabelChangedeleteddisplay.labelwhen the committed value was empty.resolveDisplaythen fell through tomanifest.canvasLabel ?? manifest.label.resolveDisplayalready uses??, so it keepslabel: ''.NodeLabelalready renders theempty-label-placeholderfor an empty label. Thedeletewas the only thing preventing an unnamed node.label: ''.{ display: { label: 'Fetch orders' } }, name cleared inlineupdateNodeData('script1', …){ display: {} }{ display: { label: '' } }Fix
handleLabelChangealways writeslabel, including''.subLabelis still deleted, so a label-only edit doesn't addsubLabel: ''to every node.useInlineLabelEditingonly callsonChangewhen the trimmed text changed. Opening and closing the editor on a node that was never renamed writes nothing.Behavior change⚠️
Clearing a node's name on the canvas no longer resets it to the node type's name. It leaves the node unnamed, which is what the user asked for. A consumer that relied on "clear to reset" must delete
display.labelitself.Not in scope
ContainerNodekeeps its reset-on-clear behavior (ContainerNode.tsxhandleLabelChange, documented there as deliberate). It has no empty-title placeholder, solabel: ''would render a blank header. That needs its own change if containers should match.label || 'Unknown Node'inresolveDisplay).display.canvasLabelstill shows it after an inline clear, becausecanvasLabeloutrankslabel. This is unchanged.Follow-up for Flow
After this ships, delete
packages/canvas/src/components/hierarchical-canvas/utils/keep-cleared-label.ts, its test and thekeepClearedLabelEmptycall inFlowCanvas.tsx'sonNodesChange.Tests
BaseNode.test.tsx:updateNodeDatais now a hoisted mock, plus a new Inline label editing group:label: ''(fails onmain, passes here);subLabelis still dropped;icon,color) are kept.manifest-resolver.test.ts: an emptyinstance.labeldoesn't fall back to the manifest label. This pins down the contract the fix relies on.Validation
Automated:
vitest run src/canvas: 3,673 tests.JsonTree.import.test.tsfailed on a timeout in the full run and passes alone; it's unrelated.tsc --noEmit: clean.pnpm turbo build --filter=@uipath/apollo-react...: green.Manual, in Storybook (
Nodes/BaseNode → Label Resolution, design mode, realupdateNodeData):mainmanifest.canvasLabel("Send Email")deletepath, so it would revert to "Send Email")No new console errors or warnings.
One UX note: when the name is empty but a description remains, the empty name row has 0px height. Renaming then goes through double-clicking the description. Both editors open, so it works, but it is less discoverable than the placeholder. This is the same state the properties panel already produces today.
🤖 Generated with Claude Code