Skip to content

fix(vscode): keep fields the canvas does not edit - #3565

Closed
markscott-ms wants to merge 1 commit into
finos:mainfrom
markscott-ms:fix/3518-canvas-keeps-fields
Closed

markscott-ms wants to merge 1 commit into
finos:mainfrom
markscott-ms:fix/3518-canvas-keeps-fields

Conversation

@markscott-ms

Copy link
Copy Markdown
Contributor

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, the interfaces of connects ends, and containment descriptions).

flowToCalm now 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:

Case Behaviour
An end of a connects (or custom) relationship moves to a different node That end loses its interfaces, because they belong to the old node
A relationship that the canvas does not draw (for example connects with no destination.node) Kept as it is. A deleted edge stays deleted
interacts edges The parser now also copies protocol and controls. Both are valid on all relationship types
Order Relationships, top-level keys, containment children and edge metadata keys keep their order, so an unchanged document gives the same text, except metadata._layout

The canvas still emits a change when it opens, so the buffer becomes dirty because of _layout (#3552). The reverse relationship of an A→B/B→A pair now keeps its own controls and unedited fields, but it still gets the protocol, description and metadata of its pair (#3519).

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Code style/formatting changes
  • ♻️ Refactoring (no functional changes)
  • ⚡ Performance improvements
  • ✅ Test additions or updates
  • 🔧 Chore (maintenance, dependencies, CI, etc.)

Affected Components

  • CLI (cli/)
  • Schema (calm/)
  • CALM AI (calm-ai/)
  • CALM Hub (calm-hub/)
  • CALM Hub UI (calm-hub-ui/)
  • CALM Lab (calm-lab/)
  • CALM Models (calm-models/)
  • CALM Server (calm-server/)
  • CALM Studio (calm-studio/)
  • CALM Widgets (calm-widgets/)
  • CALMGuard (calm-guard/)
  • Documentation (docs/)
  • Shared (shared/)
  • VS Code Extension (calm-plugins/vscode/)
  • Dependencies
  • CI/CD

Commit Message Format ✅

Testing

  • I have tested my changes locally
  • I have added/updated unit tests
  • All existing tests pass

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.json also gives the same text, except _layout.

Checklist

  • My commits follow the conventional commit format
  • I have updated documentation if necessary
  • I have added tests for my changes (if applicable)
  • My changes follow the project's coding standards

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
@markscott-ms
markscott-ms requested a review from a team as a code owner October 28, 2026 22:03
@markscott-ms

markscott-ms commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Replaced by #3566, from a branch on upstream so that PRs can stack on it.

@markscott-ms
markscott-ms deleted the fix/3518-canvas-keeps-fields branch October 28, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CALM Canvas removes interfaces, development-language and other fields from the architecture when it opens

1 participant