Skip to content

Sources: keep source-list focus on the top row while results arrive - #807

Merged
ProdigyV21 merged 1 commit into
ProdigyV21:mainfrom
silentbil:fix/source-list-initial-focus
Oct 14, 2026
Merged

ProdigyV21 merged 1 commit into
ProdigyV21:mainfrom
silentbil:fix/source-list-initial-focus

Conversation

@silentbil

Copy link
Copy Markdown
Collaborator

Summary

Since 7052288 ("stabilize focus and animate source scrolling") the source list follows the focused source instead of the focused row, starting the moment it opens. Results keep arriving and are sorted in above the first row, so focus rides that row down the list.

With Telegram connected and "search Telegram when clicking" on, the picker usually opens with only the trailing "Search Telegram" row, which always stays last. Every source list then ended up scrolled to the bottom with focus on that row, and the user had to scroll back up to reach the actual sources.

This restores row-position focus as it was before 7052288: the list opens on the top row and stays there while results arrive.

Everything else from 7052288 is kept:

  • measured, animated scrolling;
  • stable row keys;
  • release names not re-wrapping when a row is selected;
  • repeated key presses reading the current index.

Trade-off

After the user has moved down, results that arrive above the cursor can shift a different source under it — the pre-7052288f behaviour. That only happens while results are still streaming in. Opening on the bottom row affected every title for Telegram users.

Testing

  • ./gradlew :app:testSideloadDebugUnitTest passes.
  • SourceScrollingDeviceTest on an Android TV emulator (API 30):
    • arrivingSourcesDoNotReplaceTheFocusedSource and firstSourceKeepsFocusWhileMoreResultsArrive test the removed behaviour, so they are replaced by focusStaysOnTheTopRowWhileResultsArrive, which covers results arriving above a trailing action row.
    • That test fails on main the way the bug looks: focus ends on the trailing row.
    • 7/8 pass. addonFiltersResetAndReturnFocusWithoutSticking fails identically on unmodified main, so it is pre-existing and unrelated.
  • Manual: the source list opens on the top source, and D-pad navigation scrolls smoothly row by row.

Since 7052288 the source list followed the focused source instead of the
focused row, from the moment it opened. Results keep arriving and are
sorted in above it, so focus rode the first row down the list. With
Telegram's "search when clicking" row - often the only row when the
picker opens, and always last - every source list opened scrolled to the
bottom on the Telegram row.

Focus is a row position again, as before 7052288: the list opens on the
top row and stays there while results arrive. The commit's other changes
are kept (measured smooth scrolling, stable row keys, no re-wrapping
release names, reading the current index for repeated key presses).

The two device tests for the source-following focus are replaced by one
that keeps focus on the top row while results arrive above a trailing
action row.
@github-actions github-actions Bot added the area: android Changes to the Android app or Gradle build label Oct 14, 2026
@ProdigyV21
ProdigyV21 merged commit 0f0a060 into ProdigyV21:main Oct 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: android Changes to the Android app or Gradle build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants