Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix(ui): dechud some dropdowns (#3471)
Fake-Userd7330e94359a
diff --git a/js/app/packages/app/component/app-sidebar/sidebar.tsx b/js/app/packages/app/component/app-sidebar/sidebar.tsxindex 7221ef5d1c..03aa4dbfd8 100644--- a/js/app/packages/app/component/app-sidebar/sidebar.tsx+++ b/js/app/packages/app/component/app-sidebar/sidebar.tsx@@ -438,7 +438,6 @@ const SidebarShortcutLink = (props: SidebarShortcutLinkProps) => {type SettingsMenuItem = {tab: SettingsTab;label: string;- description: string;icon: Component<{ class?: string }>;};@@ -446,19 +445,16 @@ const SETTINGS_MENU_TOP_ITEMS: SettingsMenuItem[] = [{tab: 'Mobile App',label: 'App',- description: 'Get the mobile app',icon: DeviceMobileIcon,},{tab: 'Agent',label: 'MCPs',- description: 'Agent connectors and MCP servers',icon: PlugIcon,},{tab: 'Team',label: 'Team',- description: 'Members and invites',icon: UsersThreeIcon,},];@@ -467,19 +463,16 @@ const SETTINGS_MENU_BOTTOM_ITEMS: SettingsMenuItem[] = [{tab: 'Shortcuts',label: 'Shortcuts',- description: 'Keyboard shortcuts',icon: KeyboardIcon,},{tab: 'Appearance',label: 'Appearance',- description: 'Theme and UI customization',icon: PaintBucketIcon,},{tab: 'Account',label: 'Account',- description: 'Profile, email, and subscription',icon: UserIconPhosphor,},];@@ -623,7 +616,7 @@ const SidebarSettingsWidget = (props: SidebarSettingsWidgetProps) => {<For each={topItems()}>{(item) => (<Dropdown.Item- class="flex items-start gap-2 px-2.5 py-2.5 text-sm cursor-default outline-none text-ink-muted"+ class="flex items-center gap-2 px-2.5 py-2 text-sm cursor-default outline-none text-ink-muted"onSelect={() => props.onSelect(item.tab)}><span class="size-5 flex items-center justify-center">@@ -632,22 +625,16 @@ const SidebarSettingsWidget = (props: SidebarSettingsWidgetProps) => {class="size-4 shrink-0 text-ink-extra-muted"/></span>- <div class="flex flex-col min-w-0">- <span class="text-ink">{item.label}</span>- <span class="text-xxs text-ink-extra-muted leading-tight">- {item.description}- </span>- </div>+ <span class="text-ink">{item.label}</span></Dropdown.Item>)}</For>- <Show when={topItems().length > 0 && bottomItems().length > 0}>- <Dropdown.Separator />- </Show>+ </Dropdown.Group>+ <Dropdown.Group><For each={bottomItems()}>{(item) => (<Dropdown.Item- class="flex items-start gap-2 px-2.5 py-2.5 text-sm cursor-default outline-none text-ink-muted"+ class="flex items-center gap-2 px-2.5 py-2 text-sm cursor-default outline-none text-ink-muted"onSelect={() => props.onSelect(item.tab)}><span class="size-5 flex items-center justify-center">@@ -656,12 +643,7 @@ const SidebarSettingsWidget = (props: SidebarSettingsWidgetProps) => {class="size-4 shrink-0 text-ink-extra-muted"/></span>- <div class="flex flex-col min-w-0">- <span class="text-ink">{item.label}</span>- <span class="text-xxs text-ink-extra-muted leading-tight">- {item.description}- </span>- </div>+ <span class="text-ink">{item.label}</span></Dropdown.Item>)}</For>diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/active-filter-chips.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/active-filter-chips.tsxindex b29783f89d..960a281af5 100644--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/active-filter-chips.tsx+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/active-filter-chips.tsx@@ -201,7 +201,7 @@ const FilterChip = (props: {</span>}>- <Dropdown open={open()} onOpenChange={setOpen} gutter={4}>+ <Dropdown open={open()} onOpenChange={setOpen}><Dropdown.Triggervariant="ghost"class="inline-flex items-center gap-1.5 px-2 leading-none not-disabled:hover:bg-ink/10 not-disabled:active:bg-ink/12"diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/group-dropdown.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/group-dropdown.tsxindex dfa39991fb..93d8b04dab 100644--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/group-dropdown.tsx+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/group-dropdown.tsx@@ -21,7 +21,6 @@ export const GroupDropdown: Component<GroupDropdownProps> = (props) => {open={props.open}onOpenChange={props.onOpenChange}placement="bottom-start"- gutter={4}><Tooltip label="Group"><Dropdown.Trigger depth={2} class="bg-surface">diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/sort-dropdown.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/sort-dropdown.tsxindex 8896d37ac0..6dd0259e6e 100644--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/sort-dropdown.tsx+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/sort-dropdown.tsx@@ -29,7 +29,6 @@ export const SortDropdown: Component<SortDropdownProps> = (props) => {open={props.open}onOpenChange={props.onOpenChange}placement="bottom-start"- gutter={4}><Tooltip label="Sort" hotkey={TOKENS.soup.sort}><Dropdown.Trigger depth={2} class="bg-surface">diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view-create-button.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view-create-button.tsxindex b7e1a4eb83..26073627b1 100644--- a/js/app/packages/app/component/next-soup/soup-view/soup-view-create-button.tsx+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view-create-button.tsx@@ -155,7 +155,7 @@ export const SoupViewCreateButton = () => {);const MultiOptionButton = (props: { hideLabel?: boolean }) => (- <Dropdown placement="bottom-start" gutter={4}>+ <Dropdown placement="bottom-start"><Dropdown.Triggervariant="active"class={cn(diff --git a/js/app/packages/channel/Call/CallControls/CallControlsDefaultAndPanelRow.tsx b/js/app/packages/channel/Call/CallControls/CallControlsDefaultAndPanelRow.tsxindex 42ce7c31a6..d3801d4680 100644--- a/js/app/packages/channel/Call/CallControls/CallControlsDefaultAndPanelRow.tsx+++ b/js/app/packages/channel/Call/CallControls/CallControlsDefaultAndPanelRow.tsx@@ -8,7 +8,7 @@ import VideoCameraSlash from '@phosphor/video-camera-slash.svg';import { cn, Dropdown } from '@ui';import { type Accessor, For, Show } from 'solid-js';import { match } from 'ts-pattern';-import { BACKGROUND_IMAGES, useCallContext } from '../CallContext';+import { useCallContext } from '../CallContext';import { CallDeviceList } from '../CallDeviceList';import {CallControlButton,@@ -47,14 +47,23 @@ function isBackgroundBlurSupported(): boolean {return hasStreamProcessor || hasFallback;}+const BACKGROUND_OPTIONS = [+ { value: 'none', label: 'None' },+ { value: 'blur-light', label: 'Small blur' },+ { value: 'blur-medium', label: 'Medium blur' },+ { value: 'blur-heavy', label: 'Large blur' },+] as const;++type BackgroundOptionValue = (typeof BACKGROUND_OPTIONS)[number]['value'];+function BackgroundEffectSelector() {const callCtx = useCallContext();- const currentEffectValue = () => {+ const currentEffectValue = (): BackgroundOptionValue | '' => {const effect = callCtx.backgroundEffect();if (effect.type === 'none') return 'none';if (effect.type === 'blur') return `blur-${effect.intensity}`;- return `image-${effect.id}`;+ return '';};const handleChange = (value: string) => {@@ -70,20 +79,6 @@ function BackgroundEffectSelector() {| 'heavy';callCtx.setBackgroundEffect({ type: 'blur', intensity });- return;- }-- if (value.startsWith('image-')) {- const id = value.replace('image-', '');- const bg = BACKGROUND_IMAGES.find((b) => b.id === id);-- if (!bg) return;-- callCtx.setBackgroundEffect({- type: 'image',- id: bg.id,- path: bg.path,- });}};@@ -91,49 +86,17 @@ function BackgroundEffectSelector() {<Dropdown.RadioGroup value={currentEffectValue()} onChange={handleChange}><Dropdown.Group><Dropdown.GroupLabel>Background</Dropdown.GroupLabel>- <Dropdown.RadioItem value="none">- <span class="flex-1 truncate">None</span>- <Dropdown.ItemIndicator>- <CheckIcon class="size-3.5 text-accent" />- </Dropdown.ItemIndicator>- </Dropdown.RadioItem>- </Dropdown.Group>- <Dropdown.Group>- <Dropdown.GroupLabel>Blur</Dropdown.GroupLabel>- <Dropdown.RadioItem value="blur-light">- <span class="flex-1 truncate">Light</span>- <Dropdown.ItemIndicator>- <CheckIcon class="size-3.5 text-accent" />- </Dropdown.ItemIndicator>- </Dropdown.RadioItem>- <Dropdown.RadioItem value="blur-medium">- <span class="flex-1 truncate">Medium</span>- <Dropdown.ItemIndicator>- <CheckIcon class="size-3.5 text-accent" />- </Dropdown.ItemIndicator>- </Dropdown.RadioItem>- <Dropdown.RadioItem value="blur-heavy">- <span class="flex-1 truncate">Heavy</span>- <Dropdown.ItemIndicator>- <CheckIcon class="size-3.5 text-accent" />- </Dropdown.ItemIndicator>- </Dropdown.RadioItem>+ <For each={BACKGROUND_OPTIONS}>+ {(option) => (+ <Dropdown.RadioItem value={option.value}>+ <span class="flex-1 truncate">{option.label}</span>+ <Dropdown.ItemIndicator>+ <CheckIcon class="size-3.5 text-accent" />+ </Dropdown.ItemIndicator>+ </Dropdown.RadioItem>+ )}+ </For></Dropdown.Group>- <Show when={BACKGROUND_IMAGES.length}>- <Dropdown.Group>- <Dropdown.GroupLabel>Image</Dropdown.GroupLabel>- <For each={BACKGROUND_IMAGES}>- {(bg) => (- <Dropdown.RadioItem value={`image-${bg.id}`}>- <span class="flex-1 truncate">{bg.label}</span>- <Dropdown.ItemIndicator>- <CheckIcon class="size-3.5 text-accent" />- </Dropdown.ItemIndicator>- </Dropdown.RadioItem>- )}- </For>- </Dropdown.Group>- </Show></Dropdown.RadioGroup>);}diff --git a/js/app/packages/channel/Call/CallControls/CallControlsPanelSmallRow.tsx b/js/app/packages/channel/Call/CallControls/CallControlsPanelSmallRow.tsxindex 427db141a6..6cbc83474c 100644--- a/js/app/packages/channel/Call/CallControls/CallControlsPanelSmallRow.tsx+++ b/js/app/packages/channel/Call/CallControls/CallControlsPanelSmallRow.tsx@@ -50,7 +50,7 @@ export function CallControlsPanelSmallRow(props.class)}>- <Dropdown placement="top-start" gutter={4}>+ <Dropdown placement="top-start"><Dropdown.Triggeras="button"type="button"diff --git a/js/app/packages/core/component/Properties/component/modal/CreatePropertyModal.tsx b/js/app/packages/core/component/Properties/component/modal/CreatePropertyModal.tsxindex f8d292d9cf..63793b1ebf 100644--- a/js/app/packages/core/component/Properties/component/modal/CreatePropertyModal.tsx+++ b/js/app/packages/core/component/Properties/component/modal/CreatePropertyModal.tsx@@ -462,7 +462,7 @@ export const CreatePropertyModal: Component<CreatePropertyModalProps> = (<label class="block text-xs font-medium text-ink mb-1">Data Type</label>- <Dropdown gutter={4}>+ <Dropdown><Dropdown.Trigger class="w-full p-1.5 border border-edge-muted bg-surface text-sm text-ink text-left flex items-center gap-2 hover:bg-hover rounded-sm justify-between"><span class="truncate">{selectedDataTypeLabel()}</span><CaretDownIcon class="size-3 text-ink-muted shrink-0" />diff --git a/js/app/packages/core/component/TabsInsetDropdown.tsx b/js/app/packages/core/component/TabsInsetDropdown.tsxindex 188331df8f..61db3a13bb 100644--- a/js/app/packages/core/component/TabsInsetDropdown.tsx+++ b/js/app/packages/core/component/TabsInsetDropdown.tsx@@ -37,7 +37,7 @@ export const TabsInsetDropdown = (props: TabsInsetDropdownProps) => {});return (- <Dropdown placement="bottom-start" gutter={4}>+ <Dropdown placement="bottom-start"><Dropdown.Triggerclass={cn('not-disabled:hover:bg-surface active:bg-surface focus-visible:bg-surface',diff --git a/js/app/packages/property/src/core/Root.tsx b/js/app/packages/property/src/core/Root.tsxindex a42612974b..6097bea33f 100644--- a/js/app/packages/property/src/core/Root.tsx+++ b/js/app/packages/property/src/core/Root.tsx@@ -69,7 +69,6 @@ export function Root(props: PropertyRootProps) {open={editorOpen()}onOpenChange={setEditorOpen}getAnchorRect={() => editorAnchor()?.getBoundingClientRect()}- gutter={4}placement="bottom-start"><divdiff --git a/js/app/packages/property/src/editors/popover/EditorPopover.tsx b/js/app/packages/property/src/editors/popover/EditorPopover.tsxindex 248f66643f..45b9e730c5 100644--- a/js/app/packages/property/src/editors/popover/EditorPopover.tsx+++ b/js/app/packages/property/src/editors/popover/EditorPopover.tsx@@ -29,16 +29,18 @@ export function EditorPopover(props: EditorPopoverProps) {return (<Dropdown.Content- mount={ctx.portalMount()}- depth={3}class={cn('max-h-96 overflow-hidden flex flex-col w-full max-w-60 p-0',props.class)}- onEscapeKeyDown={close}onInteractOutside={close}+ onEscapeKeyDown={close}+ mount={ctx.portalMount()}+ depth={3}>- {props.children}+ <Dropdown.Group class="p-0 gap-0 flex-1 min-h-0">+ {props.children}+ </Dropdown.Group></Dropdown.Content>);}diff --git a/js/app/packages/ui/components/Dropdown.tsx b/js/app/packages/ui/components/Dropdown.tsxindex aec470d1b9..3affa939c7 100644--- a/js/app/packages/ui/components/Dropdown.tsx+++ b/js/app/packages/ui/components/Dropdown.tsx@@ -26,7 +26,6 @@ import { splitProps, type ComponentProps } from 'solid-js';// const DROPDOWN_CONTENT_CLASS = 'z-action-menu bg-surface rounded-xl ring-1 ring-edge shadow-[0_8px_24px_-16px_rgba(0,0,0,0.24),0_2px_8px_-6px_rgba(0,0,0,0.18)] p-1.5';// const DROPDOWN_ITEM_CLASS = 'rounded-md hover:bg-ink/3 focus:bg-ink/3 data-[highlighted]:bg-ink/3';-// const DROPDOWN_SEPARATOR_CLASS = 'h-px bg-edge-muted border-0 -mx-1.5 my-1';export type DropdownSubContentProps = ComponentProps<typeof KobalteDropdownMenu.SubContent> & { depth?: SurfaceProps['depth']; mount?: PortalMount; };export type DropdownContentProps = ComponentProps<typeof KobalteDropdownMenu.Content> & { depth?: SurfaceProps['depth']; mount?: PortalMount; };@@ -41,33 +40,36 @@ export type DropdownItemProps = ComponentProps<typeof KobalteDropdownMenu.Item>;export type DropdownSubProps = ComponentProps<typeof KobalteDropdownMenu.Sub>;type PortalMount = ComponentProps<typeof KobalteDropdownMenu.Portal>['mount'];-const ROW_CLASS = 'rounded-lg w-full flex items-center gap-2.5 px-2 h-8 text-left text-xs cursor-default outline-none hover:bg-ink/5 data-highlighted:bg-ink/5 data-disabled:opacity-50 data-disabled:cursor-not-allowed';-const CONTENT_CLASS ='rounded-xl flex flex-col size-auto z-action-menu gap-1 bg-edge-muted ';+const ROW_CLASS = 'rounded-lg w-full flex items-center gap-2.5 px-2 h-8 text-left text-xs cursor-default outline-none hover:bg-ink/5 data-highlighted:bg-ink/5 data-disabled:opacity-50 data-disabled:cursor-not-allowed';function DropdownContent(props: DropdownContentProps) {- const [local, rest] = splitProps(props, ['depth', 'class', 'mount']);+ const [local, rest] = splitProps(props, ['depth', 'class', 'mount', 'children']);return (<KobalteDropdownMenu.Portal mount={local.mount}><KobalteDropdownMenu.Content- class={cn(CONTENT_CLASS, local.class)}+ class={cn('rounded-xl size-auto z-action-menu', local.class)}depth={local.depth ?? 2}as={Surface}{...rest}- />+ >+ <div class="flex flex-col gap-px bg-edge-muted size-full">{local.children}</div>+ </KobalteDropdownMenu.Content></KobalteDropdownMenu.Portal>);}function DropdownSubContent(props: DropdownSubContentProps) {- const [local, rest] = splitProps(props, ['depth', 'class', 'mount']);+ const [local, rest] = splitProps(props, ['depth', 'class', 'mount', 'children']);return (<KobalteDropdownMenu.Portal mount={local.mount}><KobalteDropdownMenu.SubContent- class={cn(CONTENT_CLASS, local.class)}+ class={cn('rounded-xl size-auto z-action-menu', local.class)}depth={local.depth ?? 2}as={Surface}{...rest}- />+ >+ <div class="flex flex-col gap-px bg-edge-muted size-full">{local.children}</div>+ </KobalteDropdownMenu.SubContent></KobalteDropdownMenu.Portal>);}@@ -129,7 +131,8 @@ function DropdownRadioItem(props: DropdownRadioItemProps) {function DropdownSub(props: DropdownSubProps) {return (<KobalteDropdownMenu.Sub- gutter={12}+ gutter={11}+ shift={-7}{...props}/>);@@ -156,7 +159,7 @@ function DropdownTrigger(props: DropdownTriggerProps) {);}-export const Dropdown = Object.assign((props: ComponentProps<typeof KobalteDropdownMenu>) => (<KobalteDropdownMenu {...props} />), {+export const Dropdown = Object.assign((props: ComponentProps<typeof KobalteDropdownMenu>) => (<KobalteDropdownMenu gutter={4} {...props} />), {RadioGroup: KobalteDropdownMenu.RadioGroup, /* passthrough — pure logical wrapper */Separator: KobalteDropdownMenu.Separator, /* passthrough — styled via class at use sites */ItemIndicator: DropdownItemIndicator,