Skip to content

Answers draw more diagram types - #191

Merged
trick77 merged 3 commits into
masterfrom
feat/more-diagram-types
Sep 17, 2026
Merged

trick77 merged 3 commits into
masterfrom
feat/more-diagram-types

Conversation

@trick77

@trick77 trick77 commented Sep 17, 2026

Copy link
Copy Markdown
Owner

An answer's diagram is now chosen by the shape of the content: a flowchart for branches, a sequence for exchanges, a state machine, an entity model, or a trigger to target mapping drawn as two subgraphs. With only two hand-drawn shapes on offer, a mapping question (which event produces to which Kafka topic) came back as a flowchart with an invented order between the topics and one topic drawn twice.

The picture no longer cites per node; the sentence that introduces it carries the markers. That removes the reason for the hand-written layout, so the renderer, chip placement and src renumbering go. The renumberer treats the fence as code. Stored answers with the older JSON fence still draw through the existing conversion.

Rendering runs with strict sanitising, no click bindings, colours from the app's tokens, flat look. Corpus tests assert the fence leaves the backend byte for byte and passes the renderer's parser; a Playwright pass covered a stored legacy thread, a mapping answer, the share page, the full view, the SVG download and the project wiring graph.

Flow-corpus eval (BA audience) is running; its numbers follow in a comment.

@trick77

trick77 commented Sep 17, 2026

Copy link
Copy Markdown
Owner Author

Flow-corpus eval, BA audience, two runs of ten (same setup as docs/measurements/2026-09-17-ba-diagrams.md):

run diagrams rubric present contradicted forbidden cited parts tokens
1 7 / 10 28/30 0 0 17/30 319k
2 9 / 10 27/30 0 0 19/30 317k

Reference on #188: 7/10 and 6/9, rubric 27/30 and 23/26. All 16 fences pass the renderer's parser (9 flowchart, 7 sequence). Four of them are in the corpus now.

An answer's diagram is a mermaid fence chosen by the shape of the content:
a flowchart for branches, a sequence for exchanges, a state machine, an
entity model, or a trigger to target mapping drawn as two subgraphs. The
two hand-written shapes forced a mapping into a flowchart with an invented
order and a target drawn twice.

The picture no longer cites per node; the sentence that introduces it
carries the markers. That removes the reason for a hand-written layout, so
the renderer, the chip placement and the src renumbering go. The renumberer
treats the fence as code. Stored answers with the older JSON fence still
draw through the existing conversion.

The renderer runs with securityLevel strict, no bindFunctions, the theme
read from the app's tokens, the classic look without shadows. Corpus tests
now assert the fence leaves the backend byte for byte and passes the
renderer's own parser.
The renderer's viewBox starts above and left of the origin, so a ground
rect at 0,0 left a bare band along two edges of the downloaded file. A
render that failed is no longer cached: the first diagram of a type loads
its chunk, and a chunk missing after a redeploy would otherwise follow the
source for the rest of the session.
@trick77
trick77 force-pushed the feat/more-diagram-types branch from 9551bad to 66aefef Compare September 17, 2026 18:36
@trick77
trick77 merged commit 70020ae into master Sep 17, 2026
2 checks passed
@trick77
trick77 deleted the feat/more-diagram-types branch September 17, 2026 18:47
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