refactor(settings): move unit-system and global injection-site exclusions to Account

The unit-system selector and the app-wide injection-site exclusions are
personal account preferences, not dashboard-layout controls. Move both
cards from the Dashboard settings section to the Account section, next to
the profile. The persistence path is unchanged — same endpoints, query
keys, mutation hooks, and labels; only the render location moves. The
Dashboard section keeps the layout/widget controls.
This commit is contained in:
Marc-André Bombeck committed 2026-06-04 19:13:47 +02:00
1 parent 6f378c8584
commit c0065437a7
2 files changed
+9 -8

No files matched your search

@@ -53,6 +53,8 @@ import { restartOnboardingTour } from "@/lib/onboarding/tour-restart";
import { describePasskeyError } from "@/lib/passkey-errors";
import { queryKeys } from "@/lib/query-keys";
import { TimezonePicker } from "@/components/settings/timezone-picker";
import { UnitPreferenceCard } from "@/components/settings/unit-preference-card";
import { InjectionSitesCard } from "@/components/settings/injection-sites-card";
import { detectBrowserTimezone, DEFAULT_TIMEZONE } from "@/lib/tz/format";
interface PasskeyInfo {
@@ -583,6 +585,13 @@ export function AccountSection() {
</form>
</div>
{/* Unit system + global injection-site exclusions live with the
account profile: both are personal preferences that apply
app-wide, not dashboard-layout controls. */}
<UnitPreferenceCard isAuthenticated={isAuthenticated} />
<InjectionSitesCard isAuthenticated={isAuthenticated} />
{/* Passkeys card */}
<div className="bg-card border-border rounded-xl border p-6">
<div className="mb-4 flex items-center gap-2">
@@ -1,14 +1,10 @@
"use client";
import { DashboardLayoutSection } from "@/components/settings/dashboard-layout-section";
import { UnitPreferenceCard } from "@/components/settings/unit-preference-card";
import { InjectionSitesCard } from "@/components/settings/injection-sites-card";
import { useAuth } from "@/hooks/use-auth";
import { useTranslations } from "@/lib/i18n/context";
export function DashboardSection() {
const { t } = useTranslations();
const { isAuthenticated } = useAuth();
return (
<section
@@ -27,10 +23,6 @@ export function DashboardSection() {
</p>
</header>
<UnitPreferenceCard isAuthenticated={isAuthenticated} />
<InjectionSitesCard isAuthenticated={isAuthenticated} />
<DashboardLayoutSection id="dashboard-layout" />
</section>
);