Files
HealthLog/src/components/settings/layout-section.tsx
T
Marc-André Bombeck 9b191a208d feat(settings): round-2 information-architecture rework
Apply the v1.18.0 walkthrough notes across the settings surface:

- Drop the explanatory top-text block from every settings section so
  content starts at one consistent vertical height (the sr-only heading
  stays for the accessibility tree).
- Move "Restart onboarding tour" out of Account into Advanced.
- Module hub: drop the explanatory line above the first card.
- Split the Integrations page into three left-side entries — the
  Connections content is now the Integrationen page itself, with
  Channels and Sources (source weighting) as their own entries. Drop the
  /settings/sources redirect (it is a real route again); Channels is a
  new entry.
- Notifications: drop the top text, the channels / inbox cross-links,
  and the embedded Vorsorge editor (it has its own page). Keep the mood,
  low-stock, and proactive-coach reminder cards.
- Rename the Layout hub entry to "Layout".
- Flip the Coach toggle to "Activate Coach" (default on, opt-out) over
  the same single disableCoach column — one source of truth.
- Move the AI "About me" context into Account → Profil, before
  cycle tracking.
- Gesundheitsakte: replace the gradient hero with a normal card.

i18n across all six locales for the renamed / added labels; settings
tests updated for the new structure.
2026-06-16 21:47:00 +02:00

100 lines
3.1 KiB
TypeScript

"use client";
import Link from "next/link";
import {
ChevronRight,
LayoutDashboard,
TrendingUp,
type LucideIcon,
} from "lucide-react";
import { cn } from "@/lib/utils";
import { useTranslations } from "@/lib/i18n/context";
/**
* v1.17.1 (F-2) — the one "Layout & Personalization" home.
*
* Before this section, "how my app is laid out" was scattered across
* several unrelated settings sections with no shared framing. This
* section is the single front door for the arrangement editors: it
* presents them as one consistent set of cards and links to each editor,
* which keep their own routes and mutation flows intact.
*
* v1.18.0 (S5) — Medications (Medikamente) and Mood (Stimmung) graduated
* to their own top-level nav entries, so the hub now hosts only the
* dashboard + insights arrangement editors.
*/
interface LayoutLink {
href: string;
icon: LucideIcon;
titleKey: string;
descriptionKey: string;
}
const LAYOUT_LINKS: ReadonlyArray<LayoutLink> = [
{
href: "/settings/dashboard",
icon: LayoutDashboard,
titleKey: "settings.sections.layout.dashboard.title",
descriptionKey: "settings.sections.layout.dashboard.description",
},
{
href: "/settings/insights",
icon: TrendingUp,
titleKey: "settings.sections.layout.insights.title",
descriptionKey: "settings.sections.layout.insights.description",
},
// v1.18.0 (S5) — Medications (Medikamente) and Mood (Stimmung) graduated
// to their own top-level nav entries, so they are no longer linked from
// the Layout hub. Only the dashboard + insights arrangement editors
// remain here.
];
export function LayoutSection() {
const { t } = useTranslations();
return (
<section
aria-labelledby="settings-section-layout-title"
className="space-y-6"
>
<header>
<h1 id="settings-section-layout-title" className="sr-only">
{t("settings.sections.layout.title")}
</h1>
</header>
<ul className="space-y-3">
{LAYOUT_LINKS.map((link) => {
const Icon = link.icon;
return (
<li key={link.href}>
<Link
href={link.href}
className={cn(
"bg-card border-border hover:bg-accent/40 group flex items-center gap-4 rounded-xl border p-4 transition-colors sm:p-5",
)}
>
<Icon
className="text-muted-foreground h-5 w-5 shrink-0"
aria-hidden="true"
/>
<div className="min-w-0 flex-1 space-y-0.5">
<p className="text-sm font-semibold">{t(link.titleKey)}</p>
<p className="text-muted-foreground text-xs">
{t(link.descriptionKey)}
</p>
</div>
<ChevronRight
className="text-muted-foreground/60 group-hover:text-foreground h-4 w-4 shrink-0 transition-colors"
aria-hidden="true"
/>
</Link>
</li>
);
})}
</ul>
</section>
);
}