Repository navigation
Conversation
Comment bodies now render fenced ```mermaid blocks as diagrams, matching GitHub and the existing Markdown file preview. Reuses MermaidDiagram, so theme switching and the fallback-to-source on parse errors behave the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DC3ZZGaUiyaYpb4F3Z864J
Author
|
commentでもmermaidが表示できると嬉しいので、マージしてもらえると嬉しいです。レビューよろしくお願いします🙏 |
This branch has not been deployed
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
```mermaidfenced code blocks in comment bodies as diagrams, matching GitHub's behavior in review commentsImplementation notes
src/client/components/CommentBodyRenderer.tsx: theprerenderer passesmermaid-language blocks to the existingMermaidDiagramcomponent, wrapped inmy-2to match the spacing of other comment blocksMermaidDiagramkeeps the behavior identical to the file preview: mermaid is lazy-loaded,securityLevel: 'strict', the diagram follows the light/dark theme, and it falls back to the raw source when parsing failsMarkdownDiffViewerScreenshots
Test plan
CommentBodyRenderer.test.tsx: a mermaid block renders as a diagram, and a parse error falls back to the source (mermaid is mocked as inMarkdownDiffViewer.test.tsx)pnpm test— full Vitest suite passes (862 passed / 2 skipped)pnpm check— oxlint type-aware checks passpnpm build— production build succeeds--commentcontaining a mermaid block; the diagram renders inside the comment thread