From 07c9d01fafd5acc5267bdb1b9aea8b5dbf34bb51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?=
Date: Fri, 15 May 2026 19:10:13 +0200
Subject: [PATCH] feat(ui): extract a shared NativeSelect primitive and migrate
three call sites
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
v1.4.27 MB7 / CF-52 — three settings/admin surfaces each declared a
local `NATIVE_SELECT_CLASS` constant tracing the same visual contract
as the shadcn ``. The copies had drifted slightly so
`AccountSection`, `TimezonePicker`, and `GeneralSettingsSection`
rendered at subtly different focus-ring weights. The new
`` primitive owns the contract; all three call sites
import it and the in-file constants retire. The native picker remains
the right experience for the 400-entry timezone list and the
admin-only locale dropdowns, so the primitive deliberately stays on a
styled `
-
updateSettings.mutate({ defaultLocale: e.target.value })
}
disabled={updateSettings.isPending}
- className={NATIVE_SELECT_CLASS}
+ className="w-auto"
>
-
+
{/* v1.4.25 W7 — server-wide default timezone for new
@@ -69,13 +74,13 @@ export function GeneralSettingsSection() {
{t("admin.defaultUserTimezoneDescription")}
-
updateSettings.mutate({ defaultUserTimezone: e.target.value })
}
disabled={updateSettings.isPending}
- className={NATIVE_SELECT_CLASS}
+ className="sm:w-auto"
>
{/* Preserve the stored value even if it's not in the
@@ -88,7 +93,7 @@ export function GeneralSettingsSection() {
{zone}
))}
-
+
diff --git a/src/components/settings/account-section.tsx b/src/components/settings/account-section.tsx
index 9a1424d46..c40e98410 100644
--- a/src/components/settings/account-section.tsx
+++ b/src/components/settings/account-section.tsx
@@ -37,6 +37,7 @@ import {
import { Input } from "@/components/ui/input";
import { DateInput } from "@/components/ui/date-input";
import { Label } from "@/components/ui/label";
+import { NativeSelect } from "@/components/ui/native-select";
import { PasswordInput } from "@/components/ui/password-input";
import { useAuth } from "@/hooks/use-auth";
import { formatDate } from "@/lib/format";
@@ -53,15 +54,10 @@ interface PasskeyInfo {
createdAt: string;
}
-/**
- * Shared class string for native `` elements inside the Account
- * card. Mirrors the visual contract of `` and shadcn
- * `` (`h-9`, identical border/focus tokens) so gender,
- * language, and any future native dropdown render at the same height
- * and width as every other input in the form.
- */
-const NATIVE_SELECT_CLASS =
- "border-input bg-background text-foreground ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border px-3 py-1 text-sm focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none";
+// v1.4.27 MB7 / CF-52 — the in-file `NATIVE_SELECT_CLASS` constant
+// retired; the shared `` primitive owns the visual
+// contract now. Existing ``
+// call sites in this file swapped to `` below.
export function AccountSection() {
const { t, locale, setLocale } = useTranslations();
@@ -380,16 +376,15 @@ export function AccountSection() {