Repository navigation
fix(vscode): keep every container of a node with several parents - #3574
Open
caisindenis wants to merge 17 commits into
Open
caisindenis wants to merge 17 commits into
caisindenis wants to merge 17 commits into
Conversation
CALM Canvas kept one parent per node and rebuilt containment from it on save, so a node in several containers lost all but one membership. The canvas now draws the node in each container. Copies share the CALM id, are written once, and edits apply to every copy. Closes finos#3571 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copies multiply with each level of shared containers. Above 1000 drawings, each node is drawn in its first container only, and the save still writes its other memberships. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A large architecture with no shared nodes no longer disables copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Saved positions in _layout are keyed by node id, and main drew a node in its last container. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… drawings Write each containment relationship back with its id, place and fields, and keep memberships the canvas does not draw (a container that is not a node, a cycle, a self reference, a redundant parent). Each node's first container is the one main drew it in. Deleting or unparenting one drawing removes its membership from every drawing, and a drop into a container with several drawings rebuilds the canvas from the file. Paste no longer copies hidden memberships. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ions When the diagram has copies or memberships that are not drawn, a delete or unparent rebuilds the canvas from the file, so the canvas and the file agree. Positions carry over by each drawing's path of CALM ids, because a drawing can take the CALM id from one that goes. Write the layout in file order, resolve definitions once per CALM node, and remove a loop that could no longer change anything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The schema needs at least one member. Drop a relationship that an edit left empty when its container has another one or is not a node, and give a relationship with no unique-id the id main gave it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…her container React Flow passes the drawings nested in a deleted drawing too, and each was treated as a pick, so other drawings of them went too. A nested node that is also in a container that stays is now kept. A delete that reloads the canvas saves once, and a standard dropped on a copy links the node once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vas edits A standard dropped on a copy linked the copy when the DOM found the drawing, so a second drop added the relationship again. Delete, unparent, drop, paste, validation badges and definition lookups for nodes in several containers are now pure functions in canvas-edits, tested by round trips through the parser and the save. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts remove changes React Flow calls onNodesChange with a remove change for every deleted drawing after onNodesDelete, so a nested node that a delete kept was removed again. Add a test that renders the canvas and plays the React Flow callbacks in order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ere it was React Flow removes the edges of deleted drawings before onNodesDelete, and that save ran before the reload, so a delete with edges saved twice. A node a delete kept was placed at its position relative to its old container. A node with no unique-id kept its place in the file only by chance. Remove the drop reload: a drop always lands in the outer container, which has one drawing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each new test fails when its behaviour is reverted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
@caisindenis please resolve the merge conflicts and then we'll take a look. You may also want to ensure any fixes that were done on #3570 and also need applied here are done. |
…ulti-parent A standard dropped on a node now adds its controls to every drawing of that node, so a drop on a copy is saved. linkTargetOf had no user left. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… container Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s and drags The notice moves to the canvas store, because a state setter in the load effect fails lint. A drag into a container rebuilds the canvas when the diagram has copies, as delete and unparent do. A standard drop resolves each control once per node, not once per drawing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Done. 90920fd merges From #3570, the edge fixes do not apply here, because the canvas keeps each edge on one drawing. The copy limit notice does apply: 9e420ae and 537fc6a show it on the canvas. |
Contributor
Author
@markscott-ms this is done |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #3571. Related to #3569 and #3570.
CALM Canvas kept one container per node and rebuilt
deployed-in/composed-offrom it on save. A node in several containers (for example a namespace in two clusters) lost all but one membership from the file after any canvas edit.Now the canvas draws the node, with everything nested in it, in each container:
mainused (the last one that does not close a cycle) keeps the CALM id, so positions saved in_layoutstill apply. Each other drawing is a copy with its own React Flow id and the CALM id indata.calmId.Known limit, as on
main: dagre fails on an edge to a container that has children, and the canvas falls back to a grid. Copies make such containers more common.Also fixed while here:
unique-id(not valid CALM)Type of Change
Affected Components
cli/)calm/)calm-ai/)calm-hub/)calm-hub-ui/)calm-lab/)calm-models/)calm-server/)calm-studio/)calm-widgets/)calm-guard/)docs/)shared/)calm-plugins/vscode/)Commit Message Format ✅
fix(vscode): keep every container of a node with several parentsTesting
Written test-first: parser, save round-trip, canvas edit helpers, and new
Apptests for delete, unparent, rename and drop on copies. Fresh-context reviews ran, and each finding was fixed with a test that fails without the fix. On Node 26,npm run build,npm test(all workspaces) andnpm run lintpass.Checklist
🤖 Generated with Claude Code