Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: unbreak the frontend suite and the icon alignment check (#10413)

Daniel Han5b283e5f3919
diff --git a/studio/frontend/smoke-composer-icons.html b/studio/frontend/smoke-composer-icons.html
index 3e5df315daa..407b3b0b987 100644
--- a/studio/frontend/smoke-composer-icons.html
+++ b/studio/frontend/smoke-composer-icons.html
@@ -1,6 +1,10 @@
<!doctype html>
<html lang="en">
- <head><meta charset="UTF-8" /><title>Composer icon alignment</title></head>
+ <head>
+ <meta charset="UTF-8" />
+ <script src="/crypto-boot.js"></script>
+ <title>Composer icon alignment</title>
+ </head>
<body>
<div id="root"></div>
<script type="module" src="/smoke-composer-icons-main.tsx"></script>
diff --git a/tests/studio/playwright_composer_icons.py b/tests/studio/playwright_composer_icons.py
index 90bfbed4f0e..4589d687350 100644
--- a/tests/studio/playwright_composer_icons.py
+++ b/tests/studio/playwright_composer_icons.py
@@ -27,8 +27,16 @@ MEASURE = """() => [...document.querySelectorAll('button[data-case]')].map(butto
const buttonBox = button.getBoundingClientRect();
const svgBox = svg.getBoundingClientRect();
const glyph = svg.getBBox();
- const glyphCenter = new DOMPoint(glyph.x + glyph.width / 2, glyph.y + glyph.height / 2)
- .matrixTransform(svg.getScreenCTM());
+ // Scale from the rendered box, not from getScreenCTM(). Firefox leaves CSS `zoom` out of
+ // the CTM while getBoundingClientRect() applies it, so a CTM-mapped centre lands 1/zoom
+ // out and reads as a misaligned glyph on a correctly aligned icon.
+ const view = svg.viewBox.baseVal;
+ const scaleX = view.width ? svgBox.width / view.width : 1;
+ const scaleY = view.height ? svgBox.height / view.height : 1;
+ const glyphCenter = {
+ x: svgBox.x + (glyph.x + glyph.width / 2 - view.x) * scaleX,
+ y: svgBox.y + (glyph.y + glyph.height / 2 - view.y) * scaleY,
+ };
const centerX = buttonBox.x + buttonBox.width / 2;
const centerY = buttonBox.y + buttonBox.height / 2;
return {