diff --git a/src/components/settings/about-me-section.tsx b/src/components/settings/about-me-section.tsx
index aeb554416..6683d45a4 100644
--- a/src/components/settings/about-me-section.tsx
+++ b/src/components/settings/about-me-section.tsx
@@ -33,6 +33,7 @@ import { toast } from "sonner";
import { Button } from "@/components/ui/button";
import { Label } from "@/components/ui/label";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { useTranslations } from "@/lib/i18n/context";
import { queryKeys } from "@/lib/query-keys";
@@ -181,10 +182,11 @@ export function AboutMeSection({
}
return (
-
@@ -290,6 +293,7 @@ export function AboutMeSection({
+
{/* v1.18.0 (S5) — injection-site exclusions moved to the dedicated
Medikamente settings section, where every medication-specific
@@ -599,7 +604,7 @@ export function AccountSection() {
{/* Passkeys card */}
-
)}
-
+
);
}
diff --git a/src/components/settings/integrations/fitbit-card.tsx b/src/components/settings/integrations/fitbit-card.tsx
index 1b280ad7d..666bd4607 100644
--- a/src/components/settings/integrations/fitbit-card.tsx
+++ b/src/components/settings/integrations/fitbit-card.tsx
@@ -34,6 +34,7 @@ import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { PasswordInput } from "@/components/ui/password-input";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { IntegrationStatusPill } from "@/components/settings/integration-status-pill";
import type { IntegrationPillState } from "@/components/settings/integration-status-pill";
@@ -188,9 +189,8 @@ export function FitbitCard({
: null;
return (
-
)}
-
+
);
}
diff --git a/src/components/settings/integrations/nightscout-card.tsx b/src/components/settings/integrations/nightscout-card.tsx
index c0ad7785a..8d13e06b0 100644
--- a/src/components/settings/integrations/nightscout-card.tsx
+++ b/src/components/settings/integrations/nightscout-card.tsx
@@ -28,6 +28,7 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { PasswordInput } from "@/components/ui/password-input";
import { Switch } from "@/components/ui/switch";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import {
IntegrationStatusPill,
@@ -158,9 +159,8 @@ export function NightscoutCard({ enabled = true }: { enabled?: boolean }) {
: null;
return (
-
)}
-
+
);
}
diff --git a/src/components/settings/integrations/oauth-provider-card.tsx b/src/components/settings/integrations/oauth-provider-card.tsx
index f107a1772..c5564c783 100644
--- a/src/components/settings/integrations/oauth-provider-card.tsx
+++ b/src/components/settings/integrations/oauth-provider-card.tsx
@@ -28,6 +28,7 @@ import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { PasswordInput } from "@/components/ui/password-input";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import {
IntegrationStatusPill,
@@ -201,9 +202,8 @@ export function OAuthProviderCard({
}
return (
-
)}
-
+
);
}
diff --git a/src/components/settings/integrations/whoop-card.tsx b/src/components/settings/integrations/whoop-card.tsx
index 4d7b4797a..1669ee9df 100644
--- a/src/components/settings/integrations/whoop-card.tsx
+++ b/src/components/settings/integrations/whoop-card.tsx
@@ -26,6 +26,7 @@ import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { PasswordInput } from "@/components/ui/password-input";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { IntegrationStatusPill } from "@/components/settings/integration-status-pill";
import type { IntegrationPillState } from "@/components/settings/integration-status-pill";
@@ -182,7 +183,7 @@ export function WhoopCard({
: null;
return (
-
+
)}
-
+
);
}
diff --git a/src/components/settings/integrations/withings-card.tsx b/src/components/settings/integrations/withings-card.tsx
index 2560322c3..1920c17f7 100644
--- a/src/components/settings/integrations/withings-card.tsx
+++ b/src/components/settings/integrations/withings-card.tsx
@@ -19,6 +19,7 @@ import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { PasswordInput } from "@/components/ui/password-input";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { IntegrationStatusPill } from "@/components/settings/integration-status-pill";
import type { IntegrationPillState } from "@/components/settings/integration-status-pill";
@@ -190,7 +191,7 @@ export function WithingsCard({
: null;
return (
-
+
)}
-
+
);
}
diff --git a/src/components/settings/low-stock-card.tsx b/src/components/settings/low-stock-card.tsx
index d25019d79..763c0a16d 100644
--- a/src/components/settings/low-stock-card.tsx
+++ b/src/components/settings/low-stock-card.tsx
@@ -7,6 +7,7 @@ import { PackageOpen } from "lucide-react";
import { Input } from "@/components/ui/input";
import { Switch } from "@/components/ui/switch";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { useTranslations } from "@/lib/i18n/context";
import { queryKeys } from "@/lib/query-keys";
@@ -190,12 +191,13 @@ export function LowStockCard({
}
return (
-
-
+
);
}
diff --git a/src/components/settings/medications-section.tsx b/src/components/settings/medications-section.tsx
index a1421aba9..9d488a10d 100644
--- a/src/components/settings/medications-section.tsx
+++ b/src/components/settings/medications-section.tsx
@@ -8,6 +8,7 @@ import {
type ReorderMedication,
} from "@/components/medications/medication-order-editor";
import { MedicationViewToggle } from "@/components/medications/medication-view-toggle";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { InjectionSitesCard } from "@/components/settings/injection-sites-card";
import { useAuth } from "@/hooks/use-auth";
@@ -79,9 +80,9 @@ export function MedicationsSection() {
{/* View preference — cards vs table. The shared header toggle
writes optimistically, so there is no Save button here. */}
-
)}
-
+
{/* Manual order — applies to both list views. */}
-
)}
-
+
{/* v1.18.0 (S5) — injection-site exclusions are a medication setting;
they moved here from the account profile so all medication-specific
diff --git a/src/components/settings/modules-section.tsx b/src/components/settings/modules-section.tsx
index d52ed2507..72db906b7 100644
--- a/src/components/settings/modules-section.tsx
+++ b/src/components/settings/modules-section.tsx
@@ -42,6 +42,7 @@ import {
type LucideIcon,
} from "lucide-react";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { ModuleToggleRow } from "@/components/settings/module-toggle-row";
import { useAuth } from "@/hooks/use-auth";
@@ -106,7 +107,7 @@ export function ModulesSection() {
// frame's standard subtitle). The "Module immer aktiv" core-domains card
// was removed: a domain that can't be turned off doesn't need to be listed.
return (
-
+
-
+
);
}
diff --git a/src/components/settings/mood-reminder-card.tsx b/src/components/settings/mood-reminder-card.tsx
index 95ee03ae5..71510fafd 100644
--- a/src/components/settings/mood-reminder-card.tsx
+++ b/src/components/settings/mood-reminder-card.tsx
@@ -6,6 +6,7 @@ import { SmilePlus } from "lucide-react";
import { NativeSelect } from "@/components/ui/native-select";
import { Switch } from "@/components/ui/switch";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { useTranslations } from "@/lib/i18n/context";
import { queryKeys } from "@/lib/query-keys";
@@ -155,9 +156,9 @@ export function MoodReminderCard({
}
return (
-
)}
-
+
);
}
diff --git a/src/components/settings/mood-section.tsx b/src/components/settings/mood-section.tsx
index dff7c7019..f05539029 100644
--- a/src/components/settings/mood-section.tsx
+++ b/src/components/settings/mood-section.tsx
@@ -2,6 +2,7 @@
import { Archive, Folders, Loader2, Tags } from "lucide-react";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { ArchivedTagsCard } from "@/components/mood/manage/archived-tags-card";
import { TagGroupsCard } from "@/components/mood/manage/tag-groups-card";
@@ -45,30 +46,30 @@ export function MoodSection() {
return (
{/* Groups — picker group order + own groups. */}
-
);
}
diff --git a/src/components/settings/notification-status-card.tsx b/src/components/settings/notification-status-card.tsx
index eea9c5763..f13ac3c96 100644
--- a/src/components/settings/notification-status-card.tsx
+++ b/src/components/settings/notification-status-card.tsx
@@ -32,6 +32,7 @@ import {
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { useAuth } from "@/hooks/use-auth";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { useFormatters, useTranslations } from "@/lib/i18n/context";
import { queryKeys } from "@/lib/query-keys";
@@ -114,9 +115,9 @@ export function NotificationStatusCard() {
if (isLoading) {
return (
-
+
-
+
);
}
@@ -128,8 +129,7 @@ export function NotificationStatusCard() {
const channels = Array.isArray(data) ? data : [];
if (channels.length === 0) {
return (
-
-
+
);
}
return (
-
+
))}
-
+
);
}
diff --git a/src/components/settings/ntfy-card.tsx b/src/components/settings/ntfy-card.tsx
index 28cdcaed0..7f2022d2e 100644
--- a/src/components/settings/ntfy-card.tsx
+++ b/src/components/settings/ntfy-card.tsx
@@ -9,6 +9,7 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Switch } from "@/components/ui/switch";
import { PasswordInput } from "@/components/ui/password-input";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { TestConnectionButton } from "@/components/settings/test-connection-button";
import { useTranslations } from "@/lib/i18n/context";
@@ -82,7 +83,7 @@ export function NtfyCard({ isAuthenticated }: { isAuthenticated: boolean }) {
});
return (
-
+
-
+
);
}
diff --git a/src/components/settings/settings-card.tsx b/src/components/settings/settings-card.tsx
new file mode 100644
index 000000000..9537ca7a1
--- /dev/null
+++ b/src/components/settings/settings-card.tsx
@@ -0,0 +1,63 @@
+import * as React from "react";
+
+import { Card } from "@/components/ui/card";
+import { cn } from "@/lib/utils";
+
+/**
+ * `` — the standard Settings card container.
+ *
+ * Every Settings section paints the same bordered surface: a rounded card
+ * with the app's one card-padding contract (`p-4 md:p-6` — 16 px on phones,
+ * 24 px from `md` up). Before this primitive the surface hand-rolled
+ * `bg-card border-border rounded-xl border p-4 sm:p-6` in ~35 files, which
+ * (a) bypassed the `` primitive entirely and (b) stepped padding at
+ * `sm:` (640 px) instead of `md:` (768 px), so on a ~700 px tablet Settings
+ * cards read denser than every other surface.
+ *
+ * The default renders the ui `` so the surface composes from one shape.
+ * Unlike the bare `` it does NOT impose the `flex flex-col gap` layout:
+ * Settings card bodies own their internal rhythm (`SettingsCardHeader` +
+ * `mt-4`/`space-y-*` bodies), so the container only owns the border, radius,
+ * background, and padding. Pass `className` for per-card extras
+ * (`scroll-mt-28`, `space-y-4`, `flex h-full flex-col`, …).
+ *
+ * `as="section"` keeps a card's semantic landmark element (a `` with
+ * an `aria-labelledby`) while painting the same shape and padding contract.
+ */
+const SETTINGS_CARD_SHELL = "block gap-0 p-4 md:p-6";
+
+type SettingsCardOwnProps = { className?: string };
+
+type SettingsCardProps = SettingsCardOwnProps & {
+ as?: E;
+} & Omit, keyof SettingsCardOwnProps | "as">;
+
+export function SettingsCard({
+ as,
+ className,
+ ...props
+}: SettingsCardProps) {
+ if (as) {
+ const Component = as as React.ElementType;
+ return (
+ -backed one.
+ className={cn(
+ "bg-card text-card-foreground rounded-xl border p-4 shadow-sm md:p-6",
+ className,
+ )}
+ {...props}
+ />
+ );
+ }
+ return (
+ )}
+ />
+ );
+}
diff --git a/src/components/settings/sources-section.tsx b/src/components/settings/sources-section.tsx
index 9a714b156..237b019c7 100644
--- a/src/components/settings/sources-section.tsx
+++ b/src/components/settings/sources-section.tsx
@@ -42,6 +42,7 @@ import {
import { Button } from "@/components/ui/button";
import { Skeleton } from "@/components/ui/skeleton";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { useTranslations } from "@/lib/i18n/context";
import { queryKeys } from "@/lib/query-keys";
@@ -285,7 +286,7 @@ export function SourcesSection() {
// card, below the ladder.
return (
-
+
-
+
);
}
diff --git a/src/components/settings/telegram-card.tsx b/src/components/settings/telegram-card.tsx
index 40d42f681..2813f4f2c 100644
--- a/src/components/settings/telegram-card.tsx
+++ b/src/components/settings/telegram-card.tsx
@@ -9,6 +9,7 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Switch } from "@/components/ui/switch";
import { PasswordInput } from "@/components/ui/password-input";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { TestConnectionButton } from "@/components/settings/test-connection-button";
import { useTranslations } from "@/lib/i18n/context";
@@ -87,7 +88,7 @@ export function TelegramCard({
}
return (
-
+
-
+
);
}
diff --git a/src/components/settings/thresholds-editor-section.tsx b/src/components/settings/thresholds-editor-section.tsx
index 092429e2f..c4035b2e2 100644
--- a/src/components/settings/thresholds-editor-section.tsx
+++ b/src/components/settings/thresholds-editor-section.tsx
@@ -19,6 +19,7 @@ import {
type EffectiveRange,
} from "@/lib/analytics/effective-range";
import { apiFetchRaw, apiGet } from "@/lib/api/api-fetch";
+import { SettingsCard } from "@/components/settings/settings-card";
interface ThresholdsApiResponse {
effective: Record;
@@ -115,9 +116,9 @@ export function ThresholdsEditorSection({ id }: { id: string }) {
});
return (
-
{/* v1.4.19 A8 / F-07: page header `settings.sections.thresholds.*`
already provides the title + description for this route, so the
@@ -159,7 +160,7 @@ export function ThresholdsEditorSection({ id }: { id: string }) {
))}
)}
-
+
);
}
@@ -323,6 +324,7 @@ function MetricRow({
onClick={() => valid && onSave({ min: minNum, max: maxNum })}
disabled={busy || !valid}
size="sm"
+ className="min-h-11 sm:min-h-9"
>
{t("common.save")}
@@ -330,6 +332,7 @@ function MetricRow({
diff --git a/src/components/settings/web-push-card.tsx b/src/components/settings/web-push-card.tsx
index f3204b4dc..fc44fe612 100644
--- a/src/components/settings/web-push-card.tsx
+++ b/src/components/settings/web-push-card.tsx
@@ -5,6 +5,7 @@ import { BellRing, Loader2 } from "lucide-react";
import { Button } from "@/components/ui/button";
import { TestConnectionButton } from "@/components/settings/test-connection-button";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { useTranslations } from "@/lib/i18n/context";
import { apiFetchRaw } from "@/lib/api/api-fetch";
@@ -204,7 +205,7 @@ export function WebPushCard() {
);
return (
-
+
) : null}
-
+
);
}
diff --git a/src/components/settings/webhook-card.tsx b/src/components/settings/webhook-card.tsx
index bf2a17b69..e43e0e40d 100644
--- a/src/components/settings/webhook-card.tsx
+++ b/src/components/settings/webhook-card.tsx
@@ -9,6 +9,7 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Switch } from "@/components/ui/switch";
import { PasswordInput } from "@/components/ui/password-input";
+import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";
import { TestConnectionButton } from "@/components/settings/test-connection-button";
import { useTranslations } from "@/lib/i18n/context";
@@ -80,7 +81,7 @@ export function WebhookCard({ isAuthenticated }: { isAuthenticated: boolean }) {
});
return (
-