feat(calm-hub-ui): render items catalogues in pattern diagrams - #3110
Merged
markscott-ms merged 7 commits intoSep 18, 2026
Merged
Conversation
A pattern may declare nodes and relationships under items as well as prefixItems. The renderer read only prefixItems, so a catalogue node never appeared and a decision naming one rendered no box at all. items is read as one more choice block. Its members get a decision group like prefixItems alternatives do, so the existing parenting and the existing options lookup handle them with no further change. The catalogue box carries the decision's prompt and choices. A decision is read from prefixItems only. Declaring one in items is rejected by validation, so the renderer does not tolerate it. Drawer's isPatternData accepts nodes.items, or a pattern that declares only a catalogue is misrouted as an architecture and never reaches the transformer. The allOf lookup and the oneOf/anyOf read were each written out four times. Both are now one function.
YoofiTT96
force-pushed
the
feat/2859-visualisation-items
branch
from
September 15, 2026 22:05
af3b44e to
395070c
Compare
28 tasks
markscott-ms
requested changes
Sep 17, 2026
YoofiTT96
marked this pull request as ready for review
September 18, 2026 06:03
Most of them restated the line below. The ones that carry a reason nobody can read from the code stay: why useDropzone takes no accept filter, why a dropped file must not borrow the viewport key, and why the default layout is withheld alongside it. Those three were paragraphs guarding one or two lines each. Same facts, fewer words, and the viewport-key note is now one point per line rather than four run together.
markscott-ms
approved these changes
Sep 18, 2026
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.
Description
A pattern may declare nodes and relationships under
itemsas well asprefixItems. The renderer read onlyprefixItems, so a catalogue node never appeared on the diagram and a decision naming one drew no box at all. The pattern in #2859 rendered two nodes and one edge, with the catalogue and the decision missing entirely.Now the catalogue draws as a decision box carrying the author's prompt and each answer, with the catalogue nodes inside it.
Part of #2859.
PR sequence
Four stacked PRs, each reviewable alone, in this order:
prefixItemsalternatives — the pre-existing gaps that had to be fixed firstitemsin pattern validationitemsin generationitemsin the pattern diagramGitHub will not let a cross-fork PR target a branch in my fork, so all four sit on
mainand each diff carries the ones below it. The commit to review here is the last one.The decision worth knowing
itemsis read as one more choice block, nothing else. Its members get a decision group exactly asprefixItemsalternatives do, so the existing parenting and the existing options lookup handle them with no further change. That keeps this PR to the reading side of the transformer and leaves the parent-resolution model alone.A decision is read from
prefixItemsonly. #3060 rejects a decision declared initems, so the renderer does not tolerate what validation refuses.Gotcha
This makes
itemsvisible; it does not change how decision boxes relate to containers. A catalogue node that also sits in adeployed-incontainer still parents to the decision box, leaving the container drawn empty beside it. That shape was unreachable before, because the catalogue rendered nothing at all, so this PR makes an existing limitation newly visible. #2933 owns the fix and has been updated with the current behaviour.Tidying
The
allOflookup and theoneOf/anyOfread were each written out four times. Both are now one function, which is most of the line count in the diff.Type of Change
Additive. A pattern that uses no
itemsrenders exactly as before.Affected Components
cli/)calm/)calm-ai/)calm-hub/)calm-hub-ui/)calm-server/)calm-widgets/)docs/)shared/)calm-plugins/vscode/)Commit Message Format ✅
feat(calm-hub-ui): render items catalogues in pattern diagramsTesting
Seven new tests in
patternTransformer.test.ts, covering a catalogue node rendering, its grouping into one box, the prompt attaching, ananyOfcatalogue's label, aprefixItemsdecision staying separate from the catalogue box, a relationship underitems, and a plainitems: { $ref }correctly ignored.Mutation-tested: stop reading the catalogue and five of the seven fail while the rest stay green.
calm-hub-uipasses 118 files and 1450 tests. Lint and build are clean, and the full rootnpm testis green.Rendering is not viewport-dependent — the transformer returns the same nodes and edges at any width — so no mobile-specific case applies here.
Checklist