fix(settings): keep moved checkup and session cards reachable in context

The checkups page links to the checkup reminders under Notifications
and the screening hints under the health profile, the two cards that
left its settings in this release. Data & privacy gets a row pointing
at sessions and devices under Security.
This commit is contained in:
Marc-André Bombeck committed 2026-10-21 21:50:13 +02:00
1 parent 90c9a4e2d0
commit b25ee09f7d
12 files changed
+104 -1

No files matched your search

@@ -114,6 +114,16 @@ describe("<VorsorgeSection> loading + empty", () => {
expect(html).not.toContain('data-slot="vorsorge-loading"');
});
it("links the checkups page to the reminder and screening settings that moved", () => {
remindersMock.mockReturnValue({ data: [], isLoading: false });
const page = render(<VorsorgeSection variant="page" />);
expect(page).toContain('href="/settings/notifications#vorsorge-reminders"');
expect(page).toContain('href="/settings/anamnesis#screening-hints"');
// The embedded settings card is already in Settings and carries no links.
const embedded = render(<VorsorgeSection />);
expect(embedded).not.toContain('data-slot="vorsorge-settings-links"');
});
it("renders reminder cards once data lands", () => {
const reminder: MeasurementReminder = {
id: "r1",
@@ -465,7 +465,38 @@ export function VorsorgeSection({
</>
}
/>
) : (
) : null}
{variant === "page" && !inSharedRecord ? (
// The reminder switches and the screening hints moved out of the
// checkups settings in v1.44 (Notifications, Health profile); both
// stay one tap away from the page they are about.
<div
className="flex flex-wrap gap-2"
data-slot="vorsorge-settings-links"
>
<Button
asChild
variant="outline"
size="sm"
className="min-h-11 sm:min-h-9"
>
<Link href="/settings/notifications#vorsorge-reminders">
{t("notifications.checkupReminders.title")}
</Link>
</Button>
<Button
asChild
variant="outline"
size="sm"
className="min-h-11 sm:min-h-9"
>
<Link href="/settings/anamnesis#screening-hints">
{t("records.life.screening.cardTitle")}
</Link>
</Button>
</div>
) : null}
{variant === "page" ? null : (
<SettingsCardHeader
icon={CalendarClock}
titleId="vorsorge-section-title"
@@ -71,6 +71,8 @@ describe("<PrivacySection> — assembled Data & Privacy dashboard", () => {
expect(html).not.toContain("settings-security-sessions-card");
expect(html).not.toContain("settings-trusted-devices-card");
expect(html).not.toContain('href="/settings/export"');
// ...but stay one tap away from here, where people looked for them.
expect(html).toContain('href="/settings/security#sessions"');
});
it("shows a loading placeholder for the retention block before the summary resolves", () => {
@@ -23,6 +23,7 @@ import {
Clock,
Sparkles,
Info,
MonitorSmartphone,
} from "lucide-react";
import { Button } from "@/components/ui/button";
@@ -180,6 +181,25 @@ export function PrivacySection() {
)}
</SettingsCard>
{/* Sessions, trusted devices and the security activity live under
Security since v1.44; the row keeps them reachable from here, where
people looked for them before. */}
<SettingsCard>
<SettingsCardHeader
anchor="sessions-link"
icon={MonitorSmartphone}
title={t("settings.privacy.sessions.title")}
description={t("settings.privacy.sessions.description")}
/>
<SettingsCardActions align="start">
<Button asChild variant="outline" size="sm">
<Link href="/settings/security#sessions">
{t("settings.privacy.sessions.open")}
</Link>
</Button>
</SettingsCardActions>
</SettingsCard>
{/* Delete / reset — with the honest backup lag disclosure */}
<SettingsCard>
<SettingsCardHeader