From 158282e84df27e48fc849048cccdb8f157db35f9 Mon Sep 17 00:00:00 2001 From: PunGrumpy <108584943+PunGrumpy@users.noreply.github.com> Date: Sat, 8 Aug 2026 00:21:04 +0700 Subject: [PATCH] fix(web): stop the zoom pill width jump when Reset appears The Reset button was conditionally mounted, so the floating zoom pill snapped wider and narrower every time zoom crossed 100%. The button now stays in the DOM inside a grid wrapper whose columns animate 0fr to 1fr (with an opacity fade), so the pill expands smoothly, collapses to zero width when idle, and the transition retargets mid-flight. While hidden the wrapper is inert, keeping the button out of the tab order and the accessibility tree; under reduced motion the safe-list snaps the width and keeps the fade. Co-Authored-By: Claude Fable 5 --- apps/web/components/optimizer-preview.tsx | 36 +++++++++++++++-------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/apps/web/components/optimizer-preview.tsx b/apps/web/components/optimizer-preview.tsx index 3d6bbc6..7d3282b 100644 --- a/apps/web/components/optimizer-preview.tsx +++ b/apps/web/components/optimizer-preview.tsx @@ -73,19 +73,29 @@ const ZoomControls = ({ zoom, setTransform }: ZoomControlsProps) => ( > - {zoom > 1 && ( - - )} +
1 ? "grid-cols-[1fr]" : "grid-cols-[0fr]" + )} + > +
+ +
+
);