Skip to content

ui/motion: SlidingIndicator re-places a resize that lands during a slide - #34330

Merged
teamleaderleo merged 2 commits into
feat-cmux-nextfrom
lane/ui-motion-slide-resize
Nov 4, 2026
Merged

teamleaderleo merged 2 commits into
feat-cmux-nextfrom
lane/ui-motion-slide-resize

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

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's onfinish calls 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.animate guard 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 getBoundingClientRect pair per finished slide.

metric before after delta harness
reads per slide 1 2 +1 (on finish) motion.test.tsx
highlight off its item after a mid-slide resize until next change never fixed motion.test.tsx

No visual change at rest; spec leo-workspace design/motion-and-polish.md.

Agent session: agent session

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with 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 onfinish now re-reads the selected item's box and re-places the highlight with no second motion, while the slide itself keeps its course.

Details

  • Adds one getBoundingClientRect pair per finished slide; no new timers, observers, or loops.
  • Adds a test where a mid-slide resize re-places the highlight on finish with exactly one animation played.

Written for commit 6ad85e2. Summary will update on new commits.

View guided diff Turn on auto-fix

teamleaderleo and others added 2 commits November 3, 2026 23:15
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
@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 6ad85e2: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr34330 -f ref=lane/ui-motion-slide-resize -f platform=macos -f backend_mode=local

Gallery before/after for 6ad85e2: 16 states rendered, 5 images differ, 296 more touched states not rendered. Images are in the run's artifact, not on this public PR; the independent review of this head reads them on its own, so the PR needs no hand-made screenshots of these states.

gh run download 41738425267 -R manaflow-ai/cmux -n gallery-advisory-34330-6ad85e276d01b7974e239f57274ec3999dd62b3f (then read gallery-review.json)

States
State Theme Status Diff Picked by
ui.motion-sliding-indicator/pill-spring Apple System Colors changed 0% own SlidingIndicator.tsx
ui.motion-sliding-indicator/pill-spring Apple System Colors Light unchanged 0% own SlidingIndicator.tsx
ui.motion-sliding-indicator/pill-ease Apple System Colors Light changed 0% own SlidingIndicator.tsx
ui.motion-sliding-indicator/pill-ease Apple System Colors changed 0% own SlidingIndicator.tsx
ui.motion-sliding-indicator/plate-spring Apple System Colors Light unchanged 0% own SlidingIndicator.tsx
ui.motion-sliding-indicator/plate-spring Apple System Colors unchanged 0% own SlidingIndicator.tsx
ui.motion-sliding-indicator/underline-spring Apple System Colors Light unchanged 0% own SlidingIndicator.tsx
ui.motion-sliding-indicator/underline-spring Apple System Colors unchanged 0% own SlidingIndicator.tsx
ui.motion-sliding-indicator/today Apple System Colors Light unchanged 0% own SlidingIndicator.tsx
ui.motion-sliding-indicator/today Apple System Colors unchanged 0% own SlidingIndicator.tsx
agent-pane.inspector/chat-menu Apple System Colors Light unchanged 0% imports SlidingIndicator.tsx (1 hops)
agent-pane.inspector/chat-menu Apple System Colors unchanged 0% imports SlidingIndicator.tsx (1 hops)
agent-pane.inspector/wire-log Apple System Colors Light changed 0.0246% imports SlidingIndicator.tsx (1 hops)
agent-pane.inspector/wire-log Apple System Colors changed 0.0202% imports SlidingIndicator.tsx (1 hops)
agent-pane.inspector-colours/errors Apple System Colors Light unchanged 0% imports SlidingIndicator.tsx (1 hops)
agent-pane.inspector-colours/errors Apple System Colors unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-depth-layer/parallax Apple System Colors Light unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-depth-layer/parallax Apple System Colors unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-depth-layer/drift Apple System Colors Light unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-depth-layer/drift Apple System Colors unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-depth-layer/drift-parallax Apple System Colors Light unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-depth-layer/drift-parallax Apple System Colors unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-depth-layer/still Apple System Colors Light unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-depth-layer/still Apple System Colors unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-hover-feedback/scale Apple System Colors Light unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-hover-feedback/scale Apple System Colors unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-hover-feedback/blink Apple System Colors Light unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-hover-feedback/blink Apple System Colors unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-hover-feedback/slow Apple System Colors Light unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-hover-feedback/slow Apple System Colors unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-hover-feedback/press-dip Apple System Colors Light unchanged 0% imports SlidingIndicator.tsx (1 hops)
ui.motion-hover-feedback/press-dip Apple System Colors unchanged 0% imports SlidingIndicator.tsx (1 hops)

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

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 teamleaderleo left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 teamleaderleo left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@teamleaderleo
teamleaderleo merged commit d236f41 into feat-cmux-next Nov 4, 2026
199 of 209 checks passed
@teamleaderleo
teamleaderleo deleted the lane/ui-motion-slide-resize branch November 4, 2026 00:42

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 6ad85e27 Deployed Nov 3, 2026 by teamleaderleo via wait for same-key tree publisher #107976
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant