Read the type scale from AslTypography - #71
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The app read its type scale through two different paths:
The second is correct by coincidence of configuration, and nothing at the call site says so.
AslAppThemesetstypography = AslTypography, so today they resolve to the sameTextStyleinstance. But wrap any composable in a bareMaterialTheme { }— a preview, a test harness, a third-party wrapper — and those call sites silently fall back to Material's stock type scale. No compile error, and with no UI tests in this project, nothing to catch it.67 files took the indirect path. This makes the direct one the only one.
What changed
Every
MaterialTheme.typography.XbecameAslTypography.Xacross 65 files — 42 in:designsystem, the rest spread over the feature modules and:app. The now-unusedMaterialThemeimport was removed from each.The diff is 208 insertions against 207 deletions: an almost exactly 1:1 substitution.
Behavior
No behavior change, and this is provable rather than assumed:
AslAppThemeinstallsAslTypographyintoMaterialTheme, soMaterialTheme.typography.XandAslTypography.Xare the same object for everyX.Scope
Exactly three files still import
MaterialTheme, each deliberately:designsystem/theme/Theme.kt— the adapter that installs the Asl tokens into Material3 (MaterialTheme(colorScheme = …, typography = AslTypography, shapes = …)). This is the one legitimate consumer and must keep it.GitDiffScreen.ktandGitHistoryScreen.kt— hold the three colour tokens with no mapping inTheme.kt'scolorScheme(...):surfaceVariant(diff hunk-header background) andtertiary/secondary(git-graph lane colours). Those render with stock Material colours today; substituting the closest-looking Asl token would be a silent visual change. They still need a deliberate design decision — either add tokens for those roles or map them inTheme.kt.Untouched on purpose: Material3 components (
Text,Scaffold,HorizontalDivider,Icon) — the app deliberately builds on M3, and only the token accessor was in question. Also the 15FontFamily.Monospaceuses, sinceAslCode.*differs in size and weight and swapping them is a visual change, not a substitution.Tests
No new tests. A provably identical token substitution with no new logic.
Verification
./gradlew test— all modules pass../gradlew :app:compileDebugKotlin— passes../gradlew detekt— passes.MaterialTheme.typographyreferences remain anywhere indesignsystem,feature, orapp.MaterialThemeare the ones listed above.Baseline
All baselines regenerated — 64 removed, 0 added.
:designsystem−42,:feature:settings−6,:feature:editor−5,:feature:onboarding−4,:feature:projects−3,:feature:terminal−2,:app−2. Project total 307 → 243.:feature:gitis unchanged, correctly: its two remaining entries are the unmapped-colour files.