Repository navigation
Description
Problem
A rendered diagram (diagram content renderer, DiagramContent in packages/module-diagrams/src/ui.tsx:32-56) is a bare <figure>. The serif title sits on the chat background above the drawing, the drawing has its own inner border, and the actions sit in a separate row underneath: a large filled "Open diagram" Button and the share trigger (ui.tsx:49-52). Other framed content in the chat puts its title and actions in one header bar inside a frame:
- the kit's
CodeBlockhas a header with a right-sideactionslot (packages/ui-kit/src/blocks/CodeBlock.tsx), used bybrain-markdown-code.tsx:38; - the chat Mermaid block uses compact
IconButtons ("Open diagram", "Share diagram") in its top-right corner (packages/ui-react/src/components/chat/mermaid-block.tsx:99-115).
So the diagram block looks unfinished next to them, and its large action button takes a full row.
Example: the Odysseus "Voyage record" diagram (Odysseus → RECORD → Voyage ledger) renders with "Open diagram" as a large filled button below the card and the share icon beside it.
Approach
Frame the rendered diagram like the other content blocks:
- an outer frame with the same border, radius and surface tokens as
CodeBlock; - a header row inside the frame with the title on the left and the actions on the right: open/zoom and share as compact icon buttons, consistent with the Mermaid block and the kit's header-action pattern, with accessible names unchanged ("Open diagram", "Share diagram");
- the drawing (or its narrow/summary fallback) in the frame body, with no doubled inner border.
Reuse the existing kit pieces (CodeBlock's header pattern or a shared frame primitive if one exists; IconButton) rather than adding module-local styling. If a shared "framed block with header actions" primitive is missing and two blocks now need it, extracting it into ui-kit is in scope.
Acceptance criteria
- A rendered diagram shows one frame, with its title and the open/share actions in a header row: title left, actions right.
- Actions are compact icon buttons with unchanged accessible names and at least 44×44 touch targets on coarse pointers. They stay keyboard reachable and keep visible focus.
- Layout holds at 320 px and 1280 px in light and dark: the title truncates or wraps without pushing the actions out, and nothing overflows.
- Print and share output are unchanged. The print drawing still replaces the interactive one, and the header actions are hidden in print.
- The zoom viewer and share menu behave exactly as before.
- Visual review screenshots (320/1280 × light/dark) are attached to the PR, and the existing diagram browser/layout tests pass, updated only where the frame legitimately moved controls.
Part of #2079.
Activity
schlessera commentedon Nov 3, 2026
Claiming (claim-3397-664522). Branch
feat/3397-diagram-framefromepic/2079-module-renderers(d1e1f3a). Collision check on the cited files: closure-level overlaps only (module-diagrams/ui-react/ui-kit workspaces shared with many open PRs), no direct path collisions.schlessera commentedon Nov 3, 2026
Implementation is up for review in #3410 (base
epic/2079-module-renderers@ d1e1f3a, head dcc7539), marked ready, milestone 0.45.0. This issue closes when the epic batch lands on main. Local proof:check:prpassed; pinned-image browsers green (diagrams chromium+webkit 268/268, pointer fine/coarse/mixed 480/480); share-mode markup byte-identical; three mutation receipts. Follow-up re-audit of the diagram browser-document pins: #3405.CONTRACT: feat(module-diagrams): frame rendered diagrams with header …
schlessera commentedon Nov 3, 2026
Delivered to
epic/2079-module-renderersas74008eadcvia #3410, after ready-candidate proof passed on the exact epic base. This issue closes when the epic batch lands on main.