Skip to content

Add dynamic view synthesis, new diagram tokens, and self-tests#25

Merged
Malcolmnixon merged 5 commits into
mainfrom
feature/dynamic-ad-hoc-views
Jul 11, 2026
Merged

Add dynamic view synthesis, new diagram tokens, and self-tests#25
Malcolmnixon merged 5 commits into
mainfrom
feature/dynamic-ad-hoc-views

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

This pull request implements and documents the new "dynamic (ad-hoc) views" feature, which allows rendering any supported view type of any resolvable model element directly from the command line, without requiring a pre-declared view in the SysML source. The work includes CLI, design, requirements, and verification documentation, as well as updates to the rendering core to support and describe the new DynamicViewSynthesizer unit. It also clarifies the routing logic for view kinds and documents known limitations and compatibility checks.

Dynamic (ad-hoc) view feature:

  • Added support for rendering any view type of any resolvable element via new CLI flags (--view-type, --view-target, and optional --filter), implemented by the new DynamicViewSynthesizer unit in the Core Rendering Internal subsystem. [1] [2] [3] [4] [5] [6]
  • Updated the documentation (README.md, design docs) to describe usage, options, and compatibility rules for dynamic views, including table updates and extended usage examples. [1] [2] [3]

Rendering pipeline and strategy routing:

  • Extended DiagramTypeRouter to recognize and explicitly route all supported view kind tokens (asGeneralDiagram, asStateTransitionDiagram, asActionFlowDiagram, asSequenceDiagram, asGridDiagram) in addition to the existing ones, ensuring dynamic and declared views are dispatched consistently. [1] [2] [3]
  • Documented how DynamicViewSynthesizer sets the correct RenderTargetName so that the existing strategy routing logic applies without special casing. [1] [2]

Known limitations and roadmap updates:

  • Documented the known limitation in sequence view compatibility checking, and updated the roadmap to reflect the completion of the dynamic views feature and remaining refinement tasks. [1] [2] [3]

Review and verification:

  • Added a new ReviewMark review block and requirements/verification documentation for the dynamic view synthesizer implementation. [1] [2]

These changes collectively enable flexible, on-demand diagram rendering for any model element, improve documentation and testability, and clarify the rendering pipeline's behavior for both static and dynamic views.

Malcolm Nixon and others added 5 commits July 10, 2026 23:52
- DiagramTypeRouter: add asGeneralDiagram/asStateTransitionDiagram/
  asActionFlowDiagram/asSequenceDiagram/asGridDiagram tokens, dispatching
  to their respective ILayoutStrategy implementations.
- New DynamicViewSynthesizer (internal): resolves a view-type + target
  qualified name into a synthesized SysmlViewNode without requiring a
  view def in the model, with per-kind structural compatibility
  pre-checks and clear diagnostics on failure.
- DiagramRenderer: add public SynthesizeDynamicView delegating to the
  new synthesizer, matching SynthesizeAutoView's doc style.
- Unit tests: 6 new DiagramTypeRouterTests cases, and a new
  DynamicViewSynthesizerTests covering happy paths per kind, unresolved/
  wrong-kind/stdlib target rejection, per-kind compatibility failures,
  filter pass-through, and name-collision diagnostics.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- RenderCommandOptions: add ViewType/ViewTarget/FilterExpression.
- RenderArgumentParser: parse --view-type/--view-target/--filter, with
  raw capture; update class doc comment.
- RenderCommand: validate exactly one of --view/--auto/
  (--view-type + --view-target) is used; --filter only valid alongside
  --view-type/--view-target; call DiagramRenderer.SynthesizeDynamicView,
  reporting a diagnostic on failure, or injecting the synthesized view
  via workspace.AddDeclaration and rendering via the unchanged
  RenderWorkspace path on success; update PrintHelp.
- RenderStrings.resx/.cs: add Render_OptionViewType/Render_OptionViewTarget/
  Render_OptionFilter help strings following the existing convention.
- RenderSubsystemTests: 11 new tests covering dynamic-view rendering
  (general + interconnection kinds), incompatible-target and
  unresolved-target diagnostics, filter-narrowing proof, all 3 mutual-
  exclusion/require-together error paths, and updated help text.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add SysML2Tools_RenderDynamicViewSvgSelfTest,
SysML2Tools_RenderDynamicViewPngSelfTest, and
SysML2Tools_RenderDynamicViewFilteredSelfTest to Validation.cs, wired
into the sequential RunAsync call list, mirroring the existing
SysML2Tools_{Capability}SelfTest naming/structure/assertion
conventions. The filtered self-test asserts the filtered output
genuinely differs/narrows vs the unfiltered equivalent. Update
ValidationTests.cs to cover all 3 new self-tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- New requirements/design/verification triple for DynamicViewSynthesizer.
- Updated triples for diagram-type-router, diagram-renderer, render,
  self-test/validation to cover the new tokens, SynthesizeDynamicView,
  CLI flags, and self-tests.
- requirements.yaml: include the new dynamic-view-synthesizer reqstream
  file.
- .reviewmark.yaml: new review-set for DynamicViewSynthesizer mirroring
  DiagramTypeRouter's entry shape.
- README.md and docs/user_guide/introduction.md: new dynamic-view usage
  examples, options table, and a per-kind compatibility table.
- ROADMAP.md: move "Dynamic (ad-hoc) views" from planned to done,
  explicitly carrying forward the sequence-view compatibility-check gap
  (cheap lifeline pre-check only, no message-edge-walk validation) as a
  documented known limitation under "View dynamics refinements".

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ions

The DynamicViewSynthesizer 'state' compatibility pre-check only checked for
nested SysmlTransitionNodes, rejecting targets that satisfy
StateTransitionViewLayoutStrategy.CollectStates via declared state-keyword
feature children alone. OR the transition check with a state-feature check,
mirroring the adjacent 'action' case's pattern. Corrected the design doc,
user guide compatibility table, and reqstream requirement description to
describe the real two-clause rule, and added a regression test for the
missed case.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Malcolmnixon
Malcolmnixon merged commit e0f65f1 into main Jul 11, 2026
15 checks passed
@Malcolmnixon
Malcolmnixon deleted the feature/dynamic-ad-hoc-views branch July 11, 2026 13:35
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