Skip to content

fix(web): stop the zoom pill width jump when Reset appears - #32

Merged
PunGrumpy merged 1 commit into
interface/02-compare-range-stylesfrom
interface/03-zoom-pill-stable
Aug 7, 2026
Merged

fix(web): stop the zoom pill width jump when Reset appears#32
PunGrumpy merged 1 commit into
interface/02-compare-range-stylesfrom
interface/03-zoom-pill-stable

Conversation

@PunGrumpy

@PunGrumpy PunGrumpy commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Problem

The interface review flagged (pre-existing, LOW) that the floating zoom pill snaps wider and narrower every time zoom crosses 100%, because the Reset button mounts and unmounts.

Root Cause

Conditional rendering removes the button's width from the pill instantly; the previous fix (#27) made the entrance interruptible but the layout change itself still jumped.

Solution

The button stays in the DOM inside a grid wrapper animating grid-template-columns between 0fr and 1fr (the standard animate-to-auto-width technique), paired with an opacity fade — both interruptible transitions that retarget mid-flight. When collapsed the wrapper takes zero width, so no dead space is reserved, and it is inert, keeping the hidden button out of the tab order and the accessibility tree. Under reduced motion the safe-list from #24 snaps the width change and keeps the opacity fade.

Result

The pill grows and shrinks smoothly instead of jumping; keyboard and screen-reader behavior is unchanged from the conditional-render version. Feel-check: zoom in/out across 100% repeatedly — the pill should never pop, and rapid crossings should retarget smoothly.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pigo Ready Ready Preview Aug 7, 2026 5:22pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
pigo-api Skipped Skipped Aug 7, 2026 5:22pm

@vercel
vercel Bot temporarily deployed to Preview – pigo-api August 7, 2026 17:22 Inactive
@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 158282e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 158282e.

@PunGrumpy
PunGrumpy merged commit 51bd912 into main Aug 7, 2026
10 checks passed
@PunGrumpy
PunGrumpy deleted the interface/03-zoom-pill-stable branch August 7, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant