Repository navigation
feat(DiagramLayout): per-symbol compartment switches on Layout - #8
Merged
Merged
Conversation
…mbol draws Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
HuiJun
marked this pull request as ready for review
October 16, 2026 12:23
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.
Summary
DiagramLayout::Layoutgains seven optional Boolean switches,showAttributes,showParts,showReferences,showPorts,showConstraints,showItemsandshowActions, one per compartment kind of the annotated element's box. Unset means the compartment is drawn;falsemeans the modeler suppressed it on that symbol, so a renderer omits it instead of drawing it into a box sized without it.The need comes from SysML v1 migration: a Cameo symbol stores which compartments the modeler collapsed (
SUPPRESS_PARTS_COMPARTMENT,SUPPRESS_CLASS_OPERATIONS, …, on the symbol or in its symbol style), and the box it keeps is sized for the compartments left visible. Migrating only the box asLayoutmakes a renderer clip every compartment into the small box. The switches are per symbol, like the rest ofLayout, because the same element is drawn with different compartments in different views and different symbols of one view.Candidate forms, ranked by SysML v2 spec compliance and probed with the pinned pilot (
validate-sysml-batch, 2026-08) and OpenSysMLsysml -validate:show…attributes onLayout(this change) — user-defined metadata with literal Boolean values (model-level evaluable), each switch a declared attribute the language resolves, same shape as the existingcollapsedand theshow…attributes of a rendering. Pilot clean, sysml clean.enum def Compartmentwithattribute hidden : Compartment[0..*]— also valid (pilot clean, sysml clean) butreferencesis a keyword, so the literal set cannot mirror the compartment names, and a list is no more extensible than optional attributes.attribute hidden : ScalarValues::String[0..*]— valid (pilot clean, sysml clean) but the compartment names are unchecked strings.rendering noParts :> asTreeDiagram { attribute showParts : Boolean = false; }) — standard-only text and valid, but view-wide: it cannot keep two symbols of one view drawn differently.filterremoves the element from the whole view, not a compartment from one symbol.Semver impact
MINOR: adds attributes to an existing metadata definition; nothing is removed or renamed. The
DiagramLayout::Layoutmanifest entry lists the new attributes (an addition, not a contract change).How it was verified
./scripts/validate-libraries.sh: 0 errors, 0 warnings on the pinned pilot../scripts/check-engine-contract.sh: clean.metadata Layout about Imaging { x = 10; y = 20; width = 200; height = 33; showParts = false; showAttributes = false; }validates clean on the pilot and on OpenSysML.A matching Open-MBEE/OpenSysML pull request re-pins the vendored copy, writes the switches from the SysML v1 migrator and honours them in the renderers.
Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/4dd157ac12a04bf69f2b84e455f8a37b
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/4dd157ac12a04bf69f2b84e455f8a37b?variant=devin
Requested by: @HuiJun