You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(tv): return to the last focused hero action when moving up - #1099
Other clients: Apple Silo-Server/silo-apple#988; Roku N/A (its detail ActionRow keeps focusedKey); Web N/A (no D-pad focus row)
Replaces #794, which the evidence deadline closed before Darhole's captures arrived. It's the same branch, now with current main merged in, and that pull request's review history still applies.
On Android TV series and movie pages, Up into the hero action row always lands on Play, whichever hero action the viewer was on before. Coming back from the body never returns to the Watchlist, More, Audio, or Subtitles button the viewer left.
The hero row's focusProperties { enter = { playFocus } } sent every entry to Play. A custom enter on a focus group also catches programmatic requestFocus() calls aimed at its children, so the season chips' and returnToHero's requests for the Version selector were redirected to Play too, and still reported success.
Apple TV had the same problem: there, Up from the season pill landed on Watchlist instead of "Play S5:E1". Silo-Server/silo-apple#988 fixes it. With both changes, the clients behave the same way: Up returns to the hero action the viewer focused last, or Play if they haven't moved yet.
Approach
A small holder, TvHeroActionFocus, owns the hero row's focus requesters (Play, Start Over, Edition, Version, Audio, Subtitles, Watchlist, More) and the last one that gained focus. It lives above the lazy hero item, so the memory survives the hero scrolling out of composition.
The row's focusProperties { enter = … } returns the last action instead of always Play.
returnToHero (Up from the episode, cast, trailers, box set, collections, and Similar rails), Up from the series season chips, and the movie Similar rail's up all claim the last action, then fall back to Play. The scroll-then-retry path for a disposed hero is unchanged.
Edition, Version, Audio, and Subtitles each get a hoisted requester, and TvPlaybackActionSelectors reports which trigger gains focus, so Up returns to the exact selector.
The holder records whether Start Over and Edition are shown and resolves the return target on each read: Play while Start Over is hidden, Version while Edition is hidden. The memory itself is never rewritten, so a brief loading gap does not lose it.
A new detail page (detail.contentId) starts with Play.
I chose this over Modifier.focusRestorer because a restorer cancels programmatic focus requests aimed at its descendants (see the note in TvSkylineSectionFeed), and this screen focuses Play directly in several places. Audiobook pages keep their own Play-based Up handling.
Roku already behaves this way: its detail ActionRow keeps focusedKey while focus moves between sections, so it needs no change. iOS, iPadOS, macOS, the Android phone app, and the web app have no D-pad focus row.
Validation
Merged main into the branch twice instead of rebasing, so the branch is never force-pushed. Both times only TvItemDetailScreen.kt conflicted.
0b0f8ee (main at e15879514): the Watchlist and More buttons. The merge keeps main's stringResource(...) labels and More's isProvisional check, and adds this PR's focus modifiers.
TV app unit tests, lint, and debug build (:androidTvApp:testDebugUnitTest :androidTvApp:lintDebug :androidTvApp:assembleDebug) at c81b2eb: pass (1,415 tests, 0 failures; lint has 0 errors outside the baseline, and none of its notes are on lines this PR changes). Run in the ghcr.io/cirruslabs/android-sdk:36 container.
Device check: Darhole ran the flows on an Android TV emulator. See Evidence.
Darhole tested this on an Android TV emulator at a32f726, before the merge with main, and posted the captures in this comment. With this PR, Up returns to the hero action the viewer left, on both a series page and a movie page. On the base build, every case went to Play. The phone app is unaffected: the change is in androidTvApp only.
Setup
Google TV emulator (API 34, Android 14, 1080p, arm64) on macOS. Mac arrow keys send the D-pad presses.
Before: debug build of this PR's base, 7e4580d. After: debug build of this PR's head, a32f726. Each was installed over the other on the same emulator, with the same account and titles.
After every key press, Darhole read the focused control from a UI dump. The recordings show the same results as the table.
Results
Page
Steps
Before (7e4580d)
After (a32f726)
Series
Play › Down to the season chip › Up
Play
Play
Series
Watchlist › Down to an episode › Up to the season chip › Up
Play
Watchlist
Series
Audio › Down to the season chip › Up
Play
Audio
Movie
Watchlist › Down to Cast › Up
Play
Watchlist
Movie
Subtitles › Down to Cast › Down to Trailers › Up › Up
Play
Subtitles
Series, before: Up from the season chip after Watchlist lands on Play.
Series, after: the same steps return to Watchlist.
Movie, before: Up from Cast after Subtitles lands on Play.
Movie, after: the same steps return to Subtitles.
Recordings (the three series cases, then the two movie cases):
Before, series:
before-series.mp4
After, series:
after-series.mp4
Before, movie:
before-movie.mp4
After, movie:
after-movie.mp4
Not covered
Every base-build case lands on Play because of the row's enter, as Problem explains. The number of versions makes no difference.
Start Over, Edition, a movie with only a Similar rail, and the box set rail weren't tested.
If a remembered requester can't take focus, claim() asks for Play. While the hero is composed, that request also passes through the row's enter and lands on the resolved target, which is always attached then. The target is never a hidden Start Over or Edition.
The memory is keyed to detail.contentId with remember, so after Back from a cast, Similar, or box set page, Up goes to Play. tvOS resets the same way.
A remembered Audio or Subtitles trigger stays the return target even when the next episode has one track, so Up can land on a trigger that does nothing on Select. Android keeps single-choice triggers focusable. fix(tvos): return to the last focused hero action when moving up silo-apple#988 sends entry to Play for a disabled selector instead. This difference is deliberate.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
The Evidence section shows every change a user can see, or how I checked a change nobody sees.
AI Disclosure
Harness: Claude Code
Tool(s): Claude Code CLI
Model(s): claude-opus-5-5
Involvement: Fully AI-generated, human verified. A person reported the focus bug on Apple TV. The agent compared the Android TV code, wrote the change, and filed the issues. Darhole verified it on an Android TV emulator.
Adversarial review: one reviewer agent and a separate verifier agent reviewed 7e4580d..7b0d0f9 for compile errors, focus regressions, state bugs, and source-scanning tests. They confirmed one finding: a brief loading gap rewrote a remembered Edition to Version. Fixed by resolving the fallback on read instead of rewriting the memory.
Return focus to last focused hero action when moving up in TV detail screen
Adds TvHeroActionFocus, which tracks the last focused hero action (Play, Start Over, Edition, Version, Audio, Subtitles, Watchlist, More) and resolves a fallback target when that action is hidden
Adds the rememberHeroAction modifier so each hero control records itself as the last action when focused, and rewires HeroActionRow in TvItemDetailScreen.kt to use the focus holder instead of separate requesters
Gives Edition, Version, Audio, and Subtitles selector triggers their own focus requesters and focus-reporting callbacks in TvPlaybackSelectorRow.kt
Season-chip Up navigation in EpisodesSection now returns to the last focused hero action when the callback is provided
Risk: hero focus requests now target the last focused action instead of always Play; a failed request retries after scrolling and falls back to Play
Up from a series season chip always went to the Version selector, and
entering the hero action row from anywhere else always landed on Play.
The detail screen now remembers the hero action the viewer last focused
and returns there, else Play, matching tvOS.
ClosesSilo-Server#793
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audio and Subtitles had no hoisted focus target, so leaving either one
sent Up back to Version. Each trigger now reports its own requester, and
the hero row returns to the selector the viewer left, matching tvOS.
Refs Silo-Server#793
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With editions offered, the Version trigger reported the Edition trigger's
requester, so Up returned to Edition. Each now has its own hoisted
requester, and focus remembered on Edition falls back to Version when
the Edition trigger goes away.
Refs Silo-Server#793
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moving across season chips or episodes clears the next-up details for a
moment, which hid Edition and rewrote the remembered Edition to Version
for good. The row now records which controls are shown and resolves the
return target each time it is read, so Edition (and Start Over) come
back once the details load.
Refs Silo-Server#793
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the Watchlist and More conflicts in TvItemDetailScreen.kt: keeps main's string resources and More's isProvisional check, and adds this branch's hero action focus modifiers.
Resolves two conflicts in TvItemDetailScreen.kt: the Similar rail's Up keeps main's new collectionsRow == null condition and still returns to the remembered hero action, and the Play pill keeps main's date-labeled width while still recording hero action focus.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing.
The Android TV detail screen now remembers which hero action had focus. Returning to the hero from body content or the season picker requests that action, with Play as the fallback when the remembered target is unavailable.
Changes: Hero action focus restoration
Layer / File(s)
Summary
Track focus across hero actions androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailScreen.kt, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvPlaybackSelectorRow.kt
A shared focus holder records the last-focused hero action. Playback selectors use separate focus requesters and report focus changes. The holder falls back to Play when Start Over or Edition is unavailable.
Restore focus when returning to the hero androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailScreen.kt
Up navigation from body content and the season picker now targets the remembered action. Entering the hero action cluster also uses the remembered target.
On Android TV detail pages, if Start Over or Edition is briefly hidden, the remembered hero action can be replaced by Play or Version. Up navigation then returns to the fallback instead of the viewer's last choice. The effect is minor and limited to a transient state, so merging is low risk.
Security architecture risk: Minimal · up to c81b2
Returning to the hero row changes which button gets focus, not what the viewer is allowed to do. If focus restoration misses, the effect is limited to navigation on the detail screen.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(tv): return to the last focused hero action when moving up" matches the main change: Android TV detail pages now return Up focus to the last-focused hero action instead of always Play. …
Linked Issues check
Directly linked issue #793 requires that on Android TV series and movie detail pages, Up returns to the last-focused hero action, with Play as the default. The PR summary and raw summary of TvItemDeta…
Out of Scope Changes check
The changes listed in the raw summary connect to #793. TvItemDetailScreen.kt changes the hero row focus routing, returnToHero, the season-chip Up, and the Similar rail Up. TvPlaybackSelectorRow.kt add…
Description check
The description states the problem (Up from the hero action row on Android TV detail pages always lands on Play), the cause (the row's focusProperties enter always sends focus to Play), the approach (…
Full details: Title check
Explanation
The title "fix(tv): return to the last focused hero action when moving up" matches the main change: Android TV detail pages now return Up focus to the last-focused hero action instead of always Play. It is specific, concise, and does not use vague terms.
Full details: Linked Issues check
Explanation
Directly linked issue #793 requires that on Android TV series and movie detail pages, Up returns to the last-focused hero action, with Play as the default. The PR summary and raw summary of TvItemDetailScreen.kt show this implementation: a TvHeroActionFocus holder keeps the focus requesters and the last-focused action. The row's focusProperties enter returns that remembered action instead of always Play. returnToHero, the series season-chip Up, and the movie Similar rail's up claim the remembered action and fall back to Play. Edition, Version, Audio, and Subtitles have hoisted requesters, and TvPlaybackActionSelectors reports which trigger gains focus. Hidden Start Over and Edition resolve to Play and Version on read, without rewriting the memory. The PR description cites Darhole's emulator captures at a32f726 (before the merge with main). They show the Before/After behavior for series Watchlist, Audio, and Play cases and a movie Subtitles case. The issue's Apple counterpart (silo-apple#987) is a separate repository and is not a requirement of this PR. Limits: the text diff could not be read, because changed blobs are missing from the checkout, so this verdict relies on the PR summary, raw summary, and the emulator evidence. The merged build (c81b2eb) has no emulator run. Start Over, Edition, and a movie with only a Similar rail are untested. No automated test that covers the focus behavior was identified in the supplied evidence. These gaps affect verification, not whether the coding requirement is implemented.
Full details: Out of Scope Changes check
Explanation
The changes listed in the raw summary connect to #793. TvItemDetailScreen.kt changes the hero row focus routing, returnToHero, the season-chip Up, and the Similar rail Up. TvPlaybackSelectorRow.kt adds the focus requesters and focus callbacks that let Up return to the exact Edition, Version, Audio, or Subtitles trigger. Both are required to implement the remembered-action behavior. The PR description says the Play pill keeps the wider date-labeled width from main (#1035) and the collections rail returns through returnToHero (#1007). These are merged from main and were already in the merge base, so they are not new unrelated changes. The PR also states that audiobook pages and phone and other clients are unchanged. No change was identified that is unrelated to the hero-action focus objective. The diff could not be read directly, so this conclusion rests on the PR summary and raw summary.
Full details: Description check
Explanation
The description states the problem (Up from the hero action row on Android TV detail pages always lands on Play), the cause (the row's focusProperties enter always sends focus to Play), the approach (a TvHeroActionFocus holder that remembers the last focused hero action and hoists focus requesters for Edition, Version, Audio, and Subtitles), validation, and emulator evidence. It is specific and directly related to the changeset, so it passes the lenient check.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The evidence is incomplete for the visible focus change on Android TV:
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailScreen.kt: recordings show return to Play, Watchlist, Audio, and Subtitles, but the “after” captures are from a32f726, not the current PR head c81b2eb. Add a recording of the relevant focus flow on the current head.
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailScreen.kt and TvPlaybackSelectorRow.kt: the evidence does not show return focus for Start Over, Edition, Version, or More, or the movie-only Similar and box-set paths. Add Android TV recording(s) demonstrating these paths, or explain why they could not be captured.
Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.
The reason will be displayed to describe this comment to others. Learn more.
Temporary fallback focus overwrites the remembered hero action
When Start Over or Edition is temporarily hidden, the fallback focus callback replaces last, so the original action is not restored after the next episode loads. Preserve last for temporary fallback focus and update it only for an intentional action change.
Prompt for LLM
File androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailScreen.kt, lines 1884-1885:
Temporary fallback focus overwrites the remembered hero action
When Start Over or Edition is temporarily hidden, focusing its fallback invokes the focus callback and replaces `last` with Play or Version, so the original action is not restored after the next episode loads. Preserve the remembered action when focus is assigned to a temporary fallback, and update it only for an intentional action change.
The reason will be displayed to describe this comment to others. Learn more.
I checked this against the code and I'm leaving it as is. If the viewer presses Up while Start Over or Edition is hidden, focus lands on Play or Version and stays there, so that is the hero action they focused last. Up returning there next time is the rule #793 asks for. When the gap passes without the viewer entering the row, last is untouched and the hidden action comes back as the target, which is what resolving on read is for.
The reason will be displayed to describe this comment to others. Learn more.
That distinction makes sense. If the viewer enters the hero row during the loading gap, Play or Version becomes the action they most recently focused, so subsequent returns should go there. If they don’t enter the row during the gap, resolving the fallback on read preserves the original target.
I withdraw the suggestion to preserve the earlier action after focus lands on the fallback. The implementation matches the stated “last focused hero action” behavior.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Review of c81b2eb. The approach holds up. I found two small things, both on lines this PR changes, and I'm fixing both in a commit on this branch, so there's no need to change anything yourself.
I checked the parts most likely to break. Every requester the row's enter can return is attached whenever the row is composed. Start Over is gated by the same hasResume the holder reads, and Edition by the showEditions the selector reports. Version, Audio, Subtitles, Watchlist and More are always composed. claimFocusOrReport catches the throw when the hero has been scrolled out of composition. The emulator build at a32f726 ran the same Compose UI version (1.9.2) as this head.
The movie Similar rail passed heroActionFocus.target as its up requester.
Reading target during composition subscribed the whole body item to the
hero's focus state, so every move along the hero row recomposed it. The
value was never used for Up: the rail's onDirectionUp consumes the key
first, and the hero row's enter redirects a Play request to the
remembered action anyway. Pass Play, as main does.
Also correct the TvHeroActionFocus comment: Start Over stays hidden on an
episode with no resume point, not only while details load.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewed c81b2eb; fixes pushed as 7892889 (a fast-forward, no rewrite). Device check on 7892889.
Fit: 9/10 · Readiness: 9/10 — ready
Fit: this fixes a core remote-navigation annoyance on the TV detail page inside the TV client, adds no setting or new surface, and brings Android TV in line with tvOS (Silo-Server/silo-apple#988, merged) and Roku. Readiness: the code holds up under review, CI passes on 7892889, and the merged head now behaves as described on an Android TV emulator, with no regressions found in the focus paths around it (below).
Device check
Android TV emulator (API 36, 1080p) against a sandbox built from silo-server main, comparing a debug build of main (b7c0412) with one of this head (7892889), same account and data. The app was relaunched before each case, and the focused control was read from the accessibility tree after every key press.
The fix: on main, Up into the hero always lands on Play/Resume. On this head it returns to the action the viewer left, for all seven series actions (Resume, Start Over, Version, Audio, Subtitles, Watchlist, More) and all seven movie actions (Play, Edition, Version, Audio, Subtitles, Watchlist, More). That holds from the season chips, the episode rail, the cast rail, the details block and the synopsis, after a season change, and after scrolling to the bottom of the page and back.
No regressions found: page entry still focuses Play; Left/Right inside the row is unchanged; the Audio selector menu and the More menu return focus to their button on Back; Back from a cast member's page restores the cast card; fast Right, Up, Up while the hero swaps to the next episode never lost focus.
Same on both builds, as designed: after Back from a pushed page or the player, Up goes to Play/Resume, because the memory lasts one visit to the page. With Start Over remembered, moving to an episode with no resume point sends Up to Play.
Not exercised: the sandbox's movies have no Similar, trailers, collections or box set rail, so the review commit's Similar-rail line wasn't run live (its Up is handled by onDirectionUp on both builds). There was also no series with editions to test Edition disappearing, and no physical device.
The movie Similar rail read heroActionFocus.target during composition, so every move along the hero row recomposed the whole body. It passes playFocus again, which behaves the same: the rail's onDirectionUp consumes Up first, and the row's enter redirects a Play request anyway. Fixed in 7892889.
The TvHeroActionFocus comment said Start Over hides only while details load; it also stays hidden on an episode with no resume point. Reworded in 7892889.
Verified on 7892889: the TV app compiles, and TvDetailFocusPolicyTest and the other detail-screen unit tests pass (39 tests). The PR adds no tests, which matches this repository's rule for UI changes.
Checked and left as is
Every requester the row's enter can return is attached while the row is composed, so D-pad entry can't hit an unattached requester. Requests from the body go through claimFocusOrReport, which catches the throw when the hero has scrolled away.
The direct Play requests on page entry and after a failed More Like This restore now pass through enter. That changes nothing, because the holder is new on those paths and still points at Play.
The bots' point that focusing the fallback overwrites the remembered action: replied in both threads. Focus really does land on the fallback, so it becomes the last-focused action.
claim()'s fallback to Play mostly can't take effect while the row is inactive, because enter sends it back to the target. The PR's Risks section already says so, and no reviewer found an attached target that refuses focus.
Left for the maintainers
When a remembered Edition disappears, Android returns to Version and tvOS returns to Play. It's a small difference; Version sits next to Edition.
A remembered Audio or Subtitles trigger can be restored on an episode where it has only one choice. The PR discloses this as a deliberate difference from tvOS.
Validated features
No passed case on the 1.0 validation board covers hero-row focus or where Up lands on the TV detail page, so Validation tasks: none is right. The nearest case, silo-android#318 C6 (focus stays reachable from the cast rail, Back returns), is unaffected.
Other checks
User manual: unaffected. No siloserver.org page describes focus on the TV detail page.
Council review, one round at c81b2eb: Sol (gpt-6.2-sol, medium) 7/10, Opus (claude-opus-5-5, medium) 7.5/10, Gemini (gemini-4-neon, medium) 9/10. Opus also suggested deleting claim() and relying on enter alone; I left that out, because it would make every return path depend on the redirect and drop the per-target diagnostics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bugSomething isn't workingimpact: polishAnnoyance, cosmetic, or nice-to-haveneeds-reviewNeeds maintainer review to resolve uncertain classification, scope, or changed evidence.priority: P2Limited scope, workaround exists, or polishsize/M50–199 added + deleted lines (all files); change volume, not priority.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closes #793
Related issue: Silo-Server/silo-apple#987 (Apple TV counterpart, PR: Silo-Server/silo-apple#988)
Validation tasks: none
Other clients: Apple Silo-Server/silo-apple#988; Roku N/A (its detail
ActionRowkeepsfocusedKey); Web N/A (no D-pad focus row)Replaces #794, which the evidence deadline closed before Darhole's captures arrived. It's the same branch, now with current
mainmerged in, and that pull request's review history still applies.On Android TV series and movie pages, Up into the hero action row always lands on Play, whichever hero action the viewer was on before. Coming back from the body never returns to the Watchlist, More, Audio, or Subtitles button the viewer left.
The hero row's
focusProperties { enter = { playFocus } }sent every entry to Play. A customenteron a focus group also catches programmaticrequestFocus()calls aimed at its children, so the season chips' andreturnToHero's requests for the Version selector were redirected to Play too, and still reported success.Apple TV had the same problem: there, Up from the season pill landed on Watchlist instead of "Play S5:E1". Silo-Server/silo-apple#988 fixes it. With both changes, the clients behave the same way: Up returns to the hero action the viewer focused last, or Play if they haven't moved yet.
Approach
A small holder,
TvHeroActionFocus, owns the hero row's focus requesters (Play, Start Over, Edition, Version, Audio, Subtitles, Watchlist, More) and the last one that gained focus. It lives above the lazy hero item, so the memory survives the hero scrolling out of composition.focusProperties { enter = … }returns the last action instead of always Play.returnToHero(Up from the episode, cast, trailers, box set, collections, and Similar rails), Up from the series season chips, and the movie Similar rail'supall claim the last action, then fall back to Play. The scroll-then-retry path for a disposed hero is unchanged.TvPlaybackActionSelectorsreports which trigger gains focus, so Up returns to the exact selector.detail.contentId) starts with Play.I chose this over
Modifier.focusRestorerbecause a restorer cancels programmatic focus requests aimed at its descendants (see the note inTvSkylineSectionFeed), and this screen focuses Play directly in several places. Audiobook pages keep their own Play-based Up handling.Roku already behaves this way: its detail
ActionRowkeepsfocusedKeywhile focus moves between sections, so it needs no change. iOS, iPadOS, macOS, the Android phone app, and the web app have no D-pad focus row.Validation
maininto the branch twice instead of rebasing, so the branch is never force-pushed. Both times onlyTvItemDetailScreen.ktconflicted.0b0f8ee(mainate15879514): the Watchlist and More buttons. The merge keepsmain'sstringResource(...)labels and More'sisProvisionalcheck, and adds this PR's focus modifiers.c81b2eb(mainatb7c0412af): the Similar rail's Up keeps feat(detail): show the collections a movie or series is in on its page #1007'scollectionsRow == nullcondition and still returns to the remembered hero action. The Play pill keeps feat(catalog): label sports episodes by air date #1035's wider date-labeled width and still records hero focus. feat(detail): show the collections a movie or series is in on its page #1007's new collections rail returns throughreturnToHero, so it also lands on the remembered action.mainadded no new focusable hero controls.:androidTvApp:testDebugUnitTest :androidTvApp:lintDebug :androidTvApp:assembleDebug) atc81b2eb: pass (1,415 tests, 0 failures; lint has 0 errors outside the baseline, and none of its notes are on lines this PR changes). Run in theghcr.io/cirruslabs/android-sdk:36container.Evidence
Evidence: https://evidence.siloserver.org/r/silo-android/pr-1099/
Darhole tested this on an Android TV emulator at
a32f726, before the merge withmain, and posted the captures in this comment. With this PR, Up returns to the hero action the viewer left, on both a series page and a movie page. On the base build, every case went to Play. The phone app is unaffected: the change is inandroidTvApponly.Setup
7e4580d. After: debug build of this PR's head,a32f726. Each was installed over the other on the same emulator, with the same account and titles.Results
7e4580d)a32f726)Series, before: Up from the season chip after Watchlist lands on Play.
Series, after: the same steps return to Watchlist.
Movie, before: Up from Cast after Subtitles lands on Play.
Movie, after: the same steps return to Subtitles.
Recordings (the three series cases, then the two movie cases):
Before, series:
before-series.mp4
After, series:
after-series.mp4
Before, movie:
before-movie.mp4
After, movie:
after-movie.mp4
Not covered
enter, as Problem explains. The number of versions makes no difference.main. No emulator run has covered the merged build (c81b2eb) yet. Not yet run: a page opened from a tapped card before its details load (feat(detail): open detail pages from the tapped card on phone and TV #971), Show Series Info in the More menu, Up from the collections row (feat(detail): show the collections a movie or series is in on its page #1007), and a date-labeled sports series (feat(catalog): label sports episodes by air date #1035).Risks
claim()asks for Play. While the hero is composed, that request also passes through the row'senterand lands on the resolved target, which is always attached then. The target is never a hidden Start Over or Edition.detail.contentIdwithremember, so after Back from a cast, Similar, or box set page, Up goes to Play. tvOS resets the same way.Checklist
AI Disclosure
claude-opus-5-57e4580d..7b0d0f9for compile errors, focus regressions, state bugs, and source-scanning tests. They confirmed one finding: a brief loading gap rewrote a remembered Edition to Version. Fixed by resolving the fallback on read instead of rewriting the memory.🤖 Generated with Claude Code
Note
Return focus to last focused hero action when moving up in TV detail screen
TvHeroActionFocus, which tracks the last focused hero action (Play, Start Over, Edition, Version, Audio, Subtitles, Watchlist, More) and resolves a fallback target when that action is hiddenrememberHeroActionmodifier so each hero control records itself as the last action when focused, and rewiresHeroActionRowin TvItemDetailScreen.kt to use the focus holder instead of separate requestersEpisodesSectionnow returns to the last focused hero action when the callback is providedMacroscope summarized 7892889.