Skip to content

[pull] develop from mermaid-js:develop#181

Merged
pull[bot] merged 174 commits into
code:developfrom
mermaid-js:develop
Jun 2, 2026
Merged

[pull] develop from mermaid-js:develop#181
pull[bot] merged 174 commits into
code:developfrom
mermaid-js:develop

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Jun 2, 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 : )

knsv-bot and others added 30 commits May 6, 2026 14:29
Re-anchor labels after final point mutations, refresh reroute scans against current edge geometry, avoid label-label placement collisions, and keep shared-track nudging from treating an edge's own label as a blocker.

Split the former direction post-processing implementation into focused pass modules while keeping direction.ts as a compatibility export.
Move the sibling L-shape anti-crossing and collinear shared-face rescue passes out of postProcessing.ts behind clearer names, leaving postProcessing as the pass coordinator.
knsv and others added 27 commits May 30, 2026 13:51
The handdrawn/rough look renders the swimlane lanes but not the nodes (`g.node`
is missing), so the three handdrawn snapshots fail. The lane clusters already
branch on `look === 'handDrawn'`; the node-shape rough path still needs a fix for
the swimlanes layout. The failure only reproduces in a real browser (jsdom has no
getBBox), so it needs in-browser debugging.

Skip (rather than delete) the block so it is trivially re-enabled once rough node
rendering works. The 16 standard-look fixture snapshots are unaffected.
…wn e2e

Handdrawn/rough mode does render swimlanes nodes — mermaid gives them the class
`rough-node` instead of `node` (shapes/util.ts getNodeClasses), so the
`cy.get('g.node')` assertion missed them and the snapshots looked empty. Widen
the assertion to `g.node, g.rough-node` and re-enable the handdrawn block
(reverses the temporary skip in 7cd1481).

Verified in real Chromium (Playwright) against the dev server: all three
handdrawn fixtures render as swimlanes with lanes + nodes and no error-icon
(4-car-fun-sales-tb nodes=14, 9-edge-labels nodes=2, intake-review-complete
nodes=5).
- edges.js: drop the 3 PR-added "Create the actual text element" restate comments
- lineJump.ts: clarify the isStraightPath regex comment (the char class allows
  numeric path data incl. scientific-notation `e`, not just M/L commands)
- sizeCapture.ts: note mermaidCapturedSizes accumulates unbounded in dev
- cloneLayoutDataForMeasure.ts: collapse the over-elaborate JSDoc to one line
- docs/syntax/swimlanes.md: note the in-docs examples use the Neo look + Redux theme

The dead commented-out debug-circle blocks the review flagged in edges.js are
pre-existing on develop (not introduced here), so left untouched.
Rename the swimlanes orthogonal-router folder + file away from the author/AI-tool
name (raykovGemini/raykov.ts) to descriptive names (orthogonalRouter/router.ts),
drop the `raykovRouting` import alias in favour of the existing
`routeEdgesOrthogonal` export, and add a header comment crediting the
orthogonal-connector-routing literature.

11 import sites updated; swimlanes + DDLT suites green (166 tests).
Cover the precedence in flowDiagram.init that swimlanes relies on: a user-defined
(%%{init}%%) layout wins over defaultLayout, which wins over the site-config
layout, and no layout is forced when none is set anywhere.
- Remove the dead `ipsecCola/**` glob (that engine was deleted earlier in the PR).
- Drop the shared production helpers (createGraph.ts, cloneLayoutDataForMeasure.ts,
  lineJump.ts) from the override — they pass the project lint baseline (0 errors),
  so they no longer need the loosened rules.
- The override now covers only the swimlanes / ddlt / layout-utils algorithm code
  and its specs, documented as tracked tech debt to bring to baseline and remove.
Move the `.swimlane.cluster rect` rule out of flowchart/styles.ts into a
swimlanes-owned styles function (diagrams/swimlanes/styles.ts) that composes the
flowchart styles. createFlowDiagram now accepts a `styles` override, which the
swimlanes diagram uses.

The lane-border stroke now uses the theme's clusterBkg variable instead of a
hardcoded #fcfcfc, so it adapts to the theme (notably the dark themes the docs
use). This is a small intentional visual change to the swimlane lane borders, so
the swimlanes Argos baselines will shift accordingly.

Verified in Chromium: swimlanes render (lanes + nodes, no error) with the rule
applied from the swimlanes stylesheet.
…abelNode

The swimlanes `isLabelNode` config gated an older split-edge label model inside
the shared createGraphWithElements. It was superseded by the always-applied
waypoint model (createEdgeLabelNodes) — never enabled (default false), and it
would double-handle labels if it were. Remove it:

- createGraph.ts: drop the isLabelNode branch + NonClusterNode import; the edge
  loop is now the single universal path, so the shared function carries no
  swimlanes-specific logic.
- adjustLayout.ts: the `!isLabelNode` guards become unconditional `if (edge.label)`.
- SwimlanesDiagramConfig: remove the isLabelNode option; regenerate config.type.ts.
- Refresh the now-stale DOMUS / orthogonalize comments.

Also fix a tsc error in flowDiagram.spec.ts (a cast that eslint --fix had stripped).

Verified: tsc clean, 191 swimlanes/DDLT/config tests pass, and 9-edge-labels
renders with its edge label in Chromium.
…imlane.js

Move the ~225-line swimlane lane shape out of the shared clusters.js into
clusters/swimlane.js (verbatim — only const -> export const), imported back and
kept in the clusters.js shape dispatch table. Also drops the now-swimlane-only
`evaluate` import from clusters.js.

Verified in Chromium (verbatim move, no behaviour change): classic renders the
3 lanes with their swimlane-title/swimlane-body rects; handdrawn renders the 3
rough lanes — both with no error-icon.
T20's narrowing dropped the `lineJump*.ts` glob, which also uncovered the
lineJump spec files — and lineJump.integration.spec.ts uses console for debug
output (like the other layout specs), tripping no-console in CI. Re-cover just
the lineJump *specs* (lineJump*.spec.ts); lineJump.ts production stays at baseline.
mergeDummies only computed edgePoints (node x/y were spread through from
assignCoordinates unchanged), and layoutCore deletes every edge's points
before routeEdgesOrthogonal re-routes from scratch — so the corridor/
obstacle/track machinery and its emitted polylines were never rendered.
Remove the file, inline assignCoordinates in the pipeline, drop the now-dead
edgePoints field and writeback, and delete the test that exercised it. Node
positions and routed edges are unchanged (all pipeline/LR specs still pass).
… exception

Swimlanes deliberately consumes flowchart's public entry points
(createFlowDiagram, the styles default export) because it is flowchart syntax
with a different layout engine. Add inline rationale at both import sites
pointing to the sanctioned 'layout-variant diagram' exception in
diagrams/CLAUDE.md, so the cross-diagram import reads as intentional rather
than a violation of the isolation rule.
The unified flow renderer is the first consumer of the public Positions type
threaded through DrawDefinition, so type its positions parameter as
`positions?: Positions` instead of `any`. Matches render()'s signature.
… re-export

- scoreLayout: document that symmetryScore is unimplemented (always NaN) and
  not symmetry-aware, at both the field and the assignment, so the aggregate
  is not mistaken for symmetry-inclusive.
- postProcessing: explain why anchorLabelsToPolyline runs twice (anchor, then
  re-anchor after later passes reshape the polylines).
- postProcessing: remove the ValidationIssue re-export — it has no external
  consumer.
Add the 'Available since MERMAID_RELEASE_VERSION' placeholder near the top of
the syntax doc so the release tooling stamps the real version on publish, per
the new-diagram checklist. Regenerated the published doc to match.
…mlane

Hard-switch the user-facing keyword from the plural `swimlanes` to the
singular `swimlane` (unreleased, so no alias kept):

- grammar: flow.jison lexer keyword; detector regex (diagram id stays
  'swimlanes', as do the layout-algorithm name, backend/profile ids and
  folder names — those are internal).
- config key: schema property swimlanes -> swimlane and SwimlanesDiagramConfig
  -> SwimlaneDiagramConfig (regenerated config.type.ts); updated the
  .build/jsonSchema.ts default-config key list and all config.swimlane reads.
- fixtures: rewrote the keyword (and frontmatter config key) in every
  layout-test .mmd and refreshed each .sizes.json sourceSha256 so they stay
  in the DDLT sweep.
- docs + tests: keyword in syntax doc examples (regenerated), parser specs,
  detector/orchestration/mermaidAPI specs, and cypress sources.

Verified: 1306 unit tests, types:verify-config, tsc and the DDLT sweep all green.
…tive

dependency-tree 11.5.0 (pulled in dev-only via cypress-split -> find-cypress-specs
-> spec-change) added @discoveryjs/json-ext and bumped filing-cabinet to ^5.5.1,
introducing the flagged vulnerability. spec-change requests ^11.4.0, so a pnpm
override to 11.4.3 satisfies the range and drops the vulnerable transitive. Dev
dependency only — not shipped to consumers.
…gram id)

Complete the swimlanes -> swimlane rename beyond the keyword/config key:
- layout-algorithm name (render.ts registration, defaultLayout, the edges.js
  layout gate, the DDLT layoutAlgorithm stamp) and the dev-explorer layout
  dropdown value.
- diagram id (detector) — so id now matches keyword/config/layout; the
  aria-roledescription follows.
- fixtures: layout: swimlane in frontmatter, plus de-indent / frontmatter
  cleanup, with sourceSha256 refreshed; 10-node-placement opts in via the
  keyword (no explicit layout) so its Level 0 check asserts the keyword.
- changeset, specs, and the knsv3 scratch page updated to match.

Full mermaid unit suite green (4444 tests).
…ook cluster styling

Switch the swimlane lane border to options.clusterBorder and add the neo
look's cluster/node rules so swimlane clusters match the neo theme.
…metadata

The capturedFrom provenance strings still referenced the old layout=swimlanes
param (now dead after the rename). Update them to layout=swimlane. Metadata
only — sourceSha256 hashes the .mmd, so freshness is unaffected.
…6f-4vf2)

The dependency-review check flagged @isaacs/brace-expansion@5.0.0 (High DoS via
unbounded brace expansion), pulled dev-only via rimraf -> glob -> minimatch.
Add a pnpm override to ^5.0.1 (the patched release). Dev dependency only.
dependency-review flagged minimatch@10.0.3 (3 High ReDoS advisories), pulled
dev-only via rimraf -> glob@11 -> minimatch. Scope the override to the 10.x
line (^10.2.1, resolves to 10.2.5) so glob v7/v8/v10's minimatch majors are
untouched. Dev dependency only.
…ced vulns

The branch lockfile had drifted ~2000 lines from develop and re-resolved many
dev-only transitives to newer-but-vulnerable versions develop never had
(minimatch@10.0.3, @isaacs/brace-expansion@5.0.0, brace-expansion@2.0.2,
dependency-tree@11.5.0). Reset the lockfile to develop's base and reinstall so
only the genuine swimlanes deltas remain (~235 lines), reusing develop's
patched resolutions. dependency-review only reviews the PR delta, so the
flagged dev-dep advisories clear. package.json overrides retained as a backstop.
feat(swimlanes): add swimlanes as a standalone diagram type with a layered orthogonal layout (#2028)
@pull pull Bot locked and limited conversation to collaborators Jun 2, 2026
@pull pull Bot added the ⤵️ pull label Jun 2, 2026
@pull pull Bot merged commit bab5fc0 into code:develop Jun 2, 2026
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.

3 participants