Repository navigation
ui/motion: SlidingIndicator re-places a resize that lands during a slide - #34330
Conversation
The ResizeObserver skips a change while a slide runs; the slide's finish now re-reads the selected item's box and places the highlight there with no motion. Fixes #33770. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-e5afe752a9bef9377fa3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-e5afe752a9bef9377fa3
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Gallery before/after for
States
Pick other states with a red: cmux-next checks (god files, concurrency, crash safety, l10n); base red: the same failure on the base cf0fdde; does not block Shipped in:
|
teamleaderleo
left a comment
There was a problem hiding this comment.
Review (codex gpt-6-astra high, next-review, since=20261103T232347Z): SHIP at 6ad85e2
SHIP at 6ad85e2
Visual verdict: no images; Leo tries the build
No correctness findings in the finish callback, observer cleanup, or regression test. Test execution was unavailable because Bun is not installed.
Follow-ups: none
teamleaderleo
left a comment
There was a problem hiding this comment.
Review (subagent claude opus-5.5 medium): SHIP at 6ad85e2
Review (subagent claude opus-5.5 medium): SHIP at 6ad85e2
Visual verdict: unchanged by this diff.
Checked: onfinish calls the current place() through a ref, cleared on disconnect; a cancelled slide never fires onfinish; the new test fails without the fix; existing callers unchanged.
Follow-ups: none
Fixes #33770. Leo (2026-11-03): "there's just tons of design systems related stuff for spacing guttters icons etc whatever like we don't yet feel "designed" yet nawmean". Motion follow-up from #33766.
What was wrong:
useSlidingIndicator's ResizeObserver returns early while a slide runs, and the slide's finish did not remeasure, so a font load or resize inside the 240 ms slide left the highlight off its item until the next selection or resize.Fix: the observer's placement is one
place(); the slide'sonfinishcalls it, so the highlight lands on the item's current box with no second motion. The slide itself keeps its course (no mid-slide jump). Test: widen the target tab mid-slide, finish the slide, and the highlight takes the new width with exactly one animation played.Overlap: #34300 (picker tabs, batch 6) adds an
element.animateguard to the same effect's early-return line; this PR leaves that line alone, so the two merge cleanly.Performance: no new timer, observer or loop. Stop conditions unchanged: the slide is one finite Web Animation that ends on its own (next change and unmount cancel it); the one ResizeObserver disconnects on unmount, which also clears the settle callback. Added work: one
getBoundingClientRectpair per finished slide.No visual change at rest; spec leo-workspace
design/motion-and-polish.md.Agent session: agent session
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes #33770: a font load or resize that landed during the 240ms slide left the highlight off its item until the next selection or resize. The slide's
onfinishnow re-reads the selected item's box and re-places the highlight with no second motion, while the slide itself keeps its course.Details
getBoundingClientRectpair per finished slide; no new timers, observers, or loops.Written for commit 6ad85e2. Summary will update on new commits.