Repository navigation
improve(ui): mobile sheets move with iOS-style springs, flicks and swipe-to-dismiss - #188162
Merged
roboclaw-bot merged 3 commits intoOct 30, 2026
Merged
Conversation
Mobile Panels, Inbox and Filter & sort sheets now present, resize and dismiss on one critically damped spring fitted to the iOS sheet curve. Gesture releases carry their velocity into that spring, flicks step between detents, a sheet pulled down or flicked down closes, and closing sheets slide out instead of disappearing. Co-authored-by: vyctorbrzezowski <[email protected]>
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Collapse the sheet spring into --motion-sheet (duration plus a simplified linear() curve within 0.3% of the solver), reuse it in every sheet, drawer and picker transition, reuse the existing page reveal for in-sheet push motion, and record the approved total CSS budget increase. Co-authored-by: vyctorbrzezowski <[email protected]>
Flicks dispatch input with explicit timestamps so release velocity does not depend on runner load, slow placements pause before lifting, and the Details helper ignores a sheet that is already hidden while it slides out. Co-authored-by: vyctorbrzezowski <[email protected]>
roboclaw-bot
enabled auto-merge (squash)
October 30, 2026 08:13
roboclaw-bot
deleted the
openclaw/improve-mobile-sheet-animations-and-testing
branch
October 30, 2026 08:19
Collaborator
Author
|
Merged via squash auto-merge.
|
This was referenced Oct 30, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 31, 2026
…ipe-to-dismiss (openclaw#188162) * improve(ui): give mobile sheets iOS-style spring motion Mobile Panels, Inbox and Filter & sort sheets now present, resize and dismiss on one critically damped spring fitted to the iOS sheet curve. Gesture releases carry their velocity into that spring, flicks step between detents, a sheet pulled down or flicked down closes, and closing sheets slide out instead of disappearing. Co-authored-by: vyctorbrzezowski <[email protected]> * improve(ui): share one compact sheet motion token Collapse the sheet spring into --motion-sheet (duration plus a simplified linear() curve within 0.3% of the solver), reuse it in every sheet, drawer and picker transition, reuse the existing page reveal for in-sheet push motion, and record the approved total CSS budget increase. Co-authored-by: vyctorbrzezowski <[email protected]> * test(ui): make mobile sheet gesture tests timing-independent Flicks dispatch input with explicit timestamps so release velocity does not depend on runner load, slow placements pause before lifting, and the Details helper ignores a sheet that is already hidden while it slides out. Co-authored-by: vyctorbrzezowski <[email protected]> --------- Co-authored-by: vyctorbrzezowski <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by @vyctorbrzezowski.
Work sessions
What Problem This Solves
Mobile sheets in the Control UI do not move like the iOS sheets people expect: the Panels sheet fades in place, disappears instantly on close, ignores flicks, snaps between heights without easing, and cannot be swiped away. The Inbox and Filter & sort sheets cannot be swiped down at all.
User Impact
On phones, the Panels sheet, the Inbox and Filter & sort sheets, the navigation drawer, in-sheet pages and the Details/Panels switch now share one iOS-style spring. Sheets slide up and back down, follow the finger, carry a flick's momentum into the next height, and close with a downward flick, a pull past half their minimum height, or a tap outside. Slow drags still leave the Panels sheet at exactly the height you chose. Reduced-motion users keep instant changes.
Why This Change Was Made
Motion now has one owner in
ui/src/lib/motion/:spring.tssolves Apple's duration/bounce spring in closed form and reduces it to a compact CSSlinear()easing (13 stops, within 0.3% of the solver).base.cssexposes it as one--motion-sheettoken (441ms linear(…)) that every sheet, drawer, picker page and segmented-control transition reuses; a unit test keeps it generated from the solver.gesture.tsholds the WWDC18 fluid-interface physics: release velocity over the last 100 ms, momentum projection with the scroll-view deceleration rate, and rubber-banding.chat-mobile-host-release.tsdecides where a released Panels sheet rests; the runtime then swaps in a one-off spring curve that starts at the finger's speed.sheet-dismiss.tsgives the sidebar bottom sheets swipe-to-dismiss and an animated tap-outside dismissal.Closing keeps
hiddenandinertas the immediate source of truth for focus and accessibility.transition-behavior: allow-discretelets the hidden sheet finish sliding out, with the Panels launcher still visible. A sheet settling into the dock stays above the conversation until it arrives, so collapsing no longer drops it behind the chat. Live drag geometry is written to the sheet itself instead of the whole region, following the Vaul note that inherited custom properties restyle every descendant per frame.CSS budget. The total Control UI CSS gzip budget was already exceeded on
main(308,922 B against a 308,526 B cap), so any growth failscontrol-ui-performance. After consolidating to one motion token, reusing the existing page-reveal rule for push motion, logicalinset-inline-startfor the segmented thumb (no RTL rules) and nativevisibilityinterpolation for the drawer backdrop, the change adds 279 B gzip / 1,344 B raw (down from about 530 B gzip). Raw stays under its cap. @vyctorbrzezowski approved exceeding the gzip budget, sototalCssGzipBytesmoves to 309,265 B (measured 309,201 B plus the 64 B build variance) with an approval note.Accepted limits: engines without
allow-discreteexit transitions (before Safari 18 / Chrome 117) still hide the sheet instantly, as they do today. An open panel tool or Details page stops presenting the moment the sheet closes, so it slides out with an empty body; keeping that content presented through the exit needs a closing state in the pane owner and is left as a follow-up. Escape and programmatic closes of the sidebar sheets stay instant.Research: sources and what each one decided
SpringSpring(duration: 0.5, bounce: 0.3)→ stiffness 157.9, damping 17.6spring(duration:bounce:)UIScrollView.DecelerationRate.normal; relative velocity; rubber-band at boundariesprojectDistance, close decision below the minimum, overscroll resistancecubic-bezier(0.32, 0.72, 0, 1)over 500 mslinear()easinglinear()approximates springs with enough stopsFit study. A grid search over Apple's spring space against the Ionic/Vaul iOS curve found the best match at bounce 0 and a 0.29–0.30 s perceptual duration (≈1.5% RMS of the travel distance over 600 ms). SwiftUI's default 0.5 s
.smoothspring measured noticeably slower than iOS sheets, so the PR uses 0.3 s with no bounce. Critically damped springs never overshoot from rest and only overshoot when a release is faster than the spring's natural frequency, which is how momentum earns a little settle without any bounce at rest.How it moves
Evidence
Panels sheet, before (left) and after (right). Same script, same touch input via Chrome DevTools Protocol, 390×844 mobile emulation. Steps include flicks, a slow drag past the top, close, and slow-motion replays with page animations at 20% speed.
panels-sheet-before-after.mp4
Navigation drawer and Filter & sort sheet, before and after, including swipe-down dismissal, a choice page, and tap-outside.
drawer-and-filter-sheet-before-after.mp4
Before: flicking the grabber up stops where the finger lifts.
After: the flick carries the sheet to the expanded detent.
Before: 120 ms after tapping ✕, the sheet is already gone.
After: 120 ms after tapping ✕, the sheet is sliding away.
Measured motion. Visible sheet height sampled every animation frame, before versus after:
Tests
ui/src/e2e/mobile-sheet-motion.e2e.test.ts(8 cases): spring entrance and slide-out exit with the launcher still visible; flicks through dock → expanded → dock → dismiss; slow releases keep their height and only close past half the minimum; header-space drag with tappable controls and the sliding segment thumb; push/pop direction for Details pages; Filter & sort swipe-down, spring-back and tap-outside; reduced motion stays instant. Five of these cases fail onmain(no spring, no flick detents, no exit, no swipe).spring.test.ts(Apple's documented coefficients, monotonic critically damped curve, velocity hand-off, iOS-curve fit, CSS token sync),gesture.test.ts,chat-mobile-host-release.test.ts.mobile-inbox-sheetnow asserts the shared spring's duration (< 500 ms) instead of the old 240 ms curve, and the layout test helper treats a sheet that is sliding out as already closed.allow-discreteexit in Safari's engine.pnpm tsgo:ui, oxlint, stylelint,oxfmt --check,check:control-ui-controllers,git diff --check,test/scripts/control-ui-performance.test.ts, and a localpnpm ui:check-performance:baseagainst the merge base (passes with the new cap: total CSS gzip 308,833 → 309,112 B).hiddenwhile it slides out (this fixedsession-progress-live-placementon the first CI run). Both suites pass repeatedly locally.chat-stream-runtime-budgets› “commits a streamed delta burst…” failed once in CI; it also fails 2 of 3 local runs on the unchanged merge base (92f70af), so it is a pre-existing flake unrelated to this change.origin/main→8236d31, before the CSS consolidation): no actionable findings. The reviewer saw the diff without the surrounding pane-owner and popover lifecycle code and did not execute tests.Not verified: a physical iPhone in Safari or the native iOS app; captures use Chromium mobile emulation and Playwright WebKit. Drag cost on low-end phones was not profiled.