Skip to content

Fix empty modal cards on the TV's cached frame path - #169

Merged
GLinnik21 merged 4 commits into
mainfrom
fix-modal-card-blank-on-tv
Sep 19, 2026
Merged

GLinnik21 merged 4 commits into
mainfrom
fix-modal-card-blank-on-tv

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

What

The two modal cards #161 added (the sign-in offer alert and the Details card) drew as empty glass on the television while the simulator drew them fully. Nothing in #161's checks could have seen it: the simulator runs with the frame cache off (frame cache: CopyTexSubImage error=0x500 — cache off), so the cached host path was never exercised.

Cause

popover::host promotes a captured page snapshot to a ground snapshot (stage two). The promotion did not mark the ground as already drawn this frame, so a later host::live() scope — the dispatcher's empty modal-scrim scope after Login's embedded alert — replayed the foreground-free ground over the alert's title, body and buttons. Input and the 2 s keepalive make unscoped page damage, which recaptures and re-trips it.

Changes

  • ea960825 The fix. A successful capture sets GROUND_DRAWN. Regression test ui/popover_host_tests.rs drives the real host state machine over a CPU FrameCache stand-in; it fails on the old code ([page, scrim, glass] where [..., title/body/buttons] is expected) and passes now.
  • 2cba7b34 Docs. The simulator cannot see the cached modal ground; said so in ui-sim, which-tier and agent-reference.
  • 6dfcafcb Delivery-watch race. submit and queue_standing registered the delivery watch after the spool append, so the ordinary flush (or compaction) could settle a record in the gap. spool::append_watched_if registers the watch under the spool lock, before the write; both callers use it. Lock order stays spool then delivery.
  • 860d2575 Stale Details card. The card took its body and answers once at open, so a receipt arriving while it was up left the old body, and a failed delivery never gave Send report back. DecisionAlert::reconcile_card compares what the card renders, updates in place (no entrance restart, valid focus kept, a removed answer hands focus to Close), and drops the cached ground only when content changed.

The last two were found in review of #161 and were written test-first, red then green.

Verification

  • make check green on the pre-rebase tip; after rebasing onto Crash reporting: keep capture armed through a panic, retry unreadable envelopes, read nothing without a DSN #168 (no file overlap) make lint and cargo +nightly check --lib --no-default-features are green, full suite is CI's.
  • Television (debug flavour, sign-in failure scenario): offer card and Details card complete at settle and at +10 s; left/right/back move focus correctly. There is no "cache on" log line, so the device evidence is visual: the same scenario that was blank is now intact.
  • Not exercised: pressing Send report (the debug build has no Sentry/PostHog); delivery tracking is covered by host tests, not the device. The claim that consent/repair alerts were unaffected rests on reading the code.

🤖 Generated with Claude Code

GLinnik21 and others added 4 commits September 19, 2026 22:43
A settled embedded alert captures its panel ground before drawing its title,
body and buttons. Mark that capture as already drawn in this frame so a later
host::live scope cannot replay the foreground-free snapshot over those controls.
All shared host-cache consumers inherit the fix without screen-specific changes.

The host cache (becb4e5) predates #161. The sign-in cards are embedded alerts
drawn before the dispatcher's modal-scrim scope, which is the order that trips
it; whether older embedded alerts share that order was not checked. A cache-off
simulator never enters this path, which is why #161's simulator captures looked
complete while the television drew empty glass. Dispatcher page damage can
repeat the capture after input.

Regression first: the unmodified production host state machine failed with
left [page, scrim, glass], right [page, scrim, glass, title/body/buttons] on the
first settled frame. GL framebuffer copies are replaced by a CPU framebuffer;
the host protocol and the freeze gate are the real ones. Cache-off and
draw-last controls pass. The popover tests pass (12/12). This change has not
yet been run on the television.

Document the cache-promotion invariant and the simulator coverage limitation.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The simulator runs with the frame cache off, so popover::host's cached stages
never run there and a simulator capture cannot show a fault in them. Say so
where the simulator's coverage is listed (ui-sim, which-tier Tier 1.5,
agent-reference), since #161's captures read as complete while the television
drew empty glass.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
`submit` and `queue_standing` appended a record and only then registered its
delivery watch, so the ordinary flush (or compaction) could settle the record
in the gap and the watch would come up Queued for a report that was already
Delivered, or resurrect one `forget` had erased.

`spool::append_watched_if` admits the watch under the spool lock, before the
write, so neither the flush nor compaction can settle an unwatched record; a
write failure fails the watch and a refused admission (permission, stale
tenure, no capacity) permits no fallback. Both callers use it. Lock order stays
spool then delivery.

Regressions ran red first: the flush reducer, run at the point the lock is
released and the submitter has not resumed, found Queued where Delivered was
expected, for both entry points. Erasure winning, a stale worker, and
compaction discarding the new record are covered too.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The Details card took its body and answers once, at open. A receipt arriving
while it was up left the support-only body on screen, and a failed delivery
never gave *Send report* back to a card that had dropped it.

`DecisionAlert::reconcile_card` compares the title, paragraphs and answers the
card actually renders (not the incident's ID or state tag, which a receipt can
leave unchanged) and updates in place: no restart of the entrance, valid focus
kept, a removed answer hands focus to *Close*, and a newly available *Send
report* does not steal it. A change drops the cached panel ground, since the
body sizes the panel; unchanged content stays quiet. Login feeds it every tick
while Details is open.

Regressions ran red first: a receipt arriving while open, and a failed delivery
that should offer Send again. Focus on removal of Send is covered, and the
cached-ground invalidation is graded against the host state machine.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 19, 2026 19:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@GLinnik21
GLinnik21 merged commit 2c2009a into main Sep 19, 2026
5 checks passed
@GLinnik21
GLinnik21 deleted the fix-modal-card-blank-on-tv branch September 19, 2026 19:56
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