Skip to content

[pull] main from tldraw:main#465

Merged
pull[bot] merged 3 commits intocode:mainfrom
tldraw:main
Mar 27, 2026
Merged

[pull] main from tldraw:main#465
pull[bot] merged 3 commits intocode:mainfrom
tldraw:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Mar 27, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

MitjaBezensek and others added 3 commits March 27, 2026 09:56
…#8349)

Adds unit tests for the zero-length labeled arrow NaN propagation fix
from #8329. Tests cover the three guard areas: geometry interpolation,
spatial index insertion (via `Box.isValid`), and arrow label
computation.

Relates to #8329

### Change type

- [x] `other`

### Test plan

1. Run `cd packages/editor && yarn test run -t
"interpolateAlongEdge|uninterpolateAlongEdge|Box.isValid"`
2. Run `cd packages/tldraw && yarn test run -t "Zero-length"`

- [x] Unit tests
- [ ] End to end tests

### Code changes

| Section | LOC change |
| ------- | ---------- |
| Tests   | +114 / -0  |
Use the same fence length for open and close (via a backreference) so
inner ``` lines do not end a longer fence. Allow trailing markdown after
the first closed block so multi-fence pastes are not merged into one
body. Support CRLF and a case-insensitive mermaid info string; add
tests.

### Change type

- [ ] `bugfix`
- [x] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`

### Test plan

- [x] Unit tests
- [ ] End to end tests
…#8322)

Refactor the code around blueprint creation as well as the rendering by
making sure shape types are defined at one level only, the blueprint
creation, so we can easily allow extensibility through passing a
function that can map each diagram node types to different, preferred
shapes, or simply custom shapes.

Also allows to pass a function to take full control of the node
creation, if ever needed.

### Boring bullet points!

- Add MermaidBlueprintNode.render (geo vs custom shape type + props) and
diagramKind on the blueprint IR.
- Optional per-diagram mapNodeToRenderSpec when building blueprints;
default mapping matches previous geo behavior.
- renderBlueprint creates nodes from node.render; optional
blueprintRender.createShape for full override (shapeId contract
preserved for arrows).
- Export helpers: defaultMermaidNodeRenderSpec,
resolveMermaidNodeRender, defaultCreateMermaidNodeFromBlueprint,
MERMAID_MINDMAP_NODE_TYPE.
- Update README, api-report, and tests.


### Example page

Added an example page which show how custom shapes can be used to create
"on the fly" CI pipeline workflows with mermaid diagram.


https://github.com/user-attachments/assets/861179c2-7757-4657-b39c-e071a14e8756

### API changes

- createMermaidDiagram options: add flowchart, state, sequence, mindmap
with optional mapNodeToRenderSpec each.
- BlueprintRenderingOptions: add optional createShape
(MermaidNodeCreateFunction) to override default node creation from the
blueprint.

### Change type

- [ ] `bugfix`
- [x] `improvement`
- [ ] `feature`
- [x] `api`
- [ ] `other`

### Test plan

- [x] Unit tests
- [ ] End to end tests

### Release notes

- createMermaidDiagram options: add flowchart, state, sequence, mindmap
with optional mapNodeToRenderSpec each.
- BlueprintRenderingOptions: add optional createShape
(MermaidNodeCreateFunction) to override default node creation from the
blueprint.
@pull pull Bot locked and limited conversation to collaborators Mar 27, 2026
@pull pull Bot added the ⤵️ pull label Mar 27, 2026
@pull pull Bot merged commit e3e9618 into code:main Mar 27, 2026
4 of 7 checks passed
@pull pull Bot had a problem deploying to deploy-staging March 27, 2026 15:13 Error
@pull pull Bot had a problem deploying to deploy-staging March 27, 2026 15:13 Error
@pull pull Bot had a problem deploying to deploy-production March 27, 2026 15:13 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants