mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 15:23:29 +00:00
chore(release): v1.4.38
Robustness sweep, perf hotspots, full localization, coach gate cascade closure. - /api/dashboard/summary cold-mount 4.6 s → ~500 ms via DAY-bucket sparkline + 60 s response cache. - Coach API gate inventory test surfaced and closed two orphan routes (chat[id] GET+DELETE, chat-message feedback POST). - Cross-tz fast-path runtime guard falls back to live for users more than ±3 h from UTC; proper bucket minting stays v1.5. - es / fr / it / pl coverage 27 % → 63 % (~3 400 new strings) plus three medication-cluster placeholder restorations. - IANA timezone validation closes the User.timezone self-DoS regression the new dashboard SQL would have surfaced. - Unit suite 4520 → 4524. See CHANGELOG.md for the full set.
This commit is contained in:
1 parent
fe64f66c7f
commit
a550031a84
66 files changed
+7910
-3717
No files matched your search
@@ -165,6 +165,17 @@ export function MedicationIntakeQuickAdd({
|
||||
const json = await res.json();
|
||||
return json.data as MedicationOption[];
|
||||
},
|
||||
// v1.4.38 — share the parent dashboard's medications cache.
|
||||
// `queryKeys.medications()` resolves to `["medications"]` — the
|
||||
// same key the dashboard's onboarding checklist subscriber holds.
|
||||
// Without a staleTime the sheet-mount triggers a fresh
|
||||
// `/api/medications` GET on every open even when the parent cache
|
||||
// already has current data. Match the dashboard's 60s window and
|
||||
// skip the refetch-on-mount so opening the sheet inside the TTL
|
||||
// reads straight from the React-Query cache.
|
||||
staleTime: 60_000,
|
||||
refetchOnMount: false,
|
||||
refetchOnWindowFocus: false,
|
||||
});
|
||||
|
||||
const medications = useMemo(
|
||||
@@ -297,9 +308,18 @@ export function MedicationIntakeQuickAdd({
|
||||
);
|
||||
|
||||
// Empty-state branch: the user has no active medications. Render a
|
||||
// hint + CTA into the body so the user has a single tap into the
|
||||
// medication-creation surface. The form itself is suppressed so we
|
||||
// don't ship an unusable Save button.
|
||||
// hint into the body and promote the "Medikament anlegen" CTA into
|
||||
// the sheet footer slot so the primary action lives where the user
|
||||
// expects it (matches the populated form's Save-button slot). The
|
||||
// form itself is suppressed so we don't ship an unusable Save
|
||||
// button.
|
||||
//
|
||||
// v1.4.38 W-D P2-1 — symmetry fix. The previous shape rendered the
|
||||
// CTA in the body and a footer with only the Close button, which
|
||||
// read as the dialog losing a save button. Now the body carries the
|
||||
// hint and the footer carries `<Cancel> <Link asChild>Medikament
|
||||
// anlegen</Link>` so the footer-slot promise holds across both
|
||||
// branches.
|
||||
if (!medicationsLoading && medications.length === 0) {
|
||||
const emptyFooter = (
|
||||
<div className="flex w-full items-center justify-end gap-2">
|
||||
@@ -310,9 +330,14 @@ export function MedicationIntakeQuickAdd({
|
||||
onClick={onCancel}
|
||||
className="min-h-11 sm:min-h-9"
|
||||
>
|
||||
{t("common.close")}
|
||||
{t("common.cancel")}
|
||||
</Button>
|
||||
)}
|
||||
<Button asChild className="min-h-11 sm:min-h-9">
|
||||
<Link href="/medications">
|
||||
{t("dashboard.medicationIntakeQuickAdd.emptyCta")}
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
@@ -332,16 +357,6 @@ export function MedicationIntakeQuickAdd({
|
||||
{t("dashboard.medicationIntakeQuickAdd.emptyDescription")}
|
||||
</p>
|
||||
</div>
|
||||
<Button
|
||||
asChild
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="min-h-11 sm:min-h-9"
|
||||
>
|
||||
<Link href="/medications">
|
||||
{t("dashboard.medicationIntakeQuickAdd.emptyCta")}
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
{footerSlot ? createPortal(emptyFooter, footerSlot) : emptyFooter}
|
||||
</>
|
||||
|
||||
Reference in new issue
Block a user