From 8df5b5253a9d7fd8148f199491d8ace57b0eb54a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 09:53:51 +0000 Subject: [PATCH] Settings sub-screens in the new look MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every screen behind a Settings row, behind Debug → New look, converted through what they share: - SettingsSubScreen: calm bar, page, gutter, 720dp cap, and CalmMaterial (the new look's neutrals in Material's colour roles plus Inter), which carries the screens that read MaterialTheme. It also sets the tonal role the app's scheme never set. - SubScreenCard, the profile and goal editors, Language and AI tools on your network read Look, which returns the old values in the old look. - SectionHeaderCaps uses LookLabel: sentence case in the new look. - PulseSegmented and the profile's segments mark the choice with a raised surface instead of mint. Audit: audits/2026-11-17-new-look-settings-subscreens.md. Claude-Session: https://claude.ai/code/session_01P1t1aUqSUPd3whKXmgVm7w --- app/src/main/assets/i18n/pt-BR.json | 3 +- .../java/com/pulseloop/ui/calm/CalmTheme.kt | 36 +++++++ .../main/java/com/pulseloop/ui/calm/Look.kt | 24 +++++ .../com/pulseloop/ui/components/AppChrome.kt | 11 +- .../pulseloop/ui/components/PulseSegmented.kt | 16 ++- .../com/pulseloop/ui/onboarding/Editors.kt | 74 ++++++------- .../pulseloop/ui/screens/AccuracyCheckUi.kt | 52 ++++----- .../java/com/pulseloop/ui/screens/BodyUi.kt | 18 ++-- .../com/pulseloop/ui/screens/DebugScreen.kt | 2 +- .../ui/screens/HealthConnectSourceUi.kt | 30 +++--- .../ui/screens/LanguageSettingsScreen.kt | 8 +- .../com/pulseloop/ui/screens/McpSettingsUi.kt | 66 ++++++------ .../com/pulseloop/ui/screens/PostpartumUi.kt | 12 +-- .../ui/screens/SettingsSubScreens.kt | 95 +++++++++------- ...2026-11-17-new-look-settings-subscreens.md | 101 ++++++++++++++++++ docs/new-look-plan.md | 18 ++++ 16 files changed, 385 insertions(+), 181 deletions(-) create mode 100644 audits/2026-11-17-new-look-settings-subscreens.md diff --git a/app/src/main/assets/i18n/pt-BR.json b/app/src/main/assets/i18n/pt-BR.json index 7dd918cc..f5fcfcee 100644 --- a/app/src/main/assets/i18n/pt-BR.json +++ b/app/src/main/assets/i18n/pt-BR.json @@ -991,6 +991,7 @@ "Lets the coach read your data. Detect sets this for you; turn it off if your server rejects tools (vLLM needs --enable-auto-tool-choice).": "Permite que o coach leia seus dados. Detectar define isso para você; desative se o seu servidor rejeitar ferramentas (o vLLM precisa de --enable-auto-tool-choice).", "Library": "Biblioteca", "License": "Licença", + "Life stage": "Fase da vida", "Light": "Leve", "Limited": "Limitado", "Limited HR data available for today.": "Poucos dados de FC disponíveis para hoje.", @@ -1567,7 +1568,7 @@ "Score {0} out of 100": "Pontuação {0} de 100", "Scores are PulseLoop estimates from ring data compared with the user's own baseline, not medical measurements.": "As pontuações são estimativas do PulseLoop a partir dos dados do anel comparados com a linha de base do próprio usuário, não medidas médicas.", "Screens in bed": "Telas na cama", - "Screens that have moved to it so far: Today, Vitals, Sleep, Activity, Nutrition, My Health, Readiness, Symptom Radar, Settings.": "Telas que já usam o novo visual: Hoje, Vitais, Sono, Atividade, Nutrição, Minha saúde, Prontidão, Radar de sintomas, Configurações.", + "Screens that have moved to it so far: Today, Vitals, Sleep, Activity, Nutrition, My Health, Readiness, Symptom Radar, Settings and its screens.": "Telas que já usam o novo visual: Hoje, Vitais, Sono, Atividade, Nutrição, Minha saúde, Prontidão, Radar de sintomas, Configurações e suas telas.", "Searching…": "Procurando…", "See Raw Packets above.": "Veja Pacotes brutos acima.", "See Ring Events above.": "Veja Eventos do anel acima.", diff --git a/app/src/main/java/com/pulseloop/ui/calm/CalmTheme.kt b/app/src/main/java/com/pulseloop/ui/calm/CalmTheme.kt index 3f455d7f..a2075560 100644 --- a/app/src/main/java/com/pulseloop/ui/calm/CalmTheme.kt +++ b/app/src/main/java/com/pulseloop/ui/calm/CalmTheme.kt @@ -91,3 +91,39 @@ fun CalmTypography(enabled: Boolean = true, content: @androidx.compose.runtime.C androidx.compose.material3.ProvideTextStyle(androidx.compose.material3.LocalTextStyle.current.inter(), content) } } + +/** + * [CalmTypography] plus the new look's neutrals in Material's colour roles, for a screen whose + * content reads `MaterialTheme` rather than naming colours (the Settings sub-screens: switches, + * text fields, `onSurfaceVariant` captions, dialogs). Brand and status roles (primary, error) are + * left as they are. Input outlines use [CalmColors.textMuted], since the hairline [CalmColors.border] + * is too faint for a control's boundary (3:1). + */ +@androidx.compose.runtime.Composable +fun CalmMaterial(enabled: Boolean = true, content: @androidx.compose.runtime.Composable () -> Unit) { + if (!enabled) { content(); return } + val c = androidx.compose.material3.MaterialTheme.colorScheme + val scheme = c.copy( + background = CalmColors.page, + onBackground = CalmColors.text, + surface = CalmColors.card, + onSurface = CalmColors.text, + surfaceVariant = CalmColors.card, + onSurfaceVariant = CalmColors.textSecondary, + surfaceContainerLowest = CalmColors.page, + surfaceContainerLow = CalmColors.card, + surfaceContainer = CalmColors.card, + surfaceContainerHigh = CalmColors.cardRaised, + surfaceContainerHighest = CalmColors.cardRaised, + outline = CalmColors.textMuted, + outlineVariant = CalmColors.border, + // Tonal buttons: the app's scheme never set these, so Material's default lavender showed. + secondaryContainer = CalmColors.cardRaised, + onSecondaryContainer = CalmColors.text, + ) + androidx.compose.material3.MaterialTheme( + colorScheme = scheme, + shapes = androidx.compose.material3.MaterialTheme.shapes, + typography = androidx.compose.material3.MaterialTheme.typography, + ) { CalmTypography(content = content) } +} diff --git a/app/src/main/java/com/pulseloop/ui/calm/Look.kt b/app/src/main/java/com/pulseloop/ui/calm/Look.kt index ed57023a..a6a45210 100644 --- a/app/src/main/java/com/pulseloop/ui/calm/Look.kt +++ b/app/src/main/java/com/pulseloop/ui/calm/Look.kt @@ -9,6 +9,9 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import com.pulseloop.ui.theme.PulseColors +import com.pulseloop.ui.theme.PulseType +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontWeight /** * The surface and text roles of whichever look is on, for pieces shared by converted and @@ -25,6 +28,27 @@ object Look { val textSecondary: Color get() = if (calm) CalmColors.textSecondary else PulseColors.textSecondary val textMuted: Color get() = if (calm) CalmColors.textMuted else PulseColors.textMuted val radius: Dp get() = if (calm) CalmShape.radius else 8.dp + + /** A card's or a row's title (PulseType.title / CalmType.title). */ + val titleStyle: TextStyle get() = if (calm) CalmType.title else PulseType.title + /** Running text (PulseType.body / CalmType.bodySmall, both 14sp). */ + val bodyStyle: TextStyle get() = if (calm) CalmType.bodySmall else PulseType.body + /** Small text: an address, a caption (12sp in both). */ + val labelStyle: TextStyle get() = if (calm) CalmType.label.copy(fontWeight = FontWeight.Normal) else PulseType.label +} + +/** + * The name over a group of controls. The old look's tracked capitals (PulseType.eyebrow); in the + * new look sentence case at 14sp, since a caps kicker over content is what the craft floor bans. + * Pass the text in sentence case: the old look upper-cases it. + */ +@androidx.compose.runtime.Composable +fun LookLabel(text: String, modifier: Modifier = Modifier) { + if (Look.calm) { + androidx.compose.material3.Text(text, style = CalmType.bodySmall.copy(fontWeight = FontWeight.SemiBold), color = Look.textSecondary, modifier = modifier) + } else { + androidx.compose.material3.Text(text.uppercase(), style = PulseType.eyebrow, color = PulseColors.textSecondary, modifier = modifier) + } } /** diff --git a/app/src/main/java/com/pulseloop/ui/components/AppChrome.kt b/app/src/main/java/com/pulseloop/ui/components/AppChrome.kt index 23be8625..80cb4c96 100644 --- a/app/src/main/java/com/pulseloop/ui/components/AppChrome.kt +++ b/app/src/main/java/com/pulseloop/ui/components/AppChrome.kt @@ -241,14 +241,9 @@ fun greetingForHour(): String = when (Calendar.getInstance().get(Calendar.HOUR_O @Composable fun SectionHeaderCaps(title: String, modifier: Modifier = Modifier, action: (@Composable () -> Unit)? = null) { Row(modifier = modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) { - Text( - title.uppercase(), - // The one eyebrow style (12sp, 1sp tracking), not a hand-rolled 14sp variant. - style = PulseType.eyebrow, - color = PulseColors.textSecondary, - // Takes the free width (instead of a Spacer) so a long title wraps beside the action. - modifier = Modifier.weight(1f), - ) + // Takes the free width (instead of a Spacer) so a long title wraps beside the action. The + // new look writes it in sentence case (LookLabel): no caps kicker over content. + com.pulseloop.ui.calm.LookLabel(title, modifier = Modifier.weight(1f)) action?.invoke() } } diff --git a/app/src/main/java/com/pulseloop/ui/components/PulseSegmented.kt b/app/src/main/java/com/pulseloop/ui/components/PulseSegmented.kt index 8388e9c6..d73be867 100644 --- a/app/src/main/java/com/pulseloop/ui/components/PulseSegmented.kt +++ b/app/src/main/java/com/pulseloop/ui/components/PulseSegmented.kt @@ -11,6 +11,9 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextOverflow import com.pulseloop.ui.theme.PulseColors import com.pulseloop.ui.theme.PulseType +import com.pulseloop.ui.calm.CalmColors +import com.pulseloop.ui.calm.CalmType +import com.pulseloop.ui.calm.Look /** * The one segmented control (Sleep's Day/Week/Month/Year, a vital's Today/Week/Month): Material's @@ -31,7 +34,16 @@ fun PulseSegmented( onClick = { onSelect(key) }, shape = SegmentedButtonDefaults.itemShape(index, options.size), icon = {}, - colors = SegmentedButtonDefaults.colors( + // The new look marks the choice with a raised surface and full-strength text rather + // than a mint fill: mint is for what to tap, and every segment is tappable. + colors = if (Look.calm) SegmentedButtonDefaults.colors( + activeContainerColor = CalmColors.cardRaised, + activeContentColor = CalmColors.text, + activeBorderColor = CalmColors.textMuted, + inactiveContainerColor = CalmColors.card, + inactiveContentColor = CalmColors.textSecondary, + inactiveBorderColor = CalmColors.textMuted, + ) else SegmentedButtonDefaults.colors( activeContainerColor = PulseColors.accentSoft, activeContentColor = PulseColors.textPrimary, activeBorderColor = PulseColors.accent, @@ -40,7 +52,7 @@ fun PulseSegmented( inactiveBorderColor = PulseColors.borderStrong, ), ) { - Text(label, style = PulseType.label, maxLines = 1, overflow = TextOverflow.Ellipsis) + Text(label, style = if (Look.calm) CalmType.bodySmall else PulseType.label, maxLines = 1, overflow = TextOverflow.Ellipsis) } } } diff --git a/app/src/main/java/com/pulseloop/ui/onboarding/Editors.kt b/app/src/main/java/com/pulseloop/ui/onboarding/Editors.kt index 025595f2..4b622a7e 100644 --- a/app/src/main/java/com/pulseloop/ui/onboarding/Editors.kt +++ b/app/src/main/java/com/pulseloop/ui/onboarding/Editors.kt @@ -83,7 +83,7 @@ fun ProfileEditor( tr("Measurement units"), fontSize = 14.sp, fontWeight = FontWeight.Medium, - color = PulseColors.textPrimary, + color = com.pulseloop.ui.calm.Look.text, ) SegmentedRow( options = listOf(tr("Metric"), tr("Imperial")), @@ -108,11 +108,11 @@ fun ProfileEditor( tr("Name"), fontSize = 14.sp, fontWeight = FontWeight.Medium, - color = PulseColors.textPrimary, + color = com.pulseloop.ui.calm.Look.text, ) Box(Modifier.weight(1f), contentAlignment = Alignment.CenterEnd) { if (draft.name.isEmpty()) { - Text(tr("Optional"), fontSize = 14.sp, color = PulseColors.textMuted) + Text(tr("Optional"), fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textMuted) } BasicTextField( value = draft.name, @@ -120,7 +120,7 @@ fun ProfileEditor( singleLine = true, textStyle = TextStyle( fontSize = 14.sp, - color = PulseColors.textPrimary, + color = com.pulseloop.ui.calm.Look.text, textAlign = TextAlign.End, ), cursorBrush = SolidColor(PulseColors.accent), @@ -130,7 +130,7 @@ fun ProfileEditor( } } - HorizontalDivider(color = PulseColors.borderSubtle) + HorizontalDivider(color = com.pulseloop.ui.calm.Look.border) Column( Modifier.padding(vertical = 12.dp), @@ -140,7 +140,7 @@ fun ProfileEditor( tr("Sex"), fontSize = 14.sp, fontWeight = FontWeight.Medium, - color = PulseColors.textPrimary, + color = com.pulseloop.ui.calm.Look.text, ) SegmentedRow( options = listOf(tr("Not set"), tr("Female"), tr("Male"), tr("Other")), @@ -166,7 +166,7 @@ fun ProfileEditor( } SectionHeaderCaps(tr("Body metrics"), action = { - Text(tr("Optional"), fontSize = 12.sp, color = PulseColors.textMuted) + Text(tr("Optional"), fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted) }) FormCard { Column { @@ -175,13 +175,13 @@ fun ProfileEditor( value = draft.age?.let { trf("{0} years", it) }, onClick = { activePicker = ProfilePickerKind.AGE }, ) - HorizontalDivider(color = PulseColors.borderSubtle) + HorizontalDivider(color = com.pulseloop.ui.calm.Look.border) PickerRow( title = tr("Height"), value = heightLabel(draft), onClick = { activePicker = ProfilePickerKind.HEIGHT }, ) - HorizontalDivider(color = PulseColors.borderSubtle) + HorizontalDivider(color = com.pulseloop.ui.calm.Look.border) PickerRow( title = tr("Weight"), value = weightLabel(draft), @@ -241,9 +241,9 @@ private fun FormCard(content: @Composable () -> Unit) { Box( Modifier .fillMaxWidth() - .clip(RoundedCornerShape(8.dp)) - .background(PulseColors.card) - .border(1.dp, PulseColors.borderSubtle, RoundedCornerShape(8.dp)) + .clip(RoundedCornerShape(com.pulseloop.ui.calm.Look.radius)) + .background(com.pulseloop.ui.calm.Look.card) + .border(1.dp, com.pulseloop.ui.calm.Look.border, RoundedCornerShape(com.pulseloop.ui.calm.Look.radius)) .padding(horizontal = 16.dp, vertical = 8.dp), ) { content() @@ -260,7 +260,7 @@ private fun SegmentedRow( Modifier .fillMaxWidth() .clip(RoundedCornerShape(4.dp)) - .background(PulseColors.cardSoft) + .background(if (com.pulseloop.ui.calm.Look.calm) com.pulseloop.ui.calm.CalmColors.cardRaised else PulseColors.cardSoft) .padding(3.dp) .selectableGroup(), horizontalArrangement = Arrangement.spacedBy(3.dp), @@ -273,7 +273,7 @@ private fun SegmentedRow( // 48dp: each segment is a target (it was about 36dp). .heightIn(min = 48.dp) .clip(RoundedCornerShape(4.dp)) - .background(if (selected) PulseColors.accent else Color.Transparent) + .background(if (selected) (if (com.pulseloop.ui.calm.Look.calm) com.pulseloop.ui.calm.CalmColors.page else PulseColors.accent) else Color.Transparent) .selectable(selected = selected, role = Role.RadioButton) { onSelect(index) } .padding(vertical = 8.dp), contentAlignment = Alignment.Center, @@ -282,7 +282,7 @@ private fun SegmentedRow( option, fontSize = 14.sp, fontWeight = if (selected) FontWeight.SemiBold else FontWeight.Medium, - color = if (selected) PulseColors.onAccent else PulseColors.textSecondary, + color = if (selected) (if (com.pulseloop.ui.calm.Look.calm) com.pulseloop.ui.calm.Look.text else PulseColors.onAccent) else com.pulseloop.ui.calm.Look.textSecondary, maxLines = 1, // Four translated options share the width; ellipsize rather than clip mid-glyph. overflow = TextOverflow.Ellipsis, @@ -308,13 +308,13 @@ private fun PickerRow(title: String, value: String?, onClick: () -> Unit) { title, fontSize = 14.sp, fontWeight = FontWeight.Medium, - color = PulseColors.textPrimary, + color = com.pulseloop.ui.calm.Look.text, modifier = Modifier.weight(1f), ) Text( value ?: tr("Not set"), fontSize = 14.sp, - color = if (value == null) PulseColors.textMuted else PulseColors.textSecondary, + color = if (value == null) com.pulseloop.ui.calm.Look.textMuted else com.pulseloop.ui.calm.Look.textSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.widthIn(max = 160.dp), ) @@ -353,13 +353,13 @@ private fun NumberPickerSheet( PulseButton(PulseButtonStyle.Text, onClick = { onSave(null) onDismiss() - }) { Text(tr("Clear"), color = PulseColors.textSecondary) } + }) { Text(tr("Clear"), color = com.pulseloop.ui.calm.Look.textSecondary) } Spacer(Modifier.weight(1f)) Text( title, fontSize = 16.sp, fontWeight = FontWeight.SemiBold, - color = PulseColors.textPrimary, + color = com.pulseloop.ui.calm.Look.text, ) Spacer(Modifier.weight(1f)) PulseButton(PulseButtonStyle.Text, onClick = { @@ -386,7 +386,7 @@ private fun NumberPickerSheet( label(value), fontSize = 16.sp, fontWeight = if (selected) FontWeight.SemiBold else FontWeight.Normal, - color = if (selected) PulseColors.textPrimary else PulseColors.textSecondary, + color = if (selected) com.pulseloop.ui.calm.Look.text else com.pulseloop.ui.calm.Look.textSecondary, ) } } @@ -428,13 +428,13 @@ private fun DecimalValueSheet( PulseButton(PulseButtonStyle.Text, onClick = { onSave(null) onDismiss() - }) { Text(tr("Clear"), color = PulseColors.textSecondary) } + }) { Text(tr("Clear"), color = com.pulseloop.ui.calm.Look.textSecondary) } Spacer(Modifier.weight(1f)) Text( title, fontSize = 16.sp, fontWeight = FontWeight.SemiBold, - color = PulseColors.textPrimary, + color = com.pulseloop.ui.calm.Look.text, ) Spacer(Modifier.weight(1f)) PulseButton(PulseButtonStyle.Text, @@ -446,7 +446,7 @@ private fun DecimalValueSheet( ) { Text( tr("Done"), - color = if (parsedValue != null) PulseColors.accent else PulseColors.textMuted, + color = if (parsedValue != null) PulseColors.accent else com.pulseloop.ui.calm.Look.textMuted, fontWeight = FontWeight.SemiBold, ) } @@ -460,15 +460,15 @@ private fun DecimalValueSheet( trf("Enter your weight in {0}", unit), fontSize = 14.sp, fontWeight = FontWeight.Medium, - color = PulseColors.textPrimary, + color = com.pulseloop.ui.calm.Look.text, ) Box( Modifier .fillMaxWidth() - .clip(RoundedCornerShape(8.dp)) - .background(PulseColors.card) - .border(1.dp, PulseColors.borderSubtle, RoundedCornerShape(8.dp)) + .clip(RoundedCornerShape(com.pulseloop.ui.calm.Look.radius)) + .background(com.pulseloop.ui.calm.Look.card) + .border(1.dp, com.pulseloop.ui.calm.Look.border, RoundedCornerShape(com.pulseloop.ui.calm.Look.radius)) .padding(16.dp), ) { if (text.isEmpty()) { @@ -476,7 +476,7 @@ private fun DecimalValueSheet( LocalizedDecimalInput.format(70.5), fontSize = 20.sp, fontWeight = FontWeight.SemiBold, - color = PulseColors.textMuted, + color = com.pulseloop.ui.calm.Look.textMuted, ) } BasicTextField( @@ -486,7 +486,7 @@ private fun DecimalValueSheet( textStyle = TextStyle( fontSize = 20.sp, fontWeight = FontWeight.SemiBold, - color = PulseColors.textPrimary, + color = com.pulseloop.ui.calm.Look.text, ), keyboardOptions = androidx.compose.foundation.text.KeyboardOptions( keyboardType = androidx.compose.ui.text.input.KeyboardType.Decimal, @@ -510,7 +510,7 @@ private fun DecimalValueSheet( Text( tr("You can use either a comma or a period as the decimal separator."), fontSize = 12.sp, - color = PulseColors.textMuted, + color = com.pulseloop.ui.calm.Look.textMuted, ) if (text.isNotEmpty() && parsedValue == null) { @@ -623,9 +623,9 @@ private fun GoalSliderCard( Column( Modifier .fillMaxWidth() - .clip(RoundedCornerShape(8.dp)) - .background(PulseColors.card) - .border(1.dp, PulseColors.borderSubtle, RoundedCornerShape(8.dp)) + .clip(RoundedCornerShape(com.pulseloop.ui.calm.Look.radius)) + .background(com.pulseloop.ui.calm.Look.card) + .border(1.dp, com.pulseloop.ui.calm.Look.border, RoundedCornerShape(com.pulseloop.ui.calm.Look.radius)) .padding(16.dp), verticalArrangement = Arrangement.spacedBy(12.dp), ) { @@ -634,7 +634,7 @@ private fun GoalSliderCard( Modifier .size(30.dp) .clip(RoundedCornerShape(4.dp)) - .dither(tint, 0.14f), + .then(if (com.pulseloop.ui.calm.Look.calm) Modifier.background(com.pulseloop.ui.calm.CalmColors.cardRaised) else Modifier.dither(tint, 0.14f)), contentAlignment = Alignment.Center, ) { Icon(icon, contentDescription = null, Modifier.size(16.dp), tint = tint) @@ -644,14 +644,14 @@ private fun GoalSliderCard( title, fontSize = 16.sp, fontWeight = FontWeight.Medium, - color = PulseColors.textPrimary, + color = com.pulseloop.ui.calm.Look.text, modifier = Modifier.weight(1f), ) Text( label, fontSize = 16.sp, fontWeight = FontWeight.SemiBold, - fontFamily = com.pulseloop.ui.theme.UbuntuMono, + fontFamily = if (com.pulseloop.ui.calm.Look.calm) com.pulseloop.ui.calm.Inter else com.pulseloop.ui.theme.UbuntuMono, color = tint, ) } @@ -671,7 +671,7 @@ private fun GoalSliderCard( colors = SliderDefaults.colors( thumbColor = tint, activeTrackColor = tint, - inactiveTrackColor = PulseColors.elevated, + inactiveTrackColor = if (com.pulseloop.ui.calm.Look.calm) com.pulseloop.ui.calm.CalmColors.cardRaised else PulseColors.elevated, ), ) } diff --git a/app/src/main/java/com/pulseloop/ui/screens/AccuracyCheckUi.kt b/app/src/main/java/com/pulseloop/ui/screens/AccuracyCheckUi.kt index 7604bf01..587a3242 100644 --- a/app/src/main/java/com/pulseloop/ui/screens/AccuracyCheckUi.kt +++ b/app/src/main/java/com/pulseloop/ui/screens/AccuracyCheckUi.kt @@ -143,16 +143,16 @@ fun AccuracyCheckSettingsScreen(onBack: () -> Unit) { if (openLoad != null && current == null) { AccuracyCard { - Text(tr("Compare your ring with another device"), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = PulseColors.textPrimary) + Text(tr("Compare your ring with another device"), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = com.pulseloop.ui.calm.Look.text) Text( tr("Wear the ring and a watch or band you trust for a few days. PulseLoop reads that device's data from " + "Health Connect and shows where the ring agrees and where it falls short."), - fontSize = 14.sp, color = PulseColors.textSecondary, + fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textSecondary, ) Text( tr("While a check runs, PulseLoop stops exporting the types the other device also writes, so Health Connect " + "doesn't count your steps, sleep and heart rate twice."), - fontSize = 12.sp, color = PulseColors.textMuted, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted, ) if (!available) { Text(tr("Health Connect isn't available on this phone."), fontSize = 12.sp, color = PulseColors.danger) @@ -173,7 +173,7 @@ fun AccuracyCheckSettingsScreen(onBack: () -> Unit) { if (scanning) CircularProgressIndicator(Modifier.size(20.dp).align(Alignment.CenterVertically), strokeWidth = 2.dp) } } - if (ringLoad != null && !hasRing) Text(tr("Pair your ring first: a check compares it against the other device."), fontSize = 12.sp, color = PulseColors.textMuted) + if (ringLoad != null && !hasRing) Text(tr("Pair your ring first: a check compares it against the other device."), fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted) note?.let { Text(it, fontSize = 12.sp, color = PulseColors.warning) } } @@ -181,10 +181,10 @@ fun AccuracyCheckSettingsScreen(onBack: () -> Unit) { if (r != null) { if (r.sources.isEmpty()) { AccuracyCard { - Text(trf("No other app wrote readable data in the last {0} days.", ReferenceSourceScanner.LOOKBACK_DAYS), fontSize = 14.sp, color = PulseColors.textSecondary) + Text(trf("No other app wrote readable data in the last {0} days.", ReferenceSourceScanner.LOOKBACK_DAYS), fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textSecondary) Text( tr("If your watch syncs through an app like Health Sync, check that it's set to write to Health Connect."), - fontSize = 12.sp, color = PulseColors.textMuted, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted, ) } } @@ -194,7 +194,7 @@ fun AccuracyCheckSettingsScreen(onBack: () -> Unit) { if (r.unreadable.isNotEmpty() || r.failed.isNotEmpty()) { AccuracyCard { if (r.unreadable.isNotEmpty()) { - Text(tr("Not allowed to read: ") + r.unreadable.joinToString(", ") { it.label }, fontSize = 12.sp, color = PulseColors.textMuted) + Text(tr("Not allowed to read: ") + r.unreadable.joinToString(", ") { it.label }, fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted) } if (r.failed.isNotEmpty()) { Text(tr("Couldn't read: ") + r.failed.joinToString(", ") { it.label }, fontSize = 12.sp, color = PulseColors.warning) @@ -218,7 +218,7 @@ fun AccuracyCheckSettingsScreen(onBack: () -> Unit) { val past = history.filter { it.state == AccuracyCheckEntity.STATE_DONE } if (past.isNotEmpty()) { AccuracyCard { - Text(tr("Past checks"), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = PulseColors.textPrimary) + Text(tr("Past checks"), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = com.pulseloop.ui.calm.Look.text) past.forEach { c -> Row( Modifier.fillMaxWidth() @@ -228,8 +228,8 @@ fun AccuracyCheckSettingsScreen(onBack: () -> Unit) { verticalAlignment = Alignment.CenterVertically, ) { Column(Modifier.weight(1f)) { - Text(trf("{0} vs {1}", c.deviceLabel, c.referenceLabel), fontSize = 14.sp, color = PulseColors.textPrimary) - Text(AccuracyUiText.span(c), fontSize = 12.sp, color = PulseColors.textMuted) + Text(trf("{0} vs {1}", c.deviceLabel, c.referenceLabel), fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.text) + Text(AccuracyUiText.span(c), fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted) } Text( tr("View"), fontSize = 14.sp, color = PulseColors.accent, @@ -294,8 +294,8 @@ private fun RunningCard(check: AccuracyCheckEntity, scope: kotlinx.coroutines.Co var confirmEnd by remember { mutableStateOf(false) } val (day, total) = AccuracyUiText.dayOf(check) AccuracyCard { - Text(trf("Accuracy check · day {0} of {1}", day, total), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = PulseColors.textPrimary) - Text(trf("{0} vs {1}, until {2}.", check.deviceLabel, check.referenceLabel, AccuracyUiText.date(check.plannedEndAt)), fontSize = 14.sp, color = PulseColors.textSecondary) + Text(trf("Accuracy check · day {0} of {1}", day, total), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = com.pulseloop.ui.calm.Look.text) + Text(trf("{0} vs {1}, until {2}.", check.deviceLabel, check.referenceLabel, AccuracyUiText.date(check.plannedEndAt)), fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textSecondary) Text(trf("Wear both as usual. Health Connect export paused for: {0}.", AccuracyUiText.units(units)), fontSize = 12.sp, color = PulseColors.warning) PulseButton(PulseButtonStyle.Outlined, onClick = { confirmEnd = true }) { Text(tr("End now")) } } @@ -320,11 +320,11 @@ private fun ResumeCard(check: AccuracyCheckEntity, scope: kotlinx.coroutines.Cor val context = LocalContext.current var busy by remember { mutableStateOf(false) } AccuracyCard { - Text(tr("Check finished: resume Health Connect export"), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = PulseColors.textPrimary) - Text(AccuracyUiText.endReason(check) + " ${AccuracyUiText.span(check)}.", fontSize = 14.sp, color = PulseColors.textSecondary) + Text(tr("Check finished: resume Health Connect export"), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = com.pulseloop.ui.calm.Look.text) + Text(AccuracyUiText.endReason(check) + " ${AccuracyUiText.span(check)}.", fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textSecondary) Text( trf("During the check, {0} wrote the same types to Health Connect. Exporting the ring's copy of those days now would count them twice.", check.referenceLabel), - fontSize = 12.sp, color = PulseColors.textMuted, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted, ) PulseButton(onClick = { busy = true @@ -336,7 +336,7 @@ private fun ResumeCard(check: AccuracyCheckEntity, scope: kotlinx.coroutines.Cor }, enabled = !busy, modifier = Modifier.fillMaxWidth()) { Text(tr("Export them too")) } Text( tr("Export them too if you're taking the other device off and want the ring's full history in Health Connect."), - fontSize = 12.sp, color = PulseColors.textMuted, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted, ) } } @@ -391,18 +391,18 @@ private fun StartDialog( @Composable private fun SourceCard(context: Context, s: ReferenceSourceSurvey, onUse: (() -> Unit)? = null) { AccuracyCard { - Text(ReferenceAppLabels.label(context, s.packageName), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = PulseColors.textPrimary) - Text(s.packageName, fontSize = 12.sp, color = PulseColors.textMuted) + Text(ReferenceAppLabels.label(context, s.packageName), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = com.pulseloop.ui.calm.Look.text) + Text(s.packageName, fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted) if (s.packageName in ReferenceAppLabels.BRIDGES) { Text( tr("A bridge app: it copies another app's data (for example Huawei Health) into Health Connect."), - fontSize = 12.sp, color = PulseColors.textSecondary, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textSecondary, ) } Text( if (s.devices.isEmpty()) tr("Device: not recorded") else tr("Device: ") + s.devices.joinToString("; ") { ReferenceSurveyText.device(it) }, - fontSize = 12.sp, color = PulseColors.textSecondary, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textSecondary, ) s.echo?.takeIf { it.looksLikeEcho }?.let { Text( @@ -421,16 +421,16 @@ private fun MetricRow(m: MetricSurvey) { val context = LocalContext.current val last = com.pulseloop.ui.components.PhoneFormat.date("MMMd", m.lastAt) + " " + com.pulseloop.ui.components.PhoneFormat.clock(context, m.lastAt) Column(Modifier.fillMaxWidth().padding(top = 4.dp)) { - Text(m.metric.label, fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = PulseColors.textPrimary) + Text(m.metric.label, fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = com.pulseloop.ui.calm.Look.text) Text( trf("{0} samples, {1} · latest {2} · arrives ~{3} late", m.sampleCount, ReferenceSurveyText.cadence(m), last, ReferenceSurveyText.duration(m.medianDeliveryDelayMs)), - fontSize = 12.sp, color = PulseColors.textSecondary, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textSecondary, ) if (m.metric == ReferenceMetric.SLEEP) { Text( if (ReferenceSurveyText.hasSleepStages(m)) tr("With stages: ") + m.sleepStageTypes.sorted().joinToString(", ") { ReferenceSurveyText.sleepStage(it) } else tr("No sleep stages, only time asleep"), - fontSize = 12.sp, color = PulseColors.textMuted, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted, ) } } @@ -439,7 +439,7 @@ private fun MetricRow(m: MetricSurvey) { @Composable internal fun AccuracyCard(content: @Composable () -> Unit) { Column( - Modifier.fillMaxWidth().clip(RoundedCornerShape(8.dp)).background(PulseColors.card).padding(16.dp), + Modifier.fillMaxWidth().clip(RoundedCornerShape(com.pulseloop.ui.calm.Look.radius)).background(com.pulseloop.ui.calm.Look.card).padding(16.dp), verticalArrangement = Arrangement.spacedBy(8.dp), ) { content() } } @@ -452,7 +452,7 @@ internal fun AccuracyCard(content: @Composable () -> Unit) { internal fun AdjustedCaption(note: String) { Text( trf("Adjusted by your accuracy check: {0}. Settings → Accuracy check to change.", note), - fontSize = 12.sp, color = PulseColors.textMuted, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted, ) } @@ -477,7 +477,7 @@ internal fun AccuracyCheckBanner(c: AccuracyCheckEntity, onOpen: () -> Unit) { trf("Accuracy check · day {0} of {1} · Health Connect export paused", day, total) } else tr("Accuracy report ready · choose what to do with the paused export") Row( - Modifier.fillMaxWidth().heightIn(min = 48.dp).clip(RoundedCornerShape(8.dp)).background(PulseColors.card) + Modifier.fillMaxWidth().heightIn(min = 48.dp).clip(RoundedCornerShape(com.pulseloop.ui.calm.Look.radius)).background(com.pulseloop.ui.calm.Look.card) .clickable(role = androidx.compose.ui.semantics.Role.Button, onClick = onOpen).padding(12.dp), verticalAlignment = Alignment.CenterVertically, ) { diff --git a/app/src/main/java/com/pulseloop/ui/screens/BodyUi.kt b/app/src/main/java/com/pulseloop/ui/screens/BodyUi.kt index 62733eee..ca1ee57c 100644 --- a/app/src/main/java/com/pulseloop/ui/screens/BodyUi.kt +++ b/app/src/main/java/com/pulseloop/ui/screens/BodyUi.kt @@ -104,7 +104,7 @@ fun HealthConnectBodyCard(onUpdated: () -> Unit) { } Column( - Modifier.fillMaxWidth().clip(RoundedCornerShape(8.dp)).background(PulseColors.card).padding(16.dp), + Modifier.fillMaxWidth().clip(RoundedCornerShape(com.pulseloop.ui.calm.Look.radius)).background(com.pulseloop.ui.calm.Look.card).padding(16.dp), verticalArrangement = Arrangement.spacedBy(12.dp), ) { Row(Modifier.switchRow(checked = enabled, enabled = available && !busy, onCheckedChange = { on -> @@ -112,16 +112,16 @@ fun HealthConnectBodyCard(onUpdated: () -> Unit) { else { enabled = false; HealthConnectBodyImport.setEnabled(context, false) } }), verticalAlignment = androidx.compose.ui.Alignment.CenterVertically) { Column(Modifier.weight(1f)) { - Text(tr("Sync from your scale"), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = PulseColors.textPrimary) + Text(tr("Sync from your scale"), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = com.pulseloop.ui.calm.Look.text) Text( tr("Weight, height and body composition from Health Connect (Fitdays and other scale apps)."), - fontSize = 12.sp, color = PulseColors.textSecondary, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textSecondary, ) } Switch(checked = enabled, enabled = available && !busy, onCheckedChange = null) } if (!available) { - Text(tr("Health Connect isn't available on this phone."), fontSize = 12.sp, color = PulseColors.textMuted) + Text(tr("Health Connect isn't available on this phone."), fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted) } val s = snapshot @@ -130,19 +130,19 @@ fun HealthConnectBodyCard(onUpdated: () -> Unit) { val whenText = Instant.ofEpochMilli(w.measuredAt).atZone(ZoneId.systemDefault()) .format(DateTimeFormatter.ofPattern("d MMM, HH:mm")) Row(verticalAlignment = androidx.compose.ui.Alignment.Bottom, horizontalArrangement = Arrangement.spacedBy(8.dp)) { - Text("%.1f".format(UnitConverter.weight(w.value, units)), fontSize = 28.sp, fontWeight = FontWeight.Bold, color = PulseColors.textPrimary) - Text("$unit · $whenText", fontSize = 12.sp, color = PulseColors.textMuted, modifier = Modifier.padding(bottom = 4.dp)) + Text("%.1f".format(UnitConverter.weight(w.value, units)), fontSize = 28.sp, fontWeight = FontWeight.Bold, color = com.pulseloop.ui.calm.Look.text) + Text("$unit · $whenText", fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted, modifier = Modifier.padding(bottom = 4.dp)) } val facts = buildList { s.bodyFatPct?.let { add(trf("Body fat {0}%", "%.1f".format(it))) } s.leanMassKg?.let { add(trf("Lean {0} {1}", "%.1f".format(UnitConverter.weight(it, units)), unit)) } s.heightCm?.takeIf { it > 0 }?.let { h -> add(trf("BMI {0}", "%.1f".format(w.value / ((h / 100) * (h / 100))))) } } - if (facts.isNotEmpty()) Text(facts.joinToString(" · "), fontSize = 14.sp, color = PulseColors.textSecondary) + if (facts.isNotEmpty()) Text(facts.joinToString(" · "), fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textSecondary) if (s.trend.size >= 2) WeightLine(s.trend, units) - Text(trf("From {0}", w.source), fontSize = 12.sp, color = PulseColors.textMuted) + Text(trf("From {0}", w.source), fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted) } - note?.let { Text(it, fontSize = 12.sp, color = PulseColors.textMuted) } + note?.let { Text(it, fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted) } if (enabled) { PulseButton(PulseButtonStyle.Text, onClick = { importNow() }, enabled = !busy) { Text(if (busy) tr("Syncing…") else tr("Sync now")) } } diff --git a/app/src/main/java/com/pulseloop/ui/screens/DebugScreen.kt b/app/src/main/java/com/pulseloop/ui/screens/DebugScreen.kt index be9c2e1c..808ea6d9 100644 --- a/app/src/main/java/com/pulseloop/ui/screens/DebugScreen.kt +++ b/app/src/main/java/com/pulseloop/ui/screens/DebugScreen.kt @@ -218,7 +218,7 @@ fun DebugScreen(viewModel: DiagnosticsViewModel, onBack: () -> Unit = {}) { ) { Column(Modifier.weight(1f)) { Text(tr("Try the new look"), style = MaterialTheme.typography.bodyMedium) - Text(tr("Screens that have moved to it so far: Today, Vitals, Sleep, Activity, Nutrition, My Health, Readiness, Symptom Radar, Settings."), style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onSurfaceVariant) + Text(tr("Screens that have moved to it so far: Today, Vitals, Sleep, Activity, Nutrition, My Health, Readiness, Symptom Radar, Settings and its screens."), style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onSurfaceVariant) } Switch(checked = com.pulseloop.ui.calm.NewLook.on, onCheckedChange = null) } diff --git a/app/src/main/java/com/pulseloop/ui/screens/HealthConnectSourceUi.kt b/app/src/main/java/com/pulseloop/ui/screens/HealthConnectSourceUi.kt index 74e069db..52b95efd 100644 --- a/app/src/main/java/com/pulseloop/ui/screens/HealthConnectSourceUi.kt +++ b/app/src/main/java/com/pulseloop/ui/screens/HealthConnectSourceUi.kt @@ -141,16 +141,16 @@ fun HealthConnectSourceContent(onEnabled: (() -> Unit)? = null) { Column(verticalArrangement = Arrangement.spacedBy(12.dp)) { AccuracyCard { - Text(tr("Use the device you already wear"), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = PulseColors.textPrimary) + Text(tr("Use the device you already wear"), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = com.pulseloop.ui.calm.Look.text) Text( tr("No PulseLoop ring? If your Oura, Galaxy Ring, Fitbit or watch app writes to Health Connect, PulseLoop can " + "read it from there: sleep, heart rate, HRV, blood oxygen, steps, calories, workouts and periods. " + "Every screen, the coach and your insights then work from that data."), - fontSize = 14.sp, color = PulseColors.textSecondary, + fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textSecondary, ) Text( tr("PulseLoop reads only the app you choose, and doesn't write that data back to Health Connect."), - fontSize = 12.sp, color = PulseColors.textMuted, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted, ) if (!available) { Text(tr("Health Connect isn't available on this phone."), fontSize = 12.sp, color = PulseColors.danger) @@ -169,7 +169,7 @@ fun HealthConnectSourceContent(onEnabled: (() -> Unit)? = null) { if (enabled && source != null) { val pkg = source!! AccuracyCard { - Text(trf("Using {0}", HealthConnectSource.label(context, pkg)), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = PulseColors.textPrimary) + Text(trf("Using {0}", HealthConnectSource.label(context, pkg)), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = com.pulseloop.ui.calm.Look.text) val last = remember(refresh) { HealthConnectSource.lastImportAt(context) } val count = remember(refresh) { HealthConnectSource.lastImportCount(context) } Text( @@ -177,12 +177,12 @@ fun HealthConnectSourceContent(onEnabled: (() -> Unit)? = null) { trf("Last import {0}", localDateTime(context, it)) + trf(" · {0} readings", "%,d".format(count)) } ?: tr("Not imported yet"), - fontSize = 14.sp, color = PulseColors.textSecondary, + fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textSecondary, ) Text( tr("PulseLoop checks for new data every hour and whenever you open the app. A night usually appears once ") + trf("{0} has synced it in the morning.", HealthConnectSource.label(context, pkg)), - fontSize = 12.sp, color = PulseColors.textMuted, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted, ) if (canRead && !HealthConnectSource.canReadInBackground(granted.orEmpty())) { Text(tr("Allow background access so imports also run while PulseLoop is closed."), fontSize = 12.sp, color = PulseColors.warning) @@ -209,24 +209,24 @@ fun HealthConnectSourceContent(onEnabled: (() -> Unit)? = null) { if (scanning) { Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) { CircularProgressIndicator(Modifier.size(20.dp), strokeWidth = 2.dp) - Text(tr("Looking for apps writing to Health Connect…"), fontSize = 14.sp, color = PulseColors.textSecondary) + Text(tr("Looking for apps writing to Health Connect…"), fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textSecondary) } } else if (r != null) { val usable = r.sources.filter { it.echo?.looksLikeEcho != true } if (usable.isEmpty()) { AccuracyCard { - Text(trf("No app wrote health data in the last {0} days.", ReferenceSourceScanner.LOOKBACK_DAYS), fontSize = 14.sp, color = PulseColors.textSecondary) + Text(trf("No app wrote health data in the last {0} days.", ReferenceSourceScanner.LOOKBACK_DAYS), fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textSecondary) Text( tr("In the Oura app: Settings → Health Connect, and turn on sharing. Then come back and look again."), - fontSize = 12.sp, color = PulseColors.textMuted, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted, ) PulseButton(PulseButtonStyle.Outlined, onClick = { doScan() }) { Text(tr("Look again")) } } } usable.forEach { src -> AccuracyCard { - Text(HealthConnectSource.label(context, src.packageName), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = PulseColors.textPrimary) - Text(src.metrics.joinToString(", ") { it.metric.label }, fontSize = 14.sp, color = PulseColors.textSecondary) + Text(HealthConnectSource.label(context, src.packageName), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = com.pulseloop.ui.calm.Look.text) + Text(src.metrics.joinToString(", ") { it.metric.label }, fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textSecondary) // Tonal: one card per app, so filled would put several mint buttons on one screen. PulseButton(PulseButtonStyle.Tonal, onClick = { HealthConnectSource.enable(context, src.packageName) @@ -240,7 +240,7 @@ fun HealthConnectSourceContent(onEnabled: (() -> Unit)? = null) { } } } - note?.let { Text(it, fontSize = 12.sp, color = PulseColors.textMuted) } + note?.let { Text(it, fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted) } } } @@ -265,9 +265,9 @@ fun HealthConnectSourceHeroCard(onOpen: () -> Unit) { Text(trf("{0} via Health Connect", HealthConnectSource.label(context, pkg)), fontSize = 20.sp, fontWeight = FontWeight.SemiBold, color = com.pulseloop.ui.calm.Look.text) Text(tr("Data source") + " · " + lastLine, fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textSecondary) } else { - Text(tr("DATA SOURCE"), style = com.pulseloop.ui.theme.PulseType.eyebrow, color = PulseColors.textSecondary) - Text(trf("{0} via Health Connect", HealthConnectSource.label(context, pkg)), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = PulseColors.textPrimary) - Text(lastLine, fontSize = 14.sp, color = PulseColors.textSecondary) + Text(tr("DATA SOURCE"), style = com.pulseloop.ui.theme.PulseType.eyebrow, color = com.pulseloop.ui.calm.Look.textSecondary) + Text(trf("{0} via Health Connect", HealthConnectSource.label(context, pkg)), fontSize = 16.sp, fontWeight = FontWeight.Bold, color = com.pulseloop.ui.calm.Look.text) + Text(lastLine, fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textSecondary) } } com.pulseloop.ui.components.Chevron() diff --git a/app/src/main/java/com/pulseloop/ui/screens/LanguageSettingsScreen.kt b/app/src/main/java/com/pulseloop/ui/screens/LanguageSettingsScreen.kt index 8c315299..d6b07d2c 100644 --- a/app/src/main/java/com/pulseloop/ui/screens/LanguageSettingsScreen.kt +++ b/app/src/main/java/com/pulseloop/ui/screens/LanguageSettingsScreen.kt @@ -49,7 +49,7 @@ fun LanguageSettingsScreen(onBack: () -> Unit) { SettingsSubScreen(title = tr("Language"), onBack = onBack) { Column( // A radio group: TalkBack reads "selected, 1 of 5" and each row is one 48dp target. - Modifier.fillMaxWidth().clip(RoundedCornerShape(8.dp)).background(PulseColors.card).selectableGroup(), + Modifier.fillMaxWidth().clip(RoundedCornerShape(com.pulseloop.ui.calm.Look.radius)).background(com.pulseloop.ui.calm.Look.card).selectableGroup(), ) { AppLanguage.entries.forEach { lang -> Row( @@ -69,16 +69,16 @@ fun LanguageSettingsScreen(onBack: () -> Unit) { Column(Modifier.padding(start = 12.dp, top = 8.dp, bottom = 8.dp)) { Text( if (lang == AppLanguage.SYSTEM) tr("System default") else lang.label, - fontSize = 16.sp, color = PulseColors.textPrimary, + fontSize = 16.sp, color = com.pulseloop.ui.calm.Look.text, ) - lang.caption?.let { Text(tr(it), fontSize = 12.sp, color = PulseColors.textMuted) } + lang.caption?.let { Text(tr(it), fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted) } } } } } Text( tr("The coach also replies in the language you choose."), - fontSize = 12.sp, color = PulseColors.textMuted, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted, ) } diff --git a/app/src/main/java/com/pulseloop/ui/screens/McpSettingsUi.kt b/app/src/main/java/com/pulseloop/ui/screens/McpSettingsUi.kt index 1fe5787f..958a941f 100644 --- a/app/src/main/java/com/pulseloop/ui/screens/McpSettingsUi.kt +++ b/app/src/main/java/com/pulseloop/ui/screens/McpSettingsUi.kt @@ -99,8 +99,8 @@ fun McpSettingsScreen(onBack: () -> Unit) { SettingsSubScreen(title = tr("AI tools on your network"), onBack = onBack) { Text( tr("Let AI tools on your computer, like Claude Desktop or Cursor, read your PulseLoop data over your Wi-Fi or Tailscale. They can only read: nothing can be changed or deleted."), - style = PulseType.body, - color = PulseColors.textSecondary, + style = com.pulseloop.ui.calm.Look.bodyStyle, + color = com.pulseloop.ui.calm.Look.textSecondary, ) McpCard { @@ -111,7 +111,7 @@ fun McpSettingsScreen(onBack: () -> Unit) { horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, ) { - Text(tr("Share with AI tools on this network"), style = PulseType.title, color = PulseColors.textPrimary, modifier = Modifier.weight(1f)) + Text(tr("Share with AI tools on this network"), style = com.pulseloop.ui.calm.Look.titleStyle, color = com.pulseloop.ui.calm.Look.text, modifier = Modifier.weight(1f)) Switch(checked = on, onCheckedChange = null) } Text( @@ -122,10 +122,10 @@ fun McpSettingsScreen(onBack: () -> Unit) { status.unreachable -> tr("Not on Wi-Fi or Tailscale, so nothing could reach it. Connect and try again.") else -> tr("Off") }, - style = PulseType.body, - color = if (status.unreachable && !on) PulseColors.warning else PulseColors.textSecondary, + style = com.pulseloop.ui.calm.Look.bodyStyle, + color = if (status.unreachable && !on) PulseColors.warning else com.pulseloop.ui.calm.Look.textSecondary, ) - Text(tr("Stays on for"), style = PulseType.eyebrow, color = PulseColors.textSecondary) + if (com.pulseloop.ui.calm.Look.calm) com.pulseloop.ui.calm.LookLabel(tr("Stays on for")) else Text(tr("Stays on for"), style = PulseType.eyebrow, color = com.pulseloop.ui.calm.Look.textSecondary) PulseSegmented( options = McpPrefs.HOURS_CHOICES.map { it to trf("{0} h", it) } + (ALWAYS to tr("Always")), selected = if (alwaysOn) ALWAYS else hours, @@ -134,8 +134,8 @@ fun McpSettingsScreen(onBack: () -> Unit) { if (alwaysOn && !batteryExempt) { Text( tr("Android may pause it while the phone sleeps. Allow it to run in the background so your tools can always reach it."), - style = PulseType.label, - color = PulseColors.textSecondary, + style = com.pulseloop.ui.calm.Look.labelStyle, + color = com.pulseloop.ui.calm.Look.textSecondary, ) PulseButton(PulseButtonStyle.Outlined, onClick = { requestBatteryExemption(context) }, modifier = Modifier.fillMaxWidth()) { Text(tr("Allow background running")) @@ -144,17 +144,17 @@ fun McpSettingsScreen(onBack: () -> Unit) { } Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { - Text(tr("Connect to").uppercase(), style = PulseType.eyebrow, color = PulseColors.textSecondary) + com.pulseloop.ui.calm.LookLabel(tr("Connect to")) if (urls.isEmpty()) { - Text(tr("Connect the phone to Wi-Fi or Tailscale to get an address."), style = PulseType.body, color = PulseColors.textSecondary) + Text(tr("Connect the phone to Wi-Fi or Tailscale to get an address."), style = com.pulseloop.ui.calm.Look.bodyStyle, color = com.pulseloop.ui.calm.Look.textSecondary) } else { SelectionContainer { Column(verticalArrangement = Arrangement.spacedBy(4.dp)) { urls.forEach { u -> Text( if (u.startsWith("http://100.")) trf("{0} (Tailscale)", u) else u, - style = PulseType.body, - color = PulseColors.textPrimary, + style = com.pulseloop.ui.calm.Look.bodyStyle, + color = com.pulseloop.ui.calm.Look.text, ) } } @@ -162,15 +162,15 @@ fun McpSettingsScreen(onBack: () -> Unit) { } Text( tr("Paired tools on this network can read your health data while this is on. Nothing is sent anywhere by itself."), - style = PulseType.body, - color = PulseColors.textSecondary, + style = com.pulseloop.ui.calm.Look.bodyStyle, + color = com.pulseloop.ui.calm.Look.textSecondary, ) } Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { - Text(tr("Paired tools").uppercase(), style = PulseType.eyebrow, color = PulseColors.textSecondary) + com.pulseloop.ui.calm.LookLabel(tr("Paired tools")) if (paired.isEmpty()) { - Text(tr("No tools paired yet."), style = PulseType.body, color = PulseColors.textSecondary) + Text(tr("No tools paired yet."), style = com.pulseloop.ui.calm.Look.bodyStyle, color = com.pulseloop.ui.calm.Look.textSecondary) } paired.forEach { t -> Row( @@ -178,12 +178,12 @@ fun McpSettingsScreen(onBack: () -> Unit) { verticalAlignment = Alignment.CenterVertically, ) { Column(Modifier.weight(1f)) { - Text(t.label, style = PulseType.title, color = PulseColors.textPrimary) + Text(t.label, style = com.pulseloop.ui.calm.Look.titleStyle, color = com.pulseloop.ui.calm.Look.text) Text( t.lastUsedAt?.let { trf("Paired {0} · last used {1}", day(t.createdAt), day(it)) } ?: trf("Paired {0} · not used yet", day(t.createdAt)), - style = PulseType.label, - color = PulseColors.textSecondary, + style = com.pulseloop.ui.calm.Look.labelStyle, + color = com.pulseloop.ui.calm.Look.textSecondary, ) } PulseButton(PulseButtonStyle.Text, onClick = { revoking = t }) { Text(tr("Revoke")) } @@ -202,7 +202,7 @@ fun McpSettingsScreen(onBack: () -> Unit) { text = { Text( tr("Paired tools on this network will be able to read your health data at any time, also after the phone restarts, until you turn it off here or tap Stop in its notification. The notification stays while it's on."), - style = PulseType.body, + style = com.pulseloop.ui.calm.Look.bodyStyle, ) }, confirmButton = { @@ -221,7 +221,7 @@ fun McpSettingsScreen(onBack: () -> Unit) { title = { Text(tr("Pair a tool")) }, text = { Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { - Text(tr("Name it so you'll recognise it later, like the app and the computer."), style = PulseType.body) + Text(tr("Name it so you'll recognise it later, like the app and the computer."), style = com.pulseloop.ui.calm.Look.bodyStyle) OutlinedTextField( value = label, onValueChange = { label = it.take(McpTokens.MAX_LABEL) }, @@ -255,27 +255,27 @@ fun McpSettingsScreen(onBack: () -> Unit) { title = { Text(trf("{0} is paired", label)) }, text = { Column(Modifier.verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(8.dp)) { - Text(tr("Copy this now. It won't be shown again."), style = PulseType.body, color = PulseColors.warning) - SelectionContainer { Text(token, style = PulseType.body, color = PulseColors.textPrimary) } + Text(tr("Copy this now. It won't be shown again."), style = com.pulseloop.ui.calm.Look.bodyStyle, color = PulseColors.warning) + SelectionContainer { Text(token, style = com.pulseloop.ui.calm.Look.bodyStyle, color = com.pulseloop.ui.calm.Look.text) } PulseButton(PulseButtonStyle.Text, onClick = { copySecret(context, token) }) { Text(tr("Copy token")) } - Text(tr("Claude Desktop or Cursor").uppercase(), style = PulseType.eyebrow, color = PulseColors.textSecondary) + com.pulseloop.ui.calm.LookLabel(tr("Claude Desktop or Cursor")) Text( tr("Add this to claude_desktop_config.json or .cursor/mcp.json, then restart the app. It needs Node.js on the computer."), - style = PulseType.label, - color = PulseColors.textSecondary, + style = com.pulseloop.ui.calm.Look.labelStyle, + color = com.pulseloop.ui.calm.Look.textSecondary, ) - SelectionContainer { Text(bridge, style = PulseType.label, color = PulseColors.textPrimary) } + SelectionContainer { Text(bridge, style = com.pulseloop.ui.calm.Look.labelStyle, color = com.pulseloop.ui.calm.Look.text) } PulseButton(PulseButtonStyle.Text, onClick = { copySecret(context, bridge) }) { Text(tr("Copy config")) } - Text(tr("Tools that connect over HTTP").uppercase(), style = PulseType.eyebrow, color = PulseColors.textSecondary) - SelectionContainer { Text(direct, style = PulseType.label, color = PulseColors.textPrimary) } + com.pulseloop.ui.calm.LookLabel(tr("Tools that connect over HTTP")) + SelectionContainer { Text(direct, style = com.pulseloop.ui.calm.Look.labelStyle, color = com.pulseloop.ui.calm.Look.text) } PulseButton(PulseButtonStyle.Text, onClick = { copySecret(context, direct) }) { Text(tr("Copy address and header")) } if (urls.isEmpty()) { Text( tr("Replace PHONE-ADDRESS with the phone's address once it is on Wi-Fi or Tailscale."), - style = PulseType.label, - color = PulseColors.textSecondary, + style = com.pulseloop.ui.calm.Look.labelStyle, + color = com.pulseloop.ui.calm.Look.textSecondary, ) } } @@ -290,7 +290,7 @@ fun McpSettingsScreen(onBack: () -> Unit) { AlertDialog( onDismissRequest = { revoking = null }, title = { Text(trf("Revoke {0}?", t.label)) }, - text = { Text(tr("It won't be able to read your data any more. Pair it again to reconnect."), style = PulseType.body) }, + text = { Text(tr("It won't be able to read your data any more. Pair it again to reconnect."), style = com.pulseloop.ui.calm.Look.bodyStyle) }, confirmButton = { PulseButton(PulseButtonStyle.Text, onClick = { tokens.revoke(t.id) @@ -310,7 +310,7 @@ private fun McpCard(content: @Composable () -> Unit) { Column( Modifier .fillMaxWidth() - .background(PulseColors.card, RoundedCornerShape(8.dp)) + .background(com.pulseloop.ui.calm.Look.card, RoundedCornerShape(com.pulseloop.ui.calm.Look.radius)) .padding(16.dp), verticalArrangement = Arrangement.spacedBy(12.dp), ) { content() } diff --git a/app/src/main/java/com/pulseloop/ui/screens/PostpartumUi.kt b/app/src/main/java/com/pulseloop/ui/screens/PostpartumUi.kt index 7d4bc3dd..464728f6 100644 --- a/app/src/main/java/com/pulseloop/ui/screens/PostpartumUi.kt +++ b/app/src/main/java/com/pulseloop/ui/screens/PostpartumUi.kt @@ -75,16 +75,16 @@ fun PostpartumProfileCard(onOpen: () -> Unit) { } Column( - Modifier.fillMaxWidth().clip(RoundedCornerShape(8.dp)).background(PulseColors.card).padding(16.dp), + Modifier.fillMaxWidth().clip(RoundedCornerShape(com.pulseloop.ui.calm.Look.radius)).background(com.pulseloop.ui.calm.Look.card).padding(16.dp), verticalArrangement = Arrangement.spacedBy(12.dp), ) { - Text(tr("LIFE STAGE"), style = com.pulseloop.ui.theme.PulseType.eyebrow, color = PulseColors.textSecondary) + com.pulseloop.ui.calm.LookLabel(tr("Life stage")) Row(verticalAlignment = Alignment.CenterVertically) { Column(Modifier.weight(1f)) { - Text(tr("Postpartum / breastfeeding"), fontSize = 16.sp, fontWeight = FontWeight.SemiBold, color = PulseColors.textPrimary) + Text(tr("Postpartum / breastfeeding"), fontSize = 16.sp, fontWeight = FontWeight.SemiBold, color = com.pulseloop.ui.calm.Look.text) Text( tr("Pauses cycle predictions while breastfeeding, adds an alcohol-to-feeding estimate, a mood check-in and warning signs, and tells the coach."), - fontSize = 12.sp, color = PulseColors.textMuted, + fontSize = 12.sp, color = com.pulseloop.ui.calm.Look.textMuted, ) } Switch(checked = enabled, onCheckedChange = { @@ -95,10 +95,10 @@ fun PostpartumProfileCard(onOpen: () -> Unit) { } if (enabled) { Row(verticalAlignment = Alignment.CenterVertically) { - Text(tr("Baby's birth date"), fontSize = 14.sp, color = PulseColors.textSecondary, modifier = Modifier.weight(1f)) + Text(tr("Baby's birth date"), fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textSecondary, modifier = Modifier.weight(1f)) PulseButton(PulseButtonStyle.Text, onClick = { picking = true }) { Text(birth?.format(fmt) ?: tr("Set")) } } - Text(tr("Feeding"), fontSize = 14.sp, color = PulseColors.textSecondary) + Text(tr("Feeding"), fontSize = 14.sp, color = com.pulseloop.ui.calm.Look.textSecondary) FlowRow(Modifier.selectableGroup(), horizontalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) { listOf( Postpartum.Feeding.EXCLUSIVE to tr("Breastfeeding only"), diff --git a/app/src/main/java/com/pulseloop/ui/screens/SettingsSubScreens.kt b/app/src/main/java/com/pulseloop/ui/screens/SettingsSubScreens.kt index 2eeb524e..6a0036d4 100644 --- a/app/src/main/java/com/pulseloop/ui/screens/SettingsSubScreens.kt +++ b/app/src/main/java/com/pulseloop/ui/screens/SettingsSubScreens.kt @@ -121,8 +121,13 @@ internal fun SettingsSubScreen( bottomOverlay: (@Composable BoxScope.() -> Unit)? = null, content: @Composable ColumnScope.() -> Unit, ) { + // The new look (docs/new-look-plan.md, "Settings"): the calm bar, page, gutter and 720dp cap, + // and calm Material roles plus Inter for everything inside, since most of these screens read + // MaterialTheme (onSurfaceVariant captions, switches, fields) rather than naming colours. + val calm = com.pulseloop.ui.calm.NewLook.on + com.pulseloop.ui.calm.CalmMaterial(enabled = calm) { Scaffold( - containerColor = PulseColors.background, + containerColor = if (calm) com.pulseloop.ui.calm.CalmColors.page else PulseColors.background, // The NavHost route wrapper (PulseLoopApp's paddedComposable) has ALREADY applied the // outer Scaffold's system-bar padding to this whole subtree. Consuming the insets a // second time here — once via contentWindowInsets, once via TopAppBar's own default — @@ -131,13 +136,16 @@ internal fun SettingsSubScreen( topBar = { // The shared pushed-screen bar (centred title, one back arrow), like every other // pushed screen; it applies no insets of its own either. - com.pulseloop.ui.components.PulseTopBar(title = title, onBack = onBack) + if (calm) com.pulseloop.ui.calm.CalmTopBar(title, onBack) + else com.pulseloop.ui.components.PulseTopBar(title = title, onBack = onBack) }, ) { padding -> Box(Modifier.fillMaxSize().padding(padding)) { Column( // imePadding: the app is edge-to-edge, so without it the keyboard covers fields. - Modifier.fillMaxSize().imePadding().verticalScroll(rememberScrollState()).padding(16.dp), + Modifier.fillMaxSize().imePadding().verticalScroll(rememberScrollState()) + .then(if (calm) Modifier.wrapContentWidth().widthIn(max = 720.dp).fillMaxWidth() else Modifier) + .padding(horizontal = if (calm) com.pulseloop.ui.calm.CalmShape.gutter else 16.dp, vertical = if (calm) 8.dp else 16.dp), verticalArrangement = Arrangement.spacedBy(16.dp), ) { content() @@ -146,6 +154,7 @@ internal fun SettingsSubScreen( bottomOverlay?.invoke(this) } } + } } // MARK: - AI Coach @@ -225,7 +234,7 @@ fun CoachSettingsScreen(onBack: () -> Unit) { // AI Coach section — ported from CoachSettingsSection.swift SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("AI Coach"), style = PulseType.title) + Text(tr("AI Coach"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(4.dp)) // Readiness differs by provider: the local mode is gated by the server address, // not a key, so the old key-only check told a correctly-configured user their @@ -882,7 +891,7 @@ fun CoachSettingsScreen(onBack: () -> Unit) { SubScreenCard { Column(Modifier.padding(16.dp)) { Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically) { - Text(tr("Coach Memory"), style = PulseType.title, modifier = Modifier.weight(1f)) + Text(tr("Coach Memory"), style = com.pulseloop.ui.calm.Look.titleStyle, modifier = Modifier.weight(1f)) PulseButton(PulseButtonStyle.Text, onClick = { showMemory = !showMemory }) { Text(if (showMemory) tr("Hide") else trf("Show ({0})", memories.size)) } @@ -1033,7 +1042,7 @@ fun CheckInsSettingsScreen(onBack: () -> Unit) { SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("Detected workouts"), style = PulseType.title) + Text(tr("Detected workouts"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(4.dp)) Text( tr("After a sync, what your ring saw you doing (a walk, a ride, strength training), to add with a tap. Nothing is logged without you."), @@ -1053,7 +1062,7 @@ fun CheckInsSettingsScreen(onBack: () -> Unit) { // NotificationsSettingsView section): a local notification at <20% / <10%, once per day. SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("Ring battery alerts"), style = PulseType.title) + Text(tr("Ring battery alerts"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(4.dp)) Text( tr("Get notified when your ring drops below 20% and 10%, so tracking doesn't stop mid-day."), @@ -1078,7 +1087,7 @@ fun CheckInsSettingsScreen(onBack: () -> Unit) { SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("Daily check-ins"), style = PulseType.title) + Text(tr("Daily check-ins"), style = com.pulseloop.ui.calm.Look.titleStyle) if (!coachEnabled) { Spacer(Modifier.height(4.dp)) Text( @@ -1187,7 +1196,7 @@ private fun DailyGuidanceSettingsCard() { SubScreenCard { Column(Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(12.dp)) { - Text(tr("Daily guidance"), style = PulseType.title) + Text(tr("Daily guidance"), style = com.pulseloop.ui.calm.Look.titleStyle) Text( tr("Built on your phone from your ring's data. No AI key needed."), style = MaterialTheme.typography.bodySmall, @@ -1770,7 +1779,7 @@ fun MeasurementSettingsScreen(coordinator: RingSyncCoordinator?, onBack: () -> U SettingsSubScreen(title = tr("Measurement frequency"), onBack = onBack) { SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("Measurement"), style = PulseType.title) + Text(tr("Measurement"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(4.dp)) Text( tr("How often the ring measures in the background. Shorter heart-rate intervals give finer history at the cost of battery."), @@ -1970,7 +1979,7 @@ private fun QuietHoursCard() { SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("Sleep trimming"), style = PulseType.title) + Text(tr("Sleep trimming"), style = com.pulseloop.ui.calm.Look.titleStyle) Text( tr("A still wrist reads as sleep, so an evening on the sofa can run the night high. " + "Trimmed minutes are never imported — changing these later won't bring them back."), @@ -2292,7 +2301,7 @@ fun WearableSettingsScreen( if (device != null) { SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("Ring management"), style = PulseType.title) + Text(tr("Ring management"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(8.dp)) Text( tr("Restart reboots the ring if it supports that, reconnects it, and sends it " + @@ -2462,7 +2471,7 @@ private fun BackgroundSyncCard() { SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("Reliable background sync"), style = PulseType.title) + Text(tr("Reliable background sync"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(8.dp)) Text( if (exempt) { @@ -2541,7 +2550,7 @@ private fun BatteryHistorySection(db: PulseLoopDatabase) { SubScreenCard { Column(Modifier.padding(16.dp)) { Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically) { - Text(tr("Battery history"), style = PulseType.title, modifier = Modifier.weight(1f)) + Text(tr("Battery history"), style = com.pulseloop.ui.calm.Look.titleStyle, modifier = Modifier.weight(1f)) SingleChoiceSegmentedButtonRow { BatteryHistoryRange.entries.forEachIndexed { i, r -> SegmentedButton( @@ -2694,7 +2703,7 @@ fun PrivacyDataSettingsScreen( // Data Backup — export/import full app data as JSON. SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("Data backup"), style = PulseType.title) + Text(tr("Data backup"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(8.dp)) Text( tr("Export all your data to a single JSON file for backup, device migration, or external analysis. Import restores everything — replacing all current data."), @@ -2762,7 +2771,7 @@ fun PrivacyDataSettingsScreen( // App data — destructive reset/restore actions. SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("App data"), style = PulseType.title) + Text(tr("App data"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(8.dp)) // Unpairing lives on Ring & sync only (one place for the ring); this card only // erases the app's own data. @@ -2787,7 +2796,7 @@ fun PrivacyDataSettingsScreen( // Demo data — Android-only (iOS seeds via the Simulator's SeedData). SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("Demo data"), style = PulseType.title) + Text(tr("Demo data"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(8.dp)) Text( tr("Explore the app without a ring. Seeds activity, HR, SpO2, sleep, and a coach conversation."), @@ -2812,7 +2821,7 @@ fun PrivacyDataSettingsScreen( // The unmasked export is for protocol debugging: only offered once developer // options are unlocked, so nobody shares raw health frames by accident. val developer = remember { ApiKeyStore(context).developerUnlocked } - Text(tr("Diagnostics"), style = PulseType.title) + Text(tr("Diagnostics"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(8.dp)) Text( tr("Export app, device, and wearable logs as JSON for bug reports."), @@ -3050,13 +3059,13 @@ fun AboutSettingsScreen(onOpenDebug: () -> Unit, onBack: () -> Unit) { message, fontSize = 14.sp, fontWeight = FontWeight.Medium, - color = PulseColors.textPrimary, + color = com.pulseloop.ui.calm.Look.text, modifier = Modifier .align(Alignment.BottomCenter) .padding(bottom = 28.dp) .clip(CircleShape) .background(PulseColors.elevated) - .border(1.dp, PulseColors.borderSubtle, CircleShape) + .border(1.dp, com.pulseloop.ui.calm.Look.border, CircleShape) .padding(horizontal = 16.dp, vertical = 12.dp) .semantics { liveRegion = LiveRegionMode.Polite }, ) @@ -3065,7 +3074,7 @@ fun AboutSettingsScreen(onOpenDebug: () -> Unit, onBack: () -> Unit) { ) { // Version row: tap 7× to unlock Developer options; a tint/border builds with progress. SubScreenCard( - Modifier.border(1.5.dp, PulseColors.accent.copy(alpha = tapProgress * 0.9f), RoundedCornerShape(8.dp)), + Modifier.border(1.5.dp, PulseColors.accent.copy(alpha = tapProgress * 0.9f), RoundedCornerShape(com.pulseloop.ui.calm.Look.radius)), onClick = { registerVersionTap() }, ) { Column( @@ -3074,7 +3083,7 @@ fun AboutSettingsScreen(onOpenDebug: () -> Unit, onBack: () -> Unit) { .dither(PulseColors.accent, tapProgress * 0.22f) .padding(16.dp), ) { - Text(tr("Version"), style = PulseType.title) + Text(tr("Version"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(4.dp)) Text( trf("PulseLoop v{0} ({1})", com.pulseloop.BuildConfig.VERSION_NAME, com.pulseloop.BuildConfig.VERSION_CODE), @@ -3085,7 +3094,7 @@ fun AboutSettingsScreen(onOpenDebug: () -> Unit, onBack: () -> Unit) { SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("PulseLoop"), style = PulseType.title) + Text(tr("PulseLoop"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(4.dp)) Text( tr("An LLM-native health app that turns a cheap Bluetooth smart ring into a real, " + @@ -3109,20 +3118,20 @@ fun AboutSettingsScreen(onOpenDebug: () -> Unit, onBack: () -> Unit) { }) { Row(Modifier.padding(16.dp).fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) { Column(Modifier.weight(1f)) { - Text(tr("Source on GitHub"), style = PulseType.title) + Text(tr("Source on GitHub"), style = com.pulseloop.ui.calm.Look.titleStyle) Text( REPO_URL.removePrefix("https://"), style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onSurfaceVariant, ) } - Icon(Icons.Filled.OpenInNew, null, Modifier.size(16.dp), tint = PulseColors.textMuted) + Icon(Icons.Filled.OpenInNew, null, Modifier.size(16.dp), tint = com.pulseloop.ui.calm.Look.textMuted) } } SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("License"), style = PulseType.title) + Text(tr("License"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(4.dp)) Text( tr("Open-source health tracker. Ported from iOS.\nCC BY 4.0 · Free to share and " + @@ -3267,7 +3276,7 @@ fun StravaSettingsScreen(onBack: () -> Unit) { if (!isConfigured) { SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("Strava Not Configured"), style = PulseType.title) + Text(tr("Strava Not Configured"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(8.dp)) Text( tr("Add stravaClientId and stravaClientSecret to local.properties to enable Strava integration."), @@ -3281,7 +3290,7 @@ fun StravaSettingsScreen(onBack: () -> Unit) { SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("Strava Integration"), style = PulseType.title) + Text(tr("Strava Integration"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(8.dp)) Text( if (isConnected) trf("Connected as {0}. Workouts sync automatically when finished.", athleteName) @@ -3353,7 +3362,7 @@ fun StravaSettingsScreen(onBack: () -> Unit) { if (isConnected) { SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("Auto Upload"), style = PulseType.title) + Text(tr("Auto Upload"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(4.dp)) Text( "Finished workouts are automatically uploaded to Strava. GPS routes, heart rate data, and sport type are included.", @@ -3540,7 +3549,7 @@ fun HealthConnectSettingsScreen(onBack: () -> Unit) { SettingsSubScreen(title = tr("Health Connect"), onBack = onBack) { SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("Health Connect"), style = PulseType.title) + Text(tr("Health Connect"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(4.dp)) Text( tr("Export ring data to Health Connect so other apps and dashboards can show it. Exporting only writes. PulseLoop reads Health Connect only for features you turn on: body data in your profile, Use without a ring, and the accuracy check."), @@ -3624,7 +3633,7 @@ fun HealthConnectSettingsScreen(onBack: () -> Unit) { Modifier.fillMaxWidth().heightIn(min = 48.dp).clickable(role = androidx.compose.ui.semantics.Role.Button) { typesOpen = !typesOpen }, verticalAlignment = Alignment.CenterVertically, ) { - Text(tr("Data Types"), style = PulseType.title, modifier = Modifier.weight(1f)) + Text(tr("Data Types"), style = com.pulseloop.ui.calm.Look.titleStyle, modifier = Modifier.weight(1f)) Text( if (typesOpen) tr("Hide") else tr("Show"), style = MaterialTheme.typography.labelLarge, color = MaterialTheme.colorScheme.primary, @@ -3759,7 +3768,7 @@ fun HealthConnectSettingsScreen(onBack: () -> Unit) { // stamp so the export state matches an empty Health store. SubScreenCard { Column(Modifier.padding(16.dp)) { - Text(tr("Remove exported data"), style = PulseType.title) + Text(tr("Remove exported data"), style = com.pulseloop.ui.calm.Look.titleStyle) Spacer(Modifier.height(4.dp)) Text( tr("Delete every record PulseLoop wrote to Health Connect and reset the export to start fresh. Your ring data in PulseLoop is untouched."), @@ -4016,7 +4025,7 @@ private fun AutoBackupCard() { Column(Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(12.dp)) { Row(verticalAlignment = Alignment.CenterVertically) { Column(Modifier.weight(1f)) { - Text(tr("Automatic backups"), style = PulseType.title) + Text(tr("Automatic backups"), style = com.pulseloop.ui.calm.Look.titleStyle) Text( tr("Saves the same file as Export to a folder you choose, and keeps the latest 5."), style = MaterialTheme.typography.bodySmall, @@ -4081,20 +4090,28 @@ private fun backupStatus(context: android.content.Context): String { @Composable private fun SubScreenCard( modifier: Modifier = Modifier, - color: androidx.compose.ui.graphics.Color = PulseColors.card, - borderColor: androidx.compose.ui.graphics.Color = PulseColors.borderSubtle, + /** Null: the look's card. A caller's `PulseColors.cardSoft` (an inset, raised card) maps to + * the new look's raised surface. */ + color: androidx.compose.ui.graphics.Color? = null, + borderColor: androidx.compose.ui.graphics.Color? = null, onClick: (() -> Unit)? = null, content: @Composable ColumnScope.() -> Unit, ) { - val shape = RoundedCornerShape(8.dp) - CompositionLocalProvider(LocalContentColor provides PulseColors.textPrimary) { + val calm = com.pulseloop.ui.calm.Look.calm + val shape = RoundedCornerShape(com.pulseloop.ui.calm.Look.radius) + val surface = when { + color == null -> com.pulseloop.ui.calm.Look.card + calm && color == PulseColors.cardSoft -> com.pulseloop.ui.calm.CalmColors.cardRaised + else -> color + } + CompositionLocalProvider(LocalContentColor provides com.pulseloop.ui.calm.Look.text) { Column( modifier .fillMaxWidth() .clip(shape) - .background(color) + .background(surface) .then(if (onClick != null) Modifier.clickable(onClick = onClick) else Modifier) - .border(1.dp, borderColor, shape), + .border(1.dp, borderColor ?: com.pulseloop.ui.calm.Look.border, shape), content = content, ) } diff --git a/audits/2026-11-17-new-look-settings-subscreens.md b/audits/2026-11-17-new-look-settings-subscreens.md new file mode 100644 index 00000000..48570bf0 --- /dev/null +++ b/audits/2026-11-17-new-look-settings-subscreens.md @@ -0,0 +1,101 @@ +# Audit: Settings sub-screens in the new look + +Date: 2026-11-17 · PR: see the PR linking this file · Auditor: Claude Code. +- **impeccable:** loaded (context, `craft-floor.md`, `android.md`) and applied to **rendered** + screens. All 18 sub-screens were drawn on the JVM with Robolectric native graphics, inside the + app's real `PulseLoopTheme`, in the new look, and Physiology also in the old look. The harness + used an in-memory stand-in for the Android Keystore so the screens that read encrypted settings + could render. It is local only and not committed. +- **Device check:** owed. There is no emulator in this environment (no KVM). +- **ux-user-flows, graphic-design-fundamentals, less-is-more:** applied by hand from their + SKILL.md files. + +## Scope + +Every screen behind a Settings row: +- AI Coach, Notifications, User profile, Physiology, Calibration, Goals & sleep, Measurement + frequency, Ring & sync. +- Backup & data, About, Nutrition, Strava, Health Connect. +- Accuracy check, Use without a ring, AI tools on your network, Language. + +They are converted through what they share: +- the scaffold (`SettingsSubScreen` + `CalmMaterial`); +- the card (`SubScreenCard`); +- the editors (`Editors.kt`); +- `SectionHeaderCaps` / `LookLabel`; +- `PulseSegmented`. + +## ux-user-flows (§13 flow review checklist) + +No flow changes: same routes, same controls, same order, same dialogs and sheets. States seen in +the renders: +- no ring paired (Ring & sync, Measurement frequency); +- Health Connect missing (Health Connect, Use without a ring, Accuracy check); +- Strava not configured; +- empty memory and no backups yet; +- every switch off and on. + +## impeccable + +### Audit (native, on renders) + +| # | Dimension | Score | Key finding | +|---|---|---|---| +| 1 | Accessibility | 3 | Controls unchanged (48dp segments, Material switches, fields). Input outlines use `textMuted` (5.3:1) rather than the hairline, so a field's boundary passes 3:1. Selected segments carry weight and contrast, not colour alone. TalkBack on device owed. | +| 2 | Performance | 4 | No new work. | +| 3 | Appearance & theming | 3 | Neutrals, radius and type now come from the look. The coach's provider dropdowns still show mint text (P2). | +| 4 | Platform conformance | 4 | Material controls throughout; CenterAligned bar. | +| 5 | Adaptivity | 4 | 720dp cap, 20dp gutter. | +| | **Total** | **18/20** | | + +### Critique + +| # | Heuristic | Score | Key issue | +|---|---|---|---| +| 1 | Visibility of status | 4 | Unchanged status lines (Health Connect missing, backups). | +| 2 | Match real world | 4 | Unchanged copy. | +| 3 | User control | 4 | Unchanged. | +| 4 | Consistency | 4 | One bar, card, label and segmented style across all 18 screens and the hub. | +| 5 | Error prevention | 3 | Unchanged. | +| 6 | Recognition | 3 | Goal tiles keep their metric colour on the icon and value. | +| 7 | Flexibility | 3 | n/a | +| 8 | Minimalist | 4 | Caps kickers gone; dithered tiles replaced by one quiet tile. | +| 9 | Error recovery | 3 | Unchanged. | +| 10 | Help | 3 | Unchanged. | +| | **Total** | **35/40** | Good | + +### Polish (from the renders) + +- [fixed] Tonal buttons ("Pair a tool", Export, Reseed demo data) were Material's default lavender, + because the app's colour scheme never set the tonal role. `CalmMaterial` sets it; the old look + still shows it (P2, it goes when the old look is deleted). +- [fixed] `PulseSegmented` used the old mono font and a mint fill. Calm: raised surface, Inter. +- [fixed] Profile's Units/Sex segments filled the choice with mint. Calm: the choice is an inset + on a raised track, in full-strength text. +- [fixed] Goals: caps section labels, monospace values and dithered icon tiles. +- [P2] The coach's provider, model and effort dropdowns keep mint text. +- [P2] Several pushed screens keep a filled mint primary (Add a ring, Save calibration, Install + Health Connect). No Actions button shows on pushed screens, so each is still the screen's one + filled action. + +No P0 or P1. + +## graphic-design-fundamentals (§13 checklist) + +- **Hierarchy:** 16sp semibold card titles, 14sp body, 12sp captions, 14sp semibold group labels. +- **Contrast:** calm neutrals ≥ 5.3:1 on card; control outlines at `textMuted`. +- **Alignment and grid:** 20dp gutter, 16dp inside cards, as before. +- **Colour:** mint left to switches' on state and the one primary; metric colours only on goal + values and sliders, where they identify the metric. +- **Consistency / real size:** checked at 411dp. + +## less-is-more + +| Element | Verdict | +|---|---| +| Caps labels (Units, Identity, Body metrics, Daily targets, Weekly target, Life stage, Connect to, Paired tools) | Sentence case | +| Dithered goal icon tiles | One quiet tile, metric colour kept on the icon | +| Mint fill on a selected segment | Raised surface: mint is for what to tap | +| Monospace values on goals | Inter | + +No control was removed and no common action gained a tap. diff --git a/docs/new-look-plan.md b/docs/new-look-plan.md index 06bdec6e..fef0f7e0 100644 --- a/docs/new-look-plan.md +++ b/docs/new-look-plan.md @@ -114,3 +114,21 @@ and Sleep had theirs redone in `audits/2026-11-16-impeccable-pass-vitals-sleep-a These are the shared `SettingsSection` / `SettingsRow` / `DeviceHeroCard`, so they follow the look wherever they appear. Still old-styled: every sub-screen (`SettingsSubScreens.kt`), next. Audit: `audits/2026-11-16-new-look-settings.md`. +- **Settings sub-screens** (every route under `settings/`, plus the AI tools, accuracy check and + data-source screens). Converted at their shared parts rather than one by one: + - `SettingsSubScreen` (the scaffold) gives its subtree the calm bar, page, gutter and 720dp cap, + and `CalmMaterial`: the new look's neutrals in Material's colour roles plus Inter. Most of these + screens read `MaterialTheme` (captions in `onSurfaceVariant`, switches, fields, dialogs), so + they follow without edits. Input outlines use `textMuted`, since the hairline is too faint for + a control's boundary. It also sets the tonal-button role the app's scheme never set (Material's + default lavender showed through). + - `SubScreenCard`, the profile and goal editors (`Editors.kt`), the language list and the AI + tools screen read `Look` for their neutrals, radius and title styles. In the old look `Look` + returns the same `PulseColors` values, so the old look is unchanged. + - Caps labels become sentence case through `LookLabel`, which `SectionHeaderCaps` now uses + everywhere. `PulseSegmented` (also on Sleep and Vitals) and the profile's segmented rows mark + the choice with a raised surface instead of a mint fill. + + Still old-styled: the coach's provider dropdowns keep mint text, the About version tile's tap + effect, and Lab reports' own section labels (it shares the scaffold but is My Health's screen). + Audit: `audits/2026-11-17-new-look-settings-subscreens.md`.