Blog

Streaming and quick actions in DiagramaHub's AI chat

With versions 0.5.3 and 0.5.4 the AI chat streams its answers, shows which phase it's in, and adds quick actions: Explain, Improve UI, Improve Process and Fix.

Asking an AI to change a diagram and then staring at a generic spinner tells you nothing: is it thinking? Is it stuck? How long will it take? With version 0.5.3 DiagramaHub's AI chat answers in real time, and with 0.5.4 you no longer need to type a prompt for the most common requests.

Streaming responses

Chat responses now arrive progressively through Server-Sent Events (SSE). Instead of a spinner, you see which phase the response is in: "Thinking…", "Analyzing your diagram…", "Generating code…" and "Validating syntax…".

sequenceDiagram
    participant Y as You
    participant C as Chat
    participant P as AI provider
    Y->>C: Ask for a diagram change
    C->>P: Message with the diagram as context
    P-->>C: Response in chunks
    C-->>Y: Live phases and progressive text
    C-->>Y: Validated diagram and diff preview

It works with all five providers: OpenAI, Claude, Gemini, DeepSeek and MiniMax. If a provider doesn't support streaming, the chat automatically falls back to the regular flow, with nothing for you to do.

The chat knows what kind of answer you expect

Not every request is the same, so the chat detects the response mode:

  • Code mode: when you ask for a diagram change, you only see the phases, not the model's internal text.
  • Text mode: when you ask a question or request an analysis, the text appears as it's generated.

<think> tags from reasoning models (like DeepSeek) are filtered out in real time. If you close the chat panel or switch diagrams, the stream cancels itself. And if something fails, a retry button gives you up to 3 consecutive attempts.

Two more details: when the AI doesn't provide an explanation, you'll no longer see a generic "Diagram modified as requested" message, just the diff preview; and the chat now answers in the language you have active in the app.

Quick actions: one click instead of a prompt

0.5.4 adds four preset actions to the chat:

  • Explain: understand what the diagram does.
  • Improve UI: polish how it looks.
  • Improve Process: review the flow it describes.
  • Fix: repair what's broken.

To keep each request in the right place, if you ask for an explanation from the improve modal, DiagramaHub redirects you to the AI chat, where the answer is shown as text.

A chat panel that fits your work

The chat panel is now resizable, and its width is saved per diagram. If one large diagram needs more canvas and another needs room for long explanations, each one remembers your preference.

Security and maintenance

Alongside streaming we added DOMPurify sanitization for server-rendered (Kroki) SVGs, and fixed a side effect that hid node labels in Mermaid. The backend moved to Python 3.12 with an updated Docker base image. If you run your own instance, the admin panel gains "License Usage", "AI Models" and "Last Login" columns.

Try it

Open a diagram on DiagramaHub Cloud, bring up the chat and try Explain or Fix. If you self-host, update from the repository; details are in the changelog.