Wholphin/app
Leon Omelan 762a5e6dcc
Optimize recompositions on focus change (#1138)
<!-- By submitting this pull request, you acknowledge that you have read
the [contributing
guide](https://github.com/damontecres/Wholphin/blob/main/CONTRIBUTING.md,
including the AI/LLM policy, and [developer's
guide](https://github.com/damontecres/Wholphin/blob/main/DEVELOPMENT.md)
-->

## Description
<!-- Describe the changes in detail -->
I've look at the app using Layout inspector to see if there are any
recompositions that shouldn't be happening while navigating normally in
the app. I've noticed two issues
1. Every BannerCard was being recomposed on every cursor move, which
added a lot of overhead to home screen navigation
2. Tab row in the Series View was being recomposed while navigating
across episodes in given season.

### Related issues
<!-- If this is a new feature or a change, there must be a discussion in
an issue first, reference the issue here -->
<!-- If fixing a bug, reference the bug issue here, or describe the bug,
including steps to reproduce -->
Performance on the home screen is lacking, especially on low end
devices, while this isn't a full fix, it will improve the navigation, as
the app will be making significantly less work.

Probably will fix https://github.com/damontecres/Wholphin/issues/1043

### Testing
<!-- Describe how this change was tested and on what device(s) -->
Using Layout Inspector built-in recomposition counter and highlights
it's easy to see components which recompose while they shouldn't. I've
tested it on a 4K TV emulator on my M1 Macbook Pro

## Screenshots
<!-- Please include screenshots if the PR alters any UI elements -->
main: 
<img width="402" height="508" alt="image"
src="https://github.com/user-attachments/assets/6aaac6af-50d6-4f21-b465-e78bccf7e985"
/>

my branch:
<img width="401" height="563" alt="image"
src="https://github.com/user-attachments/assets/1034c0e2-9a40-4a05-8a07-f30b2e10301d"
/>

same navigation, on the same content. (down, right x4
## AI or LLM usage
<!-- If you used any AI or LLM assistance, please list where in the code
and how you tested it -->
Gemini built in to Android Studio helped me identify non-stable parts of
the code. It also helped me understand and implement fixes in the
HomePage code.
I've took the time to check manually that it didn't alter any behavior,
and verified the fixes using Layout Inspector and recomposition counter
2026-03-31 18:39:02 -04:00
..
config Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
schemas/com.github.damontecres.wholphin.data.AppDatabase Add ability to order navigation drawer items (#886) 2026-02-12 19:55:12 -05:00
src Optimize recompositions on focus change (#1138) 2026-03-31 18:39:02 -04:00
.gitignore Set update URL (#8) 2025-10-15 17:17:16 -04:00
build.gradle.kts Move native builds to wholphin-extensions (#1172) 2026-03-31 18:10:40 -04:00
proguard-rules.pro Enable minify/proguard (#29) 2025-10-17 19:44:36 -04:00