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
15 changes: 15 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1481,6 +1481,21 @@ serving, AI-estimate source); changing a number marks it `userEdited`, as a barc
- **The window theme is dark** (`Theme.PulseLoop`), so cold start doesn't flash white, and
predictive Back is on (`enableOnBackInvokedCallback`).

## The new look: behind a switch, one screen at a time

**Read this before restyling a screen.** Plan and tokens: `docs/new-look-plan.md`. The owner chose
(2026-11-16) a calmer, shadcn-style look for PulseLoop only: dark only, mint kept, Inter.

- **Its tokens and components are in `ui/calm/`.** A converted screen uses `CalmColors`,
`CalmType`, `CalmShape` and the `Calm*` components, never `PulseColors` greys or literal sizes.
Sizes stay on `PulseType.SCALE`, buttons are still `PulseButton`, text still goes through `tr()`.
- **`NewLook.on` decides, per screen.** Off by default until every screen has moved; then the
default flips and the old styling is deleted in one PR. Don't flip it early.
- **A state over time is a `StateTimeline`**, not a new chart. Its layout is `StateTimelineModel`,
which is pure and tested.
- **It departs from the design system on purpose.** Record that in the design-system repo's
`docs/divergences.md` when a session can reach it.

## Motion: one transition, a small vocabulary

- **Every navigation destination goes through `DitherTransitionBox`** (`theme/DitherTransition.kt`),
Expand Down
20 changes: 20 additions & 0 deletions app/src/main/assets/i18n/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@
"Below the typical resting range. Often fine, but worth noting if you feel faint.": "Abaixo da faixa típica em repouso. Geralmente tudo bem, mas vale atenção se você sentir tontura.",
"Beta-blockers": "Betabloqueadores",
"Beta-blockers lower heart rate; this is expected on that medication.": "Betabloqueadores reduzem a frequência cardíaca; isso é esperado com esse medicamento.",
"Biometrics under strain": "Biometria sob esforço",
"Blood": "Sangue",
"Blood Oxygen": "Oxigênio no sangue",
"Blood Pressure": "Pressão arterial",
Expand Down Expand Up @@ -631,6 +632,7 @@
"Enable Coach Check-Ins?": "Ativar check-ins do Coach?",
"Enable Nutrition Tracking": "Ativar registro de nutrição",
"Enable the AI Coach to change these — daily check-ins are written by the coach from your recent trends.": "Ative o Coach de IA para alterar isso — os check-ins diários são escritos pelo coach com base nas suas tendências recentes.",
"End Rest Mode": "Encerrar modo descanso",
"End must be after the start.": "O fim deve ser depois do início.",
"End now": "Encerrar agora",
"End session": "Encerrar sessão",
Expand Down Expand Up @@ -721,6 +723,7 @@
"Fell asleep": "Adormeceu",
"Female": "Feminino",
"Fever of 38 °C or higher": "Febre de 38 °C ou mais",
"Fewer steps": "Menos passos",
"Fewer steps than usual": "Menos passos que o normal",
"Filter models": "Filtrar modelos",
"Filter, e.g. claude": "Filtrar, ex.: claude",
Expand Down Expand Up @@ -839,6 +842,7 @@
"High fatigue": "Fadiga alta",
"High fatigue score. Wellness estimate from the ring.": "Pontuação de fadiga alta. Estimativa de bem-estar do anel.",
"High stress score. Wellness estimate, not a diagnosis.": "Pontuação de estresse alta. Estimativa de bem-estar, não um diagnóstico.",
"Higher": "Mais alto",
"Higher risk": "Risco maior",
"Hiking": "Trilha",
"Hormones": "Hormônios",
Expand Down Expand Up @@ -964,6 +968,7 @@
"Learning you · {0} of {1} nights": "Conhecendo você · {0} de {1} noites",
"Learning your baseline: {0} of {1} nights. Keep wearing your ring to bed.": "Aprendendo sua linha de base: {0} de {1} noites. Continue dormindo com o anel.",
"Learning your dry nights: {0} of {1}. Then PulseLoop shows what each drink does to your sleep.": "Aprendendo suas noites sem álcool: {0} de {1}. Depois o PulseLoop mostra o que cada bebida faz com seu sono.",
"Learning your normal": "Aprendendo o seu normal",
"Learning your normal: {0} of {1} nights.": "Aprendendo seu normal: {0} de {1} noites.",
"Learns your baseline": "Aprende sua linha de base",
"Leave": "Sair",
Expand Down Expand Up @@ -1027,6 +1032,7 @@
"Low fatigue — well recovered.": "Fadiga baixa — bem recuperado.",
"Low stress score — relaxed.": "Estresse baixo — relaxado.",
"Low systolic pressure (below 90).": "Pressão sistólica baixa (abaixo de 90).",
"Lower": "Mais baixo",
"Lower is calmer": "Quanto menor, mais calmo",
"Lower risk": "Risco menor",
"Lowest heart rate {0} before waking": "Frequência cardíaca mais baixa {0} antes de acordar",
Expand Down Expand Up @@ -1127,6 +1133,7 @@
"Never mind": "Deixa pra lá",
"New chat": "Nova conversa",
"New lab report": "Novo laudo",
"New look": "Novo visual",
"Next": "Próximo",
"Next day": "Próximo dia",
"Next period around {0} (in {1} day{2}), from your usual {3}-day cycle.": "Próxima menstruação por volta de {0} (em {1} dia{2}), com base no seu ciclo habitual de {3} dias.",
Expand Down Expand Up @@ -1167,6 +1174,7 @@
"No fatigue data yet — take a measurement.": "Ainda não há dados de fadiga — faça uma medição.",
"No goal set · {0} is a typical day": "Sem meta definida · {0} é um dia típico",
"No meals logged this week": "Nenhuma refeição registrada nesta semana",
"No night to read": "Nenhuma noite para ler",
"No nights tracked in this range yet.": "Nenhuma noite registrada neste período ainda.",
"No obvious signs in your biometrics of something straining your body.": "Nenhum sinal claro nos seus dados biométricos de algo sobrecarregando seu corpo.",
"No other app wrote readable data in the last {0} days.": "Nenhum outro app gravou dados legíveis nos últimos {0} dias.",
Expand Down Expand Up @@ -1230,6 +1238,7 @@
"Not this": "Não é isso",
"Not yet": "Ainda não",
"Notably below your typical HRV — often linked to stress, poor sleep, or strain.": "Bem abaixo da sua HRV habitual — muitas vezes ligado a estresse, sono ruim ou sobrecarga.",
"Nothing is outside your usual range.": "Nada está fora da sua faixa normal.",
"Nothing logged on this day.": "Nada registrado neste dia.",
"Nothing logged today yet.": "Nada registrado hoje ainda.",
"Nothing logged yet": "Nada registrado ainda",
Expand Down Expand Up @@ -1414,6 +1423,7 @@
"Ready to start the day? Take a measurement and I'll help you plan it.": "Pronto para começar o dia? Faça uma medição e eu ajudo você a planejá-lo.",
"Ready · {0}": "Pronto · {0}",
"Reasoning effort": "Nível de raciocínio",
"Recently": "Recentemente",
"Recommended": "Recomendado",
"Recompute": "Recalcular",
"Reconnect last ring": "Reconectar último anel",
Expand Down Expand Up @@ -1543,6 +1553,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: Symptom Radar.": "Telas que já usam o novo visual: Radar de sintomas.",
"Searching…": "Procurando…",
"See Raw Packets above.": "Veja Pacotes brutos acima.",
"See Ring Events above.": "Veja Eventos do anel acima.",
Expand Down Expand Up @@ -1593,6 +1604,8 @@
"Show fewer": "Mostrar menos",
"Show fewer events": "Mostrar menos eventos",
"Show key": "Mostrar chave",
"Show less": "Mostrar menos",
"Show more": "Mostrar mais",
"Show more events": "Mostrar mais eventos",
"Show phone-calibrated steps on Today": "Mostrar passos calibrados pelo celular em Hoje",
"Show readings": "Mostrar leituras",
Expand Down Expand Up @@ -1787,6 +1800,9 @@
"The model isn't available to download right now. Try again later.": "O modelo não está disponível para download agora. Tente mais tarde.",
"The next record starts at {0}.": "O próximo registro começa às {0}.",
"The previous record ends at {0}.": "O registro anterior termina às {0}.",
"The radar compares each night with your own usual. It starts after {0} nights; it has {1} so far.": "O radar compara cada noite com o seu normal. Ele começa depois de {0} noites; até agora tem {1}.",
"The radar compares last night's temperature, resting heart rate, heart rate variability, breathing and the day's activity with your own usual over the past four weeks. Several moving the wrong way together is what it looks for.": "O radar compara a temperatura, a frequência cardíaca em repouso, a variabilidade da frequência cardíaca e a respiração da última noite, e a atividade do dia, com o seu normal das últimas quatro semanas. Ele procura vários deles mudando na direção errada ao mesmo tempo.",
"The radar reads a night of sleep from your ring. Wear it to bed and it will have one.": "O radar lê uma noite de sono do seu anel. Durma com ele e ela vai aparecer aqui.",
"The report covers the days so far. You'll then choose what happens to the paused Health Connect export.": "O relatório abrange os dias até agora. Depois você escolherá o que acontece com a exportação pausada para o Health Connect.",
"The report printed no range for this marker.": "O laudo não trouxe faixa de referência para este marcador.",
"The ring didn't come back. Keep it near the phone and try again.": "O anel não voltou. Deixe-o perto do celular e tente de novo.",
Expand Down Expand Up @@ -1868,11 +1884,13 @@
"Trim this record, or extend it over time the ring missed. Added time counts as asleep but has no stage, so it stays out of the stage breakdown and score.": "Recorte este registro ou estenda-o sobre o tempo que o anel não registrou. O tempo adicionado conta como sono, mas não tem fase, então fica fora da divisão por fases e da pontuação.",
"Trouble breathing, chest pain or a racing heart": "Falta de ar, dor no peito ou coração acelerado",
"Try again": "Tentar novamente",
"Try the new look": "Experimentar o novo visual",
"Turn off": "Desativar",
"Turn off Drinks": "Desativar Bebidas",
"Turn off Drinks?": "Desativar Bebidas?",
"Turn on": "Ativar",
"Turn on Bluetooth to find and connect your ring.": "Ative o Bluetooth para encontrar e conectar seu anel.",
"Turn on Rest Mode": "Ativar modo descanso",
"Two hours after against two hours before, over {0} sessions. Readings during a session aren't counted: slow breathing raises HRV while it lasts.": "Duas horas depois comparadas com duas horas antes, em {0} sessões. Leituras durante a sessão não contam: a respiração lenta eleva a HRV enquanto dura.",
"Two-hour 140–199 is above the typical range.": "Duas horas após: 140–199 está acima da faixa típica.",
"Two-hour post-meal normal is up to 140 mg/dL.": "O normal duas horas após a refeição é até 140 mg/dL.",
Expand Down Expand Up @@ -2257,6 +2275,8 @@
"{0} workouts a week": "{0} treinos por semana",
"{0} years": "{0} anos",
"{0} {1} in the last 7 days": "{0} {1} nos últimos 7 dias",
"{0} {1}, higher than your usual {2}": "{0} {1}, acima do seu normal de {2}",
"{0} {1}, lower than your usual {2}": "{0} {1}, abaixo do seu normal de {2}",
"{0} · ring {1} · {2} {3}": "{0} · anel {1} · {2} {3}",
"{0} · the lab's range is {1}": "{0} · a faixa do laboratório é {1}",
"{0} · {1}": "{0} · {1}",
Expand Down
92 changes: 92 additions & 0 deletions app/src/main/assets/licenses/inter-ofl.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL

-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION AND CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
1 change: 1 addition & 0 deletions app/src/main/java/com/pulseloop/PulseLoopApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class PulseLoopApplication : Application() {
// so a Bedtime flag left on under a switched-off schedule is cleared rather than reread.
com.pulseloop.settings.QuietHoursPrefs.migrateIndependentBedtime(this)
com.pulseloop.service.DrinkPrefs.init(this)
com.pulseloop.ui.calm.NewLook.load(this)
com.pulseloop.service.Postpartum.init(this)
com.pulseloop.service.LabPrefs.init(this)
com.pulseloop.ui.theme.FairyMode.init(this)
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/java/com/pulseloop/service/HealthInsights.kt
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,17 @@ object SymptomRadar {
}
}

/**
* The radar for each of the last [days] days, oldest first, by running [compute] as of each
* day: the "Recently" timeline. A day with no night recorded is absent, not "no signs".
* Pure: the nights already carry everything [compute] reads.
*/
fun history(nights: List<Night>, today: LocalDate, days: Int): List<Pair<LocalDate, Result>> =
(days - 1 downTo 0).mapNotNull { back ->
val d = today.minusDays(back.toLong())
compute(nights, d)?.let { d to it }
}

/** Today's radar: "major" only when the night before also showed signs. */
fun compute(nights: List<Night>, today: LocalDate): Result? {
val sorted = nights.sortedBy { it.day }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,13 @@ object HealthInsightsRepository {
val workoutWindows: List<LongRange>,
/** Today's cardio load against the user's quiet waking HR; null until 3 days of data. */
val cardioLoad: CardioLoad.Result? = null,
/** The radar as of each recent day, oldest first: the "Recently" timeline. */
val radarHistory: List<Pair<LocalDate, SymptomRadar.Result>> = emptyList(),
)

private const val DAY = 86_400_000L
/** Five weeks, as the timeline shows. */
const val RADAR_HISTORY_DAYS = 35

suspend fun load(db: PulseLoopDatabase, now: Long = System.currentTimeMillis(), zone: ZoneId = ZoneId.systemDefault()): Snapshot {
val inputs = ReadinessRepository.loadInputs(db, now, zone)
Expand All @@ -159,6 +163,7 @@ object HealthInsightsRepository {
)
}
val radar = SymptomRadar.compute(radarNights, today)
val radarHistory = SymptomRadar.history(radarNights, today, RADAR_HISTORY_DAYS)

// Stress: today's daytime readings, and 14 days for resilience.
val stressRows = db.measurementDao().rangeReal(MeasurementKind.STRESS.name, start(today.minusDays(14)), now)
Expand Down Expand Up @@ -253,7 +258,7 @@ object HealthInsightsRepository {
CardioLoad.compute(hr29, { t -> nightRanges.any { t in it } }, today, zone, profile?.age)
}.getOrNull()

return Snapshot(nights, need, debt, radar, todayStress, resilience, bodyClock, cardio, areas, habits, hrToday, sleepWindows, workoutWindows, cardioLoad)
return Snapshot(nights, need, debt, radar, todayStress, resilience, bodyClock, cardio, areas, habits, hrToday, sleepWindows, workoutWindows, cardioLoad, radarHistory)
}

/** Sleep need, debt and body clock: what the Sleep tab shows under last night. */
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/com/pulseloop/ui/PulseLoopApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ fun PulseLoopApp() {
onBack = { navController.popBackStack() },
onBreathe = { navController.navigate("breathe") },
onWhatChanged = { navController.navigate("what_changed") },
onRadar = { navController.navigate("radar") },
onCycle = { navController.navigate("cycle") },
onMeds = { navController.navigate("meds") },
onPostpartum = { navController.navigate("postpartum") },
Expand Down Expand Up @@ -940,6 +941,9 @@ fun PulseLoopApp() {
paddedComposable("cycle") {
com.pulseloop.ui.screens.CycleScreen(onBack = { navController.popBackStack() })
}
paddedComposable("radar") {
com.pulseloop.ui.screens.SymptomRadarScreen(onBack = { navController.popBackStack() })
}
paddedComposable("what_changed") {
com.pulseloop.ui.screens.WhatChangedScreen(onBack = { navController.popBackStack() })
}
Expand Down
Loading
Loading