Skip to content

refactor: route top bar, drawer and Scaffold colors through the theme - #67

Closed
LeGeRyChEeSe wants to merge 2 commits into
feat/appearance-layout-controlsfrom
refactor/theme-hardcoded-colors-lot1
Closed

refactor: route top bar, drawer and Scaffold colors through the theme#67
LeGeRyChEeSe wants to merge 2 commits into
feat/appearance-layout-controlsfrom
refactor/theme-hardcoded-colors-lot1

Conversation

@LeGeRyChEeSe

Copy link
Copy Markdown
Owner

Objectif

Lot 1/4 de la migration des couleurs codées en dur (docs/sonnet5-specs/02-feature-appearance-customization.md §6) : surfaces structurelles (barre supérieure, drawer, Scaffold). Dépend de feat/appearance-layout-controls (#66).

Changements

  • CustomTopBar : fond de la Surface, teintes de toutes les icônes, texte des items du menu de tri, couleurs/placeholder/icônes du champ de recherche, et labelColor/containerColor partagés par tous les filter chips lisent maintenant MaterialTheme.colorScheme au lieu de Color(0xFF121212)/Color.White/Color.Gray/Color.Black codés en dur.
  • Les deux chips dont le fond sélectionné est l'accent réel (All, Local Installs) utilisent maintenant onSecondary pour leur texte/icône sélectionné au lieu d'un Color.Black codé en dur — un accent personnalisé sombre ne produit plus de texte illisible.
  • ModalDrawerSheet : couleur de fond/contenu, titre, texte de version, séparateur, et couleurs des items de navigation non sélectionnés lisent le thème.
  • Scaffold : containerColor : Color.BlackcolorScheme.background.

Volontairement non touché (sémantique, indépendant du thème, cf. doc)

Les couleurs du badge de palier de monétisation, et les couleurs de statut par filtre (New=rouge, Favorites=or, Installed=bleu, Downloaded=vert, Updates=jaune) ainsi que leur texte/icône sélectionné assorti.

Captures

Vérifié sur l'émulateur (Pixel_7, com.vrhub.debug) avec l'accent Violet déjà sélectionné dans une PR précédente :

  • Barre supérieure : chip "All" en violet avec texte blanc lisible ; icônes (menu, tri, refresh, settings) et chips de statut (New/Favorites/Installed) inchangés.
  • Drawer : titre "VRHUB" blanc, "Catalog" sélectionné en violet, items non sélectionnés en gris atténué, "Become Supporter" toujours doré (sémantique préservée), version et séparateur corrects.
  • Aucun crash, logcat propre.

Avec les réglages par défaut (AppearanceSettings()), colorScheme résout exactement les mêmes valeurs hexadécimales qu'avant migration — aucun changement visuel tant que l'utilisateur ne choisit pas un accent non-défaut.

Tests

  • scripts\gradlew.bat :app:assembleDevDebug et :app:testDevDebugUnitTest → succès (suite existante, aucune régression).
  • Pas de nouveau test JVM : changement purement de couleurs dans la couche composition, déjà couvert par AppearanceColorSchemesTest (PR1) pour la logique de résolution de couleur elle-même.

Réf : docs/sonnet5-specs/02-feature-appearance-customization.md §6 (Lot 1/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.
@LeGeRyChEeSe
LeGeRyChEeSe force-pushed the feat/appearance-layout-controls branch from fb3dba0 to cc8c703 Compare July 24, 2026 11:51
@LeGeRyChEeSe
LeGeRyChEeSe deleted the branch feat/appearance-layout-controls 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