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.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: re-measure annotate marks after a tab zoom commits (#13082)
Michael Han3f07e7ffd2ff
diff --git a/studio/frontend/src/features/browser/annotate-layer.tsx b/studio/frontend/src/features/browser/annotate-layer.tsxindex a502dd948a2..600e27243f5 100644--- a/studio/frontend/src/features/browser/annotate-layer.tsx+++ b/studio/frontend/src/features/browser/annotate-layer.tsx@@ -261,7 +261,8 @@ export function AnnotateLayer({page,fileName,url,-}: { page: HTMLElement; fileName: string; url?: string }) {+ zoom = 1,+}: { page: HTMLElement; fileName: string; url?: string; zoom?: number }) {const t = useT();const layerRef = useRef<HTMLDivElement | null>(null);const cursorRef = useRef<HTMLDivElement | null>(null);@@ -329,17 +330,27 @@ export function AnnotateLayer({cancelAnimationFrame(frame);frame = requestAnimationFrame(() => setFrame((value) => value + 1));};+ // Reduced motion gives zoom a 0.01ms transition, so content settles when it ends.+ const zoomed = (event: TransitionEvent) => event.propertyName === "zoom" && redraw();page.addEventListener("scroll", redraw, { capture: true, passive: true });+ page.addEventListener("transitionend", zoomed, true);const resize = new ResizeObserver(redraw);resize.observe(page);return () => {cancelAnimationFrame(frame);window.clearTimeout(settle);page.removeEventListener("scroll", redraw, { capture: true });+ page.removeEventListener("transitionend", zoomed, true);resize.disconnect();};}, [page]);+ // A zoom resizes the content after this render measured it, and fires no scroll or resize.+ useEffect(() => {+ const frame = requestAnimationFrame(() => setFrame((value) => value + 1));+ return () => cancelAnimationFrame(frame);+ }, [zoom]);+// Capture phase, so the page's own links and click handlers never see a marking press.useEffect(() => {const ownUi = (target: EventTarget | null) =>diff --git a/studio/frontend/src/features/browser/browser-panel.tsx b/studio/frontend/src/features/browser/browser-panel.tsxindex 0d6d057a978..9d2c50de6cf 100644--- a/studio/frontend/src/features/browser/browser-panel.tsx+++ b/studio/frontend/src/features/browser/browser-panel.tsx@@ -2461,6 +2461,7 @@ export const BrowserPanel = memo(function BrowserPanel({ active = true }: { actikey={`${activeTab.id}:${activeEntry.fileId}`}page={pageElement}fileName={activeEntry.name}+ zoom={activeTab.zoom}/>) : null}{activeTab && activeEntry && (pageAnnotating === "frame" || pageAnnotating === "native") ? (@@ -2480,6 +2481,7 @@ export const BrowserPanel = memo(function BrowserPanel({ active = true }: { actipage={pageElement}fileName={tabTitle(activeTab, activeEntry)}url={webAddress(activeTab) ?? undefined}+ zoom={activeTab.zoom}/>) : null}</div>