Skip to content

Commit 94ce869

Browse files
committed
fix(sidebar): derive the settings and switcher widths from SIDEBAR_WIDTH
This branch moved `SIDEBAR_WIDTH.DEFAULT` from 248 to 238 but left two hardcoded `248px` chrome widths behind, so both sat 10px wider than the live sidebar: - the workspace-switcher menu, which is meant to line up with the sidebar column it drops out of - the standalone settings sidebar, whose own comment says to keep it in step with the in-workspace chrome Both now read `SIDEBAR_WIDTH.DEFAULT` directly rather than repeating the number, so the next change to the constant cannot leave them stale again.
1 parent 999d557 commit 94ce869

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/workspace-header.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {
3838
} from '@/hooks/queries/workspace'
3939
import { usePermissionConfig } from '@/hooks/use-permission-config'
4040
import { useSettingsNavigation } from '@/hooks/use-settings-navigation'
41+
import { SIDEBAR_WIDTH } from '@/stores/constants'
4142

4243
const logger = createLogger('WorkspaceHeader')
4344

@@ -510,7 +511,7 @@ function WorkspaceHeaderImpl({
510511
sideOffset={isCollapsed ? 16 : 8}
511512
className='flex max-h-none flex-col overflow-hidden'
512513
style={{
513-
width: '248px',
514+
width: `${SIDEBAR_WIDTH.DEFAULT}px`,
514515
maxWidth: 'calc(100vw - 24px)',
515516
}}
516517
onCloseAutoFocus={(e) => e.preventDefault()}

apps/sim/components/settings/standalone-settings-shell.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { SettingsSectionProvider } from '@/components/settings/settings-panel'
2626
import { SettingsSidebar } from '@/components/settings/settings-sidebar'
2727
import { useSettingsBeforeUnload } from '@/components/settings/use-settings-before-unload'
2828
import { isBillingEnabled, isHosted } from '@/lib/core/config/env-flags'
29+
import { SIDEBAR_WIDTH } from '@/stores/constants'
2930

3031
interface StandaloneSettingsShellBaseProps {
3132
children: ReactNode
@@ -142,7 +143,8 @@ export function StandaloneSettingsShell(props: StandaloneSettingsShellProps) {
142143
*/}
143144
<div className='flex h-screen w-full overflow-hidden bg-[var(--surface-1)]'>
144145
<aside
145-
className='flex h-full w-[248px] flex-shrink-0 flex-col overflow-hidden bg-[var(--surface-1)] pt-3'
146+
style={{ width: SIDEBAR_WIDTH.DEFAULT }}
147+
className='flex h-full flex-shrink-0 flex-col overflow-hidden bg-[var(--surface-1)] pt-3'
146148
aria-label={`${SETTINGS_PLANE_CHROME[plane].label} settings navigation`}
147149
>
148150
{sidebar}

0 commit comments

Comments
 (0)