feat: add prologue diagram field at parity with hosted Stage#69
Merged
Conversation
Adds an optional Mermaid `diagram` to the prologue, vendored from hosted Stage's MermaidDiagram (lazy-loaded mermaid + zoom/pan dialog). Wires the field through the shared schema, prologue display, markdown export, and the stage-chapters skill prompt.
|
Ready to review this PR? Stage has broken it down into 8 individual chapters for you: Chapters generated by Stage for commit 293b239 on Jun 8, 2026 5:57am UTC. |
There was a problem hiding this comment.
1 issue found across 12 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 293b239. Configure here.
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.

Summary
Reaches diagram parity with hosted Stage: the prologue can now carry an optional Mermaid
diagram, rendered in the prologue sidebar with an inline SVG that expands into a zoom/pan dialog. Thestage-chaptersskill instructs the agent when and how to emit one.Changes
diagram: string | nullto the sharedPrologueSchema— flows through ingestion and the JSONprologuecolumn with no migration.MermaidDiagram+ a lazy-loadedmermaid-renderer(theme-aware,react-zoom-pan-pinchdialog, code-block fallback on render error);mermaidis code-split so it only loads when a diagram is viewed.prologue-section.tsxand added a## Diagramfenced block to the Markdown export.skills/stage-chapters/SKILL.md.Testing
pnpm typecheck,pnpm lint,pnpm test(337 passing), andpnpm buildall pass locally; added schema, formatter, and storage round-trip test coverage for the new field.Summary by cubic
Adds an optional Mermaid
diagramto the prologue for parity with hosted Stage. Diagrams render inline in the sidebar, open to a zoom/pan dialog, and are included in Markdown exports.New Features
diagram: string | nulltoPrologueSchema(defaults tonull; flows through ingestion/storage; no migration).MermaidDiagramwith lazy-loadedmermaid, theme-aware UI, zoom/pan dialog viareact-zoom-pan-pinch, and code-block fallback on errors.mermaidblock when present.skills/stage-chapters/SKILL.mdwith usage and formatting guidance.Bug Fixes
mermaidcode fence to exceed any backtick runs in diagram content, preventing fence breakouts.Written for commit 293b239. Summary will update on new commits.