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
feat: new mobile nav ui (#5726)
Peter Chinman6146c3b8f6d4
diff --git a/apps/web/src/components/app/Layout.tsx b/apps/web/src/components/app/Layout.tsxindex 54e8cd1866..2d6a29bdad 100644--- a/apps/web/src/components/app/Layout.tsx+++ b/apps/web/src/components/app/Layout.tsx@@ -83,7 +83,7 @@ import GlobalShortcuts from './GlobalHotkeys';import { ItemDndProvider } from './ItemDragAndDrop';import { FloatRegion } from './mobile/float-regions/FloatRegion';import { FloatRegionHost } from './mobile/float-regions/FloatRegionHost';-import { MobileSearchRow } from './mobile/MobileSearchRow';+import { MobileDockRow } from './mobile/MobileDockRow';import { MobileViewsRow } from './mobile/MobileViewsRow';import { SwipeDownDismissKeyboard } from './mobile/SwipeDownDismissKeyboard';import { useAppSquishHandlers } from './useAppSquishHandlers';@@ -541,15 +541,13 @@ function LayoutInner(props: RouteSectionProps) {}><FloatRegionHost />+ <MobileViewsRow /><FloatRegion- region="accessory"- priority={() => (SearchState.isOpen() ? 100 : 0)}+ region="dock"active={() => !virtualKeyboardVisible() || SearchState.isOpen()}>- <MobileSearchRow />+ <MobileDockRow /></FloatRegion>- {/* The views row owns the bottom (dock) slot. */}- <MobileViewsRow /></Show><SwipeDownDismissKeyboard /><Suspense>diff --git a/apps/web/src/components/app/mobile/MobileDockIsland.tsx b/apps/web/src/components/app/mobile/MobileDockIsland.tsxnew file mode 100644index 0000000000..0753b7e871--- /dev/null+++ b/apps/web/src/components/app/mobile/MobileDockIsland.tsx@@ -0,0 +1,31 @@+import { cn } from '@ui';+import type { ParentProps } from 'solid-js';++/**+ * The floating pill surface for dock controls. Controls (MobileDockButton,+ * MobileTouchMenu) render flat and always sit inside one of these — alone for+ * a single round button, or grouped so several share the pill:+ *+ * ```tsx+ * <MobileDockIsland class="h-11 justify-between gap-3">+ * <MobileDockButton icon={BellIcon} … />+ * <MobileTouchMenu triggerIcon={CaretUpIcon} … />+ * </MobileDockIsland>+ * ```+ *+ * The container re-enables pointer events for its children (the float-region+ * host is pointer-transparent); layout beyond the pill itself — height,+ * growth, distribution — is the caller's, via `class`.+ */+export function MobileDockIsland(props: ParentProps<{ class?: string }>) {+ return (+ <div+ class={cn(+ 'island pointer-events-auto flex items-center rounded-full',+ props.class+ )}+ >+ {props.children}+ </div>+ );+}diff --git a/apps/web/src/components/app/mobile/MobileDockRow.tsx b/apps/web/src/components/app/mobile/MobileDockRow.tsxnew file mode 100644index 0000000000..dcb7d55205--- /dev/null+++ b/apps/web/src/components/app/mobile/MobileDockRow.tsx@@ -0,0 +1,269 @@+import { useCreateMenuBlocks } from '@app/features/command/Launcher';+import {+ MobileAskAiButton,+ MobileSearchInput,+} from '@app/features/command/mobile/MobileSearchInput';+import { SearchState } from '@app/features/command/mobile/mobileSearchState';+import { useHandleFileUpload } from '@app/util/handleFileUpload';+import { ENABLE_ANIMATED_ICONS } from '@core/constant/featureFlags';+import { useSettingsState } from '@core/constant/SettingsState';+import { triggerFocusInput } from '@core/directive/focusInput';+import { hapticImpact } from '@core/mobile/haptics';+import { openFilePicker } from '@core/util/upload';+import { ICON_ANIMATION_DURATION_MS } from '@icon/animation';+import IconGear from '@icon/macro-gear.svg';+import CreateIcon from '@icon/square-pen-create.svg';+import { AnimatedChannelIcon } from '@icon/wide-channel';+import { AnimatedEmailIcon } from '@icon/wide-email';+import { AnimatedSearchIcon } from '@icon/wide-search';+import BellIcon from '@phosphor/bell-simple.svg';+import CaretUpIcon from '@phosphor/caret-up.svg';+import UploadIcon from '@phosphor/upload-simple.svg';+import { cn } from '@ui';+import { createSignal, For, Show } from 'solid-js';+import { Dynamic } from 'solid-js/web';+import { MobileDockIsland } from './MobileDockIsland';+import { MobileBottomEdgeFade } from './MobileEdgeFade';+import {+ type MobileTouchIconComponent,+ MobileTouchMenu,+ type MobileTouchMenuItem,+} from './MobileTouchMenu';+import { useMobileDockViews } from './mobile-dock-views';+import { pressPulse } from './pressPulse';+import {+ type MobileDockNavId,+ useForegroundMobileView,+ useMobileNavNavigate,+} from './use-mobile-nav';++// Keeps the directive import from being tree-shaken / lint-flagged.+false && pressPulse;++function CreateMenu() {+ const createBlocks = useCreateMenuBlocks();+ const handleFileUpload = useHandleFileUpload();++ // The desktop create menus are the source of truth (useCreateMenuBlocks);+ // rows render top → bottom ending at the thumb, so reverse to keep the+ // desktop order's first entries nearest it.+ const blocks = () => [...createBlocks()].reverse();++ const uploadItem: MobileTouchMenuItem = {+ id: 'upload-file',+ label: 'Upload file',+ icon: UploadIcon,+ animateIcon: false,+ onSelect: () => {+ openFilePicker({ multiple: true }, async (files) => {+ await handleFileUpload(files, false);+ });+ },+ };++ return (+ <MobileDockIsland class="shrink-0">+ <MobileTouchMenu+ triggerIcon={CreateIcon}+ footerLabel="Create"+ items={[+ uploadItem,+ ...blocks().map((block) => {+ const useAnimatedIcon = ENABLE_ANIMATED_ICONS && block.animatedIcon;+ return {+ // Labels key the rows: 'Message' and 'Channel' share a+ // blockName.+ id: block.label,+ label: block.label,+ icon: useAnimatedIcon ? block.animatedIcon : block.icon,+ animateIcon: !!useAnimatedIcon,+ // The block's own action, exactly as the desktop menus invoke+ // it (e.g. Channel opens the new-channel modal).+ onSelect: () => block.keyDownHandler?.(),+ };+ }),+ ]}+ />+ </MobileDockIsland>+ );+}++type MobileDockButtonProps = {+ icon: MobileTouchIconComponent;+ /** Accessible name for the icon-only button. */+ ariaLabel: string;+ onClick: () => void;+ active?: boolean;+ class?: string;+ /** Plain svg icons (e.g. Bell) don't accept `triggerAnimation`. */+ animateIcon?: boolean;+};++/**+ * Renders flat: hosts wrap it in a MobileDockIsland (alone or grouped with+ * other controls) to give it the floating chrome.+ */+function MobileDockButton(props: MobileDockButtonProps) {+ const [animating, setAnimating] = createSignal(false);++ return (+ <button+ type="button"+ aria-label={props.ariaLabel}+ use:pressPulse+ onPointerDown={() => {+ hapticImpact('light');+ if (props.animateIcon !== false) {+ setAnimating(true);+ setTimeout(() => setAnimating(false), ICON_ANIMATION_DURATION_MS);+ }+ }}+ // Fires on release; the press pulse holds the on-state while touched.+ onClick={() => {+ props.onClick();+ }}+ class={cn(+ 'relative flex size-10 shrink-0 items-center justify-center rounded-full',+ props.active && 'text-accent',+ props.class+ )}+ >+ <div class="size-6 shrink-0 [&_svg]:size-6">+ {props.animateIcon === false ? (+ <Dynamic component={props.icon} />+ ) : (+ <Dynamic component={props.icon} triggerAnimation={animating()} />+ )}+ </div>+ </button>+ );+}++function MoreViewsMenu(props: {+ isActive: (id: MobileDockNavId) => boolean;+ onNavigate: (id: MobileDockNavId) => void;+}) {+ const { settingsOpen, toggleSettings } = useSettingsState();+ const dockViews = useMobileDockViews();++ return (+ <MobileTouchMenu+ triggerIcon={CaretUpIcon}+ footerLabel="Views"+ items={[+ {+ id: 'settings',+ label: 'Settings',+ icon: IconGear,+ active: settingsOpen,+ animateIcon: false,+ dividerAfter: true,+ onSelect: toggleSettings,+ },+ // Rows render top → bottom ending at the thumb: reverse the shared+ // canonical order so Inbox lands nearest it.+ ...[...dockViews()].reverse().map((view) => ({+ id: view.id,+ label: view.label,+ icon: view.icon,+ animateIcon: view.animateIcon,+ active: () => props.isActive(view.id),+ onSelect: () => props.onNavigate(view.id),+ })),+ ]}+ />+ );+}++/**+ * The compact dock — the default bottom row everywhere: one wide island+ * grouping Notifications, Email, Channels, Search, and the Views menu — with+ * Create on its own island. Pressing Search flips the row to the search+ * layout (see MobileDockRow); the current view's button shows in accent.+ */+function MobileCompactDockRow() {+ const navigate = useMobileNavNavigate();+ const foregroundView = useForegroundMobileView();++ const navButtons = (): Array<{+ id: MobileDockNavId;+ label: string;+ icon: MobileTouchIconComponent;+ animateIcon?: boolean;+ }> => [+ {+ id: 'inbox',+ label: 'Notifications',+ icon: BellIcon,+ animateIcon: false,+ },+ { id: 'mail', label: 'Email', icon: AnimatedEmailIcon },+ { id: 'channels', label: 'Channels', icon: AnimatedChannelIcon },+ ];++ return (+ <div class="flex w-full justify-between">+ <MobileDockIsland class="h-11 min-w-0 justify-between gap-3">+ <For each={navButtons()}>+ {(button) => (+ <MobileDockButton+ icon={button.icon}+ ariaLabel={button.label}+ animateIcon={button.animateIcon}+ active={foregroundView() === button.id}+ onClick={() => navigate(button.id)}+ />+ )}+ </For>+ <MobileDockButton+ icon={AnimatedSearchIcon}+ ariaLabel="Search"+ onClick={() => {+ // Focus synchronously inside the tap so iOS lets the keyboard+ // open; the input mounts once opening the session flips the row+ // to the search layout.+ triggerFocusInput(() =>+ document.getElementById('mobile-search-input')+ );+ SearchState.open();+ navigate('search');+ }}+ />+ <MoreViewsMenu+ isActive={(id) => foregroundView() === id}+ onNavigate={navigate}+ />+ </MobileDockIsland>+ <CreateMenu />+ </div>+ );+}++type MobileDockRowProps = {+ class?: string;+};++/**+ * The bottom-most chrome row. By default it is the compact dock (see+ * MobileCompactDockRow); pressing its Search button opens a search session,+ * which swaps in the search row — the search bar ("Search or ask AI...")+ * with the "Ask AI" island — and shows the views pill row in the accessory+ * slot above as the scope switcher (see MobileViewsRow). Pressing the+ * input's X ends the session and restores the compact dock.+ */+export function MobileDockRow(props: MobileDockRowProps) {+ return (+ <div+ class={cn(+ 'flex items-center gap-3 px-(--mobile-chrome-gutter)',+ props.class+ )}+ >+ <MobileBottomEdgeFade />+ <Show when={SearchState.isOpen()} fallback={<MobileCompactDockRow />}>+ <MobileSearchInput />+ <MobileAskAiButton />+ </Show>+ </div>+ );+}diff --git a/apps/web/src/components/app/mobile/MobileSearchRow.tsx b/apps/web/src/components/app/mobile/MobileSearchRow.tsxdeleted file mode 100644index d3a5083dc2..0000000000--- a/apps/web/src/components/app/mobile/MobileSearchRow.tsx+++ /dev/null@@ -1,117 +0,0 @@-import {- CREATABLE_BLOCKS,- type CreatableBlock,- runCreateAction,-} from '@app/features/command/Launcher';-import {- MobileAskAiButton,- MobileSearchInput,-} from '@app/features/command/mobile/MobileSearchInput';-import { SearchState } from '@app/features/command/mobile/mobileSearchState';-import { useFeatureFlag } from '@app/lib/analytics/posthog';-import { useHandleFileUpload } from '@app/util/handleFileUpload';-import {- ENABLE_ANIMATED_ICONS,- ENABLE_SNIPPETS_FLAG,- ENABLE_SNIPPETS_OVERRIDE,-} from '@core/constant/featureFlags';-import { openFilePicker } from '@core/util/upload';-import PlusIcon from '@phosphor/plus.svg';-import UploadIcon from '@phosphor/upload-simple.svg';-import { cn } from '@ui';-import { Show } from 'solid-js';-import { MobileTouchMenu, type MobileTouchMenuItem } from './MobileTouchMenu';--// Rows render top → bottom, ending at the thumb, so bottom → top this reads-// Email, Message, Doc, Task, Agent, Folder, Code, Canvas, Snippet. Each name-// resolves to its first CREATABLE_BLOCKS match, which drops the-// desktop-only 'Channel' entry: it shares the 'channel' blockName with-// 'Message', so on mobile both would run the same create action.-const CREATE_MENU_BLOCK_ORDER: CreatableBlock['blockName'][] = [- 'snippet',- 'canvas',- 'code',- 'project',- 'chat',- 'task',- 'md',- 'channel',- 'email',-];--function CreateMenu() {- const snippetsFlag = useFeatureFlag(ENABLE_SNIPPETS_FLAG, {- enabledOverride: ENABLE_SNIPPETS_OVERRIDE,- });- const handleFileUpload = useHandleFileUpload();-- const blocks = () =>- CREATE_MENU_BLOCK_ORDER.filter(- (blockName) => blockName !== 'snippet' || snippetsFlag().enabled- ).flatMap((blockName) => {- const block = CREATABLE_BLOCKS.find((b) => b.blockName === blockName);- return block ? [block] : [];- });-- const uploadItem: MobileTouchMenuItem = {- id: 'upload-file',- label: 'Upload file',- icon: UploadIcon,- animateIcon: false,- onSelect: () => {- openFilePicker({ multiple: true }, async (files) => {- await handleFileUpload(files, false);- });- },- };-- return (- <MobileTouchMenu- triggerIcon={PlusIcon}- // This row sits above the views row, so anchor the menu to the trigger- // rather than the bottom chrome row.- position="trigger-bottom"- footerLabel="Create"- items={[- uploadItem,- ...blocks().map((block) => {- const useAnimatedIcon = ENABLE_ANIMATED_ICONS && block.animatedIcon;- return {- id: block.blockName,- label: block.label,- icon: useAnimatedIcon ? block.animatedIcon : block.icon,- animateIcon: !!useAnimatedIcon,- onSelect: () => runCreateAction(block.blockName),- };- }),- ]}- />- );-}--type MobileSearchRowProps = {- class?: string;-};--/**- * The search/create row: the persistent search bar ("Search or ask AI...")- * with the Create menu to its right. It sits in the accessory slot above the- * views row (see MobileViewsRow), where per-view inputs (chat, compose, email- * reply) replace it. While a search session is active the Create menu's slot- * is taken by the "Ask AI" button.- */-export function MobileSearchRow(props: MobileSearchRowProps) {- return (- <div- class={cn(- 'flex items-center gap-3 px-(--mobile-chrome-gutter)',- props.class- )}- >- <MobileSearchInput />- <Show when={!SearchState.isOpen()} fallback={<MobileAskAiButton />}>- <CreateMenu />- </Show>- </div>- );-}diff --git a/apps/web/src/components/app/mobile/MobileTouchMenu.tsx b/apps/web/src/components/app/mobile/MobileTouchMenu.tsxindex 1dce1d0b8e..8348b313fc 100644--- a/apps/web/src/components/app/mobile/MobileTouchMenu.tsx+++ b/apps/web/src/components/app/mobile/MobileTouchMenu.tsx@@ -2,7 +2,6 @@ import './MobileTouchMenu.css';import { hapticImpact } from '@core/mobile/haptics';import { isNativeMobilePlatform } from '@core/mobile/isNativeMobilePlatform';import { ICON_ANIMATION_DURATION_MS } from '@icon/animation';-import CaretUpIcon from '@phosphor/caret-up.svg';import { createElementSize } from '@solid-primitives/resize-observer';import { cn, Layer } from '@ui';import {@@ -31,6 +30,8 @@ export type MobileTouchMenuItem = {icon?: MobileTouchIconComponent;active?: () => boolean;animateIcon?: boolean;+ /** Draw a separator line below this row. */+ dividerAfter?: boolean;onSelect: () => void;};@@ -72,10 +73,7 @@ function MobileTouchMenuButton(props: MobileTouchMenuButtonProps) {}}onTouchMove={props.onTouchMove}onTouchEnd={props.onTouchEnd}- class={cn(- 'island pointer-events-auto flex items-center justify-center',- props.class- )}+ class={cn('flex items-center justify-center', props.class)}><div class="size-6 [&_svg]:size-6">{props.animateIcon === false ? (@@ -88,11 +86,14 @@ function MobileTouchMenuButton(props: MobileTouchMenuButtonProps) {);}+/**+ * The trigger renders flat: hosts wrap it in a MobileDockIsland (alone or+ * grouped with other controls) to give it the floating chrome.+ */export function MobileTouchMenu(props: {triggerIcon: MobileTouchIconComponent;position?: 'bottom-row' | 'trigger-bottom';footerLabel: string;- footerCaretClass?: string;items: MobileTouchMenuItem[];}) {// `open` drives the show/hide animation (via data-expanded); `mounted`@@ -231,56 +232,55 @@ export function MobileTouchMenu(props: {><For each={props.items}>{(item) => (- <button- type="button"- data-mobile-touch-menu-item={item.id}- class={cn(- 'flex h-11 items-center gap-2 rounded-lg px-3 text-sm',- item.active?.() ? 'text-accent' : 'text-ink',- hoveredId() === item.id- ? 'bg-hover'- : 'hover:bg-hover'- )}- onClick={() => {- hapticImpact('light');- select(item.id);- }}- >- <Show when={item.icon}>- {(Icon) => (- <div class="size-4 shrink-0 [&_svg]:size-4">- <Show- when={item.animateIcon !== false}- fallback={<Dynamic component={Icon()} />}- >- <Dynamic- component={Icon()}- triggerAnimation={hoveredId() === item.id}- />- </Show>- </div>+ <>+ <button+ type="button"+ data-mobile-touch-menu-item={item.id}+ class={cn(+ 'flex h-11 items-center gap-2 rounded-lg px-3 text-sm',+ item.active?.() ? 'text-accent' : 'text-ink',+ hoveredId() === item.id+ ? 'bg-hover'+ : 'hover:bg-hover')}+ onClick={() => {+ hapticImpact('light');+ select(item.id);+ }}+ >+ <Show when={item.icon}>+ {(Icon) => (+ <div class="size-4 shrink-0 [&_svg]:size-4">+ <Show+ when={item.animateIcon !== false}+ fallback={<Dynamic component={Icon()} />}+ >+ <Dynamic+ component={Icon()}+ triggerAnimation={hoveredId() === item.id}+ />+ </Show>+ </div>+ )}+ </Show>+ <span>{item.label}</span>+ </button>+ <Show when={item.dividerAfter}>+ <div class="-mx-1 h-px shrink-0 bg-edge" /></Show>- <span>{item.label}</span>- </button>+ </>)}</For><div class="-mx-1 h-px shrink-0 bg-edge" /><buttontype="button"- class="flex h-9 shrink-0 items-center justify-between px-3 text-sm font-medium text-ink-muted"+ class="flex h-9 shrink-0 items-center px-3 text-sm font-medium text-ink-muted"onPointerDown={() => {hapticImpact('light');closeMenu();}}><span>{props.footerLabel}</span>- <CaretUpIcon- class={cn(- 'size-6 rotate-180 text-ink',- props.footerCaretClass- )}- /></button></div></div>diff --git a/apps/web/src/components/app/mobile/MobileViewsRow.tsx b/apps/web/src/components/app/mobile/MobileViewsRow.tsxindex 03d8f18a67..b1ebd225cf 100644--- a/apps/web/src/components/app/mobile/MobileViewsRow.tsx+++ b/apps/web/src/components/app/mobile/MobileViewsRow.tsx@@ -1,68 +1,50 @@-import { useCalendarUiFlag } from '@app/features/calendar/hooks/use-calendar-ui-flag';import { SearchState } from '@app/features/command/mobile/mobileSearchState';-import { virtualKeyboardVisible } from '@core/mobile/virtualKeyboard';-import IconGear from '@icon/macro-gear.svg';-import WideCalendarIcon from '@icon/wide-calendar.svg';-import BellIcon from '@phosphor/bell-simple.svg';import { createMemo } from 'solid-js';+import { Dynamic } from 'solid-js/web';import { FloatRegion } from './float-regions/FloatRegion';-import { MobileBottomEdgeFade } from './MobileEdgeFade';+import { useMobileDockViews } from './mobile-dock-views';+import type { MobileNavViewId } from './mobile-nav-views';+import { type PillTabItem, PillTabs } from './PillTabs';import {useForegroundMobileView,useMobileNavNavigate,-} from './mobile-nav-state';-import type { MobileNavViewId } from './mobile-nav-views';-import { type PillTabItem, PillTabs } from './PillTabs';+} from './use-mobile-nav';/**- * The global views pill row in the bottom (dock) slot, beneath the search- * row. Doubles as the search scope switcher: it stays visible while the- * search session is active (even with the keyboard up).+ * The views pill row in the accessory slot, above the dock row. It shows+ * only while a search session is active (the dock is in its search layout),+ * acting as the search scope switcher — even with the keyboard up.*/export function MobileViewsRow() {- const calendarUiEnabled = useCalendarUiFlag();// Highlight only the view that is actually the foreground split content —// with an entity (or anything else) open, no pill is active.const activeView = useForegroundMobileView();const navigate = useMobileNavNavigate();+ const dockViews = useMobileDockViews();const items = createMemo<PillTabItem<MobileNavViewId>[]>(() => [- {- value: 'inbox',- label: <BellIcon class="size-5" />,- iconOnly: true,- ariaLabel: 'Inbox',- },- ...(calendarUiEnabled()- ? [- {- value: 'calendar' as const,- label: <WideCalendarIcon class="size-5" />,+ { value: 'search', label: 'All' },+ ...dockViews().map((view) =>+ view.pillIcon+ ? {+ value: view.id,+ label: <Dynamic component={view.pillIcon} class="size-5" />,iconOnly: true,- ariaLabel: 'Calendar',- },- ]- : []),- { value: 'mail', label: 'Email' },- { value: 'channels', label: 'Messages' },- { value: 'documents', label: 'Files' },- { value: 'agents', label: 'Agents' },- { value: 'tasks', label: 'Tasks' },- { value: 'calls', label: 'Calls' },- {- value: 'settings',- label: <IconGear class="size-5" />,- iconOnly: true,- ariaLabel: 'Settings',- },+ ariaLabel: view.label,+ }+ : { value: view.id, label: view.label }+ ),]);return (<FloatRegion- region="dock"- active={() => !virtualKeyboardVisible() || SearchState.isOpen()}+ region="accessory"+ // While a search session is open the scope pills outbid any other+ // accessory contributor (per-view compose/reply bars own the slot the+ // rest of the time).+ priority={100}+ active={() => SearchState.isOpen()}>- <MobileBottomEdgeFade />{/* Full-bleed strip: the pills scroll to the device edge, and thechrome gutter travels with the scrolled content instead of insettingthe scroll box. */}diff --git a/apps/web/src/components/app/mobile/PillTabs.tsx b/apps/web/src/components/app/mobile/PillTabs.tsxindex 7c94defe12..f5068afa22 100644--- a/apps/web/src/components/app/mobile/PillTabs.tsx+++ b/apps/web/src/components/app/mobile/PillTabs.tsx@@ -12,6 +12,7 @@ import {onCleanup,Show,} from 'solid-js';+import { MobileDockIsland } from './MobileDockIsland';import { MobileTouchMenu } from './MobileTouchMenu';import { computeVisiblePillValues } from './pillTabsLayout';import { pressPulse } from './pressPulse';@@ -79,8 +80,9 @@ type PillTabsProps<T extends string> = {contentClass?: string;/*** Scrollable variant only: rendered as the first child of the scroll- * content, ahead of the pills. For a control pinned at the strip's start- * while pills scroll beneath it (e.g. the filter-drawer button), give it+ * content, ahead of the pills, scrolling along with them (e.g. the+ * filter-drawer button). To instead pin a control at the strip's start+ * while pills scroll beneath it, give it* `sticky left-(--mobile-chrome-gutter) z-10` — the keep-active-in-view* logic accounts for a sticky leading element's width.*/@@ -142,6 +144,24 @@ function PillButton<T extends string>(props: {);}+/**+ * The strip's snap origin and trailing inset: the content row's edge padding,+ * with the origin also moved past a sticky leading control (it stays pinned+ * over the scrolled content).+ */+function snapInsets(content: HTMLElement) {+ const contentStyle = getComputedStyle(content);+ const padLeft = Number.parseFloat(contentStyle.paddingLeft || '0');+ const padRight = Number.parseFloat(contentStyle.paddingRight || '0');+ const gap = Number.parseFloat(contentStyle.columnGap || '0') || 0;+ const leading = content.firstElementChild as HTMLElement | null;+ const pinnedInset =+ leading && getComputedStyle(leading).position === 'sticky'+ ? leading.offsetWidth + gap+ : 0;+ return { minLeft: padLeft + pinnedInset, padRight };+}+function ScrollablePillTabs<T extends string>(props: PillTabsProps<T>) {const [stripRef, setStripRef] = createSignal<HTMLDivElement>();const [contentRef, setContentRef] = createSignal<HTMLDivElement>();@@ -283,18 +303,8 @@ function ScrollablePillTabs<T extends string>(props: PillTabsProps<T>) {const active = strip?.querySelector<HTMLElement>('[data-checked]');if (!strip || !active) return;const content = strip.firstElementChild as HTMLElement | null;- const contentStyle = content ? getComputedStyle(content) : undefined;- const padLeft = Number.parseFloat(contentStyle?.paddingLeft || '0');- const padRight = Number.parseFloat(contentStyle?.paddingRight || '0');- const gap = Number.parseFloat(contentStyle?.columnGap || '0') || 0;- // A sticky leading control stays pinned over the scrolled content,- // so the snap origin moves past it.- const leading = content?.firstElementChild as HTMLElement | null;- const pinnedInset =- leading && getComputedStyle(leading).position === 'sticky'- ? leading.offsetWidth + gap- : 0;- const minLeft = padLeft + pinnedInset;+ if (!content) return;+ const { minLeft, padRight } = snapInsets(content);// Rect arithmetic rather than offsetLeft: the strip is not// positioned (see SCROLL_STRIP_CLASS), so it is no offsetParent.const stripLeft = strip.getBoundingClientRect().left;@@ -448,17 +458,19 @@ function MenuOverflowPillTabs<T extends string>(props: PillTabsProps<T>) {)}</For><Show when={overflowItems().length > 0}>- <MobileTouchMenu- triggerIcon={DotsThreeIcon}- position="trigger-bottom"- footerLabel="Tabs"- items={overflowItems().map((item) => ({- id: item.value,- label: item.label,- active: () => props.value === item.value,- onSelect: () => props.onChange(item.value),- }))}- />+ <MobileDockIsland class="shrink-0">+ <MobileTouchMenu+ triggerIcon={DotsThreeIcon}+ position="trigger-bottom"+ footerLabel="Tabs"+ items={overflowItems().map((item) => ({+ id: item.value,+ label: item.label,+ active: () => props.value === item.value,+ onSelect: () => props.onChange(item.value),+ }))}+ />+ </MobileDockIsland></Show><divref={setMeasureRef}diff --git a/apps/web/src/components/app/mobile/mobile-dock-views.ts b/apps/web/src/components/app/mobile/mobile-dock-views.tsnew file mode 100644index 0000000000..22c18aa4c4--- /dev/null+++ b/apps/web/src/components/app/mobile/mobile-dock-views.ts@@ -0,0 +1,58 @@+import { useCalendarUiFlag } from '@app/features/calendar/hooks/use-calendar-ui-flag';+import WideCalendarIcon from '@icon/wide-calendar.svg';+import { AnimatedCallIcon } from '@icon/wide-call';+import { AnimatedChannelIcon } from '@icon/wide-channel';+import { AnimatedEmailIcon } from '@icon/wide-email';+import { AnimatedFileMdIcon } from '@icon/wide-fileMd';+import { AnimatedInboxIcon } from '@icon/wide-inbox';+import { AnimatedStarIcon } from '@icon/wide-star';+import { AnimatedTaskIcon } from '@icon/wide-task';+import BellIcon from '@phosphor/bell-simple.svg';+import { type Accessor, createMemo } from 'solid-js';+import type { MobileTouchIconComponent } from './MobileTouchMenu';+import type { MobileNavViewId } from './mobile-nav-views';++export type MobileDockView = {+ id: Exclude<MobileNavViewId, 'search' | 'settings'>;+ label: string;+ /** Views-menu row icon (animated where available). */+ icon: MobileTouchIconComponent;+ /** Plain svg icons (e.g. the calendar) don't accept `triggerAnimation`. */+ animateIcon?: boolean;+ /** When set, the scope pill renders icon-only with this icon. */+ pillIcon?: MobileTouchIconComponent;+};++/**+ * The navigation views shared by the search scope pills (MobileViewsRow) and+ * the dock's Views menu (MoreViewsMenu), in canonical order: the pill row+ * renders it as-is after the "All" pill, the menu reversed so Inbox stays+ * nearest the thumb. "All" (pills only) and Settings (menu only) are+ * per-surface additions at the edges.+ */+const MOBILE_DOCK_VIEWS: MobileDockView[] = [+ { id: 'inbox', label: 'Inbox', icon: AnimatedInboxIcon, pillIcon: BellIcon },+ {+ id: 'calendar',+ label: 'Calendar',+ icon: WideCalendarIcon,+ animateIcon: false,+ pillIcon: WideCalendarIcon,+ },+ { id: 'mail', label: 'Email', icon: AnimatedEmailIcon },+ { id: 'channels', label: 'Channels', icon: AnimatedChannelIcon },+ { id: 'documents', label: 'Files', icon: AnimatedFileMdIcon },+ { id: 'agents', label: 'Agents', icon: AnimatedStarIcon },+ { id: 'tasks', label: 'Tasks', icon: AnimatedTaskIcon },+ { id: 'calls', label: 'Calls', icon: AnimatedCallIcon },+];++/** The dock views with feature gating applied (the calendar UI flag). */+export function useMobileDockViews(): Accessor<MobileDockView[]> {+ const calendarUiEnabled = useCalendarUiFlag();+ return createMemo(() =>+ MOBILE_DOCK_VIEWS.filter(+ (view) => view.id !== 'calendar' || calendarUiEnabled()+ )+ );+}diff --git a/apps/web/src/components/app/mobile/mobile-nav-views.test.ts b/apps/web/src/components/app/mobile/mobile-nav-views.test.tsdeleted file mode 100644index 9c3adfe1f0..0000000000--- a/apps/web/src/components/app/mobile/mobile-nav-views.test.ts+++ /dev/null@@ -1,14 +0,0 @@-import { describe, expect, it } from 'vitest';-import { isMobileNavViewId } from './mobile-nav-views';--describe('isMobileNavViewId', () => {- it('accepts pill-row views and rejects everything else', () => {- expect(isMobileNavViewId('inbox')).toBe(true);- expect(isMobileNavViewId('channels')).toBe(true);- expect(isMobileNavViewId('settings')).toBe(true);- expect(isMobileNavViewId('commands')).toBe(false);- expect(isMobileNavViewId('folders')).toBe(false);- expect(isMobileNavViewId('search')).toBe(false);- expect(isMobileNavViewId('md')).toBe(false);- });-});diff --git a/apps/web/src/components/app/mobile/mobile-nav-views.ts b/apps/web/src/components/app/mobile/mobile-nav-views.tsindex cc751ab3ec..f3bd8f19aa 100644--- a/apps/web/src/components/app/mobile/mobile-nav-views.ts+++ b/apps/web/src/components/app/mobile/mobile-nav-views.ts@@ -1,9 +1,11 @@/*** Views reachable from the mobile navigation pill row, in display order.+ * `search` is the "All" pill, first in the scope pill row;* `settings` navigates through the settings state (not `openWithSplit`), and* `calendar` is additionally gated by the calendar UI flag.*/export const MOBILE_NAV_VIEW_IDS = [+ 'search','inbox','calendar','mail',diff --git a/apps/web/src/components/app/mobile/mobile-nav-state.ts b/apps/web/src/components/app/mobile/use-mobile-nav.tssimilarity index 80%rename from apps/web/src/components/app/mobile/mobile-nav-state.tsrename to apps/web/src/components/app/mobile/use-mobile-nav.tsindex a138db5459..74ad1c115e 100644--- a/apps/web/src/components/app/mobile/mobile-nav-state.ts+++ b/apps/web/src/components/app/mobile/use-mobile-nav.ts@@ -1,3 +1,4 @@+import type { ListView } from '@app/constants/list-views';import { globalSplitManager } from '@app/signal/splitLayout';import { CALENDAR_BLOCK_ID } from '@block-calendar/types';import { useSettingsState } from '@core/constant/SettingsState';@@ -5,9 +6,14 @@ import { type Accessor, createMemo } from 'solid-js';import { useSplitLayout } from '../split-layout/layout';import { isMobileNavViewId, type MobileNavViewId } from './mobile-nav-views';-type MobileSplitNavViewId = Exclude<MobileNavViewId, 'settings'>;+/**+ * Everything the dock can navigate to: the pill-row views plus the list views+ * only reachable through the Views menu or the dynamic nav button (folders,+ * companies, …).+ */+export type MobileDockNavId = ListView | 'calendar' | 'settings';-function mobileNavContent(id: MobileSplitNavViewId) {+function mobileNavContent(id: Exclude<MobileDockNavId, 'settings'>) {return id === 'calendar'? ({ type: 'calendar', id: CALENDAR_BLOCK_ID } as const): ({ type: 'component', id } as const);@@ -34,7 +40,7 @@ export function useForegroundMobileView(): Accessor<* so the switch doesn't push a swipe-back entry; from an entity it is forward* navigation so the user can swipe back. Settings toggles the settings split.*/-export function useMobileNavNavigate(): (id: MobileNavViewId) => void {+export function useMobileNavNavigate(): (id: MobileDockNavId) => void {const { openWithSplit } = useSplitLayout();const { toggleSettings } = useSettingsState();diff --git a/apps/web/src/features/command/Launcher.tsx b/apps/web/src/features/command/Launcher.tsxindex 95f05e5272..5f7ad2585f 100644--- a/apps/web/src/features/command/Launcher.tsx+++ b/apps/web/src/features/command/Launcher.tsx@@ -75,6 +75,7 @@ import {} from '@ui';import { getNormalizedKeyString } from '@ui/components/Hotkey';import {+ type Accessor,createEffect,createMemo,createSignal,@@ -589,6 +590,26 @@ export const CREATABLE_BLOCKS: CreatableBlock[] = [},];+/**+ * The creatable-block entries a create menu renders, with feature gating+ * applied — the single source of truth shared by the desktop menus and the+ * mobile dock's Create menu, so they cannot drift. Callers with a custom+ * block list (e.g. the onboarding sandbox launcher) pass it as `source` to+ * run it through the same gating.+ */+export function useCreateMenuBlocks(+ source: () => CreatableBlock[] = () => CREATABLE_BLOCKS+): Accessor<CreatableBlock[]> {+ const snippetsFlag = useFeatureFlag(ENABLE_SNIPPETS_FLAG, {+ enabledOverride: ENABLE_SNIPPETS_OVERRIDE,+ });+ return createMemo(() =>+ source().filter(+ (block) => block.blockName !== 'snippet' || snippetsFlag().enabled+ )+ );+}+export const [createMenuOpen, setCreateMenuOpen] = createControlledOpenSignal(false,{ id: 'launcher' }@@ -654,13 +675,9 @@ type LauncherInnerProps = {export const LauncherInner = (props: LauncherInnerProps) => {const hkGroup = createHotkeyGroup();- const snippetsFlag = useFeatureFlag(ENABLE_SNIPPETS_FLAG, {- enabledOverride: ENABLE_SNIPPETS_OVERRIDE,- });- const availableBlocks = () =>- (props.blocks ?? CREATABLE_BLOCKS).filter(- (block) => block.blockName !== 'snippet' || snippetsFlag().enabled- );+ const availableBlocks = useCreateMenuBlocks(+ () => props.blocks ?? CREATABLE_BLOCKS+ );const sortedBlocks = createMemo(() => {const now = Date.now();diff --git a/apps/web/src/features/command/mobile/MobileSearchInput.tsx b/apps/web/src/features/command/mobile/MobileSearchInput.tsxindex 1179240a3a..c525822c69 100644--- a/apps/web/src/features/command/mobile/MobileSearchInput.tsx+++ b/apps/web/src/features/command/mobile/MobileSearchInput.tsx@@ -1,11 +1,14 @@import { openChatWithMessage } from '@app/features/chat/ChatWithAgentButton';-import { useForegroundMobileView } from '@components/app/mobile/mobile-nav-state';import { pressPulse } from '@components/app/mobile/pressPulse';+import {+ useForegroundMobileView,+ useMobileNavNavigate,+} from '@components/app/mobile/use-mobile-nav';import { hapticImpact } from '@core/mobile/haptics';import { usePreserveFocusOnButtonTaps } from '@core/mobile/usePreserveFocusOnButtonTaps';import XIcon from '@phosphor/x.svg';import { cn } from '@ui';-import { createEffect, on, Show } from 'solid-js';+import { createEffect, on } from 'solid-js';import { SearchState } from './mobileSearchState';// Keeps the directive import from being tree-shaken / lint-flagged.@@ -13,8 +16,10 @@ false && pressPulse;// This component only writes the global session state. The active split's// bridge effect (see soup-view-context) mirrors the session into its own-// search text — the input mounts once in the stable app chrome, outside-// every split, so navigation never remounts (and thereby blurs) it.+// search text — the input lives in the app chrome outside every split and+// stays mounted for the whole session, so switching scope views never+// remounts (and thereby blurs) it. It mounts and unmounts only with the+// session itself (see MobileDockRow's search layout)./*** Sends the current query to a new AI chat and ends the search session.@@ -29,7 +34,7 @@ function submitAskAi() {/*** "Ask AI" island shown beside the search input while a session is active- * (it takes the Create button's slot — see MobileSearchRow).+ * (see MobileDockRow's search layout).*/export function MobileAskAiButton() {const hasQuery = () => SearchState.query().trim().length > 0;@@ -42,7 +47,7 @@ export function MobileAskAiButton() {data-keep-keyboardclass={cn('island pointer-events-auto flex h-11 shrink-0 items-center rounded-full px-3 text-xs font-medium',- hasQuery() ? 'text-ink' : 'text-ink-extra-muted'+ hasQuery() ? 'bg-accent text-chrome' : 'text-ink-extra-muted')}onPointerDown={(e) => {// Keep the input focused while tapping.@@ -62,10 +67,10 @@ export function MobileAskAiButton() {* selected view's own soup search directly.*/export function MobileSearchInput() {- let inputRef: HTMLInputElement | undefined;let containerRef: HTMLDivElement | undefined;const foregroundView = useForegroundMobileView();+ const navigate = useMobileNavNavigate();// iOS ends the editing session (dropping the keyboard) while processing// button taps even when pointerdown is cancelled. This keeps the input@@ -75,13 +80,6 @@ export function MobileSearchInput() {const hasQuery = () => SearchState.query().trim().length > 0;- // External closes (result taps, back navigation) drop the keyboard too.- createEffect(() => {- if (!SearchState.isOpen() && document.activeElement === inputRef) {- inputRef?.blur();- }- });-// Opening an entity ends the session (and with it the view's search// filter). Pill navigation between views keeps it —// and a session started while an entity is already foregrounded stays too@@ -93,13 +91,13 @@ export function MobileSearchInput() {}));+ // The X is how search mode ends (besides opening a result): close() resets+ // the query and unmounts the search row with its input (dropping the+ // keyboard). The All view only exists for searching, so exiting from it+ // returns to the default view.const handleClear = () => {- if (hasQuery()) {- SearchState.setQuery('');- inputRef?.focus();- } else {- SearchState.close();- }+ SearchState.close();+ if (foregroundView() === 'search') navigate('inbox');};return (@@ -111,9 +109,6 @@ export function MobileSearchInput() {><inputid="mobile-search-input"- ref={(el) => {- inputRef = el;- }}type="text"enterkeyhint="search"class="h-full min-w-0 flex-1 border-0 bg-transparent text-ink outline-none ring-0 placeholder:text-ink-placeholder focus:outline-none focus:ring-0"@@ -121,12 +116,12 @@ export function MobileSearchInput() {value={SearchState.query()}onFocus={() => {if (!SearchState.isOpen()) SearchState.open();+ // With nothing typed a search starts from the everything ("All")+ // view; an existing term keeps its current scope.+ if (!hasQuery() && foregroundView() !== 'search') navigate('search');}}- onBlur={() => {- // Dismissing the keyboard with nothing typed ends the session; with- // a query it stays so the scoped results remain browsable.- if (SearchState.isOpen() && !hasQuery()) SearchState.close();- }}+ // Blurring never ends the session — the keyboard drops but search+ // mode stays until the X is pressed (or a result opens).onInput={(e) => SearchState.setQuery(e.currentTarget.value)}onKeyDown={(e) => {// Enter (the keyboard's Search key) drops the keyboard; the view is@@ -136,20 +131,20 @@ export function MobileSearchInput() {e.currentTarget.blur();}}/>- <Show when={SearchState.isOpen() || hasQuery()}>- <button- type="button"- class="flex size-9 shrink-0 items-center justify-center rounded-full text-ink-muted"- aria-label={hasQuery() ? 'Clear search' : 'Close search'}- onPointerDown={(e) => {- e.preventDefault();- hapticImpact('light');- }}- onClick={handleClear}- >- <XIcon class="size-4" />- </button>- </Show>+ {/* The input only mounts while a session is open, so the X is always+ available as the exit. */}+ <button+ type="button"+ class="flex size-9 shrink-0 items-center justify-center rounded-full text-ink-muted"+ aria-label="Close search"+ onPointerDown={(e) => {+ e.preventDefault();+ hapticImpact('light');+ }}+ onClick={handleClear}+ >+ <XIcon class="size-4" />+ </button></div>);}diff --git a/apps/web/src/features/command/mobile/mobileSearchState.ts b/apps/web/src/features/command/mobile/mobileSearchState.tsindex 2a0afefd18..89b20db481 100644--- a/apps/web/src/features/command/mobile/mobileSearchState.ts+++ b/apps/web/src/features/command/mobile/mobileSearchState.ts@@ -3,8 +3,9 @@ import { type Accessor, batch, createSignal } from 'solid-js';interface IMobileSearchState {/**- * Whether a search session is active: the dock input is focused, or the- * user is browsing scoped results with the keyboard dismissed.+ * Whether a search session is active — from the dock's search button until+ * the input's X is pressed (or a result opens). Blurring the input only+ * drops the keyboard; it never ends the session.*/isOpen: Accessor<boolean>;open: () => void;diff --git a/apps/web/src/features/command/sidebar/sidebar-create-menu.tsx b/apps/web/src/features/command/sidebar/sidebar-create-menu.tsxindex 1ed36de256..5eb2eae522 100644--- a/apps/web/src/features/command/sidebar/sidebar-create-menu.tsx+++ b/apps/web/src/features/command/sidebar/sidebar-create-menu.tsx@@ -1,19 +1,14 @@import { CREATE_MENU_COMMAND_SCOPE } from '@app/constants/hotkeys';-import { CREATABLE_BLOCKS } from '@app/features/command/Launcher';+import { useCreateMenuBlocks } from '@app/features/command/Launcher';import { useAnalytics } from '@app/lib/analytics/analytics-context';-import { useFeatureFlag } from '@app/lib/analytics/posthog';import { useHotkeyInterceptor } from '@app/signal/hotkeyRoot';-import {- ENABLE_SNIPPETS_FLAG,- ENABLE_SNIPPETS_OVERRIDE,-} from '@core/constant/featureFlags';import { setActiveScope } from '@core/hotkey/state';import { TOKENS } from '@core/hotkey/tokens';import { activateClosestDOMScope } from '@core/hotkey/utils';import CreateIcon from '@icon/square-pen-create.svg';import PlusIcon from '@phosphor/plus.svg';import { Button, Dropdown, Hotkey, NavRow } from '@ui';-import { createMemo, createSignal, For, onCleanup, Show } from 'solid-js';+import { createSignal, For, onCleanup, Show } from 'solid-js';import { Dynamic } from 'solid-js/web';export const SidebarCreateMenu = (props: {@@ -24,15 +19,7 @@ export const SidebarCreateMenu = (props: {const analytics = useAnalytics();const [open, setOpen] = createSignal(false);const [focusedIndex, setFocusedIndex] = createSignal(-1);- const snippetsFlag = useFeatureFlag(ENABLE_SNIPPETS_FLAG, {- enabledOverride: ENABLE_SNIPPETS_OVERRIDE,- });-- const blocks = createMemo(() =>- CREATABLE_BLOCKS.filter(- (block) => block.blockName !== 'snippet' || snippetsFlag().enabled- )- );+ const blocks = useCreateMenuBlocks();const handleOpenChange = (nextOpen: boolean) => {if (nextOpen && !open()) {diff --git a/apps/web/src/features/entity/composed/ListEntity.tsx b/apps/web/src/features/entity/composed/ListEntity.tsxindex 6eef33b6c9..288ca579a3 100644--- a/apps/web/src/features/entity/composed/ListEntity.tsx+++ b/apps/web/src/features/entity/composed/ListEntity.tsx@@ -48,6 +48,7 @@ import { useIsShared } from '../utils/shared';import { NarrowCondensedLayout } from './list-entity/narrow-condensed-layout';import { NarrowInboxLayout } from './list-entity/narrow-inbox-layout';import { NarrowLayout } from './list-entity/narrow-layout';+import { NarrowSingleLineLayout } from './list-entity/narrow-single-line-layout';import {type BaseListEntityProps,hasSearchContentHits,@@ -160,6 +161,8 @@ export function ListEntity(props: ListEntityProps) {const isWide = listLayout?.isWide ?? (() => true);const isCondensedVariant = () => listLayout?.narrowLayout() === 'condensed';const usesCondensedNarrowLayout = () => !isWide() && isCondensedVariant();+ const isSingleLineVariant = () =>+ listLayout?.narrowLayout() === 'single-line';const mobileStacks = createMemo(() => {if (!isTouchDevice()) return [];@@ -208,6 +211,16 @@ export function ListEntity(props: ListEntityProps) {<WideLayout {...layoutProps()} /></MaybeEntityRow></Match>+ {/* Mixed-type lists (Search) render every entity as one line, ahead+ of the taller per-type mobile layouts below. */}+ <Match when={isSingleLineVariant()}>+ <MaybeEntityRow+ entityId={props.entity.id}+ config={props.entityRowConfig}+ >+ <NarrowSingleLineLayout {...layoutProps()} />+ </MaybeEntityRow>+ </Match><Match when={isTouchDevice() && mobileStacks().length > 0}><Entity.Notification.MobileStackRowsstacks={mobileStacks()}diff --git a/apps/web/src/features/entity/composed/list-entity/channel.tsx b/apps/web/src/features/entity/composed/list-entity/channel.tsxindex b3da112f9d..73cb085cda 100644--- a/apps/web/src/features/entity/composed/list-entity/channel.tsx+++ b/apps/web/src/features/entity/composed/list-entity/channel.tsx@@ -69,6 +69,39 @@ function ChannelMessage(props: {);}+/**+ * One-line channel-message row content: channel name, sender, then the+ * message text (or its highlighted hit). Shared by the narrow and+ * single-line row layouts.+ */+export function ChannelMessageSingleLine(props: {+ entity: ChannelMessageEntity;+}) {+ const hit = () => firstContentHit(props.entity);+ return (+ <span class="flex items-center gap-1 min-w-0 truncate">+ <span class="shrink-0 text-ink-muted text-xs whitespace-nowrap">+ {props.entity.channelName}+ </span>+ <Show when={props.entity.senderId}>+ {(id) => <UserIcon id={id()} size="sm" />}+ </Show>+ <Show when={hit()}>+ {(h) => (+ <span class="shrink-0 text-ink-extra-muted text-xs whitespace-nowrap">+ <SearchSender hit={h()} />+ </span>+ )}+ </Show>+ <span class="text-ink/50 font-normal truncate min-w-0">+ <Show when={hit()} fallback={props.entity.content}>+ {(h) => <SearchContent hit={h()} singleLine />}+ </Show>+ </span>+ </span>+ );+}+export function ChannelMessageNarrowBody(props: {entity: ChannelMessageEntity;}) {diff --git a/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsx b/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsxindex 3232963f34..b12c3bcaf0 100644--- a/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsx+++ b/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsx@@ -1,8 +1,5 @@-import { UserIcon } from '@core/component/UserIcon';import { Show } from 'solid-js';import { Entity } from '../../entity';-import { SearchContent } from '../../extractors-search/search-content';-import { SearchSender } from '../../extractors-search/search-sender';import {isChannelEntity,isChannelMessageEntity,@@ -10,7 +7,7 @@ import {isTaskEntity,} from '../../types/entity';import { isSearchEntity } from '../../types/search';-import { ChannelJoinButton } from './channel';+import { ChannelJoinButton, ChannelMessageSingleLine } from './channel';import { EmailInboxChip } from './email';import { type LayoutProps, RowIndicator } from './shared';@@ -44,36 +41,7 @@ export function NarrowLayout(props: LayoutProps) {when={isChannelMessageEntity(props.entity) && props.entity}fallback={<Entity.Title entity={props.entity} />}>- {(entity) => {- const hit = () => {- const e = entity();- return isSearchEntity(e)- ? e.search.contentHitData?.[0]- : undefined;- };- return (- <span class="flex items-center gap-1 min-w-0 truncate">- <span class="shrink-0 text-ink-muted text-xs whitespace-nowrap">- {entity().channelName}- </span>- <Show when={entity().senderId}>- {(id) => <UserIcon id={id()} size="sm" />}- </Show>- <Show when={hit()}>- {(h) => (- <span class="shrink-0 text-ink-extra-muted text-xs whitespace-nowrap">- <SearchSender hit={h()} />- </span>- )}- </Show>- <span class="text-ink/50 font-normal truncate min-w-0">- <Show when={hit()} fallback={entity().content}>- {(h) => <SearchContent hit={h()} singleLine />}- </Show>- </span>- </span>- );- }}+ {(entity) => <ChannelMessageSingleLine entity={entity()} />}</Show><Show when={isEmailEntity(props.entity) && props.entity}>{(entity) => <EmailInboxChip entity={entity()} class="ml-auto" />}diff --git a/apps/web/src/features/entity/composed/list-entity/narrow-single-line-layout.tsx b/apps/web/src/features/entity/composed/list-entity/narrow-single-line-layout.tsxnew file mode 100644index 0000000000..a91b8fac78--- /dev/null+++ b/apps/web/src/features/entity/composed/list-entity/narrow-single-line-layout.tsx@@ -0,0 +1,112 @@+import { Match, Show, Switch } from 'solid-js';+import { Entity } from '../../entity';+import {+ isChannelEntity,+ isChannelMessageEntity,+ isEmailEntity,+ isTaskEntity,+} from '../../types/entity';+import { isSearchEntity } from '../../types/search';+import { ChannelJoinButton, ChannelMessageSingleLine } from './channel';+import { EmailIdentity, EmailInboxChip } from './email';+import { type LayoutProps, RowIndicator } from './shared';++/**+ * One-line row for mixed-type lists (the Search / "All" view): every entity+ * renders as a single 44px line at the documents list's density — leading+ * entity icon, then a type-specific summary, then the timestamp.+ *+ * - Email: participants (bold) then the subject, with the inbox chip.+ * - Channel message: channel name, sender, then the message text.+ * - Task: title, with its properties in the trailing slot.+ * - Everything else (documents, channels, chats, calls, folders, …): title.+ */+export function NarrowSingleLineLayout(props: LayoutProps) {+ return (+ <Entity.Layout+ class="w-full gap-x-1 items-center text-sm pr-2 pl-1 grid"+ style={{+ 'grid-template-columns': 'auto 1fr max-content',+ 'grid-template-rows': '44px',+ 'grid-template-areas': '"indicator title timestamp"',+ }}+ >+ <Entity.Slot placement="indicator" class="relative">+ <RowIndicator+ checked={props.checked}+ hideCheckbox={props.hideCheckbox}+ onChecked={props.onChecked}+ unread={props.unread}+ />+ </Entity.Slot>++ <Entity.Slot+ placement="title"+ class="ph-no-capture flex min-w-0 items-center gap-2 truncate"+ >+ <div class="size-4 shrink-0">+ <Entity.Icon entity={props.entity} streamState={props.streamState} />+ </div>+ <Switch>+ <Match when={isEmailEntity(props.entity) && props.entity}>+ {(entity) => (+ <>+ <span class="flex max-w-1/2 min-w-0 shrink-0 items-center gap-2 font-semibold">+ <EmailIdentity entity={entity()} />+ </span>+ <span class="min-w-0 truncate font-normal text-ink/70">+ <Entity.Title entity={entity()} />+ </span>+ <EmailInboxChip entity={entity()} class="ml-auto" />+ </>+ )}+ </Match>+ <Match when={isChannelMessageEntity(props.entity) && props.entity}>+ {(entity) => <ChannelMessageSingleLine entity={entity()} />}+ </Match>+ <Match when={true}>+ <span class="min-w-0 truncate font-semibold">+ <Entity.Title entity={props.entity} />+ </span>+ <Show+ when={+ isChannelEntity(props.entity) &&+ props.entity.isParticipant === false &&+ props.entity+ }+ >+ {(entity) => (+ <ChannelJoinButton entity={entity()} class="ml-auto shrink-0" />+ )}+ </Show>+ </Match>+ </Switch>+ </Entity.Slot>++ <Show+ when={+ !props.hasNotifications &&+ !(isChannelEntity(props.entity) && isSearchEntity(props.entity))+ }+ >+ <Entity.Slot+ placement="timestamp"+ class="text-xs text-right text-ink-extra-muted font-light"+ >+ <Show+ when={!isTaskEntity(props.entity)}+ fallback={+ <Entity.Properties+ entity={props.entity}+ maxUserStackUsers={0}+ showCaret={false}+ />+ }+ >+ <Entity.Timestamp entity={props.entity} />+ </Show>+ </Entity.Slot>+ </Show>+ </Entity.Layout>+ );+}diff --git a/apps/web/src/features/entity/composed/list-entity/shared.tsx b/apps/web/src/features/entity/composed/list-entity/shared.tsxindex 908d89c74c..d585587707 100644--- a/apps/web/src/features/entity/composed/list-entity/shared.tsx+++ b/apps/web/src/features/entity/composed/list-entity/shared.tsx@@ -67,7 +67,7 @@ export interface LayoutProps {) => void;}-export type NarrowLayoutVariant = 'standard' | 'condensed';+export type NarrowLayoutVariant = 'standard' | 'condensed' | 'single-line';interface ListLayoutContextValue {isWide: Accessor<boolean>;diff --git a/apps/web/src/features/next-soup/soup-view/filters-bar/search/mobile-search-filter-drawer.tsx b/apps/web/src/features/next-soup/soup-view/filters-bar/search/mobile-search-filter-drawer.tsxnew file mode 100644index 0000000000..ee1201dd01--- /dev/null+++ b/apps/web/src/features/next-soup/soup-view/filters-bar/search/mobile-search-filter-drawer.tsx@@ -0,0 +1,322 @@+import {+ MobileDrawer,+ scrollToFocusedInput,+} from '@components/app/mobile/MobileDrawer';+import { pressPulse } from '@components/app/mobile/pressPulse';+import { ScrollIndicators } from '@core/component/VerticalScrollIndicators';+import { Accordion } from '@kobalte/core/accordion';+import ChevronDownIcon from '@phosphor/caret-down.svg';+import CheckIcon from '@phosphor/check.svg';+import SearchIcon from '@phosphor/magnifying-glass.svg';+import XIcon from '@phosphor/x.svg';+import SlidersHorizontalIcon from '@phosphor-icons/core/regular/sliders-horizontal.svg?component-solid';+import { Button, cn } from '@ui';+import { createMemo, createSignal, For, Match, Show, Switch } from 'solid-js';+import { type SearchFacetVM, useSearchFacets } from './search-facets';+import { createSearchFiltersController } from './search-filters-state';++/** Threshold above which a multi facet's option list gets its own search. */+const SEARCHABLE_OPTION_COUNT = 8;++type MultiFacet = Extract<SearchFacetVM, { kind: 'multi' }>;+type SingleFacet = Extract<SearchFacetVM, { kind: 'single' }>;++function SingleFacetContent(props: { facet: SingleFacet }) {+ return (+ <For each={props.facet.options}>+ {(option) => {+ const active = () => props.facet.selectedId() === option.id;+ return (+ <button+ type="button"+ role="radio"+ aria-checked={active()}+ class="w-full bg-surface flex items-center gap-3 px-3 py-2.5 text-sm hover:bg-hover transition-colors text-left not-last:mb-px"+ onClick={() => props.facet.onSelect(option.id)}+ >+ <Show when={option.icon}>+ {(icon) => (+ <span class="size-4 flex items-center justify-center shrink-0 text-ink-muted">+ {icon()()}+ </span>+ )}+ </Show>+ <span class="flex-1 truncate">{option.label}</span>+ <Show when={active()}>+ <CheckIcon class="size-3.5 text-accent shrink-0" />+ </Show>+ </button>+ );+ }}+ </For>+ );+}++function MultiFacetContent(props: { facet: MultiFacet }) {+ const [query, setQuery] = createSignal('');++ const filteredOptions = createMemo(() => {+ const q = query().toLowerCase();+ const options = props.facet.options();+ if (!q) return options;+ return options.filter((option) => option.label.toLowerCase().includes(q));+ });++ const toggle = (id: string) => {+ const current = props.facet.activeIds();+ props.facet.onChange(+ current.includes(id)+ ? current.filter((activeId) => activeId !== id)+ : [...current, id]+ );+ };++ return (+ <>+ {/* Any-of/all-of segment (e.g. tags), mirroring the desktop chip. */}+ <Show when={props.facet.mode?.visible()}>+ <div class="flex bg-surface mb-px" role="radiogroup" aria-label="Match">+ <For+ each={[+ { id: 'any', label: 'Match any' } as const,+ { id: 'all', label: 'Match all' } as const,+ ]}+ >+ {(option) => {+ const active = () => props.facet.mode?.value() === option.id;+ return (+ <button+ type="button"+ role="radio"+ aria-checked={active()}+ class={cn(+ 'flex-1 px-3 py-2 text-sm transition-colors hover:bg-hover',+ active() ? 'text-accent font-medium' : 'text-ink-muted'+ )}+ onClick={() => props.facet.mode?.onSelect(option.id)}+ >+ {option.label}+ </button>+ );+ }}+ </For>+ </div>+ </Show>++ <Show when={props.facet.options().length > SEARCHABLE_OPTION_COUNT}>+ <div class="flex items-center gap-2 px-3 py-2 muted bg-surface mb-px">+ <SearchIcon class="size-3.5 text-ink-muted shrink-0" />+ <input+ type="text"+ aria-label={props.facet.placeholder}+ value={query()}+ onInput={(e) => setQuery(e.currentTarget.value)}+ placeholder={props.facet.placeholder}+ class="flex-1 bg-transparent text-sm outline-none placeholder:text-ink-placeholder"+ />+ </div>+ </Show>++ <div class="max-h-[calc(50*var(--dvh))] overflow-y-auto scrollbar-hidden">+ <For each={filteredOptions()}>+ {(option) => {+ const active = () => props.facet.activeIds().includes(option.id);+ const isSole = () => {+ const ids = props.facet.activeIds();+ return ids.length === 1 && ids[0] === option.id;+ };+ return (+ <div class="w-full flex items-stretch bg-surface not-last:mb-px">+ <button+ type="button"+ role="checkbox"+ aria-checked={active()}+ class="flex-1 min-w-0 flex items-center gap-3 px-3 py-2.5 text-sm hover:bg-hover transition-colors text-left"+ onClick={() => toggle(option.id)}+ >+ <span+ class={cn(+ 'size-4 flex items-center justify-center shrink-0 rounded border transition-colors',+ active() ? 'bg-accent border-accent' : 'border-edge'+ )}+ >+ <Show when={active()}>+ <CheckIcon class="size-2.5 text-surface" />+ </Show>+ </span>+ <Show when={option.icon}>+ {(icon) => (+ <span class="size-4 flex items-center justify-center shrink-0">+ {icon()()}+ </span>+ )}+ </Show>+ <span+ class={cn(+ 'flex-1 truncate',+ active() ? 'text-ink' : 'text-ink-muted'+ )}+ >+ {option.label}+ </span>+ </button>+ <Show+ when={props.facet.onOnly && props.facet.options().length > 1}+ >+ <button+ type="button"+ class="shrink-0 px-3 text-xs text-ink-muted hover:text-ink hover:bg-hover transition-colors"+ aria-label={+ isSole()+ ? `Show all ${props.facet.label.toLowerCase()}`+ : `Show only ${option.label}`+ }+ onClick={() => props.facet.onOnly?.(option.id)}+ >+ {isSole() ? 'All' : 'Only'}+ </button>+ </Show>+ </div>+ );+ }}+ </For>+ <Show when={filteredOptions().length === 0}>+ <div class="px-4 py-2 text-sm text-ink-muted">No results</div>+ </Show>+ </div>+ </>+ );+}++function FacetSection(props: { facet: SearchFacetVM }) {+ return (+ <MobileDrawer.Section+ as={Accordion.Item}+ value={props.facet.id}+ class="mb-3"+ >+ <Accordion.Header>+ <Accordion.Trigger class="w-full flex bg-surface items-center justify-between p-3 text-sm text-ink hover:bg-hover transition-colors outline-none group mb-px">+ <span class="font-medium">{props.facet.label}</span>+ <div class="flex items-center gap-2">+ <Show when={!props.facet.isDefault()}>+ <Switch>+ <Match when={props.facet.kind === 'multi' && props.facet}>+ {(facet) => (+ <span class="group-data-expanded:hidden size-4 flex items-center justify-center rounded-full bg-accent text-surface text-xxs font-medium leading-none">+ {facet().activeIds().length}+ </span>+ )}+ </Match>+ <Match when={props.facet.kind === 'single'}>+ <span class="group-data-expanded:hidden text-xs text-accent truncate max-w-32">+ {props.facet.values()[0]?.label}+ </span>+ </Match>+ </Switch>+ </Show>+ <ChevronDownIcon class="size-3.5 text-ink-muted transition-transform duration-200 group-data-expanded:rotate-180" />+ </div>+ </Accordion.Trigger>+ </Accordion.Header>+ <Accordion.Content>+ <Switch>+ <Match when={props.facet.kind === 'single' && props.facet}>+ {(facet) => <SingleFacetContent facet={facet()} />}+ </Match>+ <Match when={props.facet.kind === 'multi' && props.facet}>+ {(facet) => <MultiFacetContent facet={facet()} />}+ </Match>+ </Switch>+ </Accordion.Content>+ </MobileDrawer.Section>+ );+}++/**+ * Mobile counterpart of the desktop Search view's facet chips+ * (SearchFiltersRow): the same facets — the Type scope plus the active+ * type's refinements (inbox, in/from, status, priority, assignee, tags…) —+ * presented as a bottom drawer opened from the search view's header filter+ * button. Facet semantics live in search-facets / search-filters-state; this+ * file is presentation only.+ */+export const MobileSearchFilterDrawer = (props: { class?: string }) => {+ const controller = createSearchFiltersController();+ const facets = useSearchFacets(controller);++ const activeCount = createMemo(+ () => facets().filter((facet) => !facet.isDefault()).length+ );+ const resetAll = () => {+ for (const facet of facets()) facet.reset();+ };++ const [scrollRef, setScrollRef] = createSignal<HTMLElement>();++ return (+ <MobileDrawer+ side="bottom"+ preventScroll={false}+ preventScrollbarShift={false}+ breakPoints={[0.85]}+ >+ <MobileDrawer.Trigger+ as={Button}+ aria-label="Open search filters"+ variant="ghost"+ size="sm"+ depth={3}+ class={cn(+ 'island bg-chrome pointer-events-auto relative size-10 shrink-0 rounded-full [&_svg]:size-5',+ props.class+ )}+ ref={pressPulse}+ >+ <SlidersHorizontalIcon />+ <Show when={activeCount() > 0}>+ <span class="absolute -top-0.5 right-0 translate-x-1/2 size-4 flex items-center justify-center rounded-full bg-accent text-surface text-xxs font-medium leading-none">+ {activeCount()}+ </span>+ </Show>+ </MobileDrawer.Trigger>++ <MobileDrawer.Portal>+ <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Content aria-label="Search filters" class="h-[80vh]">+ <MobileDrawer.Handle class="pb-1" />++ <div class="relative flex-1 min-h-0">+ <ScrollIndicators scrollRef={scrollRef} noBorderStart noBorderEnd />+ <div+ ref={setScrollRef}+ onFocusIn={(e) => scrollToFocusedInput(e)}+ class="overflow-y-auto scrollbar-hidden h-full pb-1"+ >+ <MobileDrawer.Label>Filters</MobileDrawer.Label>+ <Accordion multiple collapsible defaultValue={['type']}>+ <For each={facets()}>+ {(facet) => <FacetSection facet={facet} />}+ </For>+ </Accordion>+ </div>+ </div>++ <Show when={activeCount() > 0}>+ <div class="shrink-0 border-t border-edge-muted p-2">+ <Button+ onClick={resetAll}+ variant="base"+ size="sm"+ class="min-h-10 rounded-lg bg-active!"+ >+ <XIcon class="size-3!" />+ Clear all+ </Button>+ </div>+ </Show>+ </MobileDrawer.Content>+ </MobileDrawer.Portal>+ </MobileDrawer>+ );+};diff --git a/apps/web/src/features/next-soup/soup-view/soup-view-tabs.tsx b/apps/web/src/features/next-soup/soup-view/soup-view-tabs.tsxindex bf680c1779..54fa64f0a1 100644--- a/apps/web/src/features/next-soup/soup-view/soup-view-tabs.tsx+++ b/apps/web/src/features/next-soup/soup-view/soup-view-tabs.tsx@@ -13,6 +13,7 @@ import {} from '@app/features/next-soup/sidebar/soup-filter-presets';import { useSoup } from '@app/features/next-soup/soup-context';import { MobileFilterDrawer } from '@app/features/next-soup/soup-view/filters-bar/mobile-filter-drawer';+import { MobileSearchFilterDrawer } from '@app/features/next-soup/soup-view/filters-bar/search/mobile-search-filter-drawer';import {type SoupViewMode,useSoupView,@@ -290,15 +291,21 @@ export const CollapsedSoupViewTabs = () => {/*** Filter-drawer button + per-view filter pills, rendered in the mobile split* header. The strip is full-bleed: negative margins cancel the header row's- * gutter so pills scroll to the device edges, the gutter travels inside the- * scroll content, and the drawer button stays pinned at the strip's start- * while pills pass beneath it.+ * gutter so pills scroll to the device edges, and the gutter travels inside+ * the scroll content. The drawer button leads the strip and scrolls along+ * with the pills.*/export const MobileSoupViewTabs = () => {const listView = useCurrentListView();return (<Switch>+ <Match when={listView() === 'search'}>+ {/* The search view has no tab pills — its header hosts only the+ facet-filter drawer button (the desktop SearchFiltersRow's+ mobile counterpart). */}+ <MobileSearchFilterDrawer />+ </Match><Match when={listView() === 'companies'}><MobileCompanyModeTabs /></Match>@@ -325,7 +332,6 @@ export const MobileSoupViewTabs = () => {const MOBILE_TAB_STRIP_CLASS ='-ml-(--mobile-chrome-gutter) w-[100cqw] max-w-none flex-none';const MOBILE_TAB_CONTENT_CLASS = 'px-(--mobile-chrome-gutter)';-const MOBILE_TAB_DRAWER_CLASS = 'sticky left-(--mobile-chrome-gutter) z-10';const MobileCompanyModeTabs = () => {const { viewMode, setViewMode } = useSoupView();@@ -335,7 +341,7 @@ const MobileCompanyModeTabs = () => {scrollableclass={MOBILE_TAB_STRIP_CLASS}contentClass={MOBILE_TAB_CONTENT_CLASS}- leading={<MobileFilterDrawer class={MOBILE_TAB_DRAWER_CLASS} />}+ leading={<MobileFilterDrawer />}items={COMPANY_MODE_TABS}value={viewMode()}onChange={(value) => setViewMode(value as SoupViewMode)}@@ -353,7 +359,7 @@ const MobileViewTabs = (props: { view: TabbedListView }) => {scrollableclass={MOBILE_TAB_STRIP_CLASS}contentClass={MOBILE_TAB_CONTENT_CLASS}- leading={<MobileFilterDrawer class={MOBILE_TAB_DRAWER_CLASS} />}+ leading={<MobileFilterDrawer />}items={VIEW_TAB_LISTS[props.view]}value={activeValue()}onChange={(value) => applyTabPreset(props.view, value)}diff --git a/apps/web/src/features/next-soup/soup-view/soup-view.tsx b/apps/web/src/features/next-soup/soup-view/soup-view.tsxindex 474a5d54a3..da0e7a23b2 100644--- a/apps/web/src/features/next-soup/soup-view/soup-view.tsx+++ b/apps/web/src/features/next-soup/soup-view/soup-view.tsx@@ -208,6 +208,11 @@ const DEFAULT_PREVIEW_VIEWS = new Set(['inbox', 'channels']);const CONDENSED_NARROW_LIST_VIEWS: ReadonlySet<ListView> = new Set(['channels',]);+// Mixed-type lists render every entity as one specially designed line (see+// NarrowSingleLineLayout) instead of the taller per-type narrow layouts.+const SINGLE_LINE_NARROW_LIST_VIEWS: ReadonlySet<ListView> = new Set([+ 'search',+]);type SoupListEntryState = {focus: string | undefined;virtualCache?: CacheSnapshot;@@ -761,9 +766,9 @@ const SoupViewListContent = (props: SoupViewListProps) => {const narrowLayout = createMemo<NarrowLayoutVariant>(() => {const view = currentView();- return view && CONDENSED_NARROW_LIST_VIEWS.has(view)- ? 'condensed'- : 'standard';+ if (!view) return 'standard';+ if (SINGLE_LINE_NARROW_LIST_VIEWS.has(view)) return 'single-line';+ return CONDENSED_NARROW_LIST_VIEWS.has(view) ? 'condensed' : 'standard';});const focusFirstEntity = () => {