fix(docs): make Mermaid lifecycle diagrams readable - #6485
Conversation
The lifecycle overview diagram was a 32-node flowchart with 5 nested subgraphs. Mermaid laid it out as a 588x6156px column, and some browsers rendered it degenerately small (#6483). - Split the nested flowchart into a scope overview, a hook-order chain and a per-test flow. Tallest diagram is now 1174px instead of 6156px. - Set flowchart wrappingWidth to 400 (default 200 wrapped most labels onto 4-5 lines, which is what made diagrams narrow and very tall). - Give subgraph members explicit (or invisible) links so `direction TB` applies instead of laying nodes out in a wide row. - Trim the per-test sequence diagram so it no longer shrinks to 57%. - Node styles now set an explicit text colour, so highlighted nodes keep contrast in dark mode. - Scope benchmark chart CSS to xychart, so it stops overriding text fill on flowcharts and sequence diagrams. Every diagram on the page now renders at >= 0.84 scale. Fixes #6483
Greptile SummaryImproves Mermaid diagram readability across the documentation site.
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. The lifecycle diagrams retain the documented runtime ordering, the xychart selector matches the current Mermaid output, and the configuration and CSS changes are appropriately scoped to the readability problems being addressed.
|
| Filename | Overview |
|---|---|
| docs/docs/writing-tests/lifecycle.md | Reorganizes oversized lifecycle diagrams while preserving the documented lifecycle ordering and scope semantics. |
| docs/docusaurus.config.ts | Configures a wider Mermaid flowchart wrapping width to reduce excessive label wrapping. |
| docs/src/css/benchmark-charts.css | Scopes benchmark-specific SVG styling to xycharts so other Mermaid diagram types retain theme-aware colors. |
Reviews (1): Last reviewed commit: "fix(docs): make Mermaid lifecycle diagra..." | Re-trigger Greptile
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. This is a docs-only change (Mermaid diagrams, Docusaurus config, CSS) — none of the CLAUDE.md critical rules (dual-mode metadata, snapshot testing, AOT, etc.) apply here since no engine/source-generator code is touched. A few things I specifically verified while reviewing:
Nice, well-verified fix — the before/after scale measurements in the PR description are a good touch. |
Fixes #6483
Problem
The "Complete Lifecycle Diagram" on Test Lifecycle Overview was a single flowchart with 32 nodes and 5 nested subgraphs. Mermaid laid it out as a 588 x 6156px column, and in the reporter's browser it degenerated into a ~25px-wide thumbnail.
Root cause of the shape: Mermaid's default
flowchart.wrappingWidthis 200px, so most labels wrapped onto 4-5 lines. Combined with 4 levels of nested subgraphs that produced an extremely narrow, extremely tall diagram.Changes
flowchart.wrappingWidth: 400inthemeConfig.mermaid.optionsso labels stop wrapping onto 4-5 lines.~~~) links inside subgraphs sodirection TBis honoured — without them Mermaid lays unlinked nodes out in a wide row, which pushed one diagram to 1655px wide.Initializers/Disposalparticipants intoTest Instance, shortened two messages) so it no longer shrinks to 57%.stylerules now set an explicit text colour, so highlighted nodes keep contrast in dark mode.svg[aria-roledescription='xychart']— it was forcingtext { fill }on every Mermaid diagram, including flowcharts and sequence diagrams.Verification
Built the site and measured every diagram's rendered scale (rendered width ÷ viewBox width) with Playwright:
All 10 diagrams on the page now render at >= 0.84 scale; six render at 1.00. Benchmark xychart styling verified unchanged.