Skip to content

Home: the hub shelves are cards::Shelf - #525

Merged
GLinnik21 merged 3 commits into
mainfrom
cards-home
Oct 7, 2026
Merged

GLinnik21 merged 3 commits into
mainfrom
cards-home

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Home's hub shelves were the last hand-rolled card rows. They are now plx_ui::cards::Shelf, the same component Person, Search, Detail and the Library already use, so pop, press, caption band, sideways scroll, landing and stop registration on Home follow the one shared rule set and are covered by the shared conformance suite with no expected failures left (ci/allow/cards-conformance.txt is empty; ci/allow/cards.txt is down to profiles.rs).

What changed

  • home/mod.rs: each hub row is a Shelf fed by a HomeCards source. The hero, the hero dive, linked headings, vertical flow and the focus groups are unchanged.
  • Press, hold and activate are not routed through the shelf. Home feeds it Tick and FocusMoved only and keeps its own press paths, because a Continue Watching press is account-affecting. The diff has no hunk in activate, emit_item_menu or the press arms of step.
  • Shared Shelf / CardSource gained what Home needed, all with identity defaults so other screens are unchanged: sweep() (the dive scales a row's drawn offset and caption lag), focus_index, hover, base_y, paint_resting / paint_focused (Home paints every row's resting cards, then the focused tile last).
  • A restore that follows dormant ticks now arrives already popped, as it does everywhere else; a deliberate dive from the hero still grows from rest.
  • The conformance landing check now also bounds the scroll from above, through RowStyle::max_scroll.
  • Home's state hash no longer indexes a shelf directly; it falls back to a resting shelf's bytes.

Intended behaviour changes on Home are the shared rules only: a restored focus arrives popped, a landing that moves the focused card carries pop and scroll with it (clamped to the row's range), and the item-menu anchor is the shelf's rect. One side effect: cards more than 64 px off screen no longer register pointer stops.

SHAPE is byte-identical and SCREEN_SHAPES_PIN is unchanged, so the replay fixtures stand as recorded.

Verification

  • make check: ==== check: 76 steps — all ok; cargo check --lib --no-default-features clean; make check-replay: 3 fixtures, 6 replays, 0 failures (1-boot-home-chip-grid verdict=SAME).
  • Geometry: for every card of two 24-card rows across dive positions, retained offsets and press states, placed rects and stops equal the old formula exactly.
  • Simulator before/after against the mock server (boot, walking the shelves, sideways scroll, retained offset across the dive, item menu, detail and return): at most 1/255 per channel, the same as before-vs-before.
  • New tests: restore after idle ticks arrives popped (failing first), a deliberate dive still grows from rest, a landing the row cannot honour clamps and the pop follows, focus groups keep ids and order, every stop is the placed rect, the focused card paints apart from the rest.

Not verified: nothing here ran on the television, and mid-dive frames could not be captured deterministically in the simulator. Sideways scroll on the third shelf was not compared.

🤖 Generated with Claude Code

Gleb Linnik and others added 3 commits October 8, 2026 02:40
…lowlist

Each hub row is a Shelf over a CardSource of the published hub; the screen keeps the hero, the dive,
the linked headings, the vertical flow, the focus groups and every press and hold (a Continue Watching
tile still resumes or opens on exactly the element the engine holds). The picture's focus (the card
kept lifted while the dive returns to the billboard, none until the shelves are the picture) is the
source's focus_index; Shelf gains dormant() so a card focused during the dive grows from rest when the
shelves wake, and the Home pop/landing/geometry cases leave the conformance list except the landing
case, which waits on Shelf's overscroll fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nding case passes

The row's offset and the focused caption's settle lag are scaled by the dive again (CardSource::sweep,
read by draw, place, the stops and the opener redraw alike), the cull pad is the glow's again
(cull_margin(GLOW_PAD)), and every row's focused tile is painted after all the rows (Shelf::paint_resting,
paint_focused) so its glow overlaps the neighbouring rows. The retained-offset dive test is back to its
original name and assertions. Shelf's duplicate dormant/at_exact_rest give way to the ones on main.
The landing case now stages a move the row can follow (rotate_test_shelves_right) instead of reversing
a row that scrolls 332 px, which the shelf's clamp rightly lets move on screen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and census tests bite, and the hash no longer panics

The Shelf wake latch turned a restore announced after idle dormant ticks into a deliberate arrival,
so the restored card grew from rest instead of arriving popped; the latch now yields to an arrival
the shelf was told about. Home gains tests for the restore-after-idle case, the deliberate dive and
a landing the row cannot honour (scroll inside [0, max], the pop follows the element). The
conformance landing check also tests the scroll's upper bound for strip harnesses (RowStyle::max_scroll,
CardHarness::scroll_max). The census test mutates a real pop spring again, the census comment says what
the shelf does not hash, and the state hash falls back to a resting shelf instead of indexing. Prose:
Home's feed-only-Tick-and-FocusMoved exception, and cull_margin's leading-edge-only doc.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit a7188ad into main Oct 7, 2026
11 checks passed
@GLinnik21
GLinnik21 deleted the cards-home branch October 7, 2026 23:52
GLinnik21 added a commit that referenced this pull request Oct 20, 2026
…eeps its offset at the hero (#871)

Home rested its page by the picture's focus, which keeps the billboard until the dive is half done. After BACK from the last shelf, the page's target therefore stayed at that deep shelf, and Down from the billboard drew the deep shelves for about 7 frames before travelling back to the first. The page now rests by the focus engine's focus (`HomeScreen::rest_row`). A focused billboard rests the first shelf through the Library's rule (`ui_cards::grid_rest_scroll`).

At the billboard, every shelf was drawn at its first card and slid back to its offset on Down. Home's `CardSource::sweep` multiplied each shelf's scroll by the dive's phase (#525). The hook is removed (`CardSource::sweep`, `Swept`, `Shelf::drawn_scroll`, Home's `eff_scroll`), so a shelf is drawn at its real offset in every phase. No shelf was refetched.

The BACK fold from the last shelf is faster as a result: the page falls with the dive. In the app-tier rig the largest step is 258.9 px/frame instead of 171.9, and the page rests in 29 frames instead of 48. The owner approved it on the TV.

The app-tier Home request loop performs the BACK fold through `content::fold_to_hero`, extracted from the World pump, for `Pump` and `pump_navigation` alike.

Tests:
- Route tests on the World rig, red on the old code: the dive after BACK draws no deeper shelf, and a shelf walked seven cards keeps its drawn card at the billboard, reached by Up and by BACK.
- Screen tests, red on the old code: the page rests by the engine's focus, and a retained offset adds no motion to the late dive.
- `poster-hero-grid-dive` still grades #191 gap 3 in the simulator; its TV run is owed.

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