style: prettier across W7b surfaces

This commit is contained in:
Marc-André Bombeck committed 2026-05-14 13:19:17 +02:00
1 parent 85c3def94f
commit 16fbdbcb87
4 files changed
+19 -8

No files matched your search

+5 -1
View File
@@ -152,7 +152,11 @@ export function TrendsRow({ annotations, confidence }: TrendsRowProps) {
data-metric="mood"
className="flex h-full min-h-[300px] flex-col gap-2"
>
<MoodChart title={t("charts.mood")} mini userTimezone={userTimezone} />
<MoodChart
title={t("charts.mood")}
mini
userTimezone={userTimezone}
/>
<TrendAnnotation
metric="mood"
annotation={moodAnnotation}
+6 -1
View File
@@ -404,7 +404,12 @@ export async function buildCoachSnapshot(
if (wantsBp && features.bloodPressure) {
const sysRows = byType("BLOOD_PRESSURE_SYS");
const diaRows = byType("BLOOD_PRESSURE_DIA");
const recentDaily = buildDailyBpRows(sysRows, diaRows, recentCutoff, userTz);
const recentDaily = buildDailyBpRows(
sysRows,
diaRows,
recentCutoff,
userTz,
);
const olderSys = sysRows.filter((r) => r.measuredAt < recentCutoff);
const olderDia = diaRows.filter((r) => r.measuredAt < recentCutoff);
snapshot.bloodPressure = {
+5 -5
View File
@@ -47,7 +47,10 @@ describe("moodDateKey", () => {
"2026-05-15",
);
expect(
moodDateKey(new Date("2026-05-14T22:00:00Z"), undefined as unknown as string),
moodDateKey(
new Date("2026-05-14T22:00:00Z"),
undefined as unknown as string,
),
).toBe("2026-05-15");
});
});
@@ -73,10 +76,7 @@ describe("effectiveMoodTz", () => {
describe("read-path interpretation of legacy vs new rows", () => {
// Build a row's day-key the way the route writes it: write the
// instant `moodLoggedAt`, anchored to the row's resolved tz.
function bucketFor(row: {
moodLoggedAt: Date;
tz: string | null;
}): string {
function bucketFor(row: { moodLoggedAt: Date; tz: string | null }): string {
return moodDateKey(row.moodLoggedAt, effectiveMoodTz(row));
}
+3 -1
View File
@@ -52,6 +52,8 @@ export function moodDateKey(date: Date, tz: string): string {
* non-null `tz` column takes precedence; legacy rows fall back to
* Europe/Berlin.
*/
export function effectiveMoodTz(row: { tz: string | null | undefined }): string {
export function effectiveMoodTz(row: {
tz: string | null | undefined;
}): string {
return row.tz && row.tz.length > 0 ? row.tz : DEFAULT_TIMEZONE;
}