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
7 changes: 6 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ days / 36 sleep sessions to zero. **iOS has no connect-time demo purge anywhere*
deletion of seeded rows is user-initiated inside `SeedData`, and it handles the demo/real mix by
*detecting* it (`isDemo`, `source == "mock"`, `DataFreshness.demo`) and adapting the UI. Demo data
coexisting with a real ring is an expected state. Demo rows are retired only from
Settings → Privacy & Data → Clear Demo Data.
Settings → Backup & data → Clear Demo Data.

`ConnectPurge` now has exactly **one** member, `NOTHING`, and the single-branch `when`s that switch
on it in `EventPersistenceSubscriber` and `EventPersistenceIdentityTest` read as dead code but are
Expand Down Expand Up @@ -1116,5 +1116,10 @@ clutter came from ignoring one of them:
on Postpartum stays even though Drinks has one: "can I feed now?" is asked on that screen.
- **Notifications are reachable whether or not the coach is on.** Most of them (daily guidance,
battery alerts) never needed it, and gating the row on the coach hid them all.
- **Settings groups are jobs, named as jobs** (`SettingsScreen`): My ring, Notifications, Goals &
tracking, AI Coach, Connected apps, Me, Data & privacy. A new setting goes where someone
arriving with that job would look — sleep-hour rules sit with the sleep goal, every unit sits
on the profile, the ring is unpaired from Ring & sync only — and a content screen is never a
Settings row (Drinks used to be one).
- **A goal saved anywhere goes through `GoalSync.afterManualSave`** — it is what stops the field
following the coach, sends the step goal to the ring and republishes the widget.
17 changes: 16 additions & 1 deletion app/src/main/assets/i18n/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"A nudge about 30 minutes before your suggested bedtime.": "Um lembrete cerca de 30 minutos antes do horário sugerido para dormir.",
"A painful, red or swollen leg or arm": "Uma perna ou braço dolorido, vermelho ou inchado",
"A record for you and your doctor. PulseLoop doesn't check interactions or doses; ask your pharmacist.": "Um registro para você e seu médico. O PulseLoop não verifica interações nem doses; consulte seu farmacêutico.",
"A ring is paired. Forget it in Settings → Wearable first: the two would count the same steps and nights.": "Há um anel pareado. Esqueça-o primeiro em Configurações → Wearable: os dois contariam os mesmos passos e noites.",
"A ring is paired. Forget it in Settings → Ring & sync first: the two would count the same steps and nights.": "Há um anel pareado. Esqueça-o primeiro em Configurações → Anel e sincronização: os dois contariam os mesmos passos e noites.",
"A screening questionnaire, not a diagnosis.": "Um questionário de rastreamento, não um diagnóstico.",
"A solid active day so far.": "Um dia ativo e consistente até agora.",
"A steady week. Keep it up.": "Uma semana estável. Continue assim.",
Expand Down Expand Up @@ -219,6 +219,7 @@
"Back up now": "Fazer backup agora",
"Backend proxy": "Proxy de backend",
"Backing up…": "Fazendo backup…",
"Backup & data": "Backup e dados",
"Balance Macros (30/40/30)": "Equilibrar macros (30/40/30)",
"Banana": "Banana",
"Barcode": "Código de barras",
Expand All @@ -244,6 +245,7 @@
"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.",
"Blood Pressure": "Pressão arterial",
"Blood glucose": "Glicose no sangue",
"Blood oxygen": "Oxigênio no sangue",
"Blood oxygen (SpO₂)": "Oxigênio no sangue (SpO₂)",
"Blood oxygen (SpO₂) is the percentage of oxygen your blood carries. 95–100% is normal; altitude and lung conditions can lower it.": "O oxigênio no sangue (SpO₂) é a porcentagem de oxigênio que seu sangue transporta. De 95 a 100% é normal; altitude e problemas pulmonares podem reduzi-lo.",
Expand Down Expand Up @@ -343,6 +345,7 @@
"Connect Strava": "Conectar Strava",
"Connect ring": "Conectar anel",
"Connected": "Conectado",
"Connected apps": "Apps conectados",
"Connected as {0}. Workouts sync automatically when finished.": "Conectado como {0}. Os treinos são sincronizados automaticamente ao terminar.",
"Connected to {0}": "Conectado a {0}",
"Connected · {0}%": "Conectado · {0}%",
Expand Down Expand Up @@ -403,6 +406,7 @@
"Daily or almost daily": "Diariamente ou quase",
"Daily targets": "Metas diárias",
"Dance": "Dança",
"Data & privacy": "Dados e privacidade",
"Data Backup": "Backup de dados",
"Data Types": "Tipos de dados",
"Data behind this score": "Dados por trás desta pontuação",
Expand Down Expand Up @@ -443,6 +447,7 @@
"Demo Data": "Dados de demonstração",
"Describe": "Descrever",
"Describe your meal": "Descreva sua refeição",
"Destructive actions: reset app data, or unpair the ring and reset. To only forget the ring, use Ring & sync.": "Ações destrutivas: redefinir os dados do app, ou desparear o anel e redefinir. Para apenas esquecer o anel, use Anel e sincronização.",
"Destructive actions: unpair the ring, factory-reset app data, or both.": "Ações destrutivas: desparear o anel, redefinir os dados do app ou ambos.",
"Details": "Detalhes",
"Detect server & configure": "Detectar servidor e configurar",
Expand Down Expand Up @@ -620,6 +625,8 @@
"Goal met on {0} of the last {1} days": "Meta atingida em {0} dos últimos {1} dias",
"Goal progress: ": "Progresso da meta: ",
"Goals": "Metas",
"Goals & sleep": "Metas e sono",
"Goals & tracking": "Metas e acompanhamento",
"Goals, scores and Health Connect keep the ring's own count.": "Metas, pontuações e Health Connect mantêm a contagem do próprio anel.",
"Good": "Bom",
"Good afternoon": "Boa tarde",
Expand Down Expand Up @@ -665,6 +672,7 @@
"Heart rate stayed at your quiet level with no steps": "A frequência cardíaca ficou no seu nível tranquilo, sem passos",
"Heart rate up to {0} bpm": "Frequência cardíaca até {0} bpm",
"Heart rate variability": "Variabilidade da frequência cardíaca",
"Heart rate variability (HRV)": "Variabilidade da frequência cardíaca (VFC)",
"Heart rate when active": "Frequência cardíaca em atividade",
"Heart rate {0} → {1} bpm": "Frequência cardíaca {0} → {1} bpm",
"Heart-rate readings": "Leituras de frequência cardíaca",
Expand Down Expand Up @@ -852,6 +860,7 @@
"Max": "Máx.",
"Max tokens": "Máximo de tokens",
"Maçã": "Maçã",
"Me": "Eu",
"Meal": "Refeição",
"Meal details": "Detalhes da refeição",
"Meal name": "Nome da refeição",
Expand Down Expand Up @@ -905,6 +914,7 @@
"Move {0} up": "Mover {0} para cima",
"My Health": "Minha saúde",
"My Health & Trends": "Minha saúde e tendências",
"My ring": "Meu anel",
"NEXT MEAL IDEA · {0}": "IDEIA PARA A PRÓXIMA REFEIÇÃO · {0}",
"NUTRITION": "NUTRIÇÃO",
"Name": "Nome",
Expand Down Expand Up @@ -1058,6 +1068,7 @@
"Overwhelming tiredness": "Cansaço extremo",
"Ovos mexidos": "Ovos mexidos",
"Own your ring data": "Seus dados do anel são seus",
"Oxygen saturation (SpO₂)": "Saturação de oxigênio (SpO₂)",
"PAUSED": "PAUSADO",
"Pace": "Ritmo",
"Pair a ring to configure its all-day measurements.": "Pareie um anel para configurar as medições contínuas.",
Expand Down Expand Up @@ -1215,6 +1226,7 @@
"Ride it out": "Aguentar firme",
"Right at your limit": "Exatamente no seu limite",
"Right at your usual {0} bpm": "Exatamente no seu habitual de {0} bpm",
"Ring & sync": "Anel e sincronização",
"Ring Events": "Eventos do anel",
"Ring battery alerts": "Alertas de bateria do anel",
"Ring blood pressure is an estimate. Calibrate against a validated cuff in Settings → Calibration, and talk to a clinician about persistent high or low readings.": "A pressão arterial do anel é uma estimativa. Calibre com um medidor de braço validado em Configurações → Calibração e converse com um profissional de saúde sobre leituras persistentemente altas ou baixas.",
Expand Down Expand Up @@ -1382,6 +1394,7 @@
"Step progress": "Progresso de passos",
"Step {0} of {1}": "Etapa {0} de {1}",
"Steps": "Passos",
"Steps & activity": "Passos e atividade",
"Steps a day": "Passos por dia",
"Steps collected": "Passos coletados",
"Steps {0}{1}%": "Passos {0}{1}%",
Expand Down Expand Up @@ -1577,6 +1590,7 @@
"Usual": "Habitual",
"Usual price of a drink (optional)": "Preço habitual de uma bebida (opcional)",
"Usual sleep midpoint {0} · this week {1}": "Ponto médio habitual do sono {0} · esta semana {1}",
"VO₂ max": "VO₂ máx",
"Variable nights": "Noites irregulares",
"Version": "Versão",
"Very high": "Muito alto",
Expand Down Expand Up @@ -1803,6 +1817,7 @@
"{0} of {1} heart-rate readings from {2} match your ring exactly. ": "{0} de {1} leituras de frequência cardíaca de {2} coincidem exatamente com seu anel. ",
"{0} of {1} heart-rate samples match your ring exactly. This looks like PulseLoop's own data coming back — check that the app syncs from your watch only, not from Health Connect.": "{0} de {1} amostras de frequência cardíaca batem exatamente com o seu anel. Parecem ser dados do próprio PulseLoop voltando — confira se o app sincroniza só do seu relógio, não do Health Connect.",
"{0} of {1} nights tracked": "{0} de {1} noites registradas",
"{0} of {1} on": "{0} de {1} ativados",
"{0} of {1} tracked": "{0} de {1} registrados",
"{0} over your limit": "{0} acima do seu limite",
"{0} packets captured": "{0} pacotes capturados",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ fun HealthConnectSourceContent(onEnabled: (() -> Unit)? = null) {
// Still reading the ring row and the grants: show neither the warning nor the button yet.
} else if (hasRing && !enabled) {
Text(
tr("A ring is paired. Forget it in Settings → Wearable first: the two would count the same steps and nights."),
tr("A ring is paired. Forget it in Settings → Ring & sync first: the two would count the same steps and nights."),
fontSize = 12.sp, color = PulseColors.warning,
)
} else if (!canRead) {
Expand Down
136 changes: 75 additions & 61 deletions app/src/main/java/com/pulseloop/ui/screens/SettingsScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -125,96 +125,110 @@ fun SettingsScreen(
onSetUp = { navigate("pairing") },
)

// AI COACH. Notifications sit under General, not here: most of them (daily guidance,
// battery alerts) work without the coach and were unreachable while it was off.
// Grouped by the job people arrive with (fix my ring, silence a reminder, change a goal,
// set up the coach, connect an app, edit my details, back up), each named as that job.
SettingsSection(
title = tr("AI Coach"),
rows = listOf(
SettingsRowItem(Icons.Filled.AutoAwesome, PulseColors.accent, tr("AI Coach"), coachTrailing) {
navigate("settings/coach")
},
),
)

// GENERAL — Physiology sits under User Profile (iOS SettingsView General group), feeding the
// optional inputs that tune the vitals reference ranges. Measurement Frequency sits under
// Physiology — only rings that expose a configurable measurement interval (Colmi) declare
// MEASUREMENT_INTERVAL, so the generic 56ff jring never shows this row (iOS #74: dropped the
// old ring-only "Device" section for this since the row had no other members).
SettingsSection(
title = tr("General"),
title = tr("My ring"),
rows = buildList {
add(SettingsRowItem(Icons.Filled.AccountCircle, PulseColors.accent, tr("User Profile")) {
navigate("settings/profile")
})
add(SettingsRowItem(Icons.Filled.MonitorHeart, PulseColors.hrv, tr("Physiology")) {
navigate("settings/physiology")
})
add(SettingsRowItem(Icons.Filled.NotificationsActive, PulseColors.warning, tr("Notifications")) {
navigate("settings/checkins")
})
add(SettingsRowItem(Icons.Filled.Language, PulseColors.info, tr("Language"), com.pulseloop.ui.i18n.L10n.language.let { if (it == com.pulseloop.ui.i18n.AppLanguage.SYSTEM) tr("System default") else it.label }) {
navigate("settings/language")
add(SettingsRowItem(Icons.Filled.Watch, PulseColors.accent, tr("Ring & sync")) {
navigate("settings/wearable")
})
if (capabilities.contains(WearableCapability.MEASUREMENT_INTERVAL)) {
add(SettingsRowItem(Icons.Filled.Timer, PulseColors.spo2, tr("Measurement Frequency")) {
navigate("settings/measurement")
})
}
// Calibration is jring-only (Colmi rings measure neither BP nor blood sugar).
if (capabilities.contains(WearableCapability.BLOOD_PRESSURE) ||
capabilities.contains(WearableCapability.BLOOD_SUGAR)
) {
add(SettingsRowItem(Icons.Filled.Tune, PulseColors.bloodPressure, tr("Calibration")) {
navigate("settings/calibration")
})
}
add(SettingsRowItem(Icons.Filled.Watch, PulseColors.info, tr("Use without a ring")) {
navigate("settings/hc-source")
})
},
)

// METRICS
// Always reachable: most notifications (daily guidance, battery alerts) work without the
// coach, and gating this row on it once hid them all.
SettingsSection(
title = tr("Metrics"),
title = tr("Notifications"),
rows = listOf(
SettingsRowItem(Icons.Filled.TrackChanges, PulseColors.readiness, tr("Goals")) {
SettingsRowItem(Icons.Filled.NotificationsActive, PulseColors.warning, tr("Notifications")) {
navigate("settings/checkins")
},
),
)

SettingsSection(
title = tr("Goals & tracking"),
rows = listOf(
SettingsRowItem(Icons.Filled.TrackChanges, PulseColors.readiness, tr("Goals & sleep")) {
navigate("settings/goals")
},
SettingsRowItem(Icons.Filled.RestaurantMenu, PulseColors.calories, tr("Nutrition")) {
navigate("settings/nutrition")
},
SettingsRowItem(Icons.Filled.LocalBar, PulseColors.drinks, tr("Drinks")) {
navigate("drinks")
),
)

SettingsSection(
title = tr("AI Coach"),
rows = listOf(
SettingsRowItem(Icons.Filled.AutoAwesome, PulseColors.accent, tr("AI Coach"), coachTrailing) {
navigate("settings/coach")
},
),
)

// RESOURCES — Calibration is jring-only (Colmi rings measure neither BP nor blood
// sugar); Developer is hidden until unlocked by tapping the version 7× in About.
SettingsSection(
title = tr("Resources"),
rows = buildList {
if (capabilities.contains(WearableCapability.BLOOD_PRESSURE) ||
capabilities.contains(WearableCapability.BLOOD_SUGAR)
) {
add(SettingsRowItem(Icons.Filled.Tune, PulseColors.bloodPressure, tr("Calibration")) {
navigate("settings/calibration")
})
}
if (developerUnlocked) {
add(SettingsRowItem(Icons.Filled.BugReport, PulseColors.danger, tr("Developer")) {
navigate("debug")
})
}
add(SettingsRowItem(Icons.Filled.Shield, PulseColors.success, tr("Privacy & Data")) {
navigate("settings/privacy")
})
add(SettingsRowItem(Icons.Filled.TrendingUp, PulseColors.calories, tr("Strava")) {
navigate("settings/strava")
})
add(SettingsRowItem(Icons.Filled.Sync, PulseColors.success, tr("Health Connect")) {
title = tr("Connected apps"),
rows = listOf(
SettingsRowItem(Icons.Filled.Sync, PulseColors.success, tr("Health Connect")) {
navigate("settings/health-connect")
})
add(SettingsRowItem(Icons.Filled.Watch, PulseColors.info, tr("Use without a ring")) {
navigate("settings/hc-source")
})
add(SettingsRowItem(Icons.Filled.Verified, PulseColors.info, tr("Accuracy check"), accuracyTrailing) {
},
SettingsRowItem(Icons.Filled.TrendingUp, PulseColors.calories, tr("Strava")) {
navigate("settings/strava")
},
SettingsRowItem(Icons.Filled.Verified, PulseColors.info, tr("Accuracy check"), accuracyTrailing) {
navigate("settings/accuracy-check")
},
),
)

SettingsSection(
title = tr("Me"),
rows = listOf(
SettingsRowItem(Icons.Filled.AccountCircle, PulseColors.accent, tr("User Profile")) {
navigate("settings/profile")
},
SettingsRowItem(Icons.Filled.MonitorHeart, PulseColors.hrv, tr("Physiology")) {
navigate("settings/physiology")
},
SettingsRowItem(Icons.Filled.Language, PulseColors.info, tr("Language"), com.pulseloop.ui.i18n.L10n.language.let { if (it == com.pulseloop.ui.i18n.AppLanguage.SYSTEM) tr("System default") else it.label }) {
navigate("settings/language")
},
),
)

// Developer is hidden until unlocked by tapping the version 7× in About.
SettingsSection(
title = tr("Data & privacy"),
rows = buildList {
add(SettingsRowItem(Icons.Filled.Shield, PulseColors.success, tr("Backup & data")) {
navigate("settings/privacy")
})
add(SettingsRowItem(Icons.Filled.Info, PulseColors.textMuted, tr("About PulseLoop")) {
navigate("settings/about")
})
if (developerUnlocked) {
add(SettingsRowItem(Icons.Filled.BugReport, PulseColors.danger, tr("Developer")) {
navigate("debug")
})
}
},
)

Expand Down
Loading
Loading