From 145ce6e7b5b1f3d6d59e8f2a1678ef4d3993fa52 Mon Sep 17 00:00:00 2001 From: Sacha Sayan Date: Wed, 28 May 2025 13:45:52 -0400 Subject: [PATCH] Lock mermaid diagram sizes. (#3514) --- webview-ui/src/components/common/MermaidBlock.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webview-ui/src/components/common/MermaidBlock.tsx b/webview-ui/src/components/common/MermaidBlock.tsx index d44d51b5f9..4d8d9e6272 100644 --- a/webview-ui/src/components/common/MermaidBlock.tsx +++ b/webview-ui/src/components/common/MermaidBlock.tsx @@ -306,4 +306,12 @@ const SvgContainer = styled.div` cursor: pointer; display: flex; justify-content: center; + max-height: 400px; + + /* Ensure the SVG scales within the container */ + & > svg { + display: block; /* Ensure block layout */ + width: 100%; + max-height: 100%; /* Respect container's max-height */ + } `