mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
style: prettier across W7b surfaces
This commit is contained in:
1 parent
85c3def94f
commit
16fbdbcb87
4 files changed
+19
-8
No files matched your search
@@ -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}
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user