From d1f54cd4111a2ac46a568c9c00a809a72ef37870 Mon Sep 17 00:00:00 2001 From: Manuel Rubio Date: Thu, 9 Apr 2026 19:42:03 -0700 Subject: [PATCH] fix(studio): resolve layout shift on account preferences page (#42680) ## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Bug fix ## What is the current behavior? Fixes #34967 The `/account/me` ([https://supabase.com/dashboard/account/me](https://supabase.com/dashboard/account/me)) preferences page has layout shifting during profile loading. ## What is the new behavior? - Loading skeletons now match the structure of the loaded content (one card per dynamic section) - Static sections only render in the non-error branch, preventing them from appearing alongside error messages - Removed unused `isSuccess` destructure from `useProfile()` - CLS value now on good range <= 0.10. Screenshot from 2026-02-11 00-39-19 ## Summary by CodeRabbit * **Refactor** * Enhanced the loading state interface on the account settings page with improved visual indicators. Updated the component structure for better UI consistency and refined the visual feedback mechanism during profile data retrieval. Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com> --- apps/studio/pages/account/me.tsx | 133 +++++++++++++++++++++++++------ 1 file changed, 107 insertions(+), 26 deletions(-) diff --git a/apps/studio/pages/account/me.tsx b/apps/studio/pages/account/me.tsx index 878ee83039..33519b9b0b 100644 --- a/apps/studio/pages/account/me.tsx +++ b/apps/studio/pages/account/me.tsx @@ -1,4 +1,4 @@ -import { Card, CardContent } from 'ui' +import { Card, CardContent, CardFooter } from 'ui' import { PageContainer } from 'ui-patterns/PageContainer' import { PageHeader, @@ -7,7 +7,15 @@ import { PageHeaderSummary, PageHeaderTitle, } from 'ui-patterns/PageHeader' -import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader' +import { + PageSection, + PageSectionContent, + PageSectionDescription, + PageSectionMeta, + PageSectionSummary, + PageSectionTitle, +} from 'ui-patterns/PageSection' +import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader' import { AccountConnections } from '@/components/interfaces/Account/Preferences/AccountConnections' import { AccountDeletion } from '@/components/interfaces/Account/Preferences/AccountDeletion' @@ -58,20 +66,12 @@ const PlatformPreferences = () => { 'profile:show_analytics_and_marketing', 'profile:show_account_deletion', ]) - const { error, isLoading, isError, isSuccess } = useProfile() + const { error, isLoading, isError } = useProfile() return ( <> - {isLoading && ( - - - - - - )} - {isError && ( @@ -80,29 +80,110 @@ const PlatformPreferences = () => { )} - {isSuccess && ( + {!isError && ( <> - {profileShowInformation ? : null} - + {isLoading ? ( + + ) : ( + <> + {profileShowInformation ? : null} + + + )} + + + + + + + + + + {profileShowAnalyticsAndMarketing && } + + {profileShowAccountDeletion && } )} - - - - - - - - - - {profileShowAnalyticsAndMarketing && } - - {profileShowAccountDeletion && } ) } +const ProfileLoadingSections = ({ + showProfileInformation, +}: { + showProfileInformation: boolean +}) => ( + <> + {showProfileInformation && ( + + + + Profile information + + + + + + + + + + + + + + + + + + + + + + + )} + + + + + Account identities + + Manage the providers linked to your Supabase account and update their details. + + + + + + + + + + + + +) + +const ProfileFieldLoadingRow = ({ + labelWidth, + descriptionWidth, +}: { + labelWidth: string + descriptionWidth?: string +}) => ( +
+
+ +
+
+ + {descriptionWidth !== undefined && ( + + )} +
+
+) + const SelfHostedPreferences = () => { return ( <>