From c2a6936e7d3fe724f968b10dd689abb6ff8f75ad Mon Sep 17 00:00:00 2001 From: Guilhem Date: Thu, 6 Aug 2026 12:44:47 +0200 Subject: [PATCH] fix: keep the mermaid fullscreen dialog in its pane and its emoji vector (#10541) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: keep the mermaid fullscreen dialog inside its pane and its emoji vector Co-Authored-By: Claude Opus 5 (1M context) * fix: load only the fonts a diagram needs and size chrome per breakpoint Co-Authored-By: Claude Opus 5 (1M context) * fix: cover every emoji class in the font preload without restyling diagrams Co-Authored-By: Claude Opus 5 (1M context) * fix: keep the dialog chrome allowance in rem so it scales with the root font Co-Authored-By: Claude Opus 5 (1M context) * fix: decode mermaid entity codes when sampling text for the font preload Co-Authored-By: Claude Opus 5 (1M context) * fix: match mermaid's decimal-only entity codes and decode the Inter sample too Co-Authored-By: Claude Opus 5 (1M context) * fix: drop emoji format characters from the font sample Co-Authored-By: Claude Opus 5 (1M context) * docs: state the emoji subset spread and modifier exclusions precisely Co-Authored-By: Claude Opus 5 (1M context) * refactor: re-render once fonts settle instead of hand-picking emoji subsets Co-Authored-By: Claude Opus 5 (1M context) * refactor: give Modal a fill-height mode instead of measuring its chrome Co-Authored-By: Claude Opus 5 (1M context) * fix: guard the post-fonts re-render against a newer render The re-render after document.fonts.ready assigned svg without re-checking renderSeq after its own await. renderedCode is set before that await, so a stale re-render landing last leaves svg holding the previous diagram while renderedCode names the current source — showSvg stays true and paints the wrong diagram. Co-Authored-By: Claude Opus 5 (1M context) --------- Co-authored-by: Claude Opus 5 (1M context) --- .../lib/components/common/modal/Modal.svelte | 21 +++++++++++++----- .../copilot/chat/script/MermaidDisplay.svelte | 22 +++++++++++++++++-- .../components/sessions/PreviewTabHost.svelte | 16 +++++++++----- 3 files changed, 47 insertions(+), 12 deletions(-) diff --git a/frontend/src/lib/components/common/modal/Modal.svelte b/frontend/src/lib/components/common/modal/Modal.svelte index d718c3c1bd..20821a33f9 100644 --- a/frontend/src/lib/components/common/modal/Modal.svelte +++ b/frontend/src/lib/components/common/modal/Modal.svelte @@ -20,6 +20,11 @@ style?: string cancelText?: string | undefined kind?: 'button' | 'X' + /** Make the dialog fill the height it is anchored to and lay its body out as a flex + * column, so content can size itself with `h-full` / `flex-1 min-h-0`. Off by default: + * the dialog otherwise hugs its content, and percentage heights inside it do not + * resolve (the centering wrapper is `min-h-full`, i.e. height:auto). */ + fillHeight?: boolean /** Force a minimum z-index base. Defaults to elevating above the AI chat * side panel when it is open. Pass an explicit value to stack above other * surfaces (e.g. a modal opened over the /sessions preview-pane editor). */ @@ -36,6 +41,7 @@ style = '', cancelText = undefined, kind = 'button', + fillHeight = false, minZIndex: minZIndexProp = undefined, settings, children: children_render, @@ -119,12 +125,17 @@ >
-
+
(open = false)} />
{/if} -
+
-
+

{title}

{@render settings?.()}
-
+
{@render children_render?.()}
diff --git a/frontend/src/lib/components/copilot/chat/script/MermaidDisplay.svelte b/frontend/src/lib/components/copilot/chat/script/MermaidDisplay.svelte index dda1892baa..60687efcce 100644 --- a/frontend/src/lib/components/copilot/chat/script/MermaidDisplay.svelte +++ b/frontend/src/lib/components/copilot/chat/script/MermaidDisplay.svelte @@ -35,6 +35,13 @@ startOnLoad: false, theme: dark ? 'dark' : 'default', securityLevel: 'strict', + // Mermaid writes this stack into a