refactor(settings): fold Labs, Vorsorge, and Illness into the shell

Promote the three per-module customise surfaces from standalone
ModuleSettingsFrame pages to first-class Settings sections. They now
render inside the Settings shell — same left nav, heading, and chrome as
account / ai / integrations / notifications — instead of their own
back-button-and-title frame outside it.

Add labs, illness, and vorsorge to the slug registry (after mood) and to
SETTINGS_SECTIONS with FlaskConical / Thermometer / CalendarCheck icons.
labs and illness gate on their toggleable modules; vorsorge has no
module, so its entry is always shown. Three thin section components wrap
the existing LabsSettings / IllnessSettings / VorsorgeSettings content,
mirroring MedicationsSection / CoachSection.

Delete the three standalone /settings/{labs,vorsorge,illness} routes so
the wrench deep links resolve through the dynamic [section] route, and
drop ModuleSettingsFrame now that nothing renders it. Add the section
title / subtitle / description keys across all six locales and remove the
dead per-module *.settings.* blocks the old pages consumed.
This commit is contained in:
Marc-André Bombeck committed 2026-06-19 21:06:25 +02:00
1 parent 3e04035de8
commit 43d9610f03
18 files changed
+217 -253

No files matched your search

+6
View File
@@ -10,14 +10,17 @@ import { CoachSection } from "@/components/settings/coach-section";
import { DashboardSection } from "@/components/settings/dashboard-section";
import { ExportSection } from "@/components/settings/export-section";
import { GesundheitsakteSection } from "@/components/settings/gesundheitsakte-section";
import { IllnessSection } from "@/components/settings/illness-section";
import { InsightsSection } from "@/components/settings/insights-section";
import { IntegrationsSection } from "@/components/settings/integrations-section";
import { LabsSection } from "@/components/settings/labs-section";
import { LayoutSection } from "@/components/settings/layout-section";
import { MedicationsSection } from "@/components/settings/medications-section";
import { ModulesSection } from "@/components/settings/modules-section";
import { MoodSection } from "@/components/settings/mood-section";
import { NotificationsSection } from "@/components/settings/notifications-section";
import { SectionPlaceholder } from "@/components/settings/section-placeholder";
import { VorsorgeSection } from "@/components/settings/vorsorge-section";
// v1.18.1 (D4) — `channels` and `sources` are standalone left-side entries
// again (split out of the Integrations sub-tabs).
import { ChannelsSection } from "@/components/settings/channels-section";
@@ -64,6 +67,9 @@ const SECTION_COMPONENTS: Record<
insights: InsightsSection,
medications: MedicationsSection,
mood: MoodSection,
labs: LabsSection,
illness: IllnessSection,
vorsorge: VorsorgeSection,
thresholds: ThresholdsSection,
api: ApiSection,
gesundheitsakte: GesundheitsakteSection,
-39
View File
@@ -1,39 +0,0 @@
"use client";
import { Loader2 } from "lucide-react";
import { useAuth } from "@/hooks/use-auth";
import { useMounted } from "@/hooks/use-mounted";
import { useTranslations } from "@/lib/i18n/context";
import { ModuleSettingsFrame } from "@/components/module-list/module-settings-frame";
import { IllnessSettings } from "@/components/illness/illness-settings";
/**
* v1.18.6 (W8 / MOD-03) — the Illness module's own settings page. Dedicated
* static route (wins over `/settings/[section]`); reached from the wrench
* beside the Illness page's "hinzufügen" button.
*/
export default function IllnessSettingsPage() {
const { isLoading } = useAuth();
const mounted = useMounted();
const { t } = useTranslations();
if (!mounted || isLoading) {
return (
<div className="flex min-h-[40vh] items-center justify-center">
<Loader2 className="text-muted-foreground h-6 w-6 animate-spin motion-reduce:animate-none" />
</div>
);
}
return (
<ModuleSettingsFrame
title={t("illness.settings.title")}
description={t("illness.settings.description")}
backHref="/illness"
backLabelKey="illness.settings.back"
>
<IllnessSettings />
</ModuleSettingsFrame>
);
}
-39
View File
@@ -1,39 +0,0 @@
"use client";
import { Loader2 } from "lucide-react";
import { useAuth } from "@/hooks/use-auth";
import { useMounted } from "@/hooks/use-mounted";
import { useTranslations } from "@/lib/i18n/context";
import { ModuleSettingsFrame } from "@/components/module-list/module-settings-frame";
import { LabsSettings } from "@/components/labs/labs-settings";
/**
* v1.18.6 (W8 / MOD-03 + MOD-04) — the Labs module's own settings page.
* Dedicated static route (wins over `/settings/[section]`); reached from the
* wrench beside the Labs page's "hinzufügen" button.
*/
export default function LabsSettingsPage() {
const { isLoading } = useAuth();
const mounted = useMounted();
const { t } = useTranslations();
if (!mounted || isLoading) {
return (
<div className="flex min-h-[40vh] items-center justify-center">
<Loader2 className="text-muted-foreground h-6 w-6 animate-spin motion-reduce:animate-none" />
</div>
);
}
return (
<ModuleSettingsFrame
title={t("labs.settings.title")}
description={t("labs.settings.description")}
backHref="/labs"
backLabelKey="labs.settings.back"
>
<LabsSettings />
</ModuleSettingsFrame>
);
}
-43
View File
@@ -1,43 +0,0 @@
"use client";
import { Loader2 } from "lucide-react";
import { useAuth } from "@/hooks/use-auth";
import { useMounted } from "@/hooks/use-mounted";
import { useTranslations } from "@/lib/i18n/context";
import { ModuleSettingsFrame } from "@/components/module-list/module-settings-frame";
import { VorsorgeSettings } from "@/components/measurement-reminders/vorsorge-settings";
/**
* v1.18.6 (W8 / MOD-03) — the Vorsorge module's own settings page.
*
* A dedicated static route that wins over the dynamic `/settings/[section]`
* router (static segments take precedence in Next.js), so it adds a
* per-module settings surface without touching the parallel-phase-owned
* `section-slugs` registry or `settings-shell`. Reached from the wrench
* beside the Vorsorge page's "hinzufügen" button.
*/
export default function VorsorgeSettingsPage() {
const { isLoading } = useAuth();
const mounted = useMounted();
const { t } = useTranslations();
if (!mounted || isLoading) {
return (
<div className="flex min-h-[40vh] items-center justify-center">
<Loader2 className="text-muted-foreground h-6 w-6 animate-spin motion-reduce:animate-none" />
</div>
);
}
return (
<ModuleSettingsFrame
title={t("measurementReminders.settings.title")}
description={t("measurementReminders.settings.description")}
backHref="/vorsorge"
backLabelKey="measurementReminders.settings.back"
>
<VorsorgeSettings />
</ModuleSettingsFrame>
);
}