Skip to content

Continue Watching: a server that answers second no longer hides its newest cards behind the deck - #1405

Merged
GLinnik21 merged 2 commits into
mainfrom
fix/home-cw-first-card
Nov 15, 2026
Merged

GLinnik21 merged 2 commits into
mainfrom
fix/home-cw-first-card

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Closes #1395

What

A cold Home whose servers answer one after the other opens its Continue Watching row on the newest card again. When the household's own server answers after a server shared with it, its newer cards now lead the deck instead of waiting behind it.

Why

The cause is not the row's focus or scroll. It is deck::place (rust-modules/data/src/stores/deck.rs, the joiner loop of place, on origin/main deck.rs:273, let before = lane.rows.iter().filter(|row| order(row, &first.0) == Ordering::Less).count();, and deck.rs:279, drop_excess(lanes, true); the settle is pms.rs:3848, settle_deck(&mut srcs, refreshed)).

  • Each server's answer lands and commits on its own (step_landings, rust-modules/data/src/pms.rs), and a whole-source answer (a first one, or a refresh whose reload failed: landed_ok) carries an unplaced preview lane, which settle_deck seats with deck::place against the lanes already holding the deck. A placed lane's refresh that reloads cleanly goes through deck::reload and does not join through place.
  • place treated every joiner as joining a deck the reader had paged along: the joiner's cards newer than the window's first card were held BEHIND the window (lo/hi of the own lane were (5, 5) in the probe). Nobody had moved this deck.
  • The merge then publishes offset = sum(lane.lo) = 5, so Home's more_before was true (a skeleton before the first card) and the first card on screen was the shared server's ("card 6" of the merged order). Five LEFTs and a backward page brought the newest cards in.
  • With the shared server's libraries off there is one lane, place takes the whole window from the head, and DOWN lands on card 1. That is the reporter's isolation.

The first hypothesis (an anchor following its item while own items merge in front) is refuted for this path: focus is on the hero when the cards land, so Shelf has no anchor to follow (Shelf::tick reads focus only for a card of its own row), and Home::seat picks the column nearest the hero by the row's scroll, which is 0. A focused card IS already carried with its element when cards land in front (existing Shelf::landed/pool::slid), so no shared focus or scroll code changed.

The fix gives place the test fit already uses for "a deck at its head": every lane that held the deck before the joiners starts at the head of its listing (lo == 0 && !has_before()). A joiner at the head leads the window with its newer cards and any overflow is let go from the oldest end (drop_excess(.., false), as fit does). A deck the reader moved keeps the old rule, so a joiner still waits behind a window the reader paged along.

The arrival order is inferred, not observed. Fetches start in parallel (fan-out WIDTH 4, stores/fanout.rs), so which server answers first follows the network. The bug appears whenever the server holding the newest cards answers after another (a first answer, or a refresh whose reload failed and so re-joins). It does not depend on the order in any other way.

A server with nothing to continue keeps the default lane, and place used to seat such a joiner at its tail (lo = hi = 1), so the deck read as moved from then on: the friend's server, then an empty one, then the own server's five newer cards put them behind the window (offset 1 + 5), and "friend, then an empty one" alone published an offset of 1, a placeholder before the first card. A joiner with no rows now sits at its head (lo = hi = head.position); a non-empty joiner whose rows all fall before the window keeps the end of its listing, as before.

One behaviour to know about: a full window at its head lets go of its oldest shown cards when a joiner brings newer ones, and those cards stay ahead as lookahead. It needs the reader to have asked forward (the window grown to its bound with lo still 0) before a server's first answer lands. fit already did this for a refresh at the head; the same rule now holds for a join. place's doc comment says it and a deck test pins it.

Tests

Red on unchanged logic, then green:

  • Deck (rust-modules/data/src/stores/deck.rs): a_lane_that_joins_a_deck_at_its_head_shows_its_newer_cards_in_front and a_joining_lane_at_the_head_keeps_the_newest_cards_when_the_window_overflows FAILED (left: ["s2-0", "s2-1", "s2-2"], right: ["s1-0", ..., "s2-2"]); test result: FAILED. 15 passed; 2 failed. Green: test result: ok. 64 passed; 0 failed (make test-crate C=plx_data T=deck).
  • Home (rust-modules/screens/src/home/tests.rs), the reporter's case through the real store and the engine's DOWN: a_cold_deck_opens_on_its_newest_card_when_the_shared_server_answers_first and ..._when_a_refresh_re_joins_after_a_failed_reload FAILED (left: ["s1", "s2", "s3"], right: ["o1", ..., "s3"]); ..._when_the_own_server_answers_first and a_single_server_deck_opens_on_its_first_card already passed. Green: test result: ok. 30 passed; 0 failed (make test-crate C=plx_screens T=deck).
  • The empty server: deck a_server_with_nothing_to_continue_does_not_hide_the_newest_cards_of_the_one_after_it (friend, empty, own: the merged order, nothing before, sum(lo) == 0) and a_server_with_nothing_to_continue_leaves_nothing_before_the_deck (friend, then empty: nothing before) FAILED on 9be185b (left/right differ at the merged order; an empty lane is no card the window has moved past), green with the fix. Home a_cold_deck_opens_on_its_newest_card_when_a_server_with_nothing_answers_in_between (friend, empty, own, DOWN from the hero) FAILED on 9be185b (left: ["s1", "s2", "s3"], right: ["o1", ..., "s3"]), green with the fix. a_full_window_at_its_head_lets_go_of_its_oldest_cards_to_the_joiners_newer_ones pins the overflow sentence (it passes on both).
  • The browsing case: a_server_that_joins_in_front_keeps_the_reader_on_the_same_card_when_nothing_overflows (Home, 3 + 5 cards, so no overflow; a reader on a card, the other server's newer cards land in front, the pop follows the card). It could not be set up before the fix (the cards were held behind), so it fails there on its setup line and passes now. The shelf-level behaviour it relies on is pinned by the existing shelf_landing_carries_the_pop_and_the_scroll and shelf_landing_mid_row_keeps_the_tile_exactly (rust-modules/ui/src/cards/tests.rs) and Home's a_landing_the_row_cannot_honour_clamps_the_scroll_and_the_pop_follows.
  • Single server: a_single_server_deck_opens_on_its_first_card; the reader-moved deck keeps its old rule: a_lane_that_joins_a_deck_the_reader_moved_keeps_its_newer_cards_behind (deck).

Gates on the committed tree (git status --short empty before and after):

  • make test-crate C=plx_data: test result: ok. 1633 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 14.20s
  • make test-crate C=plx_screens: test result: ok. 2157 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 21.68s
  • make check-nodef: Finished dev profile [unoptimized + debuginfo] target(s) in 15.28s, exit 0
  • bash ci/check-deps.sh: check-deps: all gates green
  • python3 ci/check-module-layers.py: check-module-layers: green
  • No replay fixture (SCREEN_SHAPES) changed.

Not verified

No simulator or TV run. The shipping make ARM build, make check as a whole, plx_ui (untouched) and make test-hostsim were not run. The cold-launch arrival order on the reporter's household is inferred from the code, not observed.

🤖 Generated with Claude Code

GLinnik21 and others added 2 commits November 14, 2026 21:51
…ewest cards behind the deck

A deck nobody has moved is at its head, yet a lane that joined it (a second server's first answer,
or any server's refresh) was seated by the rule for a deck the reader has paged along: its cards
newer than the window's first card were held BEHIND the window. On a household whose own server
answers after a shared one, the five newest episodes were behind a window that began at the shared
server's first card: the row's offset was 5, its first card the shared server's, and the newest
cards were reached only by five LEFTs and a backward page.

`deck::place` now judges "at head" on the lanes that already hold the deck, with the test `fit`
already uses (every lane starts at the head of its listing), and a joiner at the head leads the
window with its newer cards, the overflow let go from the oldest end. A deck the reader moved keeps
the old rule. The shelf and the focus engine were not at fault: focus is on the hero when the cards
land, and a focused card is already carried with its element when cards land in front of it.

Adds a `land_deck_lane_for_test` hook that lands one server's deck through the production path, and
tests at the deck and at Home for both arrival orders, a re-answer, a single server and the
reader-moved case.

Closes #1395

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… moved past

A server whose Continue Watching is empty keeps the default lane, and `deck::place` seated such a
joiner at its tail, lo = hi = 1. From then on the deck read as moved: friend, then an empty server,
then the household's own newer cards put the own server's cards behind the window (offset 1 + 5)
and the two-server case "friend, then an empty one" published an offset of 1, a placeholder before
the first card. A joiner with no rows now sits at its head.

`place`'s doc says what the head rule does to a full window (it lets go of its oldest shown cards,
which stay ahead as lookahead), and a deck test pins it. The comments that said a refresh joins the
deck now say what is true: a placed lane's refresh goes through `deck::reload` and re-joins through
`place` only when the reload fails.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21 GLinnik21 added bug Something isn't working ui Screens, layout, focus and navigation labels Nov 15, 2026
@GLinnik21
GLinnik21 merged commit 91d6975 into main Nov 15, 2026
19 checks passed
@GLinnik21
GLinnik21 deleted the fix/home-cw-first-card branch November 15, 2026 20:04
@GLinnik21 GLinnik21 added the backport release/v0.10 When merged into main, also cherry-pick onto release/v0.10 (backport.yml) label Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Backport to release/v0.10: the cherry-pick applied, but pushing it or opening the pull request failed. See https://github.com/plxnative/plx-native/actions/runs/44191144719

GLinnik21 added a commit that referenced this pull request Nov 17, 2026
The cherry-pick of 91d6975 brought a test hook, land_deck_lane_for_test,
whose last lines read `state.seen_facts = facts_key(&scope);`. On main,
6f2c15a (#1358, sans-io machine boundaries) gave facts_key a BrowseScope
parameter (`scope.clients.facts_gen()`); at v0.10.0 it takes none and reads the
process-global plex::server_facts_gen(), so the call did not compile (E0061).

#1405's fix is deck::place; the hook only records the facts epoch the same way
its sibling hooks on this line do (`state.seen_facts = facts_key();`), so the
backport calls facts_key() as the line defines it and imports nothing from
#1358.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 pushed a commit that referenced this pull request Nov 17, 2026
…es its newest cards behind the deck (#1405) (#1447)

With several servers, Home's Continue Watching opened scrolled to the first card of the server that answered first. The newer cards of a server answering after it were held behind the window, offset by their count, so DOWN from the hero landed on the wrong card.

The cause was deck::place, not the row's focus or scroll. Every server's answer lands on its own. A whole-source answer (a first answer, or a refresh whose reload failed) joins the deck through settle_deck, and place seated every joiner by the rule for a deck the reader had paged along: its cards newer than the window's first card went behind the window, and the overflow was dropped from the head.

place now judges whether the deck is at its head, with fit's own test on the lanes that held it before this call. At the head, a joiner's newer cards lead the window, and the overflow goes from the oldest end. A full window lets go of its oldest shown cards, which stay ahead as lookahead. A deck the reader moved keeps the old rule. A joiner with no rows (a server whose Continue Watching is empty) is seated at its head rather than past its tail, so it no longer reads as a lane the deck moved past and hides the next joiner's cards.

Deck tests (red first) cover: a joiner at the head leads with its newer cards; the arrival order makes no difference; the newest cards fill a full window; a reader-moved deck keeps its window; an empty server between two others; an empty server alone. Home tests drive the real store (a new test hook, land_deck_lane_for_test) and the engine's DOWN from the hero. They cover a cold deck in either arrival order, with an empty server in between, and after a failed reload. They also check a single-server deck, and a reader who stays on the same card when cards land in front of it.

Closes #1395

(cherry picked from commit 91d6975)

Backport note: the hook land_deck_lane_for_test calls facts_key() as v0.10.0 defines it; the per-scope facts_key(&scope) came with #1358, which is not on this line.
GLinnik21 added a commit that referenced this pull request Nov 18, 2026
The release note and the authored half of the audit for v0.10.1, a patch released from release/v0.10: v0.10.0 plus the backports of #1438 (Realtek webOS 5 access() interposer), #1437 (seek snap-back on sets with no displayed-frame counter), #1405 (Continue Watching start position), #1439 (Play during a held prime) and #1370 (crash records filed under the uploading release).

Compatibility is unchanged from 0.10.0. The audit records the device evidence each fix rests on and leaves the generated block for the release run.
GLinnik21 pushed a commit that referenced this pull request Nov 18, 2026
The release note and the authored half of the audit for v0.10.1, a patch released from release/v0.10: v0.10.0 plus the backports of #1438 (Realtek webOS 5 access() interposer), #1437 (seek snap-back on sets with no displayed-frame counter), #1405 (Continue Watching start position), #1439 (Play during a held prime) and #1370 (crash records filed under the uploading release).

Compatibility is unchanged from 0.10.0. The audit records the device evidence each fix rests on and leaves the generated block for the release run.

(cherry picked from commit e2f8760)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release/v0.10 When merged into main, also cherry-pick onto release/v0.10 (backport.yml) bug Something isn't working ui Screens, layout, focus and navigation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Home: Continue Watching opens on the first shared-server item instead of the first card

1 participant