Skip to content

Conversation

@britannio
Copy link
Collaborator

No description provided.

**Changes:**
1. Added `mermaid` npm package
2. Created [MermaidRenderer component](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/6bbe-amp-render-merma/frontend/src/components/ui/mermaid-renderer.tsx) with error handling
3. Updated [DisplayConversationEntry.tsx](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/6bbe-amp-render-merma/frontend/src/components/NormalizedConversation/DisplayConversationEntry.tsx#L540-L576) to detect mermaid tools and render diagrams instead of showing raw args/result blocks

The renderer detects when `tool_name` is "mermaid" and automatically renders the diagram from the `code` argument.
**Changes to [mermaid-renderer.tsx](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/6bbe-amp-render-merma/frontend/src/components/ui/mermaid-renderer.tsx):**
- Added a **Maximize2** button in the top-right corner of each diagram
- Opens a dialog that takes up 90% of viewport width/height
- Re-renders the diagram in the fullscreen view for clarity
- Follows existing dialog patterns from the codebase
… `document.body`, escaping the container hierarchy. The dialog will now appear at the top level without being trapped inside the mermaid diagram region.
…commendations:

**Changes to [DisplayConversationEntry.tsx](file:///private/var/folders/5q/5vgq75y92dz0k7n62z93299r0000gn/T/vibe-kanban/worktrees/6bbe-amp-render-merma/frontend/src/components/NormalizedConversation/DisplayConversationEntry.tsx#L438-L528):**

1. **Always expanded by default**: Mermaid diagrams are automatically expanded via `effectiveExpanded = forceExpanded || isMermaidTool || expanded`
2. **No toggle button**: Set `hasExpandableDetails = false` for mermaid, so there's no collapse/expand button
3. **Full height expansion**: Removed `max-h-[200px] overflow-y-auto` constraints for mermaid diagrams, allowing them to use their natural height within the scrollable conversation log

The solution is centralized in `ToolCallCard`, so it works everywhere this component is used without needing special handling at each call site.
https://mermaid.live/edit#pako:[PAKO_CONTENT]

If [PAKO_CONTENT] is replaced with a pako compression of the diagram, this becomes a sharable link of the diagram.

Introduce a 'View & Share on Web' button next to the full screen button that opens this link in a new tab.

See DisplayConversationEntry
Read frontend/src/components/NormalizedConversation/DisplayConversationEntry.tsx
We just introduced a mermaid renderer.

I want a more modular solution because in future, we will want to introduce new renderers. For example, certain coding agents have tools to take browser screenshots, and I don't want each of these new cases to pollute the code.
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