Skip to content

feat(DiagramLayout): per-symbol compartment switches on Layout - #8

Merged
HuiJun merged 1 commit into
mainfrom
feature/diagram-layout-compartment-switches
Oct 16, 2026
Merged

HuiJun merged 1 commit into
mainfrom
feature/diagram-layout-compartment-switches

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

DiagramLayout::Layout gains seven optional Boolean switches, showAttributes, showParts, showReferences, showPorts, showConstraints, showItems and showActions, one per compartment kind of the annotated element's box. Unset means the compartment is drawn; false means 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 as Layout makes a renderer clip every compartment into the small box. The switches are per symbol, like the rest of Layout, 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 OpenSysML sysml -validate:

  1. Boolean show… attributes on Layout (this change) — user-defined metadata with literal Boolean values (model-level evaluable), each switch a declared attribute the language resolves, same shape as the existing collapsed and the show… attributes of a rendering. Pilot clean, sysml clean.
  2. An enum def Compartment with attribute hidden : Compartment[0..*] — also valid (pilot clean, sysml clean) but references is a keyword, so the literal set cannot mirror the compartment names, and a list is no more extensible than optional attributes.
  3. attribute hidden : ScalarValues::String[0..*] — valid (pilot clean, sysml clean) but the compartment names are unchecked strings.
  4. A rendering-level switch (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.
  5. The Views library and the graphical notation offer nothing per symbol: a view filter removes 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::Layout manifest 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.
  • A probe model with 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

…mbol draws

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@HuiJun
HuiJun marked this pull request as ready for review October 16, 2026 12:23

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@HuiJun
HuiJun merged commit 5134a14 into main Oct 16, 2026
1 of 2 checks passed
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.

1 participant