Преглед на файлове

Lock mermaid diagram sizes. (#3514)

Sacha Sayan преди 7 месеца
родител
ревизия
145ce6e7b5
променени са 1 файла, в които са добавени 8 реда и са изтрити 0 реда
  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;
 	cursor: pointer;
 	display: flex;
 	display: flex;
 	justify-content: center;
 	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 */
+	}
 `
 `