Skip to content

Feature Request: UI toggle between rendered and source view for mermaid and svg blocks #24641

Description

@ServeurpersoCom

Prerequisites

  • I am running the latest code. Mention the version if possible as well.
  • I carefully followed the README.md.
  • I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • I reviewed the Discussions, and have a new and useful enhancement to share.

Feature Description

Mermaid and svg blocks render inline with copy and preview buttons, but there is no way to look at the source behind the render without copying it out.
Add a small toggle next to copy and preview that flips the block between its rendered view and its source code, then back. Useful when you want to read or tweak what the model actually produced, not just see the result.

Applies to both rendered block types, mermaid and svg, as one shared button.
Default stays on the rendered view.
The source view reuses the normal code block look (same styling and syntax highlighting).

Follow-up to #24080.

Motivation

Ergonomics / UX

Possible Implementation

I checked that we ultimately had no other block of code that needed this switch.

Activity

  1. added
    enhancement
    on Jun 15, 2026
  2. ServeurpersoCom commented on Jun 15, 2026

    @ServeurpersoCom
    ContributorAuthor

    Memo for this PR following #24080 :

    Consider making code blocks containing SVG or Mermaid elements scrollable; this would ensure consistent behavior with the rest of the code block content.

    The option: "Use full-height code blocks
    Always display code blocks at their full natural height, overriding any height limits." already works perfectly.

  3. added theissue type on Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementserver/ui

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions