Skip to content

Shelf: a page that returns keeps its seat lifted under the BACK image - #1159

Merged
GLinnik21 merged 4 commits into
mainfrom
claude/shelf-return-lifted
Oct 30, 2026
Merged

GLinnik21 merged 4 commits into
mainfrom
claude/shelf-return-lifted

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #958 (which fixed cards::Grid). BACK from a Detail onto the Recommended page ran its shelves under the route dip's held page image, where Shelf::dormant put the restored seat to rest. The card then regrew from rest, and the caption band with it, moving the shelf below by the band's height: the same bounce #958 removed from the Library grid.

cards::Shelf now follows the same rule as Grid, in the shared layer:

  • Enter(Restored) marks the shelf as returning. A returning shelf that holds the restored seat (seated.is_some()) is not put to sleep by dormant(held): the focused card keeps its full lift and its caption band stays open under the image.
  • A Recommended page holds many shelves with the same entry id, so only the shelf whose card holds focus keeps its seat; the others are snapped to rest under the image as before.
  • On the restoring FocusMoved a dormant returning shelf calls the new CardRow::settle_seat, which puts the scroll (ending a glide the page froze when it was covered), the band and the heading lift where that focus rests, on that very event. The dip's capture frame is drawn before any tick, so the layout it captures already has them and nothing plays on under the image.
  • A deliberate move (By::Dir, By::Pointer), or focus leaving the shelf's cards, ends the return; the shelf then sleeps through the next dissolve as usual.
  • RecommendedScreen now feeds Enter to its shelves (it fed only Tick and FocusMoved).

Home needed no change: it feeds its shelves only Tick and FocusMoved (never Enter), and its shelves are dormant only while the hero is up. A test pins that its BACK round trip already returns the card lifted and every word where it stood (it passes on the old code and the new).

Tests

Each was written first and seen failing against the old behaviour; each return rule was mutation-checked (the rule removed, the test goes red).

  • ui/src/cards/tests.rs: eight tier-1 Shelf tests (seat kept lifted with band open under a held image, for a shelf that slept while covered and for a fresh one; scroll glide unfinished at the push ends on the restoring event; a return with no image sleeps through the next dissolve; a deliberate move ends the return; focus leaving the shelf ends it; a return with no restoring move wakes at its lift, not from rest; a returning shelf that holds no seat is still put to rest; a landing is adopted whole under the image).
  • ui/src/cards/warm_tests.rs: a dormant shelf warms artwork only while it keeps a returning seat.
  • src/app/recommended_enter_tests.rs: a World test drives Recommended -> Detail -> BACK through the real dip and asserts the focused card's scale is whole on every frame and the next shelf's heading stays within 0.5 px of where it stood.
  • src/app/deep_shelves_route_tests.rs: the Home pin.

Gates (merge commit 87a0cf258, committed tree, git status --short empty before and after)

  • make test-crate C=plx_ui: test result: ok. 1440 passed; 0 failed
  • make test-crate C=plx_screens: test result: ok. 1778 passed; 0 failed
  • make test-crate C=app: test result: ok. 1115 passed; 0 failed
  • make check-cargo-lint: exit 0
  • make check-nodef: exit 0
  • make check-python: 119 of 119 steps ok on the re-run. The first run failed one timing-sensitive CPU-accounting assertion in tools/test_check_parallel.py while the machine was loaded; it passes alone (26/26, twice) and in the re-run, and this PR touches nothing under tools/, ci/ or the Makefile.
  • make check-cargo-unit-hostsim: 14 failures, all in plx_media (curlio::...abort_during_connect... and the route::decision::prefs_* tests that need an unwritable fixture or a network). The set is identical before and after merging main; they are environmental to the container this ran in (uid 0, sandboxed network), and plx_media depends on none of ui, screens or appkit. Everything else in that pass is green (for example 1778 plx_screens and 1248 and 754 and 295 and 342 in the other crates). CI runs as a normal user with network and is the arbiter for those 14.
  • Test steps ran with CAP_DAC_OVERRIDE, CAP_DAC_READ_SEARCH and CAP_FOWNER dropped from the bounding set, because root otherwise passes the permission-denied fixtures.

Not run: the TV and the simulator (no pixel, LG rasterization or video-plane claim is made; the bounce is layout, asserted from the page's own placement in the World rig).

Review

pr-reviewer on origin/main...HEAD: no findings. doc-claim-auditor: one wording nit (the first sentence of shelves_on's doc names focus moves and the tick but not Enter), verified as not misleading since the paragraph below states the rule. A merge-interaction review (this branch against main's pointer-glide work in CardRow/Shelf) raised one concern, that settle_seat is gated on dormant and a warm BACK could reach the restoring event with dormant still false; a probe in the World rig shows dormant=true and the image already held at that event (the dip defers the pop's commit to its floor), and the covered-mid-ease premise does not arise under a dip, so nothing was changed for it.

Merge of origin/main into the branch: one conflict in Shelf::on's FocusMoved arm, resolved so a key's move ends the pointer glide (row.unfree()) before the seat settles.


Generated by Claude Code

BACK from a Detail onto the Recommended page put the restored seat to
rest under the route dip's held image and grew it again once the image
went, so the shelf below it dropped by the caption band's height and came
back: the bounce #958 fixed for the Library's grid.

The cause is the same. The page reports its shelves dormant under the
image, and a dormant shelf resets its lift, band and heading and discards
the restored focus. The Grid already carried a `returning` state set by
`Enter(Restored)`; the Shelf gets the same: the shelf the focus is on keeps
its seat (card, caption band, heading lift) whole, the others are still put
to rest, because stepping a shelf mid-ease under the image would hold it
past its dissolve. The band and heading are settled on the restoring
`FocusMoved` itself, so the frame the dip captures is already laid out
with them (`CardRow::settle_band`). The return ends on the first awake
tick, at a deliberate move, and when focus lands off the shelf's cards;
landings are adopted whole while dormant.

`RecommendedScreen::step_event` now hands `Enter` to its shelves. Home's
shelves are dormant only while its hero is up, never for the image, so a
dived Home already returned lifted; a World test pins that against this
change.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01P6ZnFeGA7CweKvne8tknaa
…s under the BACK image

The seat's shelf is stepped under the held image, so a scroll glide the push
froze half played (an OK pressed before it ended) finished there: layout
motion, which holds the image past its dissolve and then jumps the row
sideways. CardRow::settle_band becomes settle_seat and jumps the scroll to the
target that brings the card into view before it opens the band and raises the
heading, on the restoring FocusMoved. The tier-1 test returns a shelf whose
glide was frozen at 1137 of 3842 px and fails without the jump.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01P6ZnFeGA7CweKvne8tknaa
…h is removed

A review of the two shelf-return commits found three behavioural lines no test
would miss: the return ending when focus leaves the shelf's cards by a restore,
the stale wake-from-rest flag cleared by Enter(Restored), and warm-ahead
continuing for a returning dormant seat. Each now has a test that goes red
when its line is removed.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01P6ZnFeGA7CweKvne8tknaa
shelf.rs: main's pointer-glide hand-off (a key's move along the row ends the
glide, `row.unfree()`) and the returning seat's settle (`settle_seat`) both
apply on the arrival of a focus move; the glide ends first, so the seat's scroll
target is read from a row that follows its focus again.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01P6ZnFeGA7CweKvne8tknaa
@GLinnik21
GLinnik21 merged commit 8b634f4 into main Oct 30, 2026
19 checks passed
@GLinnik21
GLinnik21 deleted the claude/shelf-return-lifted branch October 30, 2026 11:16
GLinnik21 added a commit that referenced this pull request Oct 30, 2026
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.

2 participants