这是indexloc提供的服务,不要输入任何密码
Skip to content

Add Mermaid Markdown Diagram Support #24

@teles

Description

@teles

Enable LLM FX to recognize and render Mermaid code blocks as interactive diagrams within the UI. Users will be able to paste standard Mermaid syntax into the chat, and see flowcharts, sequence diagrams, class diagrams, etc., rendered live in the side panel.

Use case example:

sequenceDiagram
    participant User
    participant LLMFX
    User->>LLMFX: Hello Bill, how are you?
    LLMFX-->>User: I'm good thanks!
Loading

This should produce a sequence diagram showing Alice greeting Bob and Bob replying.

Benefits:

  • Improves documentation and brainstorming directly within the app
  • Allows quick visualization of processes, architectures and decision flows
  • Keeps diagrams versioned alongside chat history

Implementation suggestions:

  • Use a JavaFX WebView to load the MermaidJS library
  • Detect mermaid code fences and pass the content to Mermaid’s API for SVG/HTML generation
  • Cache rendered diagrams in the session history for faster reloading

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions