refactor: replace Spacer with custom spacers#794
Draft
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Description
This PR:
modifierparameter to all custom spacer components inSpacers.kt—VerticalSpacer,HorizontalSpacer,FillHeight,FillWidth,StatusBarSpacer,TopBarSpacerSpacer(modifier = Modifier.height/width/weight(...))calls across 110 files with the appropriate semantic componentEach raw call was replaced according to context:
Modifier.height(X)→VerticalSpacer(X)Modifier.width(X)→HorizontalSpacer(X)Modifier.weight(1f)in Column →FillHeight()Modifier.weight(1f)in Row →FillWidth()Unused
androidx.compose.foundation.layout.Spacer,height, andwidthimports were removed from each modified file. TheFillHeight/FillWidthscope constraints (ColumnScope/RowScope) provide compile-time safety — any misidentified context would have caused a build failure.Preview
N/A — pure refactor, no visual changes.
QA Notes
This is a structural refactor with no behaviour changes. Each custom spacer delegates to the same underlying
Spacerwith the same modifier. The Kotlin compiler enforces correct scope usage forFillHeight/FillWidth. Manual spot-check recommended on the highest-impact screens:For each screen: verify layout, spacing, and alignment look unchanged compared to master.
Automated checks
./gradlew compileDevDebugKotlin— passes./gradlew detekt— passes (import ordering auto-corrected)./gradlew testDevDebugUnitTest— 566 pass, 3 pre-existingCurrencyTestfailures (locale-sensitive, unrelated to this PR, pass on CI)