Skip to content

feat: fix font size being too large#20

Merged
kvietelaitis merged 2 commits intomainfrom
SCRUM-89
Apr 2, 2026
Merged

feat: fix font size being too large#20
kvietelaitis merged 2 commits intomainfrom
SCRUM-89

Conversation

@Nirmanas
Copy link
Copy Markdown
Contributor

@Nirmanas Nirmanas commented Apr 2, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 2, 2026 18:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts PIN/biometric screens’ typography and layout to prevent oversized text and improve visual alignment in authentication flows.

Changes:

  • PinScreen: replaces scroll-based layout with weighted/spacer-based vertical centering and sets explicit title/subtitle font size.
  • BiometricScreen: applies a configurable font size to the “text above PIN” and tweaks subtitle typography style.
  • BiometricViewModel: adds a titleFontSize field to state (currently not wired through to the UI).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
app/src/main/java/com/k689/identid/ui/common/pin/PinScreen.kt Moves from verticalScroll to weighted layout/spacers and sets explicit text sizing/alignment.
app/src/main/java/com/k689/identid/ui/common/biometric/BiometricViewModel.kt Adds titleFontSize to state (but currently unused).
app/src/main/java/com/k689/identid/ui/common/biometric/BiometricScreen.kt Adds textFontSize parameter and uses it in text styles; changes subtitle typography.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 206 to 212
Column(
modifier =
Modifier
.fillMaxSize()
.padding(paddingValues)
.verticalScroll(rememberScrollState()),
.weight(1.0f),
) {
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content no longer scrolls. If the available height is smaller than the combined height of the header texts + PIN field (e.g., small devices, landscape, or large accessibility font), the content can become clipped with no way to reach it. Consider restoring a verticalScroll(rememberScrollState()) (or using a LazyColumn) so the PIN entry remains reachable in constrained layouts.

Copilot uses AI. Check for mistakes.
Column(
modifier =
Modifier
.fillMaxSize()
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Column is both fillMaxSize() and weight(1f) as a direct child of the parent Column. Combining fillMaxSize with weight is redundant and can lead to confusing measurement behavior; typically you want fillMaxWidth() with weight(1f) (or drop weight if fillMaxSize is intended).

Suggested change
.fillMaxSize()
.fillMaxWidth()

Copilot uses AI. Check for mistakes.
Comment on lines 250 to 258
PinFieldLayout(
modifier = Modifier.fillMaxWidth(),
state = state,
onPinInput = { quickPin ->
onEventSend(Event.OnQuickPinEntered(quickPin))
},
)
Spacer(modifier = Modifier.weight(2.8f))
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spacer(modifier = Modifier.weight(2.8f)) introduces a hard-to-reason-about magic ratio in the layout. Consider replacing this with a named constant (documenting the intent) or using a more deterministic arrangement (e.g., verticalArrangement = Arrangement.SpaceBetween/Center) to avoid future layout regressions.

Copilot uses AI. Check for mistakes.
Comment on lines 73 to 85
data class State(
val isLoading: Boolean = false,
val error: ContentErrorConfig? = null,
val config: BiometricUiConfig,
val quickPinError: String? = null,
val quickPin: String = "",
val userBiometricsAreEnabled: Boolean = false,
val isBackable: Boolean = false,
val notifyOnAuthenticationFailure: Boolean = true,
val quickPinSize: Int = 6,
val isPinInputEnabled: Boolean = true,
val titleFontSize: TextUnit = 16.sp,
) : ViewState
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

titleFontSize was added to State, but it’s not referenced anywhere (including BiometricScreen). As-is, this adds Compose UI types to the ViewModel state without effect. Either remove this field or wire it through by passing state.titleFontSize into the UI.

Copilot uses AI. Check for mistakes.
Comment on lines 268 to 272
private fun ColumnScope.MainContent(
state: State,
onEventSent: (event: Event) -> Unit,
textFontSize: TextUnit = 16.sp,
) {
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MainContent introduces textFontSize, but the only call site in this file (BodyMainContent(state, onEventSent)) doesn’t pass it, so it will always be the default. Either pass a value from state/config (e.g., state.titleFontSize) or remove this parameter to avoid dead customization points.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@kvietelaitis kvietelaitis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kvietelaitis kvietelaitis merged commit a46a4a5 into main Apr 2, 2026
1 check passed
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.

3 participants