feat(settings): nine groups, module pages and one switch per state

Settings now reads as nine groups: Account, Tracking, Arrangement,
Notifications, Health profile, AI, Connections, Data and System. On a
phone one button names the current section and opens the grouped list,
replacing the strip of every section.

What moved, every old address still working:
- Sessions, trusted devices and security activity sit under Security;
  the privacy page anchors forward there.
- Notifications holds every reminder kind: the Coach nudges and the
  checkup reminder switches joined, and a card names the reminders set
  where their subject lives (dose times, cycle reminders).
- Arrangement holds order and view only. Mood tags, the labs biomarker
  catalog and on-device text recognition, and the injection sites live on
  module pages under /settings/modules/<id>, linked from each Modules row
  and from the module's own wrench. /settings/layout/mood redirects.
- The timezone saves on change in the Display card, with a one-tap offer
  of the device zone.
- Screening hints sit beside the life circumstances they come from.
- System gains Preview features with the Topics switch.

Duplicates: the Coach and MCP pages show their state and link to the one
switch in Modules (turning MCP off keeps tokens), the Coach overlay shows
the provider and model with a link to Settings > AI instead of a second
set of selects, and the privacy page drops its copy of the export links.

A guard walks every historical /settings address through the redirects
and every forwarded anchor to a page that renders.
This commit is contained in:
Marc-André Bombeck committed 2026-10-21 19:43:02 +02:00
1 parent 3ebef19ac3
commit 71dbef1742
76 files changed
+2517 -1806

No files matched your search

+1 -1
View File
@@ -153,7 +153,7 @@ export default function LabsPage() {
className="min-h-11 min-w-11 sm:min-h-9 sm:min-w-9"
>
<Link
href="/settings/layout/labs"
href="/settings/modules/labs"
aria-label={t("labs.customize")}
title={t("labs.customize")}
>
+1 -1
View File
@@ -150,7 +150,7 @@ export default function MoodPageClient() {
className="min-h-11 min-w-11 sm:min-h-9 sm:min-w-9"
>
<Link
href="/settings/layout/mood"
href="/settings/modules/mood"
aria-label={t("mood.customize")}
title={t("mood.customize")}
>
+1 -1
View File
@@ -44,7 +44,7 @@ export default async function SettingsSectionPage({ params }: PageProps) {
}
// Each section is its own chunk (see `SettingsSectionLoader`), so the route
// ships the one it shows rather than all twenty-one. Integrations is the
// ships the one it shows rather than all of them. Integrations is the
// one section that needs a server-resolved value: the OAuth callback URL
// each provider registers, read from the runtime env here, per request,
// because a `NEXT_PUBLIC_*` read inside a client module is inlined at build
@@ -9,6 +9,8 @@ import {
isLayoutGroupId,
} from "@/components/settings/layout-groups";
import { SettingsShell } from "@/components/settings/settings-shell";
import { ModuleSettingsLinkCard } from "@/components/settings/module-settings-pages";
import { isModuleSettingsPageId } from "@/components/settings/module-settings-page-ids";
import { SettingsHubBackLink } from "@/components/settings/settings-hub-back-link";
import { resolveServerLocale } from "@/lib/i18n/server-locale";
import { getServerTranslator } from "@/lib/i18n/server-translator";
@@ -86,6 +88,11 @@ export default async function SettingsLayoutModulePage({ params }: PageProps) {
<section aria-labelledby={headingId} className="space-y-6">
<LayoutModuleGate moduleKey={layoutGroupModule(group.id)}>
<Body />
{/* v1.44 — what the module needs beyond order and view lives
on its page under Modules; say where. */}
{isModuleSettingsPageId(group.id) ? (
<ModuleSettingsLinkCard id={group.id} />
) : null}
</LayoutModuleGate>
</section>
</RecordSettingsSectionGate>
@@ -0,0 +1,72 @@
import { notFound } from "next/navigation";
import { LayoutModuleGate } from "@/components/settings/layout-module-gate";
import { RecordSettingsSectionGate } from "@/components/settings/record-settings-section-gate";
import { ModuleSettingsPageBody } from "@/components/settings/module-settings-pages";
import {
MODULE_SETTINGS_PAGE_IDS,
isModuleSettingsPageId,
moduleSettingsPageKeys,
moduleSettingsPageModule,
} from "@/components/settings/module-settings-page-ids";
import { SettingsShell } from "@/components/settings/settings-shell";
import { SettingsHubBackLink } from "@/components/settings/settings-hub-back-link";
import { resolveServerLocale } from "@/lib/i18n/server-locale";
import { getServerTranslator } from "@/lib/i18n/server-translator";
/**
* A module's own settings: `/settings/modules/<id>`.
*
* What a module needs beyond order and view (the labs biomarker catalog and
* on-device text recognition, the mood tags, the injection sites) lives here,
* under Settings > Modules, with a back link to the Modules list. Pre-rendered
* for the known ids; any other segment 404s at routing time.
*/
export const dynamicParams = false;
export function generateStaticParams() {
return MODULE_SETTINGS_PAGE_IDS.map((module) => ({ module }));
}
interface PageProps {
params: Promise<{ module: string }>;
}
export default async function SettingsModulePage({ params }: PageProps) {
const { module } = await params;
if (!isModuleSettingsPageId(module)) notFound();
const locale = await resolveServerLocale();
const { t } = getServerTranslator(locale);
const { titleKey, descriptionKey } = moduleSettingsPageKeys(module);
const headingId = `settings-section-modules-${module}-title`;
return (
<SettingsShell
active="modules"
heading={{
title: t(titleKey),
subtitle: t(descriptionKey),
headingId,
topSlot: (
<SettingsHubBackLink
href="/settings/modules"
labelKey="settings.sections.modules.backToHub"
/>
),
}}
>
{/* The cards here lived under Arrangement until v1.44 and keep its
posture inside somebody else's record, so the gate is asked about
`layout`, not about the Modules switches. */}
<RecordSettingsSectionGate section="layout">
<section aria-labelledby={headingId} className="space-y-6">
<LayoutModuleGate moduleKey={moduleSettingsPageModule(module)}>
<ModuleSettingsPageBody id={module} />
</LayoutModuleGate>
</section>
</RecordSettingsSectionGate>
</SettingsShell>
);
}