Repository navigation
feat(view): list an action's unconnected parameter pins in a parameters compartment - #1598
Merged
Merged
Conversation
…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>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…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>
…partment Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # internal/ir/view/label.go # internal/ir/view/plantuml.go
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
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.
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), sosysml -render '#action:A::add' -render-form mermaidstill showed a lone«calc» add / declares no nodesbox with a%% not represented: 3 pin(s) not drawn (A::add.x, A::add.y, A::add.result)notice — and the Jupyter kernel's%vizbundles 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
parameterscompartment of its node, one line per pin as the tree form (#1584) writes it:in x,in y,out result, the type undertypings, an inherited pin^-marked. Thepin(s) not drawnnotice 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'sparameterLines, 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 theirusedPorts), every parameter pin for PlantUML.#action:A::addon this branch:Text and DOT are unchanged (they drew the pins already).
Based on
develop(#1583 and #1584 merged in; the overlap with #1584'sparameterLinesresolved by keeping both itspinLinesfor 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 theparameterscompartment 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:providelistsparameters / in ^fuel(its^torquepin is drawn, the flow ends there); in PlantUMLmonitorlistsin readingtoo, PlantUML drawing no pin; the1 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, andmeasure/scalethe pins the flow does not end at); the3 pin(s) not drawnnotices are gone.No text, DOT, tree, case, state, interconnection, sequence or table golden moved.
How it was verified
internal/ir/view:TestMermaidActionFramePins,TestPlantUMLActionFramePins,TestD2ActionGlyphsAndPins,TestPlantUMLActionUsesStateGrammarandTestMixedActionPinsKeepTheirFormBehaviornow assert the compartment lines and the absence of the notice (they asserted the notice before).TestHiddenCompartmentsListNoParameters: a view whose rendering statesshowCompartments = falselists noparameterscompartment and its undrawn pins return to the notice (labeller.listsgates the compartment oncompartmentsbeing shown);TestMixedActionPinsKeepTheirFormBehavioralso checks the mixed PlantUML form, whose rectangle grammar writes an action's pins asports, does not list a pin it writes.internal/frontend/jupyter: newTestVizListsACalculationsParametersruns the reporter's model through the kernel engine and checks the%viz A::adddisplay bundle's Mermaid MIME holdsparameters / in x / in y / out resultand nopin(s) not drawn.bin/sysml add.sysml -render '#action:A::add' -render-form {mermaid,plantuml,d2}as above.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 testandmake lintpass locallydocs/reference/cli.md,docs/project/view-rendering-forms.md)changes/unreleased/calc-pins-compartment.changed.mdmake docs-countsrun if a gate count moved (no count moved)