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
style(ui): new create menu (#7727)
Seamus677c1cc59c3a
diff --git a/apps/web/src/components/app/sidebar-next/create-button.tsx b/apps/web/src/components/app/sidebar-next/create-button.tsxindex 35343309dc..e22974f948 100644--- a/apps/web/src/components/app/sidebar-next/create-button.tsx+++ b/apps/web/src/components/app/sidebar-next/create-button.tsx@@ -1,30 +1,36 @@-import { SidebarCreateMenu } from '@app/features/command/sidebar/sidebar-create-menu';+import {+ createMenuOpen,+ setCreateMenuOpen,+} from '@app/features/command/Launcher';+import { APP_TOUR } from '@app/features/command/sidebar/tour';+import { useAnalytics } from '@app/lib/analytics/analytics-context';import { TOKENS } from '@core/hotkey/tokens';import PlusIcon from '@phosphor/plus.svg';-import { Button, type ButtonProps } from '@ui';+import { Button } from '@ui';+import { tourTarget } from '@ui/components/Tour';-/** The rail's create trigger, with the same treatment as Search.- * Kobalte forwards its trigger ref and handlers through the custom component.- */-const RailCreateTrigger = (props: ButtonProps) => (- <Button- {...props}- variant="ghost"- class="size-10 [&_svg]:size-5"- size="icon-md"- label="Create"- tooltipPlacement="right"- hotkey={TOKENS.global.createCommand}- >- <PlusIcon class="size-5" />- </Button>-);--export const SidebarRailCreateButton = (props: {- onMenuOpenChange?: (open: boolean) => void;-}) => (- <SidebarCreateMenu- trigger={RailCreateTrigger}- onMenuOpenChange={props.onMenuOpenChange}- />-);+/** The rail and keyboard shortcut open the same desktop launcher. */+export const SidebarRailCreateButton = () => {+ const analytics = useAnalytics();+ const createMenuTarget = tourTarget(APP_TOUR.createMenu);+ return (+ <Button+ ref={createMenuTarget}+ variant="ghost"+ class="size-10 [&_svg]:size-5"+ size="icon-md"+ label="Create"+ tooltipPlacement="right"+ hotkey={TOKENS.global.createCommand}+ aria-haspopup="dialog"+ aria-expanded={createMenuOpen()}+ onClick={() => {+ if (!createMenuOpen())+ analytics.track('create_menu_open', { from: 'sidebar' });+ setCreateMenuOpen((open) => !open);+ }}+ >+ <PlusIcon class="size-5" />+ </Button>+ );+};diff --git a/apps/web/src/components/app/split-layout/componentRegistry.tsx b/apps/web/src/components/app/split-layout/componentRegistry.tsxindex eed660910c..c318b3de9f 100644--- a/apps/web/src/components/app/split-layout/componentRegistry.tsx+++ b/apps/web/src/components/app/split-layout/componentRegistry.tsx@@ -646,3 +646,8 @@ registerComponent('ui',lazy(() => import('@app/features/ui-gallery/UiGallery')));++registerComponent(+ 'create-menu-demo',+ lazy(() => import('@app/features/command/debug/CreateMenuDemo'))+);diff --git a/apps/web/src/features/command/CarouselLauncher.tsx b/apps/web/src/features/command/CarouselLauncher.tsxnew file mode 100644index 0000000000..632c0f20b5--- /dev/null+++ b/apps/web/src/features/command/CarouselLauncher.tsx@@ -0,0 +1,34 @@+import { Show } from 'solid-js';+import { CarouselCards } from './components/CarouselCards';+import { type LauncherInnerProps, LauncherShell } from './Launcher';++/** Production carousel, sharing creation, history, and shortcuts with the list. */+export default function CarouselLauncher(props: LauncherInnerProps) {+ return (+ <LauncherShell {...props} horizontalNavigation>+ {(state) => (+ <Show+ when={state.blocks().length}+ fallback={+ <div+ role="status"+ class="flex h-56 items-center justify-center pb-12 text-sm text-ink-muted"+ >+ No matching create options+ </div>+ }+ >+ <CarouselCards+ items={state.blocks()}+ selectedIndex={state.selectedIndex()}+ itemId={state.itemId}+ showHotkeys={!state.searchMode()}+ onSelect={state.select}+ onStep={state.step}+ onChoose={state.choose}+ />+ </Show>+ )}+ </LauncherShell>+ );+}diff --git a/apps/web/src/features/command/CommandMenu.tsx b/apps/web/src/features/command/CommandMenu.tsxindex 865abd3d9a..25cfefc032 100644--- a/apps/web/src/features/command/CommandMenu.tsx+++ b/apps/web/src/features/command/CommandMenu.tsx@@ -20,6 +20,7 @@ import {setActiveScope,setPressedKeys,} from '@core/hotkey/state';+import { TOKENS } from '@core/hotkey/tokens';import type { HotkeyCommand, RegisterHotkeyReturn } from '@core/hotkey/types';import { runCommand } from '@core/hotkey/utils';import { debouncedDependent } from '@core/util/debounce';@@ -112,7 +113,13 @@ export function CommandMenu() {});const handleSelect = (item: CommandMenuItem) => {- if (isSearchItem(item) || isAskAiItem(item) || item.kind === 'new-project')+ if (+ isSearchItem(item) ||+ isAskAiItem(item) ||+ item.kind === 'new-project' ||+ (isCommandItem(item) &&+ item.data.hotkeyToken === TOKENS.global.createCommand)+ )suppressCloseAutoFocus = true;};@@ -320,8 +327,11 @@ export function CommandMenuInner(props: {const command = item.data;trackCommandUsage(item.id);- // Check if this is a multi-stage command- if (command.activateCommandScopeId) {+ // Create opens its own launcher; other multi-stage commands stay here.+ if (+ command.activateCommandScopeId &&+ command.hotkeyToken !== TOKENS.global.createCommand+ ) {const commandScope = hotkeyScopeTree.get(command.activateCommandScopeId);diff --git a/apps/web/src/features/command/DetailsLauncher.tsx b/apps/web/src/features/command/DetailsLauncher.tsxnew file mode 100644index 0000000000..91b0ac484e--- /dev/null+++ b/apps/web/src/features/command/DetailsLauncher.tsx@@ -0,0 +1,22 @@+import { LauncherDetails } from './components/LauncherDetails';+import { groupRecentCreateMenuItems } from './core/create-menu-details';+import { type LauncherInnerProps, LauncherShell } from './Launcher';++export default function DetailsLauncher(props: LauncherInnerProps) {+ return (+ <LauncherShell {...props} groupItems={groupRecentCreateMenuItems}>+ {(state) => (+ <LauncherDetails+ sections={state.sections()}+ items={state.blocks()}+ selectedIndex={state.selectedIndex()}+ itemId={state.itemId}+ onSelect={state.select}+ onChoose={state.choose}+ showHotkeys={!state.searchMode()}+ scrollSelectedIntoView={state.scrollSelectedIntoView()}+ />+ )}+ </LauncherShell>+ );+}diff --git a/apps/web/src/features/command/Launcher.test.tsx b/apps/web/src/features/command/Launcher.test.tsxindex d376af46af..8bb252c810 100644--- a/apps/web/src/features/command/Launcher.test.tsx+++ b/apps/web/src/features/command/Launcher.test.tsx@@ -1,5 +1,5 @@import { MemoryRouter, Route } from '@solidjs/router';-import { cleanup, render } from '@solidjs/testing-library';+import { cleanup, fireEvent, render } from '@solidjs/testing-library';import { createSignal } from 'solid-js';import { afterEach, beforeEach, expect, it, vi } from 'vitest';@@ -8,6 +8,7 @@ const host = vi.hoisted(() => ({openWithSplit: vi.fn(),createFolder: vi.fn(),projectFlag: (): boolean | undefined => true,+ carouselFlag: (): boolean | undefined => undefined,}));vi.mock('@components/app/split-layout/layout', () => ({@@ -40,7 +41,9 @@ vi.mock('@app/features/reminders/reminder-composer', () => ({}));vi.mock('@app/lib/analytics/posthog', () => ({useFeatureFlag: (flag: { key: string }) => () => ({enabled:- flag.key === 'enable-projects' ? host.projectFlag() === true : false,+ flag.key === 'enable-carousel-create-menu'+ ? host.carouselFlag() === true+ : flag.key === 'enable-projects' && host.projectFlag() === true,loading: flag.key === 'enable-projects' && host.projectFlag() === undefined,}),}));@@ -64,10 +67,26 @@ vi.mock('@macro-inc/lexical-core/markdown-golden', () => ({}));vi.mock('@ui', () => ({}));vi.mock('@ui/components/Hotkey', () => ({}));vi.mock('./mobile/MobileCreateSheet', () => ({}));+vi.mock('./DetailsLauncher', () => ({+ default: (props: LauncherInnerProps) => (+ <button onClick={() => props.onClose(false)}>+ Details: {props.blocks?.map((item) => item.label).join(', ')}+ </button>+ ),+}));+vi.mock('./CarouselLauncher', () => ({+ default: (props: LauncherInnerProps) => (+ <button onClick={() => props.onClose(false)}>+ Carousel: {props.blocks?.map((item) => item.label).join(', ')}+ </button>+ ),+}));import {CREATABLE_BLOCKS,createMenuOpen,+ LauncherInner,+ type LauncherInnerProps,runCreateAction,setCreateMenuOpen,useCreateMenuBlocks,@@ -75,6 +94,35 @@ import {beforeEach(() => {host.projectFlag = () => true;+ host.carouselFlag = () => undefined;+});++it.each([false, undefined])(+ 'uses the detailed launcher when the carousel flag is %s',+ async (enabled) => {+ host.carouselFlag = () => enabled;+ const view = render(() => <LauncherInner onClose={vi.fn()} />);+ await view.findByText('Details:');+ expect(view.queryByText('Carousel:')).toBeNull();+ }+);++it('switches the launcher with the flag while forwarding sandbox choices and close behavior', async () => {+ const [enabled, setEnabled] = createSignal(false);+ host.carouselFlag = enabled;+ const onClose = vi.fn();+ const blocks = CREATABLE_BLOCKS.filter((item) => item.label === 'Task');+ const view = render(() => (+ <LauncherInner blocks={blocks} onClose={onClose} />+ ));+ await view.findByText('Details: Task');+ setEnabled(true);+ fireEvent.click(await view.findByText('Carousel: Task'));+ expect(onClose).toHaveBeenCalledExactlyOnceWith(false);+ expect(view.queryByText('Details: Task')).toBeNull();+ setEnabled(false);+ await view.findByText('Details: Task');+ expect(view.queryByText('Carousel: Task')).toBeNull();});afterEach(() => {cleanup();diff --git a/apps/web/src/features/command/Launcher.tsx b/apps/web/src/features/command/Launcher.tsxindex a28e7e94e3..82d8231993 100644--- a/apps/web/src/features/command/Launcher.tsx+++ b/apps/web/src/features/command/Launcher.tsx@@ -23,6 +23,7 @@ import { getIconConfig } from '@core/component/EntityIcon';import { toast } from '@core/component/Toast/Toast';import {enableAiEditor,+ enableCarouselCreateMenu,enableChatV3Agents,enableDatabases,enableFigViewer,@@ -61,8 +62,6 @@ import { createForm } from '@queries/storage/forms';import { makePersisted } from '@solid-primitives/storage';import { useNavigate } from '@solidjs/router';import {- CommandMenuHotkeyHint,- CommandMenuList,CommandMenuSearchInput,CommandMenuShell,cn,@@ -73,23 +72,29 @@ import {import { getNormalizedKeyString } from '@ui/components/Hotkey';import {type Accessor,- createEffect,createMemo,createSignal,+ type JSX,+ lazy,onCleanup,onMount,Show,+ Suspense,} from 'solid-js';import { createStore } from 'solid-js/store';import { Dynamic } from 'solid-js/web';+import type { CreateMenuSection } from './core/create-menu-details';+import {+ launcherItemKey,+ recentLauncherBlocks,+ sortLauncherBlocks,+} from './core/launcher-history';import { createCallCommand } from './create-call-command';import { MobileCreateSheet } from './mobile/MobileCreateSheet';import type { CreatableBlock, CreatableName } from './types';const LAUNCHER_FRECENCY_STORE = 'launcher-frecency-v1';const LAUNCHER_SEARCH_MODE_STORE = 'launcher-search-mode-v1';-const FRECENCY_COUNT_WEIGHT = 10;-const FRECENCY_HALF_LIFE_DAYS = 14;type LauncherFrecencyEntry = {count: number;@@ -107,31 +112,8 @@ const [launcherSearchMode, setLauncherSearchModePreference] = makePersisted({ name: LAUNCHER_SEARCH_MODE_STORE });-function launcherItemKey(item: CreatableBlock) {- return String(item.hotkeyToken ?? `${item.label}:${item.hotkey}`);-}--function launcherFrecencyScore(item: CreatableBlock, now = Date.now()) {- const entry = launcherFrecencyStore[launcherItemKey(item)];- if (!entry) return 0;-- const ageMs = Math.max(now - entry.lastUsedAt, 0);- const halfLifeMs = FRECENCY_HALF_LIFE_DAYS * 24 * 60 * 60 * 1000;- const recency = Math.pow(0.5, ageMs / halfLifeMs);-- return entry.count * FRECENCY_COUNT_WEIGHT + recency;-}--function sortLauncherBlocks(items: CreatableBlock[]) {- const now = Date.now();- return items- .map((item, index) => ({- item,- index,- score: launcherFrecencyScore(item, now),- }))- .sort((a, b) => b.score - a.score || a.index - b.index)- .map(({ item }) => item);+export function useRecentCreateMenuBlocks(items: Accessor<CreatableBlock[]>) {+ return createMemo(() => recentLauncherBlocks(items(), launcherFrecencyStore));}function trackLauncherItemUsage(item: CreatableBlock) {@@ -956,7 +938,7 @@ type LauncherMenuItemProps = {showHotkey?: boolean;};-const LauncherMenuItem = (props: LauncherMenuItemProps) => {+export const LauncherMenuItem = (props: LauncherMenuItemProps) => {const selectedIconColor = () =>getIconConfig(props.creatableBlock.blockName).foreground;const launcherHint = () => props.creatableBlock.launcherHint;@@ -986,7 +968,7 @@ const LauncherMenuItem = (props: LauncherMenuItemProps) => {</div><Show when={props.showHotkey}>- <div class="flex border border-edge-muted text-xxs rounded-md items-center px-1.5 py-px font-normal text-ink-muted">+ <div class="flex border border-ink/12 text-xxs rounded-md items-center px-1.5 py-px font-normal text-ink-muted"><Hotkey token={props.creatableBlock.hotkeyToken} /></div></Show>@@ -994,26 +976,64 @@ const LauncherMenuItem = (props: LauncherMenuItemProps) => {);};-type LauncherInnerProps = {+export type LauncherInnerProps = {onClose: (shouldReturnFocus?: boolean) => void;blocks?: CreatableBlock[];};-export const LauncherInner = (props: LauncherInnerProps) => {+type LauncherBodyState = {+ sections: Accessor<CreateMenuSection[]>;+ blocks: Accessor<CreatableBlock[]>;+ selectedIndex: Accessor<number>;+ searchMode: Accessor<boolean>;+ itemId: (item: CreatableBlock) => string;+ select: (index: number) => void;+ step: (direction: number) => void;+ choose: (item: CreatableBlock) => void;+ scrollSelectedIntoView: Accessor<boolean>;+};++/** Shared launcher behavior and chrome; each layout supplies its own body. */+export const LauncherShell = (+ props: LauncherInnerProps & {+ children: (state: LauncherBodyState) => JSX.Element;+ class?: string;+ horizontalNavigation?: boolean;+ groupItems?: (+ items: CreatableBlock[],+ recentItems: CreatableBlock[]+ ) => CreateMenuSection[];+ }+) => {const hkGroup = createHotkeyGroup();const commands = useCreateCommands();const candidates = () => props.blocks ?? commands;const availableBlocks = useCreateMenuBlocks(candidates);- const sortedBlocks = createMemo(() => sortLauncherBlocks(availableBlocks()));+ const sortedBlocks = createMemo(() =>+ sortLauncherBlocks(availableBlocks(), launcherFrecencyStore)+ );const [searchQuery, setSearchQuery] = createSignal('');const searchMode = launcherSearchMode;- const blocks = createMemo(() => {+ const recentBlocks = useRecentCreateMenuBlocks(availableBlocks);+ const filteredBlocks = createMemo(() => {if (!searchMode()) return sortedBlocks();return sortedBlocks().filter((item) =>matchesLauncherSearch(item, searchQuery()));});+ const sections = createMemo<CreateMenuSection[]>(+ () =>+ props.groupItems?.(filteredBlocks(), recentBlocks()) ?? [+ {+ group: { id: 'other', label: 'Results', tagline: '' },+ items: filteredBlocks(),+ },+ ]+ );+ const blocks = createMemo(() =>+ sections().flatMap((section) => section.items)+ );const [attachHotkeys, launcherScope] = useHotkeyDOMScope('create-menu', true);let ref!: HTMLDivElement;@@ -1043,11 +1063,15 @@ export const LauncherInner = (props: LauncherInnerProps) => {};const setLauncherSearchMode = (next: boolean) => {+ const selectedItem = blocks()[focusedIndex()];setLauncherSearchModePreference(next);if (!next) {setSearchQuery('');}+ setFocusedIndex(+ selectedItem ? Math.max(0, blocks().indexOf(selectedItem)) : 0+ );queueMicrotask(() => {if (next) {@@ -1058,20 +1082,13 @@ export const LauncherInner = (props: LauncherInnerProps) => {});};- createEffect(() => {- searchMode();- searchQuery();- blocks().length;- setFocusedIndex(0);- });-candidates().forEach((item) => {registerHotkey({hotkeyToken: item.hotkeyToken,hotkey: item.hotkey,scopeId: launcherScope,description: item.description,- condition: () => availableBlocks().includes(item),+ condition: () => !searchMode() && availableBlocks().includes(item),registrationType: item.registrationType,runWithInputFocused: item.runWithInputFocused,keyDownHandler: () => {@@ -1085,7 +1102,7 @@ export const LauncherInner = (props: LauncherInnerProps) => {hotkey: `shift+${item.hotkey}` as ValidHotkey,scopeId: launcherScope,description: `${item.description} in new split`,- condition: () => availableBlocks().includes(item),+ condition: () => !searchMode() && availableBlocks().includes(item),registrationType: item.registrationType,runWithInputFocused: item.runWithInputFocused,keyDownHandler: () => {@@ -1110,10 +1127,17 @@ export const LauncherInner = (props: LauncherInnerProps) => {}).withGroup(hkGroup);const navUpHotkey = registerHotkey({- hotkey: ['arrowup', 'ctrl+k', 'shift+tab'],+ hotkey: props.horizontalNavigation+ ? ['arrowleft', 'arrowup', 'ctrl+k', 'shift+tab']+ : ['arrowup', 'ctrl+k', 'shift+tab'],scopeId: launcherScope,description: 'Navigate up',keyDownHandler: (event) => {+ if (+ event?.key === 'ArrowLeft' &&+ event.target instanceof HTMLInputElement+ )+ return false;event?.preventDefault();return listController.selectPrevious();},@@ -1121,10 +1145,17 @@ export const LauncherInner = (props: LauncherInnerProps) => {}).withGroup(hkGroup);const navDownHotkey = registerHotkey({- hotkey: ['arrowdown', 'ctrl+j', 'tab'],+ hotkey: props.horizontalNavigation+ ? ['arrowright', 'arrowdown', 'ctrl+j', 'tab']+ : ['arrowdown', 'ctrl+j', 'tab'],scopeId: launcherScope,description: 'Navigate down',keyDownHandler: (event) => {+ if (+ event?.key === 'ArrowRight' &&+ event.target instanceof HTMLInputElement+ )+ return false;event?.preventDefault();return listController.selectNext();},@@ -1147,6 +1178,7 @@ export const LauncherInner = (props: LauncherInnerProps) => {hotkey: 'escape',scopeId: launcherScope,description: 'Exit',+ runWithInputFocused: true,keyDownHandler: () => {props.onClose();return true;@@ -1204,7 +1236,12 @@ export const LauncherInner = (props: LauncherInnerProps) => {return (// The shared shell stopped painting its own pane (cmd+k gets one from the// app Dialog wrapper); this raw-Kobalte dialog carries it here.- <div class="elevated-surface create-menu-pane w-200 max-w-[calc(100vw-16px)] touch:mobile-sheet touch:overflow-hidden touch:pb-[var(--mobile-sheet-safe-padding,0px)]">+ <div+ class={cn(+ 'elevated-surface create-menu-pane w-200 max-w-[calc(100vw-16px)] touch:mobile-sheet touch:overflow-hidden touch:pb-[var(--mobile-sheet-safe-padding,0px)]',+ props.class+ )}+ ><divaria-hidden="true"class="hidden touch:flex h-5 shrink-0 items-center justify-center"@@ -1218,24 +1255,27 @@ export const LauncherInner = (props: LauncherInnerProps) => {ref={ref}tabindex={-1}>- <CommandMenuShell.Header class="border-b-0">+ <CommandMenuShell.Header><Showwhen={searchMode()}fallback={- <div class="min-w-0 flex flex-1 items-center gap-2 text-ink-muted">+ <div class="min-w-0 flex h-7 flex-1 items-center gap-2 text-ink-muted"><PlusIcon class="size-4 shrink-0 text-ink-extra-muted" /><h1 class="truncate text-base font-normal">Create New</h1></div>}>- <div class="min-w-0 flex flex-1 items-center gap-2">+ <div class="min-w-0 flex h-7 flex-1 items-center gap-2"><MagnifyingGlassIcon class="size-4 shrink-0 text-ink-extra-muted" /><CommandMenuSearchInputref={searchInputRef}type="text"placeholder="Search create options"value={searchQuery()}- onInput={(event) => setSearchQuery(event.currentTarget.value)}+ onInput={(event) => {+ setSearchQuery(event.currentTarget.value);+ setFocusedIndex(0);+ }}/></div></Show>@@ -1249,7 +1289,7 @@ export const LauncherInner = (props: LauncherInnerProps) => {<Hotkeyshortcut={searchModeHotkey.hotkey()}theme="subtle"- class="px-2 py-0.5"+ class="border-ink/12 px-2 py-0.5"/></span>}@@ -1259,25 +1299,23 @@ export const LauncherInner = (props: LauncherInnerProps) => {/></CommandMenuShell.Header><CommandMenuShell.Body class="touch:flex touch:flex-col">- <CommandMenuList- items={blocks()}- selectedIndex={focusedIndex()}- scrollSelectedIntoView={listController.shouldScrollSelectedIntoView()}- class="max-h-[min(60vh,26rem)] touch:min-h-0"- itemId={(item) => `create-menu-${launcherItemKey(item)}`}- onSelect={(item) => runLauncherItem(item)}- onItemMouseMove={(index) =>- listController.setSelectedIndexFromPointer(index)- }- >- {(item, index) => (- <LauncherMenuItem- creatableBlock={item}- selected={focusedIndex() === index()}- showHotkey={!searchMode()}- />- )}- </CommandMenuList>+ {props.children({+ sections,+ blocks,+ selectedIndex: focusedIndex,+ searchMode,+ itemId: (item) => `create-menu-${launcherItemKey(item)}`,+ select: listController.setSelectedIndexFromPointer,+ step: (direction) => {+ const count = blocks().length;+ if (count)+ listController.setSelectedIndex(+ (((focusedIndex() + direction) % count) + count) % count+ );+ },+ choose: runLauncherItem,+ scrollSelectedIntoView: listController.shouldScrollSelectedIntoView,+ })}</CommandMenuShell.Body><CommandMenuShell.Footer class="touch:px-6 touch:py-4"><style>{`@@ -1291,19 +1329,27 @@ export const LauncherInner = (props: LauncherInnerProps) => {`}</style><span class="flex items-center gap-1"><div class="flex gap-1">- <div class="flex border border-edge-muted text-xxs rounded-md items-center px-1.5 py-px font-normal">- <Hotkey shortcut={navUpHotkey.hotkey()} class="space-x-1" />+ <div class="flex w-7 justify-center border border-ink/12 text-xxs rounded-md items-center px-1.5 py-px font-normal">+ <Hotkey+ shortcut={searchMode() ? 'arrowup' : navUpHotkey.hotkey()}+ class="space-x-1"+ /></div>- <div class="flex border border-edge-muted text-xxs rounded-md items-center px-1.5 py-px font-normal">- <Hotkey shortcut={navDownHotkey.hotkey()} class="space-x-1" />+ <div class="flex w-7 justify-center border border-ink/12 text-xxs rounded-md items-center px-1.5 py-px font-normal">+ <Hotkey+ shortcut={searchMode() ? 'arrowdown' : navDownHotkey.hotkey()}+ class="space-x-1"+ /></div></div>Navigate</span>- <CommandMenuHotkeyHint- hotkey={<Hotkey shortcut={confirmHotkey.hotkey()} />}- label="Create"- />+ <span class="flex items-center gap-1">+ <div class="flex w-7 justify-center border border-ink/12 text-xxs rounded-md items-center px-1.5 py-px font-normal">+ <Hotkey shortcut={confirmHotkey.hotkey()} />+ </div>+ Create+ </span><span class="hidden touch:hidden md:flex items-center gap-1">Hold<span class="relative inline-flex place-items-center">@@ -1316,7 +1362,7 @@ export const LauncherInner = (props: LauncherInnerProps) => {'border text-xxs px-1.5 py-px rounded-md transition-colors duration-150',shiftHeld()? 'border-accent text-accent bg-accent/10'- : 'border-edge-muted'+ : 'border-ink/12')}>{getNormalizedKeyString({ shortcut: 'shift' })}@@ -1330,6 +1376,23 @@ export const LauncherInner = (props: LauncherInnerProps) => {);};+const DetailsLauncher = lazy(() => import('./DetailsLauncher'));+const CarouselLauncher = lazy(() => import('./CarouselLauncher'));++export const LauncherInner = (props: LauncherInnerProps) => {+ const carouselFlag = useFeatureFlag(enableCarouselCreateMenu);+ return (+ <Suspense>+ <Show+ when={carouselFlag().enabled}+ fallback={<DetailsLauncher {...props} />}+ >+ <CarouselLauncher {...props} />+ </Show>+ </Suspense>+ );+};+type LauncherProps = {open: boolean;onOpenChange: (open: boolean, shouldReturnFocus?: boolean) => void;@@ -1337,7 +1400,9 @@ type LauncherProps = {function MobileLauncher(props: LauncherProps) {const availableBlocks = useCreateMenuBlocks();- const items = createMemo(() => sortLauncherBlocks(availableBlocks()));+ const items = createMemo(() =>+ sortLauncherBlocks(availableBlocks(), launcherFrecencyStore)+ );return (<MobileCreateSheetopen={props.open}diff --git a/apps/web/src/features/command/components/CarouselCards.tsx b/apps/web/src/features/command/components/CarouselCards.tsxnew file mode 100644index 0000000000..10c5747a71--- /dev/null+++ b/apps/web/src/features/command/components/CarouselCards.tsx@@ -0,0 +1,158 @@+import { getIconConfig } from '@core/component/EntityIcon';+import CaretLeft from '@phosphor/caret-left.svg';+import CaretRight from '@phosphor/caret-right.svg';+import { cn, Hotkey } from '@ui';+import { For, Show } from 'solid-js';+import { Dynamic } from 'solid-js/web';+import { createMenuShortTagline } from '../core/create-menu-details';+import type { CreatableBlock } from '../types';++const CARD_WIDTH = 160;+const CARD_GAP = 10;++export function CarouselCards(props: {+ items: CreatableBlock[];+ showHotkeys?: boolean;+ selectedIndex: number;+ itemId: (item: CreatableBlock) => string;+ onSelect: (index: number) => void;+ onStep: (direction: number) => void;+ onChoose: (item: CreatableBlock) => void;+}) {+ const pages = () =>+ Array.from(+ { length: Math.ceil(props.items.length / 3) },+ (_, index) => index+ );++ return (+ <>+ <div class="relative">+ <div class="relative h-44 overflow-hidden [mask-image:linear-gradient(to_right,transparent,black_18%,black_82%,transparent)]">+ <For each={props.items}>+ {(item, index) => {+ const delta = () => {+ const raw = index() - props.selectedIndex;+ if (props.items.length < 12) return raw;+ return (+ raw -+ Math.round(raw / props.items.length) * props.items.length+ );+ };+ const distance = () => Math.abs(delta());+ const active = () => distance() === 0;+ return (+ <button+ type="button"+ id={props.itemId(item)}+ data-create-card+ aria-label={`Create ${item.label}`}+ aria-pressed={active()}+ aria-hidden={distance() > 5}+ tabindex={active() ? 0 : -1}+ class={cn(+ 'absolute top-1/2 flex -translate-x-1/2 -translate-y-1/2 h-36 flex-col items-start rounded-xl border p-3 text-left outline-none transition-[left,opacity,background-color,box-shadow,border-color] duration-300 motion-reduce:transition-none focus-visible:outline-2 focus-visible:outline-accent',+ getIconConfig(item.blockName).foreground,+ active()+ ? 'border-current/30 bg-current/[0.04] shadow-[0_0_20px_0] shadow-current/[0.06]'+ : 'border-ink/8 bg-ink/[0.03] hover:border-ink/20',+ distance() > 5 && 'invisible'+ )}+ style={{+ left: `calc(50% + ${delta() * (CARD_WIDTH + CARD_GAP)}px)`,+ width: `${CARD_WIDTH}px`,+ opacity:+ distance() <= 1+ ? 1+ : distance() === 2+ ? 0.9+ : distance() === 3+ ? 0.65+ : distance() === 4+ ? 0.35+ : 0.15,+ }}+ onClick={() => props.onChoose(item)}+ >+ <div+ class={cn(+ 'flex size-8 shrink-0 items-center justify-center rounded-lg',+ getIconConfig(item.blockName).background+ )}+ >+ <div class="size-5 [&_svg]:size-full">+ <Dynamic component={item.icon} />+ </div>+ </div>+ <Show when={props.showHotkeys}>+ <span class="absolute top-3 right-3 rounded-md border border-ink/12 px-1.5 py-px text-xxs text-ink-muted">+ <Hotkey+ token={item.hotkeyToken}+ shortcut={+ Array.isArray(item.hotkey)+ ? item.hotkey[0]+ : item.hotkey+ }+ />+ </span>+ </Show>+ <div class="mt-2.5 text-sm font-medium text-ink">+ {item.label}+ </div>+ <p class="mt-1 text-left text-xs leading-relaxed text-ink-muted">+ {createMenuShortTagline(item)}+ </p>+ </button>+ );+ }}+ </For>+ </div>+ </div>+ <div+ class={cn(+ 'flex h-12 items-center justify-center gap-5 px-5 pb-4',+ props.items.length <= 1 && 'invisible'+ )}+ >+ <button+ type="button"+ aria-label="Previous create option"+ class="flex size-8 shrink-0 items-center justify-center rounded-full border border-edge-muted bg-dialog text-ink-muted hover:bg-hover focus-visible:outline-2 focus-visible:outline-accent"+ onClick={() => props.onStep(-1)}+ >+ <CaretLeft class="size-4" />+ </button>+ <div class="flex items-center gap-2">+ <For each={pages()}>+ {(page) => (+ <button+ type="button"+ aria-label={`Browse create options ${page * 3 + 1}–${Math.min(page * 3 + 3, props.items.length)}`}+ aria-pressed={Math.floor(props.selectedIndex / 3) === page}+ class="flex h-6 items-center justify-center outline-none focus-visible:outline-2 focus-visible:outline-accent"+ onClick={() => props.onSelect(page * 3)}+ >+ <span+ class={cn(+ 'h-1.5 rounded-full transition-[width] motion-reduce:transition-none',+ Math.floor(props.selectedIndex / 3) === page+ ? 'w-5 bg-ink/60'+ : 'w-1.5 bg-ink/20'+ )}+ />+ </button>+ )}+ </For>+ </div>+ <button+ type="button"+ aria-label="Next create option"+ class="flex size-8 shrink-0 items-center justify-center rounded-full border border-edge-muted bg-dialog text-ink-muted hover:bg-hover focus-visible:outline-2 focus-visible:outline-accent"+ onClick={() => props.onStep(1)}+ >+ <CaretRight class="size-4" />+ </button>+ </div>+ </>+ );+}diff --git a/apps/web/src/features/command/components/CreateMenuPreview.tsx b/apps/web/src/features/command/components/CreateMenuPreview.tsxnew file mode 100644index 0000000000..d9305a156c--- /dev/null+++ b/apps/web/src/features/command/components/CreateMenuPreview.tsx@@ -0,0 +1,201 @@+import SearchIcon from '@phosphor/magnifying-glass.svg';+import {+ CommandMenuList,+ CommandMenuSearchInput,+ CommandMenuShell,+ cn,+ createCommandListController,+} from '@ui';+import { createMemo, createSignal, createUniqueId, Show } from 'solid-js';+import {+ type CreateMenuSection,+ createMenuSearchText,+ groupCreateMenuItems,+ groupRecentCreateMenuItems,+} from '../core/create-menu-details';+import { LauncherMenuItem, useRecentCreateMenuBlocks } from '../Launcher';+import type { CreatableBlock } from '../types';+import { CarouselCards } from './CarouselCards';+import { LauncherDetails } from './LauncherDetails';++/** Inline previews using Jacob's layout proportions and the existing static icons. */+export function CreateMenuPreview(props: {+ layout: 'list' | 'carousel' | 'details';+ detailsLeft?: boolean;+ items: CreatableBlock[];+ onChoose: (item: CreatableBlock) => void;+}) {+ const id = createUniqueId();+ const [query, setQuery] = createSignal('');+ let root!: HTMLDivElement;+ const recentItems = useRecentCreateMenuBlocks(() => props.items);+ const sections = createMemo<CreateMenuSection[]>(() => {+ const terms = query().trim().toLowerCase().split(/\s+/).filter(Boolean);+ const filtered = props.items.filter((item) => {+ const text = [+ item.label,+ item.launcherHint,+ ...(item.keywords ?? []),+ ...createMenuSearchText(item),+ ]+ .join(' ')+ .toLowerCase();+ return terms.every((term) => text.includes(term));+ });+ if (props.layout === 'details')+ return groupRecentCreateMenuItems(filtered, recentItems());+ if (props.layout === 'list' || query().trim())+ return [+ {+ group: { id: 'other', label: 'Results', tagline: '' },+ items: filtered,+ },+ ];+ return groupCreateMenuItems(filtered);+ });+ const items = createMemo(() =>+ sections().flatMap((section) => section.items)+ );+ const c = createCommandListController({ items, onSelect: props.onChoose });+ const selected = c.selectedItem;+ const itemId = (item: CreatableBlock) =>+ `${id}-${item.label.replaceAll(' ', '-')}`;+ const changeQuery = (value: string) => {+ setQuery(value);+ c.setSelectedIndex(0);+ };+ const step = (direction: number) => {+ const count = items().length;+ if (count)+ c.setSelectedIndex(+ (((c.selectedIndex() + direction) % count) + count) % count+ );+ };++ function onKeyDown(event: KeyboardEvent) {+ event.stopPropagation();+ if (event.isComposing || event.metaKey || event.ctrlKey || event.altKey)+ return;+ const input = event.target instanceof HTMLInputElement;+ const next =+ event.key === 'ArrowDown' ||+ (!input && props.layout === 'carousel' && event.key === 'ArrowRight');+ const previous =+ event.key === 'ArrowUp' ||+ (!input && props.layout === 'carousel' && event.key === 'ArrowLeft');+ if (next || previous) {+ event.preventDefault();+ step(next ? 1 : -1);+ const item = selected();+ if (item) {+ const option = document.getElementById(itemId(item));+ if (props.layout !== 'carousel')+ option?.scrollIntoView({ block: 'nearest' });+ if (+ !input &&+ event.target instanceof HTMLElement &&+ event.target.closest('[data-create-card], [data-create-option]')+ )+ option?.focus({ preventScroll: true });+ }+ } else if (+ event.key === 'Enter' &&+ (input ||+ event.target === root ||+ (event.target instanceof HTMLElement &&+ event.target.closest('[data-create-card], [data-create-option]')))+ ) {+ event.preventDefault();+ c.selectSelected();+ } else if (event.key === 'Escape') {+ event.preventDefault();+ changeQuery('');+ }+ }++ return (+ <div+ ref={root}+ tabindex={-1}+ data-keyboard-input+ on:keydown={onKeyDown}+ class={cn(+ 'relative isolate flex w-full flex-col overflow-hidden rounded-3xl border border-edge-muted/60 bg-dialog text-ink outline-none [--color-surface:var(--color-dialog)]',+ props.layout === 'list' && 'h-[32rem]'+ )}+ >+ <CommandMenuShell.Header>+ <SearchIcon class="size-4 shrink-0 text-ink-extra-muted" />+ <CommandMenuSearchInput+ aria-label={`Search ${props.layout} create options`}+ type="text"+ autocomplete="off"+ placeholder="Search create options"+ value={query()}+ onInput={(event) => changeQuery(event.currentTarget.value)}+ />+ </CommandMenuShell.Header>+ <Show+ when={items().length}+ fallback={+ <div class="flex min-h-72 flex-1 flex-col items-center justify-center gap-3 px-5 text-sm text-ink-muted">+ <p>No matches for “{query()}”</p>+ <button+ type="button"+ class="rounded-md border border-edge-muted px-3 py-1.5 text-ink hover:bg-hover"+ onClick={() => changeQuery('')}+ >+ Clear search+ </button>+ </div>+ }+ >+ <Show when={props.layout === 'list'}>+ <CommandMenuList+ items={items()}+ selectedIndex={c.selectedIndex()}+ itemId={itemId}+ class="min-h-0 max-h-none flex-1 overflow-y-auto p-2.5"+ onSelect={props.onChoose}+ onItemMouseMove={c.setSelectedIndexFromPointer}+ >+ {(item, index) => (+ <LauncherMenuItem+ creatableBlock={item}+ selected={c.isSelected(index())}+ showHotkey={false}+ />+ )}+ </CommandMenuList>+ </Show>+ <Show when={props.layout === 'details'}>+ <LauncherDetails+ sections={sections()}+ items={items()}+ selectedIndex={c.selectedIndex()}+ itemId={itemId}+ onSelect={c.setSelectedIndexFromPointer}+ onChoose={props.onChoose}+ detailsLeft={props.detailsLeft}+ />+ </Show>+ <Show when={props.layout === 'carousel'}>+ <CarouselCards+ items={items()}+ selectedIndex={c.selectedIndex()}+ itemId={itemId}+ onSelect={c.setSelectedIndex}+ onStep={step}+ onChoose={props.onChoose}+ />+ </Show>+ </Show>+ <Show when={props.layout !== 'carousel'}>+ <div class="flex h-9 shrink-0 items-center gap-4 px-5 text-xs text-ink-extra-muted">+ <span>↑ ↓ Navigate</span>+ <span>↵ Choose</span>+ </div>+ </Show>+ </div>+ );+}diff --git a/apps/web/src/features/command/components/LauncherDetails.tsx b/apps/web/src/features/command/components/LauncherDetails.tsxnew file mode 100644index 0000000000..aaa51c27a8--- /dev/null+++ b/apps/web/src/features/command/components/LauncherDetails.tsx@@ -0,0 +1,179 @@+import { getIconConfig } from '@core/component/EntityIcon';+import { cn, Hotkey } from '@ui';+import { createEffect, For, on, Show } from 'solid-js';+import { Dynamic } from 'solid-js/web';+import {+ type CreateMenuSection,+ createMenuDetails,+ createMenuTagline,+} from '../core/create-menu-details';+import type { CreatableBlock } from '../types';++export function LauncherDetails(props: {+ sections: CreateMenuSection[];+ items: CreatableBlock[];+ selectedIndex: number;+ itemId: (item: CreatableBlock) => string;+ onSelect: (index: number) => void;+ onChoose: (item: CreatableBlock) => void;+ showHotkeys?: boolean;+ scrollSelectedIntoView?: boolean;+ detailsLeft?: boolean;+}) {+ let list: HTMLDivElement | undefined;+ const selected = () => props.items[props.selectedIndex];+ const shortcut = (item: CreatableBlock) =>+ Array.isArray(item.hotkey) ? item.hotkey[0] : item.hotkey;++ createEffect(+ on(+ [+ () => props.selectedIndex,+ () => props.items,+ () => props.scrollSelectedIntoView,+ ],+ () => {+ if (props.scrollSelectedIntoView) {+ list+ ?.querySelector('[aria-selected="true"]')+ ?.scrollIntoView({ block: 'nearest' });+ }+ }+ )+ );++ return (+ <div+ class={cn(+ 'flex h-[min(25rem,calc(75vh-6rem))] min-h-0',+ props.detailsLeft && 'flex-row-reverse'+ )}+ >+ <Show+ when={props.items.length}+ fallback={+ <div+ role="status"+ class="flex flex-1 items-center justify-center text-sm text-ink-muted"+ >+ No matching create options+ </div>+ }+ >+ <div+ ref={list}+ role="listbox"+ aria-label="Create options"+ class="w-[38%] min-w-0 shrink-0 overflow-y-auto p-2 sm:w-64"+ >+ <For each={props.sections}>+ {(section) => (+ <div role="group" aria-label={section.group.label} class="mb-1.5">+ <div class="px-2.5 pt-2 pb-1 text-[10px] font-medium tracking-wide text-ink-extra-muted uppercase">+ {section.group.label}+ </div>+ <For each={section.items}>+ {(item) => (+ <button+ type="button"+ role="option"+ id={props.itemId(item)}+ data-create-option+ aria-selected={selected() === item}+ tabindex={-1}+ class={cn(+ 'flex h-9 w-full scroll-m-2 items-center gap-2.5 rounded-md px-2.5 text-left outline-none focus-visible:outline-2 focus-visible:outline-accent',+ selected() === item+ ? 'bg-ink/6 text-ink'+ : 'text-ink-muted'+ )}+ onPointerMove={(event) => {+ if (event.movementX || event.movementY)+ props.onSelect(props.items.indexOf(item));+ }}+ onFocus={() => props.onSelect(props.items.indexOf(item))}+ onClick={() => props.onChoose(item)}+ >+ <span+ class={cn(+ 'size-4 shrink-0 [&_svg]:size-4',+ getIconConfig(item.blockName).foreground+ )}+ >+ <Dynamic component={item.icon} />+ </span>+ <span+ class="min-w-0 flex-1 truncate text-sm font-medium"+ title={item.label}+ >+ {item.label}+ </span>+ <Show when={props.showHotkeys}>+ <span class="rounded-md border border-ink/12 px-1.5 py-px text-xxs font-normal text-ink-muted">+ <Hotkey+ token={item.hotkeyToken}+ shortcut={shortcut(item)}+ />+ </span>+ </Show>+ </button>+ )}+ </For>+ </div>+ )}+ </For>+ </div>+ <div+ class={cn(+ 'min-w-0 flex-1 overflow-y-auto',+ props.detailsLeft+ ? 'border-r border-edge-divider'+ : 'border-l border-edge-divider'+ )}+ >+ <Show when={selected()}>+ {(item) => (+ <section+ aria-label={`${item().label} details`}+ class="flex min-h-full flex-col px-6 pt-6 pb-2"+ >+ <div+ class={cn(+ 'mb-5 flex size-18 shrink-0 items-center justify-center rounded-2xl shadow-[0_0_20px_0] shadow-current/[0.06]',+ getIconConfig(item().blockName).background,+ getIconConfig(item().blockName).foreground+ )}+ >+ <div class="size-9 [&_svg]:size-full">+ <Dynamic component={item().icon} />+ </div>+ </div>+ <h2 class="text-xl font-semibold">{item().label}</h2>+ <p class="mt-1 text-left text-sm leading-relaxed text-ink-muted">+ {createMenuDetails(item())?.details ??+ createMenuTagline(item())}+ </p>+ <div class="mt-auto flex shrink-0 items-center gap-3 pt-6">+ <span+ class={cn(+ 'flex h-9 items-center gap-1.5 text-xs text-ink-muted',+ !props.showHotkeys && 'invisible'+ )}+ >+ Shortcut+ <Hotkey+ token={item().hotkeyToken}+ shortcut={shortcut(item())}+ theme="subtle"+ class="border-ink/12"+ />+ </span>+ </div>+ </section>+ )}+ </Show>+ </div>+ </Show>+ </div>+ );+}diff --git a/apps/web/src/features/command/core/create-menu-details.ts b/apps/web/src/features/command/core/create-menu-details.tsnew file mode 100644index 0000000000..6dd1350964--- /dev/null+++ b/apps/web/src/features/command/core/create-menu-details.ts@@ -0,0 +1,298 @@+import type { CreatableBlock } from '../types';++export type CreateMenuGroupId = 'docs' | 'visual' | 'talk' | 'plan' | 'ai';++export type CreateMenuGroup = {+ id: CreateMenuGroupId | 'other' | 'recent';+ label: string;+ tagline: string;+};++export const CREATE_MENU_GROUPS: readonly CreateMenuGroup[] = [+ { id: 'docs', label: 'Docs & files', tagline: 'Write, template, organize' },+ {+ id: 'visual',+ label: 'Visual & data',+ tagline: 'Diagram, design, crunch numbers',+ },+ { id: 'talk', label: 'Communicate', tagline: 'Reach people' },+ { id: 'plan', label: 'Plan & track', tagline: 'Stay on top of the work' },+ { id: 'ai', label: 'AI & automation', tagline: 'Put agents to work' },+];++const OTHER_GROUP: CreateMenuGroup = {+ id: 'other',+ label: 'More',+ tagline: 'Everything else',+};++export type CreateMenuDetails = {+ group: CreateMenuGroupId;+ /** One line under the title: what the thing actually is. */+ tagline: string;+ /** A 10–20-word description for the detailed launcher. */+ details: string;+ /** Things people typically make with it. */+ examples: readonly string[];+};++/**+ * Keyed by label rather than block name: Message and Channel share the+ * `channel` block, and the two Agent entries (one per agents flag) are never+ * both shown.+ */+const DETAILS: Record<string, CreateMenuDetails> = {+ Document: {+ group: 'docs',+ tagline: 'Rich-text doc, edited live together',+ details:+ 'A collaborative document for notes, specs and write-ups, with headings, tables, embeds, comments and AI editing.',+ examples: ['Meeting notes', 'Product spec', 'Team wiki'],+ },+ Snippet: {+ group: 'docs',+ tagline: 'Reusable template for your writing',+ details:+ 'Save reusable templates, checklists and replies so you can quickly add familiar content to new documents.',+ examples: ['Doc template', 'Checklist', 'Canned reply'],+ },+ Code: {+ group: 'docs',+ tagline: 'Code file with syntax highlighting',+ details:+ 'A standalone source file for scripts, queries and config, in whatever language you need.',+ examples: ['Python script', 'SQL query', 'Config file'],+ },+ Folder: {+ group: 'docs',+ tagline: 'Keep related files together',+ details:+ 'Organize documents, files and other folders in one place, and share them together.',+ examples: ['Client files', 'Archive', 'Team drive'],+ },+ Canvas: {+ group: 'visual',+ tagline: 'Whiteboard for diagrams and sketches',+ details:+ 'An infinite canvas for flowcharts, mind maps, architecture diagrams and freeform brainstorming.',+ examples: ['Flowchart', 'Mind map', 'Architecture diagram'],+ },+ Design: {+ group: 'visual',+ tagline: 'Figma-compatible design editor',+ details:+ 'Create interface mockups and graphics with frames and vector shapes, then save your work as a Figma file.',+ examples: ['App mockup', 'Social graphic', 'Design system'],+ },+ Spreadsheet: {+ group: 'visual',+ tagline: 'Excel-style workbook with formulas',+ details:+ 'A collaborative spreadsheet with formulas, multiple sheets and AI-assisted editing for models, budgets and analysis.',+ examples: ['Budget', 'Financial model', 'Tracker'],+ },+ Database: {+ group: 'visual',+ tagline: 'Structured records in tables and boards',+ details:+ 'Organize structured records with custom fields, then explore them in tables and boards for trackers, inventories or customer lists.',+ examples: ['CRM', 'Content calendar', 'Inventory'],+ },+ Form: {+ group: 'visual',+ tagline: 'Collect responses',+ details:+ 'Build a form to collect feedback, requests or survey answers, with every response saved into a database.',+ examples: ['Survey', 'Intake form', 'Feedback'],+ },+ 'Photoshop file': {+ group: 'visual',+ tagline: 'Layered image editing',+ details:+ 'Create and edit layered images for photo edits, composites and graphics, then save your work as a Photoshop file.',+ examples: ['Photo edit', 'Composite', 'Banner'],+ },+ 'Illustrator file': {+ group: 'visual',+ tagline: 'Vector artwork',+ details:+ 'Create scalable logos, icons and illustrations on artboards, then save your vector artwork as an Illustrator file.',+ examples: ['Logo', 'Illustration', 'Icon set'],+ },+ Email: {+ group: 'talk',+ tagline: 'Compose from your connected inbox',+ details:+ 'Write and send an email from your connected email account, with AI help drafting.',+ examples: ['Follow-up', 'Intro', 'Update to a client'],+ },+ Message: {+ group: 'talk',+ tagline: 'Quick DM to a person or group',+ details:+ 'Send a direct message to one or more teammates without setting up a channel.',+ examples: ['Quick question', 'Heads-up', 'Group DM'],+ },+ Channel: {+ group: 'talk',+ tagline: 'Ongoing space for a team or topic',+ details:+ 'Keep a team, project or topic in one shared conversation, with threaded discussions and files everyone can find.',+ examples: ['#design', '#launch', '#support'],+ },+ Call: {+ group: 'talk',+ tagline: 'Start an audio or video call',+ details:+ 'Jump into a call right away and invite teammates or external guests.',+ examples: ['Quick sync', 'Pairing', 'Customer call'],+ },+ Task: {+ group: 'plan',+ tagline: 'To-do with owner, status and due date',+ details:+ 'Capture a piece of work, assign it, set a due date and track it through to done.',+ examples: ['Bug', 'Follow-up', 'Review request'],+ },+ Project: {+ group: 'plan',+ tagline: 'Group tasks toward a shared goal',+ details:+ 'Collect related tasks under one goal and follow their progress together.',+ examples: ['Launch', 'Quarterly goal', 'Migration'],+ },+ Reminder: {+ group: 'plan',+ tagline: 'Nudge yourself at a time you pick',+ details:+ 'Ask Macro to remind you about something later — no document or task required.',+ examples: ['Call back', 'Check in Friday', 'Renew license'],+ },+ Agent: {+ group: 'ai',+ tagline: 'AI session that researches, writes and codes',+ details:+ 'Start a dedicated AI session to research a topic, draft content or work through a coding task.',+ examples: ['Research a topic', 'Draft a doc', 'Fix a bug'],+ },+ Routine: {+ group: 'ai',+ tagline: 'Run an agent on a schedule or trigger',+ details:+ 'Automations that run a model or agent on a schedule, or whenever something happens in Macro.',+ examples: ['Daily digest', 'Triage inbox', 'Weekly report'],+ },+ Skill: {+ group: 'ai',+ tagline: 'Reusable instructions for agents',+ details:+ 'Give agents reusable instructions for a specific process, writing style or workflow so they can follow your preferred approach.',+ examples: ['Brand voice', 'PR review', 'Report format'],+ },+};++export function createMenuDetails(+ item: CreatableBlock+): CreateMenuDetails | undefined {+ return DETAILS[item.label];+}++/** The one-line description a variant shows under the title. */+export function createMenuTagline(item: CreatableBlock): string {+ const fallback =+ typeof item.description === 'function'+ ? item.description()+ : item.description;+ return createMenuDetails(item)?.tagline ?? item.launcherHint ?? fallback;+}++/** Extra text that search should match on, beyond the block's own fields. */+export function createMenuSearchText(item: CreatableBlock): string[] {+ const details = createMenuDetails(item);+ if (!details) return [];+ const group = CREATE_MENU_GROUPS.find((g) => g.id === details.group);+ return [+ details.tagline,+ details.details,+ ...details.examples,+ group?.label,+ ].filter((text): text is string => !!text);+}++export type CreateMenuSection = {+ group: CreateMenuGroup;+ items: CreatableBlock[];+};++/** Splits items into the fixed groups, keeping each group's catalog order. */+export function groupCreateMenuItems(+ items: readonly CreatableBlock[]+): CreateMenuSection[] {+ const order = Object.keys(DETAILS);+ const rank = (item: CreatableBlock) => {+ const index = order.indexOf(item.label);+ return index === -1 ? order.length : index;+ };++ const sections = CREATE_MENU_GROUPS.map((group) => ({+ group,+ items: items+ .filter((item) => createMenuDetails(item)?.group === group.id)+ .sort((a, b) => rank(a) - rank(b)),+ }));+ const ungrouped = items.filter((item) => !createMenuDetails(item));+ if (ungrouped.length > 0) {+ sections.push({ group: OTHER_GROUP, items: ungrouped });+ }++ return sections.filter((section) => section.items.length > 0);+}++/** Recent choices appear once, before the remaining categorized options. */+export function groupRecentCreateMenuItems(+ items: CreatableBlock[],+ recentItems: CreatableBlock[]+): CreateMenuSection[] {+ const recent = recentItems.filter((item) => items.includes(item));+ const categories = groupCreateMenuItems(+ items.filter((item) => !recent.includes(item))+ );+ return recent.length+ ? [+ {+ group: { id: 'recent', label: 'Recents', tagline: 'Recently used' },+ items: recent,+ },+ ...categories,+ ]+ : categories;+}++/** Two-to-four word captions for compact cards. */+const SHORT_TAGLINES: Record<string, string> = {+ Document: 'Collaborative writing',+ Snippet: 'Reusable template',+ Code: 'Syntax-highlighted file',+ Folder: 'Keep files together',+ Canvas: 'Diagrams & whiteboard',+ Design: 'Figma-compatible editor',+ Spreadsheet: 'Formulas & sheets',+ Database: 'Tables & boards',+ Email: 'Compose from inbox',+ Message: 'Quick DM',+ Channel: 'Team discussion',+ Call: 'Audio or video',+ Task: 'Track work',+ Project: 'Organize related tasks',+ Reminder: 'Nudge yourself later',+ Agent: 'Dedicated agent session',+ Routine: 'Automate recurring work',+ Skill: 'Reusable agent instructions',+ Form: 'Collect responses',+ 'Photoshop file': 'Layered image editing',+ 'Illustrator file': 'Vector artwork',+};++export function createMenuShortTagline(item: CreatableBlock): string {+ return SHORT_TAGLINES[item.label] ?? createMenuTagline(item);+}diff --git a/apps/web/src/features/command/core/launcher-history.test.ts b/apps/web/src/features/command/core/launcher-history.test.tsnew file mode 100644index 0000000000..f776fa5c1d--- /dev/null+++ b/apps/web/src/features/command/core/launcher-history.test.ts@@ -0,0 +1,114 @@+import { describe, expect, it } from 'vitest';+import type { CreatableBlock } from '../types';+import { groupRecentCreateMenuItems } from './create-menu-details';+import { recentLauncherBlocks, sortLauncherBlocks } from './launcher-history';++const item = (label: string, hotkey: string): CreatableBlock => ({+ label,+ hotkey: hotkey as CreatableBlock['hotkey'],+ blockName: 'md',+ description: label,+ keyDownHandler: () => true,+});++describe('launcher recent usage', () => {+ it('takes only the three most recent available, previously used options', () => {+ const items = [+ item('Document', 'd'),+ item('Email', 'e'),+ item('Task', 't'),+ item('Folder', 'f'),+ item('Snippet', 's'),+ ];+ const recent = recentLauncherBlocks(items, {+ 'Document:d': { count: 10, lastUsedAt: 1000 },+ 'Email:e': { count: 1, lastUsedAt: 4000 },+ 'Task:t': { count: 2, lastUsedAt: 3000 },+ 'Folder:f': { count: 3, lastUsedAt: 2000 },+ 'Disabled:x': { count: 1, lastUsedAt: 5000 },+ });+ expect(recent.map((entry) => entry.label)).toEqual([+ 'Email',+ 'Task',+ 'Folder',+ ]);+ const sections = groupRecentCreateMenuItems(items, recent);+ expect(+ sections.map((section) => [+ section.group.label,+ section.items.map((entry) => entry.label),+ ])+ ).toEqual([+ ['Recents', ['Email', 'Task', 'Folder']],+ ['Docs & files', ['Document', 'Snippet']],+ ]);+ expect(sections.flatMap((section) => section.items)).toHaveLength(+ items.length+ );+ });++ it('omits Recents without history rather than filling it with unused options', () => {+ const items = [item('Email', 'e'), item('Document', 'd')];+ expect(recentLauncherBlocks(items, {})).toEqual([]);+ expect(+ groupRecentCreateMenuItems(items, []).map(+ (section) => section.group.label+ )+ ).toEqual(['Docs & files', 'Communicate']);+ });++ it('filters recent choices without promoting other search results into Recents', () => {+ const document = item('Document', 'd');+ const email = item('Email', 'e');+ const task = item('Task', 't');+ expect(+ groupRecentCreateMenuItems([document, task], [email, task]).map(+ (section) => [+ section.group.label,+ section.items.map((entry) => entry.label),+ ]+ )+ ).toEqual([+ ['Recents', ['Task']],+ ['Docs & files', ['Document']],+ ]);+ expect(groupRecentCreateMenuItems([], [email, task])).toEqual([]);+ });++ it('puts the most recent choice first even when an older choice was used more', () => {+ const items = [+ item('Document', 'd'),+ item('Email', 'e'),+ item('Task', 't'),+ ];+ const sorted = sortLauncherBlocks(items, {+ 'Document:d': { count: 100, lastUsedAt: 1000 },+ 'Task:t': { count: 1, lastUsedAt: 2000 },+ });+ expect(sorted.map((entry) => entry.label)).toEqual([+ 'Task',+ 'Document',+ 'Email',+ ]);+ expect(items.map((entry) => entry.label)).toEqual([+ 'Document',+ 'Email',+ 'Task',+ ]);+ });++ it('preserves catalog order for new items and equal timestamps', () => {+ const items = [+ item('Document', 'd'),+ item('Email', 'e'),+ item('Task', 't'),+ ];+ expect(sortLauncherBlocks(items, {})).toEqual(items);+ expect(+ sortLauncherBlocks(items, {+ 'Document:d': { count: 1, lastUsedAt: 1000 },+ 'Email:e': { count: 20, lastUsedAt: 1000 },+ })+ ).toEqual(items);+ });+});diff --git a/apps/web/src/features/command/core/launcher-history.ts b/apps/web/src/features/command/core/launcher-history.tsnew file mode 100644index 0000000000..182203d75d--- /dev/null+++ b/apps/web/src/features/command/core/launcher-history.ts@@ -0,0 +1,27 @@+import type { CreatableBlock } from '../types';++type UsageHistory = Record<string, { count: number; lastUsedAt: number }>;++export function launcherItemKey(item: CreatableBlock): string {+ return String(item.hotkeyToken ?? `${item.label}:${item.hotkey}`);+}++export function sortLauncherBlocks(+ items: CreatableBlock[],+ history: UsageHistory+): CreatableBlock[] {+ const lastUsed = (item: CreatableBlock) =>+ history[launcherItemKey(item)]?.lastUsedAt ?? 0;++ // Stable sorting preserves the catalog order for items without usage history.+ return [...items].sort((a, b) => lastUsed(b) - lastUsed(a));+}++export function recentLauncherBlocks(+ items: CreatableBlock[],+ history: UsageHistory+): CreatableBlock[] {+ return sortLauncherBlocks(items, history)+ .filter((item) => (history[launcherItemKey(item)]?.lastUsedAt ?? 0) > 0)+ .slice(0, 3);+}diff --git a/apps/web/src/features/command/debug/CreateMenuDemo.tsx b/apps/web/src/features/command/debug/CreateMenuDemo.tsxnew file mode 100644index 0000000000..b8ae71842e--- /dev/null+++ b/apps/web/src/features/command/debug/CreateMenuDemo.tsx@@ -0,0 +1,76 @@+import { SplitHeaderLeft } from '@components/app/split-layout/components/SplitHeader';+import { StaticSplitLabel } from '@components/app/split-layout/components/SplitLabel';+import { createSignal } from 'solid-js';+import { CreateMenuPreview } from '../components/CreateMenuPreview';+import { useCreateMenuBlocks } from '../Launcher';++export default function CreateMenuDemo() {+ const items = useCreateMenuBlocks();+ const [lastChoice, setLastChoice] = createSignal(+ 'Preview only — nothing is created.'+ );+ const [detailsLeft, setDetailsLeft] = createSignal(false);+ return (+ <>+ <SplitHeaderLeft>+ <StaticSplitLabel label="Create menu previews" />+ </SplitHeaderLeft>+ <div class="h-full min-h-0 overflow-auto bg-surface px-4 py-10 text-ink sm:px-10">+ <div class="mx-auto flex max-w-[66rem] flex-col gap-14 pb-10">+ <section+ aria-label="Carousel preview"+ class="w-full max-w-[50rem] self-center"+ >+ <h2 class="mb-4 text-sm font-medium text-ink-muted">Carousel</h2>+ <CreateMenuPreview+ layout="carousel"+ items={items()}+ onChoose={(item) => setLastChoice(`Carousel → ${item.label}`)}+ />+ </section>+ <section+ aria-label="Spotlight preview"+ class="w-full max-w-[50rem] self-center"+ >+ <div class="mb-4 flex items-center justify-between gap-3">+ <h2 class="text-sm font-medium text-ink-muted">Spotlight</h2>+ <button+ type="button"+ class="rounded-md px-2 py-1 text-xs text-ink-muted hover:bg-hover"+ onClick={() => setDetailsLeft((left) => !left)}+ >+ Details on the {detailsLeft() ? 'left' : 'right'} · Flip+ </button>+ </div>+ <CreateMenuPreview+ layout="details"+ detailsLeft={detailsLeft()}+ items={items()}+ onChoose={(item) => setLastChoice(`Spotlight → ${item.label}`)}+ />+ </section>+ <section+ aria-label="Classic list preview"+ class="w-full max-w-[50rem] self-center"+ >+ <h2 class="mb-4 text-sm font-medium text-ink-muted">+ Classic list+ </h2>+ <CreateMenuPreview+ layout="list"+ items={items()}+ onChoose={(item) => setLastChoice(`Classic list → ${item.label}`)}+ />+ </section>+ <p+ role="status"+ aria-live="polite"+ class="text-center text-xs text-ink-extra-muted"+ >+ {lastChoice()}+ </p>+ </div>+ </div>+ </>+ );+}diff --git a/apps/web/src/features/entity/tests/entity-icon.test.tsx b/apps/web/src/features/entity/tests/entity-icon.test.tsxindex 1cb96cf43c..2fcf2cc724 100644--- a/apps/web/src/features/entity/tests/entity-icon.test.tsx+++ b/apps/web/src/features/entity/tests/entity-icon.test.tsx@@ -176,7 +176,7 @@ describe('Entity.Icon', () => {it.each([[false, false, EnvelopeIcon, 'text-email'],- [true, false, EnvelopeOpenIcon, 'text-default'],+ [true, false, EnvelopeOpenIcon, 'text-ink-extra-muted'],[false, true, CalendarIcon, 'text-calendar'],[true, true, CalendarIcon, 'text-calendar'],] as const)(diff --git a/apps/web/src/index.css b/apps/web/src/index.cssindex 24220635e6..608778edd2 100644--- a/apps/web/src/index.css+++ b/apps/web/src/index.css@@ -347,11 +347,13 @@ body.tauri-ios {--color-html: var(--color-orange);--color-note: var(--color-violet);--color-task: var(--color-green);- --color-snippet: var(--color-pink);+ --color-snippet: var(--color-note);+ --color-form: var(--color-pink);+ --color-communication: var(--color-blue);--color-pdf: var(--color-red);--color-rss: var(--color-blue);--color-default: var(--color-content-1);- --color-email: var(--color-default);+ --color-email: var(--color-ink);}/* Scope the panel semantic itself so nested bg-panel consumers share the same@@ -544,11 +546,13 @@ body.tauri-ios {--color-html: var(--color-orange);--color-note: var(--color-violet);--color-task: var(--color-green);- --color-snippet: var(--color-pink);+ --color-snippet: var(--color-note);+ --color-form: var(--color-pink);+ --color-communication: var(--color-blue);--color-pdf: var(--color-red);--color-rss: var(--color-blue);--color-default: var(--color-content-1);- --color-email: var(--color-default);+ --color-email: var(--color-ink);/* Font families *//* Apple devices get the system font (SF): `-apple-system` anddiff --git a/apps/web/src/lib/core/component/EntityIcon.tsx b/apps/web/src/lib/core/component/EntityIcon.tsxindex 8fefb27f58..11c54cf0d6 100644--- a/apps/web/src/lib/core/component/EntityIcon.tsx+++ b/apps/web/src/lib/core/component/EntityIcon.tsx@@ -142,15 +142,15 @@ export const ENTITY_ICON_CONFIGS: Record<EntityWithValidIcon, IconConfig> = {document: {icon: File,boldIcon: FileBold,- foreground: 'text-default',- background: 'bg-default/20',+ foreground: 'text-note',+ background: 'bg-note/20',prettyName: 'Document',},call: {icon: PhoneCall,boldIcon: PhoneCallBold,- foreground: 'text-default',- background: 'bg-default/20',+ foreground: 'text-communication',+ background: 'bg-communication/20',prettyName: 'Call',},calendar: {@@ -212,8 +212,8 @@ export const ENTITY_ICON_CONFIGS: Record<EntityWithValidIcon, IconConfig> = {form: {icon: ClipboardText,boldIcon: ClipboardTextBold,- foreground: 'text-violet',- background: 'bg-violet/20',+ foreground: 'text-form',+ background: 'bg-form/20',prettyName: 'Form',},html: {@@ -226,15 +226,15 @@ export const ENTITY_ICON_CONFIGS: Record<EntityWithValidIcon, IconConfig> = {channel: {icon: HashStraight,boldIcon: HashStraightBold,- foreground: 'text-default',- background: 'bg-default/20',+ foreground: 'text-communication',+ background: 'bg-communication/20',prettyName: 'Channel',},public: {icon: GlobeIcon,boldIcon: GlobeIconBold,- foreground: 'text-default',- background: 'bg-default/20',+ foreground: 'text-communication',+ background: 'bg-communication/20',prettyName: 'Public Channel',},organization: {@@ -247,22 +247,22 @@ export const ENTITY_ICON_CONFIGS: Record<EntityWithValidIcon, IconConfig> = {private: {icon: HashStraight,boldIcon: HashStraightBold,- foreground: 'text-default',- background: 'bg-default/20',+ foreground: 'text-communication',+ background: 'bg-communication/20',prettyName: 'Private Channel',},direct_message: {icon: Users,boldIcon: UsersBold,- foreground: 'text-default',- background: 'bg-default/20',+ foreground: 'text-communication',+ background: 'bg-communication/20',prettyName: 'Direct Message',},team: {icon: UsersThree,boldIcon: UsersThreeBold,- foreground: 'text-default',- background: 'bg-default/20',+ foreground: 'text-communication',+ background: 'bg-communication/20',prettyName: 'Team Channel',},email: {@@ -380,8 +380,8 @@ export const ENTITY_ICON_CONFIGS: Record<EntityWithValidIcon, IconConfig> = {emailRead: {icon: EmailRead,boldIcon: EmailReadBold,- foreground: 'text-default',- background: 'bg-default/20',+ foreground: 'text-ink-extra-muted',+ background: 'bg-ink-extra-muted/20',prettyName: 'Read Email',},emailInvite: {@@ -443,8 +443,8 @@ export const ENTITY_ICON_CONFIGS: Record<EntityWithValidIcon, IconConfig> = {initiative: {icon: Stack,boldIcon: StackBold,- foreground: 'text-default',- background: 'bg-default/20',+ foreground: 'text-task',+ background: 'bg-task/20',prettyName: 'Project',},snippet: {diff --git a/apps/web/src/lib/core/constant/featureFlags.ts b/apps/web/src/lib/core/constant/featureFlags.tsindex e679fc4f20..30c512bead 100644--- a/apps/web/src/lib/core/constant/featureFlags.ts+++ b/apps/web/src/lib/core/constant/featureFlags.ts@@ -98,6 +98,12 @@ export const enableCanvasNext = defineFlag({default: LOCAL_ONLY ? false : undefined,});+/** Opt into the carousel create menu; otherwise use the detailed launcher. */+export const enableCarouselCreateMenu = defineFlag({+ key: 'enable-carousel-create-menu',+ env: 'ENABLE_CAROUSEL_CREATE_MENU',+});+/*** Imperative snapshot. Env/`default` override wins. Otherwise PostHog,* or `false` if flags have not loaded or the key is unknown.diff --git a/apps/web/src/routes/routes.ts b/apps/web/src/routes/routes.tsindex e7e2954bd8..3136ce5786 100644--- a/apps/web/src/routes/routes.ts+++ b/apps/web/src/routes/routes.ts@@ -621,6 +621,7 @@ export const prDetailRoute = defineRoute({const debugComponentIds = ['ui','icon-gallery',+ 'create-menu-demo',...(LOCAL_ONLY? ['theme-edit-3',diff --git a/docs/AGENT_GUIDE/navigation.md b/docs/AGENT_GUIDE/navigation.mdindex 62b755d786..b68ecffe09 100644--- a/docs/AGENT_GUIDE/navigation.md+++ b/docs/AGENT_GUIDE/navigation.md@@ -108,6 +108,7 @@ successfully rather than hashing the empty JavaScript placeholder.| `/app/md/<doc>/channel/<channel>` | Doc + channel in a split || `/app/settings/account` | Settings (also `/app/settings/api-keys`, `/mcp-server`, `/shortcuts`, etc.) || `/app/debug/ui?ui=invert-util` | UI gallery, including the inverted Markdown demo on the InvertUtil page |+| `/app/debug/create-menu-demo` | Inline create-menu comparison: classic list, minimal carousel, and details on the left. Each has independent search and selection; choosing an item only updates the preview status and creates no data. || `/app/debug/<component>` | Registered debug views (for example `icon-gallery`, `md`, or `agent-ui`); existing environment gates apply. `/app/component/<component>` remains a compatibility alias for these views |Each `~`-separated part of an app URL is a split (`/app/home/~/drive`). The@@ -431,6 +432,33 @@ changes roll back rather than becoming committed local favorites.## Create menu+On desktop, the rail **Create** button, **C**, and the command menu’s **Create**+entry open the detailed launcher at standard dialog width. Selecting **Create**+closes the command menu and hands focus to the launcher; individual creation+commands remain searchable in the command menu. The left list starts with up to three **Recents** from+actual launcher usage, followed by the remaining choices grouped by category.+Recent items do not repeat in their categories. With no history, the list starts+with categories. Hover or keyboard navigation updates the right detail panel;+click a row or press Enter to start that creation flow. The detail panel is+top-aligned, shares the list background, and is separated by a vertical divider.++The **Search mode** toggle (or **/**) switches between direct entity shortcuts+shown beside each choice and the standard create search input. The preference+persists across opens. Search filters both Recents and categories. Up/Down moves+through the displayed order and scrolls the selected row into view; Left/Right+edits the search input. Enter creates the selected item, Shift+Enter opens it in a+new split where supported, and Escape closes the launcher. Typing in search mode+never runs an entity shortcut. Switching modes preserves selection and dimensions.++The detailed layout replaces the old desktop launcher, including the onboarding+Create lesson. The PostHog flag `enable-carousel-create-menu` opts into the+carousel instead; when off, unknown, or loading, the detailed layout is used.+For local testing, set `VITE_ENABLE_CAROUSEL_CREATE_MENU=true` (or `false` to force+the detailed layout). The carousel shares creation actions, recents ordering,+search mode, and shortcuts; Left/Right also navigates its cards outside search.+The inline `/app/debug/create-menu-demo` keeps all three layouts for comparison+without creating data. Mobile continues to use its create sheet.+On mobile, the bottom dock fits fixed-width buttons in this order: Notifications,Calendar, Email, Channels, Files, Agents, Tasks, Calls, and CRM (when enabled). Calendar appears in thedock and search scope pills only when the calendar UI flag is enabled.