Skip to content

refactor: route GameListItem and install overlay colors through the theme - #68

Closed
LeGeRyChEeSe wants to merge 3 commits into
refactor/theme-hardcoded-colors-lot1from
refactor/theme-hardcoded-colors-lot2
Closed

refactor: route GameListItem and install overlay colors through the theme#68
LeGeRyChEeSe wants to merge 3 commits into
refactor/theme-hardcoded-colors-lot1from
refactor/theme-hardcoded-colors-lot2

Conversation

@LeGeRyChEeSe

Copy link
Copy Markdown
Owner

Objectif

Lot 2/4 de la migration des couleurs codées en dur (docs/sonnet5-specs/02-feature-appearance-customization.md §6) : GameListItem + overlays d'installation. Dépend de refactor/theme-hardcoded-colors-lot1 (#67).

Changements

  • GameListItem.kt : conteneur/bordure de la carte, fond/bordure du placeholder d'icône, nom du jeu, texte taille/bouton téléchargement, teinte de l'étoile non-favorite, séparateur en mode étendu, fond/texte de la description lisent maintenant MaterialTheme.colorScheme au lieu de Color(0xFF121212)/Color(0xFF1E1E1E)/Color.Black/Color.White/Color.Gray/Color.LightGray.
  • MainActivity.kt (overlays d'installation : SyncingOverlay, LoadingScreen, ErrorScreen, InstallationOverlay, BottomQueueBar) : même traitement pour fonds, bordures et couleurs de texte/icônes neutres. Le bouton "Try Again" de ErrorScreen avait un texte Color.White codé en dur sur un fond colorScheme.secondary — même bug de contraste latent que les filter chips du lot 1, corrigé avec onSecondary.

Volontairement non touché (couleurs sémantiques de statut/danger, cf. doc)

Or de l'étoile favorite, badges vert/bleu/rouge de version (téléchargé/prêt/installé), rouge d'avertissement permission, rouge suppression/désinstallation, gris de l'état "en pause" sur les indicateurs de progression, et le rouge fixe de la carte d'échec de synchronisation (gardé exact pour éviter un écart visuel par défaut, car il ne correspond pas à la valeur dark-theme de colorScheme.error).

Vérification

  • Build : scripts\gradlew.bat :app:assembleDevDebug → succès.
  • Tests JVM : scripts\gradlew.bat :app:testDevDebugUnitTest → succès (suite existante, aucune régression).
  • Smoke-test émulateur (Pixel_7, com.vrhub.debug) : lancement à froid sans crash, écran d'erreur catalogue vide affiché correctement avec l'accent Violet (bouton "Try Again" lisible), logcat propre.

Comme pour le lot 1, avec les réglages par défaut colorScheme résout aux mêmes valeurs hexadécimales qu'avant (ou une valeur visuellement indissociable, 0x1A1A1A vs 0x1E1E1E) — aucun changement visuel par défaut.

Réf : docs/sonnet5-specs/02-feature-appearance-customization.md §6 (Lot 2/4)

Third slice of the appearance-customization feature (docs/sonnet5-specs/02),
built on feat/appearance-settings-screen (extends the same screen, not just
feat/appearance-data-and-theme as the doc's PR table suggests - the
Agencement section belongs on the screen PR2 already introduced).

- AppearanceLayout.kt (new): cardCornerShape(CardCorner) and
  Density.spacingFactor() pure mappings. ROUNDED (12.dp) and
  COMFORTABLE (1x) match the original hardcoded values exactly, so
  defaults are unchanged.
- GameListItem.kt: card shape and outer vertical margin now read
  LocalAppearance instead of a hardcoded RoundedCornerShape(12.dp)/4.dp.
- MainActivity.kt: CatalogLayout.AUTO preserves the existing
  maxWidth > 800.dp heuristic; LIST/GRID force the outcome. List/grid
  contentPadding and grid item spacing scale with the density factor.
- AppearanceScreen.kt: three new FilterChip rows (Density, Card
  Corners, Catalog View) under the existing sections.

Mode (light/system) and background style remain deferred, per PR2's
scope note.
Lot 1/4 of the hardcoded-color migration (docs/sonnet5-specs/02 §6),
built on feat/appearance-layout-controls.

Structural surfaces only (top bar, drawer, Scaffold background):
- CustomTopBar: Surface background, all icon tints, sort dropdown item
  text, search field colors/placeholder/icons, and the shared
  labelColor/containerColor across every filter chip now read
  MaterialTheme.colorScheme instead of hardcoded Color(0xFF121212)/
  Color.White/Color.Gray/Color.Black.
- The two chips whose selected background is the actual accent (All,
  Local Installs) now use onSecondary for their selected text/icon
  instead of a hardcoded Color.Black, so a dark custom accent doesn't
  produce unreadable text.
- ModalDrawerSheet background/content color, drawer title, version
  text, divider, and the unselected nav item colors now read the theme.
- Scaffold containerColor: Color.Black -> colorScheme.background.

Deliberately NOT touched (semantic, independent of theme, per doc):
the monetization tier badge colors, and the per-filter status colors
(New=red, Favorites=gold, Installed=blue, Downloaded=green,
Updates=yellow) together with their matching selected text/icon color.

All defaults are unchanged (colorScheme resolves to the exact same
hex values as before for the default AppearanceSettings), so this is
a no-visible-diff refactor until the user picks a non-default accent.
…heme

Lot 2/4 of the hardcoded-color migration (docs/sonnet5-specs/02 §6),
built on refactor/theme-hardcoded-colors-lot1.

GameListItem.kt: card container/border, icon placeholder background/
border, game name, size/download-label text, unfavorited star tint,
expanded divider, description surface/text now read
MaterialTheme.colorScheme instead of Color(0xFF121212)/Color(0xFF1E1E1E)/
Color.Black/Color.White/Color.Gray/Color.LightGray.

MainActivity.kt install-related overlays (SyncingOverlay, LoadingScreen,
ErrorScreen, InstallationOverlay, BottomQueueBar): same treatment for
backgrounds, borders and neutral text/icon colors. ErrorScreen's 'Try
Again' button text was hardcoded Color.White on a
colorScheme.secondary background - same latent contrast bug as lot 1's
filter chips, fixed with onSecondary.

Deliberately NOT touched (semantic status/danger colors, per doc):
favorite-star gold, downloaded/ready/installed green-blue-red version
badges, permission-warning red, delete/uninstall red, paused-state
gray on progress indicators, and the sync-failure card's fixed dark
red (kept exact to avoid a default-look diff, since it doesn't match
colorScheme.error's dark-theme value).

Defaults unchanged for the same reason as lot 1: colorScheme resolves
to the original hardcoded hex values (or an indistinguishably close
one - 0x1A1A1A vs 0x1E1E1E) with default AppearanceSettings.
@LeGeRyChEeSe
LeGeRyChEeSe force-pushed the refactor/theme-hardcoded-colors-lot1 branch from fa40d7e to e949216 Compare July 24, 2026 11:52
@LeGeRyChEeSe
LeGeRyChEeSe deleted the branch refactor/theme-hardcoded-colors-lot1 July 24, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant