SIGN IN SIGN UP

animation: Align `cubic_bezier` with CSS `cubic-bezier` (#2756)

## Description

Align `cubic_bezier` with CSS `cubic-bezier`.

The old implementation plugged elapsed progress `t` in as the curve
parameter and sampled `y` directly, skipping the `x(s) = t` solve that
CSS performs first. Every curve therefore ran noticeably slower than the
same control points do in CSS — most visibly, the notification stack's
expand/collapse dragged even though its 400ms / `cubic-bezier(.25, .1,
.25, 1)` already matched shadcn/sonner.

The fix replaces the sampling with the standard unit-bezier solver
(Newton-Raphson + bisection fallback, as in WebKit/Blink's
`UnitBezier`), clamped to `[0, 1]` since GPUI asserts easing deltas stay
in that range.

Dialog keeps its hand-tuned trajectory exactly: `x1 = 1/3, x2 = 2/3`
make the time mapping the identity, reproducing the pre-fix output for
its `(y1, y2)` — the same trick works for any downstream caller tuned
against the old sampler.

Tests pin the implementation to Chromium's published `CubicBezier`
expectations and to an independent in-test solver of the CSS definition,
including degenerate curves.

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
F
Floyd Wang committed
5b3e18d14b3df4705c9076e9a9c100c84177bb8a
Parent: 2c0931d
Committed by GitHub <noreply@github.com> on 8/18/2026, 6:21:01 AM