This plan addresses the feedback from PR #1760 regarding the "cross-store awareness and source switcher" feature. It aims to improve name normalization, sibling filtering logic, data scope for source switching, and UI accessibility/layout.
- Add
normalizeForComparison()extension function toString(orCharSequence). - This function will:
- Unaccent the string.
- Convert to lowercase.
- Remove all non-alphanumeric characters (including symbols like ®).
- Trim whitespace.
- Update sibling grouping logic in
onFilterApps:- Calculate a "global" mapping of all owned games (from Steam, GOG, Epic, Amazon, and Custom) indexed by the new
normalizeForComparison()result. - This global mapping should be created from the full lists (
appList,gogGameList, etc.) BEFORE any filters (search, tabs, collections) are applied. - Use this global mapping to populate
otherSourcesandisInstalledOnOtherSourcefor eachLibraryItem. - Fix sibling filtering logic: A sibling is a game with the same normalized name but a different
appIdAND a differentgameSource.
- Calculate a "global" mapping of all owned games (from Steam, GOG, Epic, Amazon, and Custom) indexed by the new
- Fix logic error in
InstallStatusBadge: Move the check forappInfo.isInstalledOnOtherSourceabove the!isSteamcheck so that non-Steam games can correctly show "Installed elsewhere".
- Add an accessibility label for the "installed elsewhere" status icon in
GridStatusIcons.
- Make the "Also available on" row horizontally scrollable in
AppScreenContentto handle cases where a game is available on many platforms.
- Add KDoc to public functions and classes modified in this task to improve docstring coverage, as recommended in the PR review.
- Add test cases for
normalizeForComparison()to ensure it correctly links games like "The Witcher® 3" and "THE WITCHER 3".
- Run
StringUtilsTestto verify the normalization logic. - Command:
./gradlew :app:testDebugUnitTest --tests "app.gamenative.utils.StringUtilsTest"
- Since I cannot run the app, I will:
- Carefully review the modified
whenexpression inLibraryListCard.kt. - Verify that the "Also available on"
RowinLibraryAppScreen.ktnow has ahorizontalScrollmodifier. - Verify that
LibraryViewModel.ktuses the full library data for sibling linking.
- Carefully review the modified