Skip to content

feat(web): render mermaid diagrams in Ask answers#1369

Merged
whoisthey merged 16 commits into
mainfrom
whoisthey/render-mermaid-diagrams-in-ask
Jun 26, 2026
Merged

feat(web): render mermaid diagrams in Ask answers#1369
whoisthey merged 16 commits into
mainfrom
whoisthey/render-mermaid-diagrams-in-ask

Conversation

@whoisthey

@whoisthey whoisthey commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #1240

Summary

  • Renders fenced ```mermaid blocks in Ask Sourcebot answers as interactive diagrams (click-drag pan, zoom, copy source/image, SVG/PNG export, fullscreen) through the existing markdown rendering pipeline — no new stream part type or tool.
  • The right "evidence" panel is the canonical view: diagrams render there expanded by default, interleaved with referenced sources by order of appearance.
  • Inline, each diagram is rendered as a compact reference button (its title, or "Diagram N") that scrolls to and focuses its panel counterpart on click and hover-syncs with it, mirroring the file-reference chips. The raw mermaid fence in the answer text is left untouched, so "Copy answer" still yields a valid mermaid code block.
  • The agent names each diagram via a mermaid frontmatter title (used as the chip/panel label, falling back to "Diagram N"), with prompt guidance to quote titles containing special characters so the frontmatter stays valid. The agent is still prompted to emit diagrams proactively when a visual aids understanding.
  • While streaming, the in-progress diagram chip shows a shine-sweep shimmer (pure-CSS) so the turn doesn't look stalled while the diagram is being written.
  • Fullscreen now fits the diagram to the viewport on open (measured from the rendered SVG), supports cursor-anchored scroll-to-zoom, and shows a fit-relative zoom readout (fitted view reads 100%).
  • Adds in-thread deep links (#diagram-<hash>) that reveal/scroll to the panel diagram. mermaid is lazy-loaded so it stays out of the initial bundle; invalid/streaming source falls back to a code block.

Test plan

  • Ask a question that elicits one or more diagrams; confirm each renders expanded in the right panel and appears inline as a titled reference button.
  • Click an inline reference → the panel diagram scrolls into view and is highlighted; hover → the counterpart highlights; the panel "jump to answer" button scrolls back to the inline reference.
  • During streaming, confirm the in-progress chip shimmers and resolves to its title/label once the diagram block closes.
  • Open fullscreen: confirm it opens fit-to-screen, scroll/trackpad zooms toward the cursor, the +/- and reset controls behave, and the readout reads 100% at the fitted baseline.
  • Confirm "Copy answer" still includes a valid ```mermaid block; deep links scroll/reveal correctly; invalid or mid-stream mermaid shows the source as a code block until it renders cleanly.

Notes

This is the V1 "automatic" path from #1240 plus proactive prompting. The explicit "Visualize" button and the V2 interactive React Flow engine are intentionally out of scope, pending followup gen-UI feature work.

Based on review feedback, the inline rendering was reworked from a full inline diagram (which duplicated the right-panel diagram and defaulted the panel item to collapsed) into a reference chip that defers to the canonical, default-expanded panel diagram. The screenshots below predate that redesign.

Analytics

Adds PostHog events (web-only, prefixed wa_chat_diagram_) to understand how often the model generates diagrams (and how often they're invalid), and how often users interact with them. Every event carries chatId and a content-hashed diagramId:

  • wa_chat_diagram_rendered{ outcome: 'success' | 'error', diagramType? }. Fired once per diagram generated live in a session (gated on having observed streaming, so revisiting a chat or viewing one from history does not re-fire). This is the generation/quality signal: generation frequency, diagram type breakdown, and the invalid-render rate.
  • wa_chat_diagram_reference_clicked — the inline reference chip was clicked to focus its panel diagram.
  • wa_chat_diagram_fullscreen_opened — the diagram was opened in fullscreen.
  • wa_chat_diagram_copied{ format: 'link' | 'source' | 'image' }.
  • wa_chat_diagram_exported{ format: 'svg' | 'png' }.
  • wa_chat_diagram_panned — click-drag pan on the inline (non-fullscreen) view, reported at most once per diagram.

The five interaction events are user-gated (fired from click/drag handlers), so none of them fire on mount or when a chat is revisited.

Screen.Recording.2026-06-25.at.5.35.52.PM.mov

Summary by CodeRabbit

  • New Features
    • Ask Sourcebot answers can now render Mermaid diagrams, including diagram title metadata and inline diagram reference chips.
    • Diagrams in the chat right panel support deep linking, inline jumping, hover/reveal, and selection-driven syncing with the answer.
    • Diagram cards provide pan/zoom, fullscreen viewing, and quick actions to copy links, copy Mermaid source, and export/download SVG or high-resolution PNG.
    • The right-side panel now interleaves diagrams with referenced sources in a single ordered list.
  • UI Enhancements
    • Added a "shiny" animated loading label for diagram generation states.

Render fenced mermaid code blocks in Ask Sourcebot answers as interactive
diagrams: pan/zoom, copy source/image, SVG/PNG export, fullscreen, and
in-thread deep links. Diagrams are mirrored in the right panel, pre-collapsed
and interleaved with referenced sources by order of appearance, with
click-to-scroll between the inline diagram and its panel item. The agent is
prompted to emit mermaid blocks proactively when a visual aids understanding.
@github-actions

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds Mermaid diagram support to chat answers. It updates the agent prompt, renders fenced Mermaid blocks, adds an interactive SVG viewer, and interleaves diagrams with referenced sources in the thread panel.

Changes

Chat Mermaid diagram rendering

Layer / File(s) Summary
Prompt and enablement
CHANGELOG.md, packages/web/package.json, packages/web/src/ee/features/chat/agent.ts, packages/web/src/ee/features/chat/components/chatThread/answerCard.tsx
Adds the Mermaid dependency, updates the agent prompt with diagram guidance, records the feature in the changelog, and enables diagram rendering for answer markdown.
Diagram extraction helpers
packages/web/src/ee/features/chat/diagramUtils.ts, packages/web/src/ee/features/chat/useExtractDiagrams.ts
Adds Mermaid block matching, stable diagram IDs, title parsing, and a hook that extracts and deduplicates diagrams from message text.
Inline diagram reference
packages/web/src/components/ui/animatedShinyText.tsx, packages/web/tailwind.config.ts, packages/web/src/ee/features/chat/components/chatThread/markdownRenderer.tsx, packages/web/src/ee/features/chat/components/chatThread/diagramReferenceChip.tsx
Replaces Mermaid fences with inline diagram references, derives labels and anchors for diagram chips, and adds the shiny text animation used while diagrams are generating.
Interactive diagram viewer
packages/web/src/ee/features/chat/components/chatThread/mermaidDiagram.tsx, packages/web/src/ee/features/chat/components/chatThread/diagramPanelListItem.tsx
Adds the Mermaid SVG renderer with pan/zoom, copy/export, deep-link handling, and the expandable diagram panel row.
Thread panel interleaving
packages/web/src/ee/features/chat/diagramPanelContext.tsx, packages/web/src/ee/features/chat/components/chatThread/referencedSourcesListView.tsx, packages/web/src/ee/features/chat/components/chatThread/chatThreadListItem.tsx
Builds ordered diagram/source panel items, tracks selected diagrams, shows the right panel when diagrams are present, and renders diagrams alongside file sources.

Sequence Diagram(s)

sequenceDiagram
  participant ChatThreadListItem
  participant MarkdownRenderer
  participant DiagramReferenceChip
  participant ReferencedSourcesListView
  participant DiagramPanelListItem
  participant MermaidDiagram
  ChatThreadListItem->>MarkdownRenderer: render answer markdown with diagrams enabled
  MarkdownRenderer->>DiagramReferenceChip: render mermaid fences as inline references
  DiagramReferenceChip->>ReferencedSourcesListView: reveal diagram in side panel
  ReferencedSourcesListView->>DiagramPanelListItem: render diagram item
  DiagramPanelListItem->>MermaidDiagram: mount expanded diagram code
  ChatThreadListItem->>ReferencedSourcesListView: pass ordered diagram and source items
Loading

Estimated review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • msukkari
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR fulfills automatic Mermaid rendering, but it omits the linked issue's explicit "Visualize" button requirement. Add the explicit Visualize button that re-prompts on the current thread, or clarify that the linked issue is narrowed to automatic rendering only.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: rendering Mermaid diagrams in Ask answers.
Out of Scope Changes check ✅ Passed The changes stay focused on Mermaid answer rendering and supporting diagram UX, with no clearly unrelated code additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch whoisthey/render-mermaid-diagrams-in-ask

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

License Audit

⚠️ Status: PASS

Metric Count
Total packages 2221
Resolved (non-standard) 22
Unresolved 0
Strong copyleft 0
Weak copyleft 39

Weak Copyleft Packages (informational)

Package Version License
@img/sharp-libvips-darwin-arm64 1.0.4 LGPL-3.0-or-later
@img/sharp-libvips-darwin-arm64 1.2.4 LGPL-3.0-or-later
@img/sharp-libvips-darwin-x64 1.0.4 LGPL-3.0-or-later
@img/sharp-libvips-darwin-x64 1.2.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-arm 1.0.5 LGPL-3.0-or-later
@img/sharp-libvips-linux-arm 1.2.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-arm64 1.0.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-arm64 1.2.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-ppc64 1.2.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-riscv64 1.2.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-s390x 1.0.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-s390x 1.2.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-x64 1.0.4 LGPL-3.0-or-later
@img/sharp-libvips-linux-x64 1.2.4 LGPL-3.0-or-later
@img/sharp-libvips-linuxmusl-arm64 1.0.4 LGPL-3.0-or-later
@img/sharp-libvips-linuxmusl-arm64 1.2.4 LGPL-3.0-or-later
@img/sharp-libvips-linuxmusl-x64 1.0.4 LGPL-3.0-or-later
@img/sharp-libvips-linuxmusl-x64 1.2.4 LGPL-3.0-or-later
@img/sharp-wasm32 0.33.5 Apache-2.0 AND LGPL-3.0-or-later AND MIT
@img/sharp-wasm32 0.34.5 Apache-2.0 AND LGPL-3.0-or-later AND MIT
@img/sharp-win32-arm64 0.34.5 Apache-2.0 AND LGPL-3.0-or-later
@img/sharp-win32-ia32 0.33.5 Apache-2.0 AND LGPL-3.0-or-later
@img/sharp-win32-ia32 0.34.5 Apache-2.0 AND LGPL-3.0-or-later
@img/sharp-win32-x64 0.33.5 Apache-2.0 AND LGPL-3.0-or-later
@img/sharp-win32-x64 0.34.5 Apache-2.0 AND LGPL-3.0-or-later
axe-core 4.10.3 MPL-2.0
dompurify 3.4.11 (MPL-2.0 OR Apache-2.0)
lightningcss 1.32.0 MPL-2.0
lightningcss-android-arm64 1.32.0 MPL-2.0
lightningcss-darwin-arm64 1.32.0 MPL-2.0
lightningcss-darwin-x64 1.32.0 MPL-2.0
lightningcss-freebsd-x64 1.32.0 MPL-2.0
lightningcss-linux-arm-gnueabihf 1.32.0 MPL-2.0
lightningcss-linux-arm64-gnu 1.32.0 MPL-2.0
lightningcss-linux-arm64-musl 1.32.0 MPL-2.0
lightningcss-linux-x64-gnu 1.32.0 MPL-2.0
lightningcss-linux-x64-musl 1.32.0 MPL-2.0
lightningcss-win32-arm64-msvc 1.32.0 MPL-2.0
lightningcss-win32-x64-msvc 1.32.0 MPL-2.0
Resolved Packages (22)
Package Version Original Resolved Source
@react-grab/cli 0.1.23 UNKNOWN MIT GitHub repo (aidenybai/react-grab LICENSE file)
@react-grab/cli 0.1.29 UNKNOWN MIT GitHub repo (aidenybai/react-grab LICENSE file)
@react-grab/mcp 0.1.29 UNKNOWN MIT GitHub repo (aidenybai/react-grab LICENSE file)
@sentry/cli 2.58.5 FSL-1.1-MIT FSL-1.1-MIT npm registry (version manifest license field; Functional Source License 1.1, MIT future grant - not OSI/SPDX standard, source-available, non-copyleft)
@sentry/cli-darwin 2.58.5 FSL-1.1-MIT FSL-1.1-MIT npm registry (Functional Source License 1.1, MIT future grant - non-copyleft)
@sentry/cli-linux-arm 2.58.5 FSL-1.1-MIT FSL-1.1-MIT npm registry (Functional Source License 1.1, MIT future grant - non-copyleft)
@sentry/cli-linux-arm64 2.58.5 FSL-1.1-MIT FSL-1.1-MIT npm registry (Functional Source License 1.1, MIT future grant - non-copyleft)
@sentry/cli-linux-i686 2.58.5 FSL-1.1-MIT FSL-1.1-MIT npm registry (Functional Source License 1.1, MIT future grant - non-copyleft)
@sentry/cli-linux-x64 2.58.5 FSL-1.1-MIT FSL-1.1-MIT npm registry (Functional Source License 1.1, MIT future grant - non-copyleft)
@sentry/cli-win32-arm64 2.58.5 FSL-1.1-MIT FSL-1.1-MIT npm registry (Functional Source License 1.1, MIT future grant - non-copyleft)
@sentry/cli-win32-i686 2.58.5 FSL-1.1-MIT FSL-1.1-MIT npm registry (Functional Source License 1.1, MIT future grant - non-copyleft)
@sentry/cli-win32-x64 2.58.5 FSL-1.1-MIT FSL-1.1-MIT npm registry (Functional Source License 1.1, MIT future grant - non-copyleft)
@vitest/spy 4.1.4 UNKNOWN MIT npm registry (version manifest license field)
codemirror-lang-elixir 4.0.0 UNKNOWN Apache-2.0 npm registry (license field)
element-source 0.0.3 UNKNOWN MIT GitHub repo (aidenybai/element-source LICENSE file)
khroma 2.1.0 UNKNOWN MIT npm registry (top-level license field)
lezer-elixir 1.1.2 UNKNOWN Apache-2.0 npm registry (top-level license field)
map-stream 0.1.0 UNKNOWN MIT npm registry (top-level license field)
memorystream 0.3.1 UNKNOWN MIT npm registry (licenses array type field)
pause-stream 0.0.11 MIT,Apache2 MIT OR Apache-2.0 extracted from license array in oss-licenses.json
posthog-js 1.369.0 SEE LICENSE IN LICENSE Apache-2.0 GitHub repo (PostHog/posthog-js LICENSE file - primary Apache-2.0)
valid-url 1.0.9 UNKNOWN MIT GitHub repo (ogt/valid-url LICENSE file)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
packages/web/src/ee/features/chat/components/chatThread/chatThreadListItem.tsx (1)

366-423: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reuse the shared Mermaid and file-reference parser contracts here.

Line 377 redefines both the Mermaid block matcher and the @file: prefix instead of reusing MERMAID_BLOCK_REGEX and FILE_REFERENCE_PREFIX. useExtractDiagrams() already depends on the shared Mermaid regex, so this scan can drift and leave diagrams or file references resolved elsewhere but missing or misordered in the right panel.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/web/src/ee/features/chat/components/chatThread/chatThreadListItem.tsx`
around lines 366 - 423, The ordered panel scan in chatThreadListItem.tsx is
duplicating Mermaid and file-reference parsing rules instead of reusing the
shared contracts. Update orderedPanelItems to use MERMAID_BLOCK_REGEX and
FILE_REFERENCE_PREFIX (the same symbols used by useExtractDiagrams and
file-reference parsing) so the right panel stays aligned with the rest of the
app and does not drift on diagram or `@file`: matching.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/web/src/ee/features/chat/components/chatThread/mermaidDiagram.tsx`:
- Around line 215-246: The Mermaid action bar in mermaidDiagram.tsx is only
revealed via group-hover, which hides fullscreen/copy/export on touch and
keyboard-only interactions. Update the toolbar container around the
actions/buttons to also become visible on focus-within and for non-hover/coarse
pointer environments, so the same controls are discoverable without hover. Use
the existing toolbar wrapper and its forceControlsVisible/controlsClassName
visibility logic to add the extra visibility conditions without changing the
button behavior.
- Around line 347-357: The copy actions in mermaidDiagram’s onCopyLink and
onCopySource currently show success before the clipboard write completes, so
update both callbacks to mirror onCopyImage by awaiting
navigator.clipboard.writeText inside try/catch. If the write succeeds, keep the
success toast; if it fails, show a destructive toast with an appropriate failure
message. Use the existing onCopyLink, onCopySource, and onCopyImage functions as
the reference points for the change.

In `@packages/web/src/ee/features/chat/diagramUtils.ts`:
- Around line 15-18: The diagram id/anchor generation in getDiagramId and
getDiagramAnchorId is based only on the diagram code, so repeated identical
diagrams collide across a thread. Update the id generation to include a
per-message or per-occurrence disambiguator while preserving the content hash as
a separate stable key if needed, and make sure the DOM id/anchor returned by
getDiagramAnchorId is unique for each rendered instance.
- Line 2: The Mermaid extractor regex in MERMAID_BLOCK_REGEX only accepts LF
after the opening fence, so update it to also match CRLF. Adjust the pattern
used by useExtractDiagrams() in diagramUtils so fenced Mermaid blocks with \r\n
are captured the same as \n, preserving diagram extraction, right-panel
mirroring, and deep-link ordering.

---

Nitpick comments:
In
`@packages/web/src/ee/features/chat/components/chatThread/chatThreadListItem.tsx`:
- Around line 366-423: The ordered panel scan in chatThreadListItem.tsx is
duplicating Mermaid and file-reference parsing rules instead of reusing the
shared contracts. Update orderedPanelItems to use MERMAID_BLOCK_REGEX and
FILE_REFERENCE_PREFIX (the same symbols used by useExtractDiagrams and
file-reference parsing) so the right panel stays aligned with the rest of the
app and does not drift on diagram or `@file`: matching.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4477ca7a-9695-4ad0-8223-bddc58bb0915

📥 Commits

Reviewing files that changed from the base of the PR and between 5e1b8ee and 83347e6.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (12)
  • CHANGELOG.md
  • packages/web/package.json
  • packages/web/src/ee/features/chat/agent.ts
  • packages/web/src/ee/features/chat/components/chatThread/answerCard.tsx
  • packages/web/src/ee/features/chat/components/chatThread/chatThreadListItem.tsx
  • packages/web/src/ee/features/chat/components/chatThread/diagramPanelListItem.tsx
  • packages/web/src/ee/features/chat/components/chatThread/markdownRenderer.tsx
  • packages/web/src/ee/features/chat/components/chatThread/mermaidDiagram.tsx
  • packages/web/src/ee/features/chat/components/chatThread/referencedSourcesListView.tsx
  • packages/web/src/ee/features/chat/diagramPanelContext.tsx
  • packages/web/src/ee/features/chat/diagramUtils.ts
  • packages/web/src/ee/features/chat/useExtractDiagrams.ts

Comment thread packages/web/src/ee/features/chat/components/chatThread/mermaidDiagram.tsx Outdated
Comment thread packages/web/src/ee/features/chat/components/chatThread/mermaidDiagram.tsx Outdated
Comment thread packages/web/src/ee/features/chat/diagramUtils.ts
Comment thread packages/web/src/ee/features/chat/diagramUtils.ts
Make the right "evidence" panel the canonical, default-expanded render for
mermaid diagrams and turn the inline answer occurrence into a compact
"Diagram"/title reference button that scrolls to and focuses its panel
counterpart on click, with hover-sync, mirroring the file-reference chips.
The raw mermaid fence in the answer text is untouched, so copy stays valid.

Also:
- Let the model name diagrams via a mermaid frontmatter title (used as the
  chip/panel label, falling back to "Diagram N"), with prompt guidance to
  quote titles containing special characters.
- Show a shine-sweep shimmer on the in-progress diagram chip while streaming.
- Fix fullscreen zoom to fit-to-surface on open (measured from the rendered
  SVG), add cursor-anchored scroll-to-zoom, and make the readout relative so
  the fitted view reads 100%.
- Fix the right panel hover ring being clipped at the top edge.

Co-authored-by: Cursor <cursoragent@cursor.com>
@whoisthey whoisthey force-pushed the whoisthey/render-mermaid-diagrams-in-ask branch from f05c3d0 to ee54b41 Compare June 26, 2026 00:16

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/web/src/ee/features/chat/components/chatThread/mermaidDiagram.tsx`:
- Around line 248-268: The useEffect in mermaidDiagram should make the svg
dependency meaningful instead of leaving it unused, since the effect is meant to
refit when the rendered SVG changes. Update the guard inside this effect to
reference svg directly before scheduling the
ResizeObserver/requestAnimationFrame work, and keep the dependency list aligned
with the effect’s actual usage in fitToSurface and the svg-driven render state.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e991f074-04ce-435b-8ca6-97ffe4639fbb

📥 Commits

Reviewing files that changed from the base of the PR and between 13e906b and f05c3d0.

📒 Files selected for processing (11)
  • packages/web/src/components/ui/animatedShinyText.tsx
  • packages/web/src/ee/features/chat/agent.ts
  • packages/web/src/ee/features/chat/components/chatThread/chatThreadListItem.tsx
  • packages/web/src/ee/features/chat/components/chatThread/diagramPanelListItem.tsx
  • packages/web/src/ee/features/chat/components/chatThread/diagramReferenceChip.tsx
  • packages/web/src/ee/features/chat/components/chatThread/markdownRenderer.tsx
  • packages/web/src/ee/features/chat/components/chatThread/mermaidDiagram.tsx
  • packages/web/src/ee/features/chat/components/chatThread/referencedSourcesListView.tsx
  • packages/web/src/ee/features/chat/diagramPanelContext.tsx
  • packages/web/src/ee/features/chat/diagramUtils.ts
  • packages/web/tailwind.config.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/web/src/ee/features/chat/agent.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/web/src/ee/features/chat/components/chatThread/diagramPanelListItem.tsx
  • packages/web/src/ee/features/chat/components/chatThread/chatThreadListItem.tsx
  • packages/web/src/ee/features/chat/components/chatThread/referencedSourcesListView.tsx

Comment thread packages/web/src/ee/features/chat/components/chatThread/mermaidDiagram.tsx Outdated
@whoisthey whoisthey marked this pull request as draft June 26, 2026 00:51
whoisthey and others added 5 commits June 25, 2026 17:58
After the inline reference-chip redesign, MermaidDiagram is only ever
rendered in the right panel. Remove the unused inline variant, deep-link
effect, and "view in panel"/jump actions, and collapse DiagramViewport's
three size modes down to fullscreen-fill vs. panel auto-height.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread packages/web/tailwind.config.ts Outdated
@brendan-kellam brendan-kellam marked this pull request as ready for review June 26, 2026 18:21
@brendan-kellam

Copy link
Copy Markdown
Contributor
image image

UX feedback: for the "diagram header", I think we should style it the same as files s.t., we remain visually consistent.

@whoisthey

whoisthey commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

image image
UX feedback: for the "diagram header", I think we should style it the same as files s.t., we remain visually consistent.

Screenshot 2026-06-26 at 12 30 26 PM

Updated to match, positive change in got the sticky headers online as well, but noticed the sticky headers currently have a slight visual artifact due to the top left/right borders being rounded. Updated so that when the item header is 'sticking' to the top, the top border radiuses are square. Lmk if thoughts on the look

(example visual artifact:)
Screenshot_2026-06-26_at_12 21 24_PM-25c8c95e-2544

…item header for diagrams. Also shore up diagram header to avoid overflow visual artifact
@brendan-kellam

Copy link
Copy Markdown
Contributor

Updated to match, positive change in got the sticky headers online as well, but noticed the sticky headers currently have a slight visual artifact due to the top left/right borders being rounded. Updated so that when the item header is 'sticking' to the top, the top border radiuses are square. Lmk if thoughts on the look

@whoisthey nice lgtm 👍

brendan-kellam
brendan-kellam previously approved these changes Jun 26, 2026
@whoisthey whoisthey requested a review from brendan-kellam June 26, 2026 21:28
@mintlify

mintlify Bot commented Jun 26, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
sourcebot 🟢 Ready View Preview Jun 26, 2026, 9:34 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@whoisthey whoisthey merged commit 1f289e4 into main Jun 26, 2026
12 checks passed
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.

[FR] Render mermaid diagrams in chat answers (with explicit "Visualize" button)

2 participants