Skip to content

Hold menu: the card springs back while the item menu opens instead of snapping - #484

Merged
GLinnik21 merged 2 commits into
mainfrom
hold-pop-animates
Oct 7, 2026
Merged

GLinnik21 merged 2 commits into
mainfrom
hold-pop-animates

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

What

Long-pressing a card on Home popped it back to full size in one frame when the item menu opened (reported on RC.3 from a phone video). Press::settle jumped the dip spring to rest; it is removed, so the dispatcher's existing release spring (underdamped, from the dip back to rest) now runs while the menu opens.

To keep one owner of the motion:

  • bridge::opener_press hands the opener lift the dispatcher press's live scale (it was a constant 1.0), so the lift follows the card until it rests.
  • Press::tick raises page damage while a cancelled long hold visibly moves (!idle::settled), so popover::host_refresh re-takes the frozen host snapshot until rest (~0.35 s) and the title is not drawn twice. Taps stay motion-only: a tap that opens a cached menu (Library Sort/Filter, account menu, Settings) does not re-capture per frame.

Review

An Opus review of the first commit found that every tap re-captured the page for the whole release spring, and that invisible spring tails forced redraws; the second commit fixes both, corrects the prose it made false (press.rs, idle.rs call-site list, popover.rs, spec) and adds tests that were red first.

Verification

  • make check: 29 test result: ok, exit 0, on the committed tree
  • cargo +nightly check --lib --no-default-features: clean
  • make check-replay: 3 fixtures, 6 replays, 0 failures, all SAME
  • Not verified on the TV yet (pixel/motion behaviour needs the set).

🤖 Generated with Claude Code

Gleb Linnik and others added 2 commits October 7, 2026 13:52
0.8.0-rc.3 owner report, "still no animation" on a long-press of a Home poster: the card dips
during the hold (press::DIP is a popped card's UNPOPPED size), then when the item menu opens it is
back at full focused size in ONE frame. rc.3's `Press::settle` (from `bridge::open_item_menu`) ended
the press at rest on purpose, because the card then sat in motion under the scrim and the frozen
host snapshot while the opener's lift was drawn at rest, and the page, the snapshot and the lift
disagreed (the card read as having lost its pop, title doubled). That fixed the disagreement by
deleting the motion.

The motion now has ONE owner, the press, and the three things that draw the card read it:

- The dispatcher already abandons a hold the screen answers onto the release spring
  (`cancel_press`, the underdamped one a normal OK press gets, the only user of `--ease-bounce`).
  `open_item_menu` no longer touches the press; `Press::settle`, `InputMachine::settle_press` and
  the call are gone. A declined hold, and an abandoned press (BACK, navigation), take the same
  spring as before.
- The opener lift was handed a constant press scale of 1.0 (`redraw_opener`), so it always drew the
  pop whatever the page drew. `bridge::opener_press` hands it the dispatcher press's live scale, the
  number the page draws with.
- A spring only reports motion, and motion under an open panel is deliberately not a reason to
  re-take the host snapshot, so the snapshot kept the dipped card while the lift grew over it.
  `Press::tick` now reports every frame it moves the card as page damage; `popover::host_refresh`
  re-takes the snapshot per frame until the card rests, and the page and the lift draw the same
  number on each of them. No frame on which they disagree, so no second copy of the title.

The alternative, freezing the snapshot at the dip and letting only the lift spring over it, loses:
the lift is bigger than the snapshot's card from the first frame, and the card's caption sits at a
different place in each, so the title is drawn twice by construction. The price of this choice is a
page redraw and snapshot re-take per frame for the ~0.35 s the card springs, concurrent with the
menu's own appear; it needs a TV fps trace of the menu opening (not measured here).

Tests (watched red against the settle build first): press_damage per moving frame (ui), a real Home
hold's card scale leaves the dip, crosses the pop within 20 frames with no step over 0.04 and
rests under the open menu (run.rs, hostsim), the lift reads the press's own scale every frame
(surface_navigation_tests). The two input_tests that encoded "ends at rest" now state the spring
contract for an answered hold. The prose that said the press settles at rest (press.rs, the
restructure spec's section on the press, bridge.rs, dispatch.rs, popover.rs) says what it does now.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Review of 16bfbe3 found `Press::tick` raised page damage for EVERY press, on every frame its
spring moved at all. A tap that opens a cached surface (a Library chip, the account menu, a
Settings snapshot) then re-captured the page snapshot each frame of its ~0.35 s release spring,
each capture deferring presents up to 4 frames, and the invisible tails of both springs kept the
idle gate awake.

- Damage is raised only for a press that latched long (the hold the item menu opens on); a tap
  stays motion-only.
- And only while the card visibly moves (`idle::settled` against the phase's target) or on a
  phase change, so the release spring's tail and the dip's f32 landing stay quiet.
- Tests: a tap's release spring (card, control, abandoned short press) raises no per-frame
  damage; a cancelled long hold's damage tracks visible motion exactly and reaches
  `take_page_damage`; held steady at its dip is quiet. Both new tests were red first (a tap
  raised 26 frames of damage; a held dip raised 1 per frame).
- `bridge::opener_parts` builds the opener lift's Cx so the strengthened lift test asserts the
  drawn scale is the press's own and not the resting 1.0 mid-spring.
- Prose: `idle::invalidate`'s call-site list names `Press::tick`; `popover::host_refresh` and the
  module doc name a cancelled long hold's press motion as the re-capture reason.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit 00b7c74 into main Oct 7, 2026
11 checks passed
@GLinnik21
GLinnik21 deleted the hold-pop-animates branch October 7, 2026 11:17
GLinnik21 added a commit that referenced this pull request Oct 8, 2026
…d's spring is not page damage (#561)

Since #484 a hold the app takes leaves the card on its release spring, and Press::tick
reported every visibly moving frame of it as PAGE damage. Under an open panel page
damage invalidates the frozen host snapshot (popover::host_refresh), so the whole page
was re-captured on every frame of the ~350 ms spring (7-8 captures instead of the one
designed), each arming the present fence with two skipped iterations: the open ran at
~21 fps on the set. Removing the report alone would keep the dipped card in the snapshot
under the growing lift (the doubled title #484 fixed).

The lifted element is now carried into the page pass (DrawFrame::lifted, from
Dispatcher::lifted_opener, which is the one decision opener_lift now delegates to; a
surface names its opener through Screen::opener) and cards::Shelf / Grid::draw_card leave
it out, so the lift is the only copy of that card, drawn live above the snapshot at the
press's own scale. A card section that skipped it says so (popover::set_lift_owns) and
Press::tick then reports no page damage for the spring, including the landing on rest.
The dispatcher re-takes the snapshot when the lifted element changes (mount, or the lift
standing down while the menu fades). Openers no card section draws (Detail's episode strip
and season tabs, hero) keep the per-frame re-take unchanged.



Also: a plx_ui test of the dispatcher's lifted-element wiring (fails if the page pass is not handed the element or a change of it does not clear the flag and re-take the snapshot), the lift flag reset in the app-level test, and prose the change made stale.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant