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(create): cleanup create menu (#7861)
Seamus22ecc1c86596
diff --git a/apps/web/src/features/command/DetailsLauncher.tsx b/apps/web/src/features/command/DetailsLauncher.tsxindex 91b0ac484e..c2b4ace394 100644--- a/apps/web/src/features/command/DetailsLauncher.tsx+++ b/apps/web/src/features/command/DetailsLauncher.tsx@@ -14,6 +14,7 @@ export default function DetailsLauncher(props: LauncherInnerProps) {onSelect={state.select}onChoose={state.choose}showHotkeys={!state.searchMode()}+ shiftHeld={state.shiftHeld()}scrollSelectedIntoView={state.scrollSelectedIntoView()}/>)}diff --git a/apps/web/src/features/command/Launcher.tsx b/apps/web/src/features/command/Launcher.tsxindex 82d8231993..79451044d3 100644--- a/apps/web/src/features/command/Launcher.tsx+++ b/apps/web/src/features/command/Launcher.tsx@@ -986,6 +986,7 @@ type LauncherBodyState = {blocks: Accessor<CreatableBlock[]>;selectedIndex: Accessor<number>;searchMode: Accessor<boolean>;+ shiftHeld: Accessor<boolean>;itemId: (item: CreatableBlock) => string;select: (index: number) => void;step: (direction: number) => void;@@ -1304,6 +1305,7 @@ export const LauncherShell = (blocks,selectedIndex: focusedIndex,searchMode,+ shiftHeld,itemId: (item) => `create-menu-${launcherItemKey(item)}`,select: listController.setSelectedIndexFromPointer,step: (direction) => {diff --git a/apps/web/src/features/command/components/CreateMenuPreview.tsx b/apps/web/src/features/command/components/CreateMenuPreview.tsxindex d9305a156c..17a3730b9f 100644--- a/apps/web/src/features/command/components/CreateMenuPreview.tsx+++ b/apps/web/src/features/command/components/CreateMenuPreview.tsx@@ -1,3 +1,4 @@+import { pressedKeys } from '@core/hotkey/state';import SearchIcon from '@phosphor/magnifying-glass.svg';import {CommandMenuList,@@ -88,7 +89,10 @@ export function CreateMenuPreview(props: {step(next ? 1 : -1);const item = selected();if (item) {- const option = document.getElementById(itemId(item));+ const option =+ props.layout === 'details'+ ? root.querySelector<HTMLElement>('[aria-selected="true"]')+ : document.getElementById(itemId(item));if (props.layout !== 'carousel')option?.scrollIntoView({ block: 'nearest' });if (@@ -177,6 +181,7 @@ export function CreateMenuPreview(props: {onSelect={c.setSelectedIndexFromPointer}onChoose={props.onChoose}detailsLeft={props.detailsLeft}+ shiftHeld={pressedKeys().has('shift')}/></Show><Show when={props.layout === 'carousel'}>diff --git a/apps/web/src/features/command/components/LauncherDetails.tsx b/apps/web/src/features/command/components/LauncherDetails.tsxindex aaa51c27a8..a447d26220 100644--- a/apps/web/src/features/command/components/LauncherDetails.tsx+++ b/apps/web/src/features/command/components/LauncherDetails.tsx@@ -1,5 +1,5 @@import { getIconConfig } from '@core/component/EntityIcon';-import { cn, Hotkey } from '@ui';+import { Button, cn, Hotkey } from '@ui';import { createEffect, For, on, Show } from 'solid-js';import { Dynamic } from 'solid-js/web';import {@@ -17,6 +17,7 @@ export function LauncherDetails(props: {onSelect: (index: number) => void;onChoose: (item: CreatableBlock) => void;showHotkeys?: boolean;+ shiftHeld?: boolean;scrollSelectedIntoView?: boolean;detailsLeft?: boolean;}) {@@ -67,57 +68,66 @@ export function LauncherDetails(props: {class="w-[38%] min-w-0 shrink-0 overflow-y-auto p-2 sm:w-64"><For each={props.sections}>- {(section) => (+ {(section, sectionIndex) => (<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+ {(item, itemIndex) => {+ const index = () =>+ props.sections+ .slice(0, sectionIndex())+ .reduce(+ (offset, entry) => offset + entry.items.length,+ 0+ ) + itemIndex();+ return (+ <button+ type="button"+ role="option"+ id={`${props.itemId(item)}-${section.group.id}`}+ data-create-option+ aria-selected={props.selectedIndex === index()}+ tabindex={-1}class={cn(- 'size-4 shrink-0 [&_svg]:size-4',- getIconConfig(item.blockName).foreground+ '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',+ props.selectedIndex === index()+ ? 'bg-ink/6 text-ink'+ : 'text-ink-muted')}+ onPointerMove={(event) => {+ if (event.movementX || event.movementY)+ props.onSelect(index());+ }}+ onFocus={() => props.onSelect(index())}+ onClick={() => props.onChoose(item)}>- <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+ class={cn(+ 'size-4 shrink-0 [&_svg]:size-4',+ getIconConfig(item.blockName).foreground+ )}+ >+ <Dynamic component={item.icon} /></span>- </Show>- </button>- )}+ <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>)}@@ -135,7 +145,7 @@ export function LauncherDetails(props: {{(item) => (<sectionaria-label={`${item().label} details`}- class="flex min-h-full flex-col px-6 pt-6 pb-2"+ class="flex min-h-full flex-col p-6"><divclass={cn(@@ -153,21 +163,44 @@ export function LauncherDetails(props: {{createMenuDetails(item())?.details ??createMenuTagline(item())}</p>- <div class="mt-auto flex shrink-0 items-center gap-3 pt-6">+ <div+ class={cn(+ 'mt-3 flex items-center gap-1.5 text-xs text-ink-muted',+ !props.showHotkeys && 'invisible'+ )}+ >+ Shortcut+ <Hotkey shortcut="c" theme="subtle" class="border-ink/12" />+ then+ <Hotkey+ token={item().hotkeyToken}+ shortcut={shortcut(item())}+ theme="subtle"+ class="border-ink/12"+ />+ </div>+ <div class="mt-auto flex shrink-0 flex-col items-end gap-2 pt-6"><spanclass={cn(- 'flex h-9 items-center gap-1.5 text-xs text-ink-muted',- !props.showHotkeys && 'invisible'+ 'text-xs text-ink-muted',+ !props.shiftHeld && 'invisible')}>- Shortcut+ In new split+ </span>+ <Button+ size="lg"+ variant="strong"+ aria-label={`Create ${item().label}${props.shiftHeld ? ' in new split' : ''}`}+ onClick={() => props.onChoose(item())}+ >+ Create {item().label}<Hotkey- token={item().hotkeyToken}- shortcut={shortcut(item())}- theme="subtle"- class="border-ink/12"+ shortcut={props.shiftHeld ? 'shift+enter' : 'enter'}+ theme="current"+ aria-hidden="true"/>- </span>+ </Button></div></section>)}diff --git a/apps/web/src/features/command/core/create-menu-details.ts b/apps/web/src/features/command/core/create-menu-details.tsindex 6dd1350964..fcf83e76dc 100644--- a/apps/web/src/features/command/core/create-menu-details.ts+++ b/apps/web/src/features/command/core/create-menu-details.ts@@ -1,31 +1,36 @@import type { CreatableBlock } from '../types';-export type CreateMenuGroupId = 'docs' | 'visual' | 'talk' | 'plan' | 'ai';+export type CreateMenuGroupId =+ | 'docs'+ | 'organization'+ | 'design'+ | 'data'+ | 'comms'+ | 'tasks'+ | 'ai'+ | 'other';export type CreateMenuGroup = {- id: CreateMenuGroupId | 'other' | 'recent';+ id: CreateMenuGroupId | 'recent';label: string;tagline: string;};export const CREATE_MENU_GROUPS: readonly CreateMenuGroup[] = [- { id: 'docs', label: 'Docs & files', tagline: 'Write, template, organize' },+ { id: 'docs', label: 'Docs', tagline: 'Write and template' },{- id: 'visual',- label: 'Visual & data',- tagline: 'Diagram, design, crunch numbers',+ id: 'organization',+ label: 'Organization',+ tagline: 'Keep related work together',},- { 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' },+ { id: 'design', label: 'Design', tagline: 'Diagram, sketch, design' },+ { id: 'data', label: 'Data', tagline: 'Collect, organize, analyze' },+ { id: 'comms', label: 'Comms', tagline: 'Reach people' },+ { id: 'tasks', label: 'Tasks', tagline: 'Stay on top of the work' },+ { id: 'ai', label: 'AI', tagline: 'Put agents to work' },+ { id: 'other', label: 'Other', tagline: 'Everything else' },];-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. */@@ -57,112 +62,112 @@ const DETAILS: Record<string, CreateMenuDetails> = {examples: ['Doc template', 'Checklist', 'Canned reply'],},Code: {- group: 'docs',+ group: 'other',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',+ group: 'organization',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',+ group: 'design',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',+ group: 'design',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',+ group: 'data',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'],},+ Spreadsheet: {+ group: 'data',+ 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'],+ },Form: {- group: 'visual',+ group: 'data',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',+ group: 'design',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',+ group: 'design',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',+ group: 'comms',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',+ group: 'comms',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',+ group: 'comms',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',+ group: 'comms',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',+ group: 'tasks',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',+ group: 'tasks',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',+ group: 'tasks',tagline: 'Nudge yourself at a time you pick',details:'Ask Macro to remind you about something later — no document or task required.',@@ -237,26 +242,21 @@ export function groupCreateMenuItems(const sections = CREATE_MENU_GROUPS.map((group) => ({group,items: items- .filter((item) => createMenuDetails(item)?.group === group.id)+ .filter(+ (item) => (createMenuDetails(item)?.group ?? 'other') === 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. */+/** Recent choices appear first and remain available in their categories. */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))- );+ const categories = groupCreateMenuItems(items);return recent.length? [{diff --git a/apps/web/src/features/command/core/launcher-history.test.ts b/apps/web/src/features/command/core/launcher-history.test.tsindex f776fa5c1d..9cf3b9f71f 100644--- a/apps/web/src/features/command/core/launcher-history.test.ts+++ b/apps/web/src/features/command/core/launcher-history.test.ts@@ -40,10 +40,13 @@ describe('launcher recent usage', () => {])).toEqual([['Recents', ['Email', 'Task', 'Folder']],- ['Docs & files', ['Document', 'Snippet']],+ ['Docs', ['Document', 'Snippet']],+ ['Organization', ['Folder']],+ ['Comms', ['Email']],+ ['Tasks', ['Task']],]);expect(sections.flatMap((section) => section.items)).toHaveLength(- items.length+ items.length + recent.length);});@@ -54,7 +57,7 @@ describe('launcher recent usage', () => {groupRecentCreateMenuItems(items, []).map((section) => section.group.label)- ).toEqual(['Docs & files', 'Communicate']);+ ).toEqual(['Docs', 'Comms']);});it('filters recent choices without promoting other search results into Recents', () => {@@ -70,7 +73,8 @@ describe('launcher recent usage', () => {)).toEqual([['Recents', ['Task']],- ['Docs & files', ['Document']],+ ['Docs', ['Document']],+ ['Tasks', ['Task']],]);expect(groupRecentCreateMenuItems([], [email, task])).toEqual([]);});diff --git a/docs/AGENT_GUIDE/navigation.md b/docs/AGENT_GUIDE/navigation.mdindex db19013a4c..bffee64d38 100644--- a/docs/AGENT_GUIDE/navigation.md+++ b/docs/AGENT_GUIDE/navigation.md@@ -436,11 +436,22 @@ On desktop, the rail **Create** button, **C**, and the command menu’s **Createentry open the detailed launcher at standard dialog width. Selecting **Create**closes the command menu and hands focus to the launcher; individual creationcommands 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+actual launcher usage, followed by all choices grouped by category.+Categories appear in this order: **Docs** (Document, Snippet), **Organization**+(Folder), **Design** (Canvas, Design, Photoshop file, Illustrator file), **Data**+(Database, Spreadsheet, Form), **Comms** (Email, Message, Channel, Call), **Tasks**+(Task, Project, Reminder), **AI** (Agent, Routine, Skill), and **Other** (Code and+any uncategorized entries). Only available entries and nonempty categories appear.+Recent items also remain in their categories. With no history, the list startswith categories. Hover or keyboard navigation updates the right detail panel;click a row or press Enter to start that creation flow. The detail panel istop-aligned, shares the list background, and is separated by a vertical divider.+The shortcut below the description shows the sequence, such as **C then T** for+Task, while direct shortcut mode is active.+Its lower-right **Create [type]** button starts the selected creation flow and+shows the Enter shortcut. Holding Shift adds an **In new split** indicator and+changes the button shortcut to Shift+Enter; clicking while holding Shift uses+the same new-split behavior where supported.The **Search mode** toggle (or **/**) switches between direct entity shortcutsshown beside each choice and the standard create search input. The preference