Skip to content

feat(view): list an action's unconnected parameter pins in a parameters compartment - #1598

Merged
HuiJun merged 7 commits into
developfrom
fix/calc-pins-compartment
Oct 28, 2026
Merged

HuiJun merged 7 commits into
developfrom
fix/calc-pins-compartment

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Follow-up to #1583 (Refs #1576): on that branch an action's or calculation's parameter pins are drawn by default, but the Mermaid, D2 and PlantUML action and mixed forms draw only the pins an edge ends at (PlantUML's state grammar draws none), so sysml -render '#action:A::add' -render-form mermaid still showed a lone «calc» add / declares no nodes box with a %% not represented: 3 pin(s) not drawn (A::add.x, A::add.y, A::add.result) notice — and the Jupyter kernel's %viz bundles Mermaid first, so the reporter's own surface showed the bare box.

Now those forms list every parameter pin they do not draw in a parameters compartment of its node, one line per pin as the tree form (#1584) writes it: in x, in y, out result, the type under typings, an inherited pin ^-marked. The pin(s) not drawn notice no longer names a listed pin (it stays for a pin neither drawn nor listed, of which the forms now have none).

  • labeller.listedPin / labeller.parameterLines / parameterPinLine (label.go): the compartment, appended to a node's lines after its details and before its compartments — the same helper shape as fix(view): render directed calc parameters as parameter pins in tree views #1584's parameterLines, taking a per-pin predicate instead of a per-kind flag so the two merge as a union.
  • Rendering.unconnectedPin (ports.go): the predicate — in an action or mixed rendering, a parameter pin no edge ends at (Mermaid, D2 with their usedPorts), every parameter pin for PlantUML.
  • mermaid.go / d2.go / plantuml.go: wire the predicate into the writer's labeller and the node label; the undrawn-pin notices skip parameter pins.

#action:A::add on this branch:

mermaid   n0("`*«calc»* **add**\n declares no nodes\n parameters\n in x\n in y\n out result`")
plantuml  state "<size:10>//«calc»//</size>\n**add**\ndeclares no nodes\nparameters\nin x\nin y\nout result" as n0 <<calc>> <<usage>>
d2        n0: "«calc»\nadd\ndeclares no nodes\nparameters\nin x\nin y\nout result" { class: usage }

Text and DOT are unchanged (they drew the pins already).

Based on develop (#1583 and #1584 merged in; the overlap with #1584's parameterLines resolved by keeping both its pinLines for trees and this PR's per-pin predicate).

Specification basis

SysML v2 §8.2.3.17 and §8.2.3.19 (informative graphical notation): the action and calculation node forms carry their parameters as param-l*/param-r*/param-b*; a form with no pin on a node lists them in the parameters compartment of §8.2.3's compartment notation, as the tree form does. No row of docs/project/spec-compliance.md moves.

Golden movements

All re-recorded with go test ./internal/ir/view -update, accounted against #1583's head 999fedd — each an existing action golden in one of the three forms whose actions have a pin no edge ends at:

  • action.{mermaid,plantuml,d2}.golden, links-action-{mermaid,plantuml,d2}.golden: provide lists parameters / in ^fuel (its ^torque pin is drawn, the flow ends there); in PlantUML monitor lists in reading too, PlantUML drawing no pin; the 1 pin(s) not drawn (provide.fuel) notice is gone.
  • glyphs-action.plantuml.golden: the same for its parameterised actions.
  • layout-collapsed-action.mermaid.golden: the folded actions' unconnected pins.
  • calc-action-view.mermaid.golden: the four calcs list their parameters (add: in x / in y / out result; Add, total: in x / in y / out r; Stepwise: in load / out result, and measure/scale the pins the flow does not end at); the 3 pin(s) not drawn notices are gone.

No text, DOT, tree, case, state, interconnection, sequence or table golden moved.

How it was verified

  • internal/ir/view: TestMermaidActionFramePins, TestPlantUMLActionFramePins, TestD2ActionGlyphsAndPins, TestPlantUMLActionUsesStateGrammar and TestMixedActionPinsKeepTheirFormBehavior now assert the compartment lines and the absence of the notice (they asserted the notice before).
  • TestHiddenCompartmentsListNoParameters: a view whose rendering states showCompartments = false lists no parameters compartment and its undrawn pins return to the notice (labeller.lists gates the compartment on compartments being shown); TestMixedActionPinsKeepTheirFormBehavior also checks the mixed PlantUML form, whose rectangle grammar writes an action's pins as ports, does not list a pin it writes.
  • internal/frontend/jupyter: new TestVizListsACalculationsParameters runs the reporter's model through the kernel engine and checks the %viz A::add display bundle's Mermaid MIME holds parameters / in x / in y / out result and no pin(s) not drawn.
  • By hand: bin/sysml add.sysml -render '#action:A::add' -render-form {mermaid,plantuml,d2} as above.
  • Gate: gofmt -l . empty, go build ./..., go vet ./internal/ir/view, go test ./internal/ir/view, go test ./internal/frontend/... ./cmd/... ./internal/doc/... ./tests/... (results in the final update).

Checklist

  • make test and make lint pass locally
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (docs/reference/cli.md, docs/project/view-rendering-forms.md)
  • Changelog entry added as changes/unreleased/calc-pins-compartment.changed.md
  • baselines regenerated and make docs-counts run if a gate count moved (no count moved)
  • No internal work-item labels in the body, docs, or changelog

devin-ai-integration Bot and others added 2 commits October 27, 2026 20:25
…rs compartment

The Mermaid, D2 and PlantUML action and mixed forms draw only the pins an
edge ends at; the parameters no edge reaches are now listed under a
parameters heading in their node's label, as the tree form lists them, so a
step-less calc shows in x, in y, out result in every form and the "pin(s)
not drawn" notice no longer names them.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…d PlantUML action forms

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

devin-ai-integration[bot]

This comment was marked as resolved.

…form draws no pin

A rendering hiding its compartments lists no parameters compartment, the
undrawn pins returning to the notice; the mixed PlantUML rendering, which
writes an action's pins as ports, lists only the pins it does not write.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 27, 2026 21:52
…partment

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

# Conflicts:
#	internal/ir/view/label.go
#	internal/ir/view/plantuml.go
Base automatically changed from fix/calc-default-behaviour-view to develop October 28, 2026 01:40
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 2 commits October 28, 2026 01:43
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
@HuiJun
HuiJun merged commit 44876a1 into develop Oct 28, 2026
30 checks passed
@HuiJun
HuiJun deleted the fix/calc-pins-compartment branch October 28, 2026 02:30
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