Files
pipelines/app/notes/quick-switch-retarget.md
T
alan fd5d4b783c Quick switch: a new request retargets the switch in flight instead of waiting
Peek taps, chords and programmatic activations during a mobile quick
switch start the next switch at once from what is on screen. Swap styles
continue from each card's current rect, pose, opacity and bar reveal;
the tape takes a fresh picture of the frame above the incoming chat and
continues its loop. The incoming chat keeps its speed and brakes once.
The arriving peek takes pointers while it moves; leaving cards do not.
The capture kit's film step gains a taps option for rapid-tap reviews.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 15:20:47 +00:00

2.4 KiB

Quick switch retargets mid-animation

Operator report: on mobile, a second peek tap did nothing until the first switch finished. The workspace used to hold the old active pane while the motion ran and take the latest request afterwards. Now every request (peek tap, keyboard chord, programmatic activate) starts its switch at once, from what is on screen.

  • Swap family (chat_pane_switch_start.dart): each card's from is its current rect; its current opacity, bar reveal and paint pose carry into the new run and decay (QuickSwitchPose.carry, rect residual for paths such as a deck's that do not start where the card is). Retained cards that are neither requested nor the previous active fade out within the first third and never take pointers; the newly active chat turns opaque in that third. Shrinking cards keep their viewport until they settle; growing ones lay out at their destination. A fresh switch is unchanged.
  • Tape: a fresh picture of the current frame (everything above the incoming chat) replaces the old one and keeps moving up; the incoming live chat continues from where it is, the next peek follows joined below it. An unseen target starts at the peek's place. A failed capture settles at once.
  • The incoming chat keeps its current speed (ChatSwitchEase launch slope, clamped to avoid overshoot) and brakes once; a reversal starts from rest.
  • Pointers follow the requested layout: the arriving peek is tappable while it moves; cards on their way off ignore pointers. Reduced motion settles each request directly, as before.

Checks: chat_switch_retarget_test.dart (five rapid peek taps for tape, swap, arc swap, card deck, crossfade over four chats; programmatic reversal for tape, swap, deck slide; reduced motion; ease); tape test in chat_mobile_panes_test.dart now asserts the reversal retarget. Suites test/features/chat/ 1448, test/application/ 193, test/ui/motion 30 pass; analyze clean.

Browser films (capture kit taps option, 560x1000, four fixture chats, five taps ~180 ms apart at the peek): /tmp/review/retarget/v2-tape, v2-swap, v3-cardStack, v3-arcSwap (sheets 02-rapid-*-sheet.png). Headless input is delivered late and unevenly, so not every tap lands on the arriving peek; each landed tap visibly started a new switch mid-motion and the runs settled to one active chat and one peek. Browser evidence only; no device run.