From e1324bd9c3f5b62910f397793700b4d522c77c3c Mon Sep 17 00:00:00 2001 From: Kartik Labhshetwar Date: Fri, 12 Dec 2025 00:39:32 +0530 Subject: [PATCH] fix(settings): improve spacing between navigation child items (#25631) * fix(settings): improve spacing between navigation child items * chore: removing prettier formatting * style: update dropdown item class names for consistent rounding * style: add spacing and hover margin to navigation items * style: add hover margin top to navigation item * apply same ui changes for team profile menu --------- Co-authored-by: Dhairyashil --- .../SettingsLayoutAppDirClient.tsx | 222 ++++++++++++++---- .../segment/FilterSegmentSelect.tsx | 4 +- .../shell/navigation/NavigationItem.tsx | 4 +- 3 files changed, 176 insertions(+), 54 deletions(-) diff --git a/apps/web/app/(use-page-wrapper)/settings/(settings-layout)/SettingsLayoutAppDirClient.tsx b/apps/web/app/(use-page-wrapper)/settings/(settings-layout)/SettingsLayoutAppDirClient.tsx index 59e16017d0..4754719f55 100644 --- a/apps/web/app/(use-page-wrapper)/settings/(settings-layout)/SettingsLayoutAppDirClient.tsx +++ b/apps/web/app/(use-page-wrapper)/settings/(settings-layout)/SettingsLayoutAppDirClient.tsx @@ -37,13 +37,41 @@ const getTabs = (orgBranding: OrganizationBranding | null) => { href: "/settings/my-account", icon: "user", children: [ - { name: "profile", href: "/settings/my-account/profile", trackingMetadata: { section: "my_account", page: "profile" } }, - { name: "general", href: "/settings/my-account/general", trackingMetadata: { section: "my_account", page: "general" } }, - { name: "calendars", href: "/settings/my-account/calendars", trackingMetadata: { section: "my_account", page: "calendars" } }, - { name: "conferencing", href: "/settings/my-account/conferencing", trackingMetadata: { section: "my_account", page: "conferencing" } }, - { name: "appearance", href: "/settings/my-account/appearance", trackingMetadata: { section: "my_account", page: "appearance" } }, - { name: "out_of_office", href: "/settings/my-account/out-of-office", trackingMetadata: { section: "my_account", page: "out_of_office" } }, - { name: "push_notifications", href: "/settings/my-account/push-notifications", trackingMetadata: { section: "my_account", page: "push_notifications" } }, + { + name: "profile", + href: "/settings/my-account/profile", + trackingMetadata: { section: "my_account", page: "profile" }, + }, + { + name: "general", + href: "/settings/my-account/general", + trackingMetadata: { section: "my_account", page: "general" }, + }, + { + name: "calendars", + href: "/settings/my-account/calendars", + trackingMetadata: { section: "my_account", page: "calendars" }, + }, + { + name: "conferencing", + href: "/settings/my-account/conferencing", + trackingMetadata: { section: "my_account", page: "conferencing" }, + }, + { + name: "appearance", + href: "/settings/my-account/appearance", + trackingMetadata: { section: "my_account", page: "appearance" }, + }, + { + name: "out_of_office", + href: "/settings/my-account/out-of-office", + trackingMetadata: { section: "my_account", page: "out_of_office" }, + }, + { + name: "push_notifications", + href: "/settings/my-account/push-notifications", + trackingMetadata: { section: "my_account", page: "push_notifications" }, + }, // TODO // { name: "referrals", href: "/settings/my-account/referrals" }, ], @@ -53,16 +81,34 @@ const getTabs = (orgBranding: OrganizationBranding | null) => { href: "/settings/security", icon: "key", children: [ - { name: "password", href: "/settings/security/password", trackingMetadata: { section: "security", page: "password" } }, - { name: "impersonation", href: "/settings/security/impersonation", trackingMetadata: { section: "security", page: "impersonation" } }, - { name: "2fa_auth", href: "/settings/security/two-factor-auth", trackingMetadata: { section: "security", page: "2fa_auth" } }, + { + name: "password", + href: "/settings/security/password", + trackingMetadata: { section: "security", page: "password" }, + }, + { + name: "impersonation", + href: "/settings/security/impersonation", + trackingMetadata: { section: "security", page: "impersonation" }, + }, + { + name: "2fa_auth", + href: "/settings/security/two-factor-auth", + trackingMetadata: { section: "security", page: "2fa_auth" }, + }, ], }, { name: "billing", href: "/settings/billing", icon: "credit-card", - children: [{ name: "manage_billing", href: "/settings/billing", trackingMetadata: { section: "billing", page: "manage_billing" } }], + children: [ + { + name: "manage_billing", + href: "/settings/billing", + trackingMetadata: { section: "billing", page: "manage_billing" }, + }, + ], }, { name: "developer", @@ -70,9 +116,21 @@ const getTabs = (orgBranding: OrganizationBranding | null) => { icon: "terminal", children: [ // - { name: "webhooks", href: "/settings/developer/webhooks", trackingMetadata: { section: "developer", page: "webhooks" } }, - { name: "api_keys", href: "/settings/developer/api-keys", trackingMetadata: { section: "developer", page: "api_keys" } }, - { name: "admin_api", href: "/settings/organizations/admin-api", trackingMetadata: { section: "developer", page: "admin_api" } }, + { + name: "webhooks", + href: "/settings/developer/webhooks", + trackingMetadata: { section: "developer", page: "webhooks" }, + }, + { + name: "api_keys", + href: "/settings/developer/api-keys", + trackingMetadata: { section: "developer", page: "api_keys" }, + }, + { + name: "admin_api", + href: "/settings/organizations/admin-api", + trackingMetadata: { section: "developer", page: "admin_api" }, + }, // TODO: Add profile level for embeds // { name: "embeds", href: "/v2/settings/developer/embeds" }, ], @@ -97,13 +155,13 @@ const getTabs = (orgBranding: OrganizationBranding | null) => { }, ...(orgBranding ? [ - { - name: "members", - href: `${WEBAPP_URL}/settings/organizations/${orgBranding.slug}/members`, - isExternalLink: true, - trackingMetadata: { section: "organization", page: "members" }, - }, - ] + { + name: "members", + href: `${WEBAPP_URL}/settings/organizations/${orgBranding.slug}/members`, + isExternalLink: true, + trackingMetadata: { section: "organization", page: "members" }, + }, + ] : []), { name: "privacy_and_security", @@ -146,31 +204,83 @@ const getTabs = (orgBranding: OrganizationBranding | null) => { icon: "lock", children: [ // - { name: "features", href: "/settings/admin/flags", trackingMetadata: { section: "admin", page: "features" } }, - { name: "license", href: "/auth/setup?step=1", trackingMetadata: { section: "admin", page: "license" } }, - { name: "impersonation", href: "/settings/admin/impersonation", trackingMetadata: { section: "admin", page: "impersonation" } }, - { name: "apps", href: "/settings/admin/apps/calendar", trackingMetadata: { section: "admin", page: "apps" } }, - { name: "users", href: "/settings/admin/users", trackingMetadata: { section: "admin", page: "users" } }, - { name: "organizations", href: "/settings/admin/organizations", trackingMetadata: { section: "admin", page: "organizations" } }, - { name: "lockedSMS", href: "/settings/admin/lockedSMS", trackingMetadata: { section: "admin", page: "locked_sms" } }, - { name: "oAuth", href: "/settings/admin/oAuth", trackingMetadata: { section: "admin", page: "oauth" } }, - { name: "Workspace Platforms", href: "/settings/admin/workspace-platforms", trackingMetadata: { section: "admin", page: "workspace_platforms" } }, - { name: "Playground", href: "/settings/admin/playground", trackingMetadata: { section: "admin", page: "playground" } }, + { + name: "features", + href: "/settings/admin/flags", + trackingMetadata: { section: "admin", page: "features" }, + }, + { + name: "license", + href: "/auth/setup?step=1", + trackingMetadata: { section: "admin", page: "license" }, + }, + { + name: "impersonation", + href: "/settings/admin/impersonation", + trackingMetadata: { section: "admin", page: "impersonation" }, + }, + { + name: "apps", + href: "/settings/admin/apps/calendar", + trackingMetadata: { section: "admin", page: "apps" }, + }, + { + name: "users", + href: "/settings/admin/users", + trackingMetadata: { section: "admin", page: "users" }, + }, + { + name: "organizations", + href: "/settings/admin/organizations", + trackingMetadata: { section: "admin", page: "organizations" }, + }, + { + name: "lockedSMS", + href: "/settings/admin/lockedSMS", + trackingMetadata: { section: "admin", page: "locked_sms" }, + }, + { + name: "oAuth", + href: "/settings/admin/oAuth", + trackingMetadata: { section: "admin", page: "oauth" }, + }, + { + name: "Workspace Platforms", + href: "/settings/admin/workspace-platforms", + trackingMetadata: { section: "admin", page: "workspace_platforms" }, + }, + { + name: "Playground", + href: "/settings/admin/playground", + trackingMetadata: { section: "admin", page: "playground" }, + }, ], }, ]; tabs.find((tab) => { if (tab.name === "security" && !HOSTED_CAL_FEATURES) { - tab.children?.push({ name: "sso_configuration", href: "/settings/security/sso", trackingMetadata: { section: "security", page: "sso_configuration" } }); + tab.children?.push({ + name: "sso_configuration", + href: "/settings/security/sso", + trackingMetadata: { section: "security", page: "sso_configuration" }, + }); // TODO: Enable dsync for self hosters // tab.children?.push({ name: "directory_sync", href: "/settings/security/dsync" }); } if (tab.name === "admin" && IS_CALCOM) { - tab.children?.push({ name: "create_org", href: "/settings/organizations/new", trackingMetadata: { section: "admin", page: "create_org" } }); + tab.children?.push({ + name: "create_org", + href: "/settings/organizations/new", + trackingMetadata: { section: "admin", page: "create_org" }, + }); } if (tab.name === "admin" && IS_CALCOM) { - tab.children?.push({ name: "create_license_key", href: "/settings/license-key/new", trackingMetadata: { section: "admin", page: "create_license_key" } }); + tab.children?.push({ + name: "create_license_key", + href: "/settings/license-key/new", + trackingMetadata: { section: "admin", page: "create_license_key" }, + }); } }); @@ -442,8 +552,9 @@ const TeamListCollapsible = ({ teamFeatures }: { teamFeatures?: Record + aria-label={`${team.name} ${ + teamMenuState[index].teamMenuOpen ? t("collapse_menu") : t("expand_menu") + }`}>
{teamMenuState[index].teamMenuOpen ? ( @@ -451,7 +562,7 @@ const TeamListCollapsible = ({ teamFeatures }: { teamFeatures?: Record )}
- { } + {} {!team.parentId && ( - + {team.accepted && ( - {/* TODO */} - {/* + {/* TODO */} + {/* )} - { } + {} {!tab.icon && tab?.avatar && ( -
+
{tab.children?.map((child, index) => (
+ aria-label={`${otherTeam.name} ${ + otherTeamMenuState[index].teamMenuOpen + ? t("collapse_menu") + : t("expand_menu") + }`}>
{otherTeamMenuState[index].teamMenuOpen ? ( @@ -783,7 +895,7 @@ const SettingsSidebarContainer = ({ )}
- { } + {} {!otherTeam.parentId && ( +
{children}
diff --git a/packages/features/shell/navigation/NavigationItem.tsx b/packages/features/shell/navigation/NavigationItem.tsx index 2d492af00e..2047ced22e 100644 --- a/packages/features/shell/navigation/NavigationItem.tsx +++ b/packages/features/shell/navigation/NavigationItem.tsx @@ -105,7 +105,7 @@ export const NavigationItem: React.FC<{ {t(item.name)} -
+
{item.child?.map((childItem) => { const childIsCurrent = typeof childItem.isCurrent === "function" @@ -196,7 +196,7 @@ export const NavigationItem: React.FC<{ : `[&[aria-current='page']]:bg-emphasis`, isChild ? `[&[aria-current='page']]:text-emphasis [&[aria-current='page']]:bg-emphasis hidden h-8 pl-16 lg:flex lg:pl-11 ${ - props.index === 0 ? "mt-0" : "mt-px" + props.index === 0 ? "mt-0" : "mt-1 hover:mt-1 [&[aria-current='page']]:mt-1" }` : "[&[aria-current='page']]:text-emphasis mt-0.5 text-sm", isLocaleReady