Skip to content

feat: add prologue diagram field at parity with hosted Stage#69

Merged
dastratakos merged 2 commits into
mainfrom
dastratakos/provo-v3
Jun 8, 2026
Merged

feat: add prologue diagram field at parity with hosted Stage#69
dastratakos merged 2 commits into
mainfrom
dastratakos/provo-v3

Conversation

@dastratakos

@dastratakos dastratakos commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

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. The stage-chapters skill instructs the agent when and how to emit one.

Changes

  • Added diagram: string | null to the shared PrologueSchema — flows through ingestion and the JSON prologue column with no migration.
  • Vendored MermaidDiagram + a lazy-loaded mermaid-renderer (theme-aware, react-zoom-pan-pinch dialog, code-block fallback on render error); mermaid is code-split so it only loads when a diagram is viewed.
  • Rendered the diagram in prologue-section.tsx and added a ## Diagram fenced block to the Markdown export.
  • Documented the field (when to include, type guide, formatting rules) in skills/stage-chapters/SKILL.md.

Testing

pnpm typecheck, pnpm lint, pnpm test (337 passing), and pnpm build all pass locally; added schema, formatter, and storage round-trip test coverage for the new field.


Open in Stage

Summary by cubic

Adds an optional Mermaid diagram to 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

    • Added diagram: string | null to PrologueSchema (defaults to null; flows through ingestion/storage; no migration).
    • Rendered via MermaidDiagram with lazy-loaded mermaid, theme-aware UI, zoom/pan dialog via react-zoom-pan-pinch, and code-block fallback on errors.
    • Markdown export adds a “Diagram” fenced mermaid block when present.
    • Updated skills/stage-chapters/SKILL.md with usage and formatting guidance.
  • Bug Fixes

    • Markdown export now widens the mermaid code fence to exceed any backtick runs in diagram content, preventing fence breakouts.

Written for commit 293b239. Summary will update on new commits.

Review in cubic

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.
@stage-review

stage-review Bot commented Jun 8, 2026

Copy link
Copy Markdown

@dastratakos dastratakos marked this pull request as ready for review June 8, 2026 05:48

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 12 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/web/src/lib/format-prologue-markdown.ts Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread packages/web/src/components/shared/mermaid-diagram.tsx
@dastratakos dastratakos merged commit df669aa into main Jun 8, 2026
6 checks passed
@dastratakos dastratakos deleted the dastratakos/provo-v3 branch June 8, 2026 14:20
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