mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
Introduce a shared SettingsSectionFrame (the settings twin of the admin renderer's SectionFrame) that emits the canonical visible heading + subheading, and route all 19 settings sections through it. Every settings page now shows a real h1 + subtitle in the reference Übersicht style instead of an invisible sr-only title; the section bodies drop their own headings and off-style intro paragraphs (the explanatory copy folds into the frame subtitle). - Route the admin About page through SectionFrame so it carries the same visible heading as every other admin section. - Rename the AI settings section from KI-Auswertung to KI-Anbieter across six locales: the page configures the provider and key, not an analysis. - Add a heading-block spacer to the settings and admin sidebars so the first menu item lines up with the top of the first card. - Remove the always-on core-domains card from Module: a tracking area that can't be turned off doesn't need listing. - Move the proactive-coach control out of Benachrichtigungen into Coach. - Move admin module availability out of the Coach section into its own page: it gates every module, not just the coach. - Give the Layout Insights editor a proper Insights heading. Adds settings.sections.<slug>.subtitle and the new admin keys across all six locales; removes the now-unused module core-domain strings.
41 lines
1.8 KiB
TypeScript
41 lines
1.8 KiB
TypeScript
"use client";
|
|
|
|
/**
|
|
* Settings → AI section wrapper.
|
|
*
|
|
* v1.16.4 — the former 2k-LOC monolith is split into per-provider
|
|
* subcomponents under `src/components/settings/ai/` (one file per
|
|
* provider form, plus the chain / runtime cards). This file only owns
|
|
* the section frame and the card order; behaviour lives in the parts.
|
|
*
|
|
* v1.18.0 (S5) — the Coach preference cards (disable toggle, preferences,
|
|
* memory) moved out to the dedicated Coach section. The AI section keeps
|
|
* only provider / model / BYOK configuration.
|
|
*
|
|
* v1.18.1 (D8) — the "About me" context moved to Settings → Account (under
|
|
* Profil, before Zyklus-Tracking). It is personal medical context the daily
|
|
* briefing reads too, so it belongs with the account profile rather than the
|
|
* provider-configuration screen.
|
|
*/
|
|
|
|
import { AiInsightsCard } from "@/components/settings/ai/ai-insights-card";
|
|
import { useAuth } from "@/hooks/use-auth";
|
|
import { useMounted } from "@/hooks/use-mounted";
|
|
|
|
export function AiSection() {
|
|
const { isAuthenticated } = useAuth();
|
|
// v1.16.6 — the auth query can resolve before this boundary
|
|
// hydrates; every `disabled={!isAuthenticated}` binding in the child
|
|
// cards would then disagree with the SSR HTML (React #418). Gate the
|
|
// prop on `useMounted()` so the hydration render matches the
|
|
// server-rendered "not yet authenticated" state and the cards enable
|
|
// on the first client re-render.
|
|
const mounted = useMounted();
|
|
const authed = mounted && isAuthenticated;
|
|
|
|
// v1.18.6 (W9) — the visible heading + subtitle now come from the shared
|
|
// `<SettingsSectionFrame>` in the route; this body is the single provider
|
|
// card. (The "About me" context moved to Settings → Account in v1.18.1 D8.)
|
|
return <AiInsightsCard isAuthenticated={authed} />;
|
|
}
|