Skip to content

Commit 79d40f7

Browse files
committed
fix(settings): align general appearance dropdowns to a uniform width
Theme/Snap-to-grid (ChipSelect) hugged their content (~90px) while Timezone (ChipCombobox) was pinned to 260px, so the three read as a ragged column. Give all three a shared 240px trigger via fullWidth + a common width wrapper so they align as one column; menus match their triggers. No behavioral change — timezone keeps search, options and handlers are untouched.
1 parent 3aa2b61 commit 79d40f7

1 file changed

Lines changed: 42 additions & 29 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/settings/components/general

apps/sim/app/workspace/[workspaceId]/settings/components/general/general.tsx

Lines changed: 42 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ const logger = createLogger('General')
4545
/** Human-friendly timezone options for the picker, common zones first. */
4646
const TIMEZONE_OPTIONS = getTimezoneOptions()
4747

48+
/**
49+
* Shared trigger width for the three appearance dropdowns (Theme, Timezone, Snap
50+
* to grid) so they line up as one column instead of three differently-sized
51+
* pills. Wide enough for the longest common timezone label.
52+
*/
53+
const DROPDOWN_TRIGGER_CLASS = 'w-[240px] flex-shrink-0'
54+
4855
/**
4956
* Extracts initials from a user's name.
5057
* @param name - The user's full name
@@ -401,26 +408,29 @@ export function General() {
401408
<div className='flex flex-col gap-4'>
402409
<div className='flex items-center justify-between'>
403410
<Label htmlFor='theme-select'>Theme</Label>
404-
<ChipSelect
405-
align='start'
406-
dropdownWidth={140}
407-
value={settings?.theme}
408-
onChange={handleThemeChange}
409-
placeholder='Select theme'
410-
options={[
411-
{ label: 'System', value: 'system' },
412-
{ label: 'Light', value: 'light' },
413-
{ label: 'Dark', value: 'dark' },
414-
]}
415-
/>
411+
<div className={DROPDOWN_TRIGGER_CLASS}>
412+
<ChipSelect
413+
align='start'
414+
fullWidth
415+
dropdownWidth='trigger'
416+
value={settings?.theme}
417+
onChange={handleThemeChange}
418+
placeholder='Select theme'
419+
options={[
420+
{ label: 'System', value: 'system' },
421+
{ label: 'Light', value: 'light' },
422+
{ label: 'Dark', value: 'dark' },
423+
]}
424+
/>
425+
</div>
416426
</div>
417427

418428
<div className='flex items-center justify-between gap-4'>
419429
<Label>Timezone</Label>
420-
<div className='w-[260px] flex-shrink-0'>
430+
<div className={DROPDOWN_TRIGGER_CLASS}>
421431
<ChipCombobox
422432
align='start'
423-
dropdownWidth={260}
433+
dropdownWidth={240}
424434
searchable
425435
searchPlaceholder='Search timezones'
426436
value={settings?.timezone ?? getBrowserTimezone()}
@@ -480,21 +490,24 @@ export function General() {
480490

481491
<div className='flex items-center justify-between'>
482492
<Label htmlFor='snap-to-grid'>Snap to grid</Label>
483-
<ChipSelect
484-
align='start'
485-
dropdownWidth={140}
486-
value={String(snapToGridValue)}
487-
onChange={handleSnapToGridChange}
488-
placeholder='Select size'
489-
options={[
490-
{ label: 'Off', value: '0' },
491-
{ label: '10px', value: '10' },
492-
{ label: '20px', value: '20' },
493-
{ label: '30px', value: '30' },
494-
{ label: '40px', value: '40' },
495-
{ label: '50px', value: '50' },
496-
]}
497-
/>
493+
<div className={DROPDOWN_TRIGGER_CLASS}>
494+
<ChipSelect
495+
align='start'
496+
fullWidth
497+
dropdownWidth='trigger'
498+
value={String(snapToGridValue)}
499+
onChange={handleSnapToGridChange}
500+
placeholder='Select size'
501+
options={[
502+
{ label: 'Off', value: '0' },
503+
{ label: '10px', value: '10' },
504+
{ label: '20px', value: '20' },
505+
{ label: '30px', value: '30' },
506+
{ label: '40px', value: '40' },
507+
{ label: '50px', value: '50' },
508+
]}
509+
/>
510+
</div>
498511
</div>
499512

500513
<div className='flex items-center justify-between'>

0 commit comments

Comments
 (0)