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
20 changes: 19 additions & 1 deletion app/src/main/assets/i18n/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"%,d steps": "%,d passos",
"%,d steps a day": "%,d passos por dia",
"%,d steps yesterday vs your usual %,d": "%,d passos ontem vs. seus habituais %,d",
"+ Log meal": "+ Registrar refeição",
"+ Record Activity": "+ Registrar atividade",
"+%.1f °C from your usual": "+%.1f °C acima do seu habitual",
"+%.1f °C last night against your usual. Can come with illness, a late workout, alcohol or the menstrual cycle.": "+%.1f °C na noite passada em relação ao seu habitual. Pode acompanhar doença, treino tarde, álcool ou o ciclo menstrual.",
", about {0} kcal. Can we look at alternatives?": ", cerca de {0} kcal. Podemos ver alternativas?",
Expand Down Expand Up @@ -273,6 +275,7 @@
"CAPS AD": "CAPS AD",
"CDC suggests waiting at least 2 hours per standard drink before breastfeeding. It's an estimate: bodies differ, and pumping and dumping doesn't make it faster. Not drinking is the safest choice.": "O CDC sugere esperar pelo menos 2 horas por dose padrão antes de amamentar. É uma estimativa: cada corpo é diferente, e tirar o leite e descartar não acelera nada. Não beber é a escolha mais segura.",
"CDC suggests waiting at least 2 hours per standard drink before feeding. It's an estimate: bodies differ, and pumping and dumping doesn't make it faster. Not drinking is the safest choice.": "O CDC sugere esperar pelo menos 2 horas por dose padrão antes de amamentar. É uma estimativa: cada corpo é diferente, e tirar o leite e descartar não acelera nada. Não beber é a escolha mais segura.",
"COACH": "COACH",
"CVV (emotional support, 24 h)": "CVV (apoio emocional, 24 h)",
"CVV listens 24 hours a day, free and anonymous. In danger now, call SAMU.": "O CVV escuta 24 horas por dia, de graça e com sigilo. Se houver perigo agora, ligue para o SAMU.",
"CVV · 188": "CVV · 188",
Expand Down Expand Up @@ -384,6 +387,7 @@
"Cycling": "Ciclismo",
"DATA SOURCE": "FONTE DE DADOS",
"DETECTED · REVIEW": "DETECTADO · REVISAR",
"Daily": "Diário",
"Daily AI-generated health insights based on your ring data": "Insights de saúde diários gerados por IA com base nos dados do seu anel",
"Daily Check-in Notifications": "Notificações de check-in diário",
"Daily Goals": "Metas diárias",
Expand Down Expand Up @@ -472,6 +476,8 @@
"Duration held the score back": "A duração limitou a pontuação",
"Duration must be greater than zero.": "A duração deve ser maior que zero.",
"During the check, {0} wrote the same types to Health Connect. Exporting the ring's copy of those days now would count them twice.": "Durante a verificação, {0} gravou os mesmos tipos no Health Connect. Exportar agora a cópia do anel desses dias contaria tudo duas vezes.",
"EARLIER": "ANTERIORES",
"ESTIMATED": "ESTIMADO",
"Each night is compared with your own previous four weeks once there are two weeks to compare with. ": "Cada noite é comparada com suas próprias quatro semanas anteriores assim que houver duas semanas para comparar. ",
"Early bird": "Matutino",
"Early evening, when you're under 70% of your step goal. Off in Rest Mode.": "No início da noite, quando você estiver abaixo de 70% da sua meta de passos. Desativado no Modo Descanso.",
Expand Down Expand Up @@ -545,6 +551,7 @@
"Exporting all history can take a while on the first run.": "Exportar todo o histórico pode demorar um pouco na primeira vez.",
"Exporting…": "Exportando…",
"Extreme swelling of your hands or face": "Inchaço intenso nas mãos ou no rosto",
"FOOD": "ALIMENTAÇÃO",
"Factory Reset Ring": "Restaurar anel de fábrica",
"Factory reset erases all data stored on the ring itself and resets it to factory state. Your synced data in the app is kept.": "A restauração de fábrica apaga todos os dados armazenados no próprio anel e o retorna ao estado de fábrica. Seus dados sincronizados no app são mantidos.",
"Factory reset ring?": "Restaurar anel de fábrica?",
Expand Down Expand Up @@ -619,6 +626,7 @@
"Grounds suggestions in your city's current weather": "Baseia as sugestões no clima atual da sua cidade",
"Gym": "Academia",
"HELP": "AJUDA",
"HISTORY": "HISTÓRICO",
"HR collected": "HR coletada",
"HR pending": "HR pendente",
"HR, SpO₂, HRV & stress": "HR, SpO₂, HRV e estresse",
Expand Down Expand Up @@ -744,6 +752,7 @@
"Last 8 weeks": "Últimas 8 semanas",
"Last Sleep": "Último sono",
"Last check-in {0}: score {1} of 30": "Último check-in {0}: pontuação {1} de 30",
"Last import {0}": "Última importação {0}",
"Last night": "Ontem à noite",
"Last night's heart rate and HRV readings weren't enough to score recovery": "As leituras de frequência cardíaca e HRV da noite passada não foram suficientes para calcular a recuperação",
"Last night: {0}. A few dry nights will show what it does to you.": "Noite passada: {0}. Algumas noites sem álcool vão mostrar o efeito em você.",
Expand Down Expand Up @@ -1029,6 +1038,7 @@
"Overwhelming tiredness": "Cansaço extremo",
"Ovos mexidos": "Ovos mexidos",
"Own your ring data": "Seus dados do anel são seus",
"PAUSED": "PAUSADO",
"Pace": "Ritmo",
"Pair a ring to configure its all-day measurements.": "Pareie um anel para configurar as medições contínuas.",
"Pair your ring first.": "Pareie seu anel primeiro.",
Expand Down Expand Up @@ -1103,6 +1113,7 @@
"Quiet from": "Silêncio a partir de",
"Quiet hours schedule:": "Horário de silêncio:",
"Quiet until": "Silêncio até",
"READINGS": "LEITURAS",
"RECOVERY, WEEK BY WEEK": "RECUPERAÇÃO, SEMANA A SEMANA",
"REFERENCE ZONES": "ZONAS DE REFERÊNCIA",
"REM sleep": "Sono REM",
Expand Down Expand Up @@ -1195,6 +1206,7 @@
"Row counts include demo and real rows. Tap a table to see its newest rows. Stored health rows are never included in a diagnostics export.": "As contagens incluem linhas de demonstração e reais. Toque numa tabela para ver as linhas mais recentes. Dados de saúde armazenados nunca entram numa exportação de diagnóstico.",
"Running": "Corrida",
"SAMU (emergencies)": "SAMU (emergências)",
"SCORE": "PONTUAÇÃO",
"Salada verde com tomate": "Salada verde com tomate",
"Same as heart rate": "Igual à frequência cardíaca",
"Save": "Salvar",
Expand Down Expand Up @@ -1388,6 +1400,7 @@
"System default": "Padrão do sistema",
"Systolic": "Sistólica",
"TAP TO EDIT GOALS": "TOQUE PARA EDITAR AS METAS",
"TODAY": "HOJE",
"TODAY'S BRIEF": "RESUMO DE HOJE",
"Tag day": "Marcar dia",
"Tag yesterday": "Marcar ontem",
Expand Down Expand Up @@ -1475,6 +1488,7 @@
"Total sleep": "Sono total",
"Total workout time this week. Health guidelines suggest at least 150 minutes of moderate activity a week.": "Tempo total de treino nesta semana. As diretrizes de saúde sugerem pelo menos 150 minutos de atividade moderada por semana.",
"Track Bedtime / DND mode": "Monitorar modo Hora de dormir / Não perturbe",
"Track GPS route": "Rastrear rota por GPS",
"Track more nights this month to see a monthly average.": "Registre mais noites este mês para ver uma média mensal.",
"Tracked {0} {1} this year": "Este ano você registrou {0} {1}",
"Trails and elevation": "Trilhas e elevação",
Expand Down Expand Up @@ -1609,6 +1623,7 @@
"Workouts": "Treinos",
"Workouts / week": "Treinos / semana",
"Write Actions": "Ações de escrita",
"YESTERDAY": "ONTEM",
"YOUR GOAL": "SUA META",
"Year": "Ano",
"Yearly Sleep": "Sono anual",
Expand Down Expand Up @@ -1691,6 +1706,7 @@
"higher": "maior",
"hour": "hora",
"hours": "horas",
"kcal eaten": "kcal ingeridas",
"kg": "kg",
"lb": "lb",
"less": "menos",
Expand All @@ -1700,6 +1716,8 @@
"nights": "noites",
"no overlap": "sem sobreposição",
"not chosen": "não escolhido",
"nothing logged yet": "nada registrado ainda",
"of {0}": "de {0}",
"of {0} this week": "de {0} esta semana",
"resting HR {0}{1}": "HR em repouso {0}{1}",
"resting heart rate {0} bpm {1}": "frequência cardíaca em repouso {0} bpm {1}",
Expand Down Expand Up @@ -1798,4 +1816,4 @@
"±{0}m · {1} pts": "±{0}m · {1} pts",
"−%.1f °C from your usual": "−%.1f °C em relação ao seu habitual",
"≈ {0} kcal · {1} g protein · leaves {2} kcal": "≈ {0} kcal · {1} g de proteína · sobram {2} kcal"
}
}
15 changes: 14 additions & 1 deletion app/src/main/java/com/pulseloop/ui/PulseLoopApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.ViewModel
Expand Down Expand Up @@ -529,7 +531,18 @@ fun PulseLoopApp() {
contentDescription = null,
)
},
label = { Text(tab.label) },
// One line, a touch smaller than labelMedium: "Sinais vitais" wrapped to two
// lines and pushed its icon up out of line with the others. Items already
// share the width equally (NavigationBarItem weights itself 1f).
label = {
Text(
tab.label,
fontSize = 11.sp,
maxLines = 1,
softWrap = false,
overflow = TextOverflow.Ellipsis,
)
},
selected = selected,
onClick = { onTab(tab) },
colors = NavigationBarItemDefaults.colors(
Expand Down
16 changes: 12 additions & 4 deletions app/src/main/java/com/pulseloop/ui/components/AppChrome.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ fun AppHeader(
batteryPercent = batteryPercent,
idle = idle,
sourceLabel = sourceLabel,
modifier = Modifier.clickable(
// Bounded: the pill is measured before the weighted greeting, so an unbounded
// "Falha na sincronização" or "Oura · Health Connect" squeezed the greeting to nothing.
modifier = Modifier.widthIn(max = 168.dp).clickable(
onClickLabel = tr("Open ring settings"),
role = Role.Button,
onClick = onOpenSettings,
Expand Down Expand Up @@ -157,6 +159,7 @@ fun ConnectionStatusPill(
fontWeight = FontWeight.Medium,
color = PulseColors.textSecondary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
}
}
Expand Down Expand Up @@ -192,15 +195,19 @@ fun CardEyebrow(
.clip(CircleShape)
.background(dotColor),
)
// The label takes the free width (instead of a Spacer) so a long translated label wraps
// rather than pushing the trailing slot off the card; the slot is bounded for the same reason.
Text(
label.uppercase(),
fontSize = 11.sp,
fontWeight = FontWeight.Medium,
letterSpacing = 1.sp,
color = PulseColors.textSecondary,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.weight(1f),
)
Spacer(Modifier.weight(1f))
trailing?.invoke()
trailing?.let { Box(Modifier.widthIn(max = 180.dp)) { it() } }
}
}

Expand All @@ -214,8 +221,9 @@ fun SectionHeaderCaps(title: String, modifier: Modifier = Modifier, action: (@Co
fontWeight = FontWeight.SemiBold,
letterSpacing = 0.8.sp,
color = PulseColors.textSecondary,
// Takes the free width (instead of a Spacer) so a long title wraps beside the action.
modifier = Modifier.weight(1f),
)
Spacer(Modifier.weight(1f))
action?.invoke()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,15 @@ fun DeviceHeroCard(
fontSize = 13.sp,
color = status.statusTint,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
status.syncText?.let { syncText ->
Text(
syncText,
fontSize = 12.sp,
color = PulseColors.textSecondary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand All @@ -26,6 +27,7 @@ import androidx.compose.ui.graphics.drawscope.rotate
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.pulseloop.ui.theme.FairyMode
import kotlin.math.PI
Expand Down Expand Up @@ -87,7 +89,8 @@ fun FairyTransformOverlay() {
}
val textIn = ((p - 0.42f) / 0.18f).coerceIn(0f, 1f)
Column(
Modifier.alpha(textIn * veil).scale(0.7f + 0.3f * textIn),
// Side margin so a longer translation wraps short of the screen edge.
Modifier.padding(horizontal = 24.dp).alpha(textIn * veil).scale(0.7f + 0.3f * textIn),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ fun PrimaryButton(
Icon(icon, contentDescription = null, Modifier.size(18.dp))
Spacer(Modifier.width(8.dp))
}
Text(title, fontSize = 16.sp, fontWeight = FontWeight.SemiBold)
// Centered: a long translated title wraps to two lines inside the full-width button.
Text(title, fontSize = 16.sp, fontWeight = FontWeight.SemiBold, textAlign = TextAlign.Center)
}
}

Expand Down Expand Up @@ -92,7 +93,8 @@ fun SecondaryButton(
Icon(icon, contentDescription = null, Modifier.size(18.dp), tint = PulseColors.textSecondary)
Spacer(Modifier.width(8.dp))
}
Text(title, fontSize = 16.sp, fontWeight = FontWeight.SemiBold)
// Centered: a long translated title wraps to two lines inside the full-width button.
Text(title, fontSize = 16.sp, fontWeight = FontWeight.SemiBold, textAlign = TextAlign.Center)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
Expand Down Expand Up @@ -112,21 +112,23 @@ fun SettingsRow(item: SettingsRowItem) {
Icon(item.icon, contentDescription = null, Modifier.size(18.dp), tint = item.tint)
}

// The title takes the free width (it used to be unweighted beside a weighted Spacer, so a
// long translated title and a long trailing value — a model slug — fought for the row).
Text(
item.title,
fontSize = 16.sp,
color = PulseColors.textPrimary,
modifier = Modifier.weight(1f),
)

Spacer(Modifier.weight(1f))

item.trailingValue?.let { trailing ->
Text(
trailing,
fontSize = 14.sp,
color = PulseColors.textSecondary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.widthIn(max = 140.dp),
)
}

Expand Down
21 changes: 17 additions & 4 deletions app/src/main/java/com/pulseloop/ui/components/TodayTiles.kt
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ fun SleepTile(
color = PulseColors.textPrimary,
)
Text(
"SCORE",
tr("SCORE"),
fontSize = 10.sp,
fontWeight = FontWeight.SemiBold,
letterSpacing = 1.sp,
Expand Down Expand Up @@ -424,6 +424,7 @@ private fun ChipTone.border() = when (this) {
}

/** Full-width gradient hero card at the top of Today (HeroInsightCardView in Swift). */
@OptIn(ExperimentalLayoutApi::class)
@Composable
fun HeroInsightCard(title: String, summary: String, chips: List<ToneChip>, modifier: Modifier = Modifier) {
val shape = RoundedCornerShape(8.dp)
Expand All @@ -445,14 +446,20 @@ fun HeroInsightCard(title: String, summary: String, chips: List<ToneChip>, modif
modifier = Modifier.padding(top = 8.dp),
)
if (chips.isNotEmpty()) {
Row(Modifier.padding(top = 16.dp), horizontalArrangement = Arrangement.spacedBy(6.dp)) {
// Wraps: three translated chips ("Linha de base pendente", …) overflow one line.
FlowRow(
Modifier.padding(top = 16.dp),
horizontalArrangement = Arrangement.spacedBy(6.dp),
verticalArrangement = Arrangement.spacedBy(6.dp),
) {
chips.forEach { chip ->
Text(
chip.label,
fontSize = 12.sp,
fontWeight = FontWeight.Medium,
color = chip.tone.foreground(),
maxLines = 1,
overflow = TextOverflow.Ellipsis,
modifier = Modifier
.clip(CircleShape)
.dither(chip.tone.ditherColor(), if (chip.tone == ChipTone.NEUTRAL) 0.10f else 0.15f)
Expand All @@ -466,6 +473,7 @@ fun HeroInsightCard(title: String, summary: String, chips: List<ToneChip>, modif
}

/** Full-width coach card (COACH eyebrow, headline, body, chips) — CoachMessageCard in Swift. */
@OptIn(ExperimentalLayoutApi::class)
@Composable
fun CoachMessageCard(
headline: String,
Expand Down Expand Up @@ -493,7 +501,7 @@ fun CoachMessageCard(
.background(PulseColors.accent),
)
Text(
"COACH",
tr("COACH"),
fontSize = 10.sp,
fontWeight = FontWeight.Medium,
letterSpacing = 1.8.sp,
Expand All @@ -515,7 +523,12 @@ fun CoachMessageCard(
modifier = Modifier.padding(top = 6.dp),
)
if (chips.isNotEmpty()) {
Row(Modifier.padding(top = 10.dp), horizontalArrangement = Arrangement.spacedBy(8.dp)) {
// Wraps rather than ellipsising the third chip to nothing on a narrow phone.
FlowRow(
Modifier.padding(top = 10.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp),
verticalArrangement = Arrangement.spacedBy(6.dp),
) {
chips.take(3).forEach { chip ->
Text(
chip,
Expand Down
Loading
Loading