From 3146650a5a2329713b9e45d416897aaccd47ed51 Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Tue, 1 Sep 2026 15:22:55 +0200 Subject: [PATCH] Fix `FormItemLayout` usages for a11y (#49761) Follow up of #49637. Usages that impacted tests were fixed in the previous PR. This PR fixes the other usages so that label are correctly linked to their inputs. No visual changes ## How to test 1. Design system: [Form examples](https://design-system-git-fix-form-item-layout-usages-supabase.vercel.app/design-system/docs/ui-patterns/forms): moved `FormControl` around the `SelectTrigger` so that the label is linked to the button (It's actually done like this in the [Select Form example](https://design-system-git-fix-form-item-layout-usages-supabase.vercel.app/design-system/docs/components/select#form) and Radix recommend targeting the button too in their [documentation](https://www.radix-ui.com/primitives/docs/components/select#labelling)) 2. [Access tokens](https://studio-staging-463111oii-supabase.vercel.app/dashboard/account/tokens): updated usage to fallback on generated ids and fixed the select just like _1_ 3. [New TOTP factor](https://studio-staging-463111oii-supabase.vercel.app/dashboard/account/security): updated usage to fallback on generated ids 4. _Studio/Database/Extensions_ (`https://studio-staging-463111oii-supabase.vercel.app/dashboard/project/[PROJECT]/database/extensions`): updated the extension enabling modal to fallback on generated ids 5. _Studio/Integrations/Vault (`https://studio-staging-463111oii-supabase.vercel.app/dashboard/project/[PROJECT]/integrations/vault/secrets`): updated the secret edition modal to fallback on generated ids 6. _Studio/Observability(`https://studio-staging-463111oii-supabase.vercel.app/dashboard/project/[PROJECT]/observability`): updated the report creation and edition modals to fallback on generated ids 7. _Studio/SQL Editor(`https://studio-staging-463111oii-supabase.vercel.app/dashboard/project/[PROJECT]/sql/new`): updated the query renaming modal to fallback on generated ids 8. _Studio/Storage/Analytics(`https://studio-staging-463111oii-supabase.vercel.app/dashboard/project/[PROJECT]/storage/analytics`): updated the table creation sheet to fallback on generated ids (you must have a bucket first) 9. _Studio/Workers(`https://studio-staging-463111oii-supabase.vercel.app/dashboard/project/[PROJECT]/workers`): updated the worker creation modal to fallback on generated ids (you must have a bucket first) 10. Updated [Signup](https://studio-staging-463111oii-supabase.vercel.app/dashboard/sign-up?returnTo=%2Fnew), [Signin](https://studio-staging-463111oii-supabase.vercel.app/dashboard/sign-in) and [SSO Signin](https://studio-staging-463111oii-supabase.vercel.app/dashboard/sign-in-sso) forms to fallback on generated ids ## Summary by CodeRabbit - **Improvements** - Standardized form field presentation across access tokens, authentication, reports, integrations, database extensions, SQL editor, storage, and worker deployment workflows. - Updated password fields and visibility toggles for more consistent input behavior. - Refined token expiration selection, verification code entry, and dropdown layouts. - Preserved existing labels, validation, options, and form functionality while simplifying the interface structure. --- .../example/form-patterns-pagelayout.tsx | 18 +++++----- .../example/form-patterns-sidepanel.tsx | 18 +++++----- .../AccessTokens/Classic/NewTokenDialog.tsx | 36 +++++++++---------- .../AccessTokens/Scoped/Form/TokenDetails.tsx | 2 +- .../Account/TOTPFactors/AddNewFactorModal.tsx | 10 ++---- .../Extensions/EnableExtensionModal.tsx | 2 +- .../Vault/Secrets/EditSecretModal.tsx | 10 ++---- .../interfaces/Reports/CreateReportModal.tsx | 7 ++-- .../interfaces/Reports/UpdateModal.tsx | 7 ++-- .../interfaces/SQLEditor/RenameQueryModal.tsx | 5 ++- .../interfaces/SignIn/SignInForm.tsx | 32 ++++++++--------- .../interfaces/SignIn/SignInSSOForm.tsx | 10 ++---- .../interfaces/SignIn/SignUpForm.tsx | 32 ++++++++--------- .../CreateTable/CreateTableSheet.tsx | 4 +-- .../interfaces/Workers/DeployWorkerDialog.tsx | 8 ++--- 15 files changed, 86 insertions(+), 115 deletions(-) diff --git a/apps/design-system/registry/default/example/form-patterns-pagelayout.tsx b/apps/design-system/registry/default/example/form-patterns-pagelayout.tsx index 42deb0f33d0..59ba2b740fd 100644 --- a/apps/design-system/registry/default/example/form-patterns-pagelayout.tsx +++ b/apps/design-system/registry/default/example/form-patterns-pagelayout.tsx @@ -580,18 +580,18 @@ export default function FormPatternsPageLayout() { label="Select (Dropdown)" description="Single selection from a list of options" > - - + - - US East (N. Virginia) - US West (Oregon) - EU West (Ireland) - - - + + + US East (N. Virginia) + US West (Oregon) + EU West (Ireland) + + )} /> diff --git a/apps/design-system/registry/default/example/form-patterns-sidepanel.tsx b/apps/design-system/registry/default/example/form-patterns-sidepanel.tsx index 1b3a146e357..c3e734a6d7e 100644 --- a/apps/design-system/registry/default/example/form-patterns-sidepanel.tsx +++ b/apps/design-system/registry/default/example/form-patterns-sidepanel.tsx @@ -573,18 +573,18 @@ export default function FormPatternsSidePanel() { label="Select (Dropdown)" description="Single selection from a list of options" > - - + - - US East (N. Virginia) - US West (Oregon) - EU West (Ireland) - - - + + + US East (N. Virginia) + US West (Oregon) + EU West (Ireland) + + )} /> diff --git a/apps/studio/components/interfaces/Account/AccessTokens/Classic/NewTokenDialog.tsx b/apps/studio/components/interfaces/Account/AccessTokens/Classic/NewTokenDialog.tsx index 350802b852c..2a5568fdf5a 100644 --- a/apps/studio/components/interfaces/Account/AccessTokens/Classic/NewTokenDialog.tsx +++ b/apps/studio/components/interfaces/Account/AccessTokens/Classic/NewTokenDialog.tsx @@ -183,13 +183,9 @@ export const NewTokenDialog = ({ name="tokenName" control={form.control} render={({ field }) => ( - + - + )} @@ -199,24 +195,24 @@ export const NewTokenDialog = ({ name="expiresAt" control={form.control} render={({ field }) => ( - +
- - + - - {Object.values(EXPIRES_AT_OPTIONS).map( - (option: { value: string; label: string }) => ( - - {option.label} - - ) - )} - - - + + + {Object.values(EXPIRES_AT_OPTIONS).map( + (option: { value: string; label: string }) => ( + + {option.label} + + ) + )} + + {isCustomExpiry && ( { name="tokenName" control={control} render={({ field }) => ( - + diff --git a/apps/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx b/apps/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx index 8b6ce19fb05..5f3accd726d 100644 --- a/apps/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx +++ b/apps/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx @@ -245,15 +245,9 @@ const SecondStep = ({ name="code" control={form.control} render={({ field }) => ( - + - + )} diff --git a/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx b/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx index 74458383ac0..69a981d0bc7 100644 --- a/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx +++ b/apps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsx @@ -239,7 +239,7 @@ export const EnableExtensionModal = ({ name="name" control={form.control} render={({ field }) => ( - + diff --git a/apps/studio/components/interfaces/Integrations/Vault/Secrets/EditSecretModal.tsx b/apps/studio/components/interfaces/Integrations/Vault/Secrets/EditSecretModal.tsx index d23c09d6e3c..c4ac1a3aa38 100644 --- a/apps/studio/components/interfaces/Integrations/Vault/Secrets/EditSecretModal.tsx +++ b/apps/studio/components/interfaces/Integrations/Vault/Secrets/EditSecretModal.tsx @@ -144,7 +144,7 @@ export const EditSecretModal = () => { name="name" control={form.control} render={({ field }) => ( - + @@ -156,11 +156,7 @@ export const EditSecretModal = () => { name="description" control={form.control} render={({ field }) => ( - + @@ -172,7 +168,7 @@ export const EditSecretModal = () => { name="secret" control={form.control} render={({ field }) => ( - +