Repository navigation
fix(vscode): keep fields the canvas does not edit - #3565
Closed
markscott-ms wants to merge 1 commit into
Closed
markscott-ms wants to merge 1 commit into
markscott-ms wants to merge 1 commit into
Conversation
CALM Canvas wrote each node and relationship again from the fields it edits, so opening the canvas removed all other fields. Start from the original element instead, keep relationships the canvas does not draw, and keep the document order. Closes finos#3518
Contributor
Author
|
Replaced by #3566, from a branch on upstream so that PRs can stack on it. |
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 #3518.
CALM Canvas wrote each node and relationship again from only the fields that it edits. Thus, to open the canvas removed all other fields from the document (for example
development-language, theinterfacesofconnectsends, and containment descriptions).flowToCalmnow starts from the original element and changes only the fields that the canvas edits. If the user clears one of those fields, it is removed.Decisions and gotchas:
connects(or custom) relationship moves to a different nodeinterfaces, because they belong to the old nodeconnectswith nodestination.node)interactsedgesprotocolandcontrols. Both are valid on all relationship typesmetadatakeys keep their order, so an unchanged document gives the same text, exceptmetadata._layoutThe canvas still emits a change when it opens, so the buffer becomes dirty because of
_layout(#3552). The reverse relationship of anA→B/B→Apair now keeps its owncontrolsand unedited fields, but it still gets theprotocol,descriptionandmetadataof its pair (#3519).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 ✅
Testing
A new round-trip test uses a document with each optional field and checks that parse, then
flowToCalm, gives the same text. Other new tests cover edits, reconnected ends, relationships that are not drawn, containment and bidirectional pairs.calm/architecture/calm-3.jsonalso gives the same text, except_layout.Checklist