Browse Source

Lock mermaid diagram sizes. (#3514)

Sacha Sayan 7 tháng trước cách đây
mục cha
commit
145ce6e7b5
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  1. 8 0
      webview-ui/src/components/common/MermaidBlock.tsx

+ 8 - 0
webview-ui/src/components/common/MermaidBlock.tsx

@@ -306,4 +306,12 @@ const SvgContainer = styled.div<SvgContainerProps>`
 	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 */
+	}
 `