Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/src/main/assets/i18n/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
"All health areas steady": "Todas as áreas estáveis",
"All models from {0} ({1})": "Todos os modelos de {0} ({1})",
"All three hold. LAM is about 98% effective only while all three do.": "As três condições valem. A LAM tem cerca de 98% de eficácia somente enquanto as três valerem.",
"All within your usual range": "Tudo dentro do seu normal",
"All {0} conversations and their replies will be deleted. This can't be undone.": "As {0} conversas e as respostas serão excluídas. Não é possível desfazer.",
"All-day heart rate": "Frequência cardíaca o dia todo",
"Allow": "Permitir",
Expand Down Expand Up @@ -1310,6 +1311,7 @@
"Outside range": "Fora da faixa",
"Outside the lab's range on {0}. Worth bringing to your doctor.": "Fora da faixa do laboratório em {0}. Vale levar ao seu médico.",
"Outside your usual last night: {0}": "Fora do seu normal na noite passada: {0}",
"Outside your usual: {0}": "Fora do seu normal: {0}",
"Overwhelming tiredness": "Cansaço extremo",
"Ovos mexidos": "Ovos mexidos",
"Own your ring data": "Seus dados do anel são seus",
Expand Down Expand Up @@ -1555,7 +1557,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, Symptom Radar.": "Telas que já usam o novo visual: Hoje, Radar de sintomas.",
"Screens that have moved to it so far: Today, Vitals, Symptom Radar.": "Telas que já usam o novo visual: Hoje, Vitais, Radar de sintomas.",
"Searching…": "Procurando…",
"See Raw Packets above.": "Veja Pacotes brutos acima.",
"See Ring Events above.": "Veja Eventos do anel acima.",
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/pulseloop/ui/calm/CalmTheme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ object CalmType {
* names its own family explicitly (PulseType's styles) is unchanged until its piece is converted.
*/
@androidx.compose.runtime.Composable
fun CalmTypography(content: @androidx.compose.runtime.Composable () -> Unit) {
fun CalmTypography(enabled: Boolean = true, content: @androidx.compose.runtime.Composable () -> Unit) {
if (!enabled) { content(); return }
val t = androidx.compose.material3.MaterialTheme.typography
fun TextStyle.inter() = copy(fontFamily = Inter)
val typography = t.copy(
Expand Down
43 changes: 30 additions & 13 deletions app/src/main/java/com/pulseloop/ui/components/VitalCard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,24 @@ fun VitalCard(
onTap: (() -> Unit)? = null,
content: @Composable () -> Unit,
) {
val shape = RoundedCornerShape(8.dp) // one card radius app-wide (was 24/30dp)
// The new look (docs/new-look-plan.md, "Vitals"): the calm card, Inter, sentence case.
val calm = com.pulseloop.ui.calm.NewLook.on
val shape = RoundedCornerShape(if (calm) com.pulseloop.ui.calm.CalmShape.radius else 8.dp) // one card radius app-wide (was 24/30dp)
val footerText = footerOverride ?: state.lastUpdatedText

Surface(
modifier = modifier
.fillMaxWidth()
.clip(shape)
.border(1.dp, MaterialTheme.colorScheme.onSurface.copy(alpha = 0.08f), shape)
.border(1.dp, if (calm) com.pulseloop.ui.calm.CalmColors.border else MaterialTheme.colorScheme.onSurface.copy(alpha = 0.08f), shape)
.then(if (onTap != null) Modifier.clickable(role = Role.Button, onClick = onTap) else Modifier),
shape = shape,
color = MaterialTheme.colorScheme.surfaceVariant,
color = if (calm) com.pulseloop.ui.calm.CalmColors.card else MaterialTheme.colorScheme.surfaceVariant,
) {
Column(
modifier = Modifier.padding(
horizontal = if (compact) 16.dp else 24.dp,
vertical = 16.dp,
horizontal = if (compact) 16.dp else if (calm) 20.dp else 24.dp,
vertical = if (calm) 20.dp else 16.dp,
),
verticalArrangement = Arrangement.spacedBy(if (compact) 4.dp else 8.dp),
) {
Expand Down Expand Up @@ -95,11 +97,11 @@ private fun CardHeader(state: VitalCardState, compact: Boolean, footerText: Stri
)
// The title takes the free width (instead of a Spacer) and the footer is bounded: both
// used to be unweighted, so a long translated title could squeeze the footer to nothing.
val calm = com.pulseloop.ui.calm.NewLook.on
Text(
state.title.uppercase(),
style = com.pulseloop.ui.theme.PulseType.eyebrow,

color = MaterialTheme.colorScheme.onSurfaceVariant,
if (calm) state.title else state.title.uppercase(),
style = if (calm) com.pulseloop.ui.calm.CalmType.title else com.pulseloop.ui.theme.PulseType.eyebrow,
color = if (calm) com.pulseloop.ui.calm.CalmColors.text else MaterialTheme.colorScheme.onSurfaceVariant,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.weight(1f),
Expand All @@ -110,7 +112,7 @@ private fun CardHeader(state: VitalCardState, compact: Boolean, footerText: Stri
Text(
footerText,
fontSize = 12.sp,
color = MaterialTheme.colorScheme.onSurfaceVariant,
color = if (calm) com.pulseloop.ui.calm.CalmColors.textMuted else MaterialTheme.colorScheme.onSurfaceVariant,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.widthIn(max = 160.dp),
Expand All @@ -122,6 +124,18 @@ private fun CardHeader(state: VitalCardState, compact: Boolean, footerText: Stri

@Composable
private fun EstimatedChip() {
if (com.pulseloop.ui.calm.NewLook.on) {
Text(
tr("Estimated"),
style = com.pulseloop.ui.calm.CalmType.label,
color = ZonePalette.ZoneAmber,
modifier = Modifier
.clip(RoundedCornerShape(8.dp))
.background(com.pulseloop.ui.calm.CalmColors.cardRaised)
.padding(horizontal = 10.dp, vertical = 6.dp),
)
return
}
Text(
tr("ESTIMATED"),
style = com.pulseloop.ui.theme.PulseType.eyebrow,
Expand All @@ -141,7 +155,9 @@ private fun EstimatedChip() {
private fun ValueRow(state: VitalCardState) {
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
Row(verticalAlignment = Alignment.Bottom, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
Text(
val calm = com.pulseloop.ui.calm.NewLook.on
if (calm) Text(state.valueText, style = com.pulseloop.ui.calm.CalmType.display, color = com.pulseloop.ui.calm.CalmColors.text)
else Text(
state.valueText,
fontSize = 32.sp,
fontWeight = FontWeight.SemiBold,
Expand All @@ -159,9 +175,10 @@ private fun ValueRow(state: VitalCardState) {
}
}
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp)) {
val calmStatus = com.pulseloop.ui.calm.NewLook.on
Text(
state.statusText.uppercase(),
style = com.pulseloop.ui.theme.PulseType.eyebrow,
if (calmStatus) state.statusText else state.statusText.uppercase(),
style = if (calmStatus) com.pulseloop.ui.calm.CalmType.title else com.pulseloop.ui.theme.PulseType.eyebrow,
fontWeight = FontWeight.SemiBold,

color = state.statusToken.toColor(),
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/pulseloop/ui/screens/DebugScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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, Symptom Radar."), style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onSurfaceVariant)
Text(tr("Screens that have moved to it so far: Today, Vitals, Symptom Radar."), style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onSurfaceVariant)
}
Switch(checked = com.pulseloop.ui.calm.NewLook.on, onCheckedChange = null)
}
Expand Down
38 changes: 32 additions & 6 deletions app/src/main/java/com/pulseloop/ui/screens/Screens.kt
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,22 @@ fun VitalsScreen(
}
}

val calm = com.pulseloop.ui.calm.NewLook.on
// The new look (docs/new-look-plan.md, "Vitals"): page colour, wider gutter, a 720dp cap and
// Inter for the whole tab. The structure stays: Vitals is where the charts live.
com.pulseloop.ui.calm.CalmTypography(enabled = calm) {
LazyColumn(
modifier = Modifier.fillMaxSize(),
modifier = if (calm) Modifier.fillMaxSize().background(com.pulseloop.ui.calm.CalmColors.page)
.wrapContentWidth().widthIn(max = 720.dp).fillMaxWidth() else Modifier.fillMaxSize(),
contentPadding = PaddingValues(
start = 16.dp, end = 16.dp,
start = if (calm) com.pulseloop.ui.calm.CalmShape.gutter else 16.dp,
end = if (calm) com.pulseloop.ui.calm.CalmShape.gutter else 16.dp,
top = 16.dp + topBarPadding, bottom = 16.dp + bottomBarPadding,
),
verticalArrangement = Arrangement.spacedBy(12.dp),
) {
item {
Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically) {
Row(Modifier.fillMaxWidth().then(if (calm) Modifier.padding(bottom = 12.dp) else Modifier), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically) {
Column(Modifier.weight(1f)) {
// No title: the tab bar names the screen, as on the other tabs.
// The answer first: is anything outside this person's usual range? The
Expand Down Expand Up @@ -558,6 +564,7 @@ fun VitalsScreen(

item { Spacer(Modifier.height(32.dp)) }
}
}
}

/**
Expand Down Expand Up @@ -650,11 +657,12 @@ private fun BpGaugeColumn(
size = 130.dp,
lineWidth = 11.dp,
)
val calm = com.pulseloop.ui.calm.NewLook.on
Text(
title.uppercase(),
style = com.pulseloop.ui.theme.PulseType.eyebrow,
if (calm) title else title.uppercase(),
style = if (calm) com.pulseloop.ui.calm.CalmType.bodySmall else com.pulseloop.ui.theme.PulseType.eyebrow,
fontWeight = FontWeight.SemiBold,
color = PulseColors.textSecondary,
color = if (calm) com.pulseloop.ui.calm.CalmColors.textSecondary else PulseColors.textSecondary,
)
}
}
Expand Down Expand Up @@ -1401,6 +1409,24 @@ private fun VitalsStatusLine() {
val db = remember { com.pulseloop.data.PulseLoopDatabase.getInstance(context) }
val guidance = rememberGuidance(db, Unit)
val off = guidance?.offSignals
if (com.pulseloop.ui.calm.NewLook.on) {
// The new look: the answer is the screen's statement, not a caption.
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
Text(tr("Last night"), style = com.pulseloop.ui.calm.CalmType.title, color = com.pulseloop.ui.calm.CalmColors.textSecondary)
Text(
when {
off == null -> " "
off.isEmpty() -> tr("All within your usual range")
else -> trf("Outside your usual: {0}", off.joinToString(", ") { it.title.lowercase() })
},
style = com.pulseloop.ui.calm.CalmType.sectionTitle,
color = if (off.isNullOrEmpty()) com.pulseloop.ui.calm.CalmColors.text else PulseColors.warning,
maxLines = 3,
overflow = androidx.compose.ui.text.style.TextOverflow.Ellipsis,
)
}
return
}
Text(
when {
off == null -> " "
Expand Down
87 changes: 87 additions & 0 deletions audits/2026-11-16-new-look-vitals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Audit: Vitals in the new look (2.16.8)

Date: 2026-11-16 · PR: see the PR linking this file · Auditor: Claude Code. impeccable was run with
the skill loaded (context with PRODUCT.md, `audit.native.md`, `critique.md`, `craft-floor.md`,
`android.md`); ux-user-flows, graphic-design-fundamentals and less-is-more were applied by hand from
their SKILL.md files.

## Scope

Vitals, behind Debug → New look. Today's pattern (statement first, calm cards) carried over, but
the charts stay: Vitals is the tab opened for the why, and each vital's chart or gauge is that
answer. `VitalCard` takes the calm chrome (12dp radius, hairline, 20dp padding, sentence-case
title and verdict, Inter 32sp value, a quiet "Estimated" badge). The status line becomes the
screen's statement ("Last night" / "All within your usual range" or "Outside your usual: HRV").
Page colour, 20dp gutter, 720dp cap and `CalmTypography` for the tab. Measuring is unchanged.

## ux-user-flows (§13 flow review checklist)

No flow changes: the same entry (Vitals tab), the same Measure control and sheet, the same cards
opening the same detail screens, the same Customize cards. States checked: loading (statement
holds its line, no cards before the first load), empty cards keep their "No … yet" text,
measuring, failed measurement, estimated values.

## impeccable

### Audit (native, from source; no emulator in this environment)

| # | Dimension | Score | Key finding |
|---|---|---|---|
| 1 | Accessibility | 3 | Verdict now a sentence-case word beside the coloured value; device check at font scale 1.3 owed. |
| 2 | Performance | 4 | Same lists and charts; no new work. |
| 3 | Appearance & theming | 3 | Cards and statement converted; Measure button and sheet, My Health card and Customize still old (NL-4). |
| 4 | Platform conformance | 4 | Unchanged controls. |
| 5 | Adaptivity | 4 | 720dp cap added. |
| | **Total** | **18/20** | |

### Critique (design review only; detector not applicable, native platform)

| # | Heuristic | Score | Key issue |
|---|---|---|---|
| 1 | Visibility of status | 4 | The answer is the headline, not a caption. |
| 2 | Match real world | 3 | "Outside your usual: HRV" names the metric plainly. |
| 3 | User control | 3 | Customize kept. |
| 4 | Consistency | 3 | Matches Today and Symptom Radar; old Measure button sits beside the new statement (NL-4). |
| 5 | Error prevention | 3 | Unchanged. |
| 6 | Recognition | 4 | Metric colour dots kept. |
| 7 | Flexibility | 3 | Unchanged. |
| 8 | Minimalist | 3 | Caps labels and dithered chip gone; charts kept on purpose. |
| 9 | Error recovery | 3 | Measurement failure copy unchanged. |
| 10 | Help | 3 | Info texts unchanged. |
| | **Total** | **32/40** | Good |

No P0 or P1. [P2] NL-4 extended: Measure button and sheet, My Health entry card.

## graphic-design-fundamentals (§13 checklist)

| # | Question | Result |
|---|---|---|
| 1 | Brief | The answer first, each vital's chart as the evidence. |
| 3 | Hierarchy | 20sp statement → 32sp value → chart. |
| 4 | Contrast | Calm tokens (text 17.3:1, secondary 7.0:1, muted 5.3:1 on card). |
| 5–6 | Alignment, spacing | 20dp gutter and card padding; 12dp between cards. |
| 7 | Typography | Inter on the tab; sizes on the scale. |
| 8 | Colour | Zone colours with the verdict's word; amber only for estimates and warnings. |
| 9 | Consistency | Same card as Today's rows and the radar. |
| 11 | Real-size test | pt-BR "Fora do seu normal: temperatura, VFC" wraps to three lines at most. |
| 13 | Production | No new assets. |

## less-is-more

| Element | Question (1–5) | Kept / moved / merged / removed, and where |
|---|---|---|
| Caps eyebrow titles and verdicts | 4 | Sentence case. |
| Dithered ESTIMATED chip | 4 | Quiet badge; the word stays. |
| Charts and gauges | 1 (helps now) | Kept: they are the tab's reason to exist. |

Taps on common actions unchanged (Measure 1, open a vital 1).

## Evidence

pt-BR missing-key check: none missing for new strings. No device here; on-device check owed.
Design canvas: the Vitals board in the new look is owed (canvas tools not connected this session).

## Verdict

Merge (behind the switch). Carried forward: NL-4 (old pieces inside converted tabs), the canvas
boards for Today and Vitals, the on-device check.
12 changes: 12 additions & 0 deletions docs/new-look-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,16 @@ couldn't reach that repo, so it is recorded here until it is moved there.

Still in the old style inside the new Today (convert with their own screens): the program chips,
Rest Mode line, bedtime, food and tag cards, the accuracy-check banner and the Customize controls.
- **Vitals** (behind the switch in `VitalsScreen`, `VitalCard`). The pattern Today set, without
taking the charts away: Vitals is the tab people open for the *why*, so each vital keeps its
full chart or gauge.
- "Last night" and the answer ("All within your usual range" / "Outside your usual: HRV") are
the screen's statement (20sp), beside the Measure button.
- `VitalCard` takes the calm card when the look is on: 12dp radius, hairline, 20dp padding,
sentence-case title and verdict, the value in Inter 32sp, and a quiet "Estimated" badge
(no dither) wherever a value is estimated.
- Page colour, the 20dp gutter, the 720dp cap and `CalmTypography` for the whole tab.

Still old-styled inside Vitals: the Measure button and its sheet, the ring gauges' own drawing,
the My Health entry card and the Customize controls.

Loading