Fix Down on Home moving focus sideways within a row #20

Merged
nezumi merged 1 commit from fix/card-lift-focus-bounds into dev 2026-11-22 03:19:40 +00:00
Owner

Problem

On the Home screen, pressing Down from a card in "Suggested for you" often moved focus to the next card in the same row instead of into Favorites / Recent, so it took several presses to get down.

Cause

Focusable lifted the focused card 2dp with graphicsLayer { translationY }. That transform also moves the card's focus bounds, so its row neighbours sit 2dp lower and count as "below" it in Compose's 2D focus search. Depending on horizontal distance, a neighbour could beat the card in the next row.

Fix

Draw the lift with drawWithContent { translate(...) } instead. It looks the same, but layout and focus bounds stay where they are.

Testing

  • Reproduced on the Android TV emulator: repeated Down presses moved focus back and forth between two cards in the Suggested row.
  • After the fix, Down moves from Suggested to Favorites in one press (checked from two positions in the row).
## Problem On the Home screen, pressing Down from a card in "Suggested for you" often moved focus to the next card in the same row instead of into Favorites / Recent, so it took several presses to get down. ## Cause `Focusable` lifted the focused card 2dp with `graphicsLayer { translationY }`. That transform also moves the card's focus bounds, so its row neighbours sit 2dp lower and count as "below" it in Compose's 2D focus search. Depending on horizontal distance, a neighbour could beat the card in the next row. ## Fix Draw the lift with `drawWithContent { translate(...) }` instead. It looks the same, but layout and focus bounds stay where they are. ## Testing - Reproduced on the Android TV emulator: repeated Down presses moved focus back and forth between two cards in the Suggested row. - After the fix, Down moves from Suggested to Favorites in one press (checked from two positions in the row).
Fix Down on Home moving focus sideways within a row
All checks were successful
CI / build (pull_request) Successful in 4m36s
3bc87216e5
The focused card's 2dp lift used graphicsLayer, which also moves its focus
bounds. Row neighbours then counted as "below" the focused card in D-pad
focus search, so Down often jumped to the next card in the same row instead
of the Favorites/Recent rows. Draw the lift with drawWithContent so layout
and focus bounds stay put.
nezumi deleted branch fix/card-lift-focus-bounds 2026-11-22 03:19:40 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nezumi/kara-tv-app!20
No description provided.