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: wide-ranging UI changes, part II (#6397)
Peter Chinman2b13351f9634
diff --git a/apps/web/src/components/app/Layout.tsx b/apps/web/src/components/app/Layout.tsxindex 492a47581f..ecc889e668 100644--- a/apps/web/src/components/app/Layout.tsx+++ b/apps/web/src/components/app/Layout.tsx@@ -26,6 +26,8 @@ import { MacroMcpSetupModal } from '@app/features/integrations/mcp-setup/MacroMcimport { Paywall } from '@app/features/paywall/Paywall';import { PropertyEditorModal } from '@app/features/property/editor/PropertyEditorModal';import { ReminderComposerModal } from '@app/features/reminders/ReminderComposerModal';+import { MobileSettingsProvider } from '@app/features/settings/context/mobile-settings';+import { MobileSettings } from '@app/features/settings/MobileSettings';import { useOnboardingV4Flag } from '@app/features/setup/flow/useOnboardingV4Flag';import { GlobalShareModal } from '@app/features/sharing/global-share-modal/GlobalShareModal';import { IosShareSheet } from '@app/features/sharing/ios-share-sheet/IosShareSheet';@@ -82,6 +84,7 @@ import GlobalShortcuts from './GlobalHotkeys';import { ItemDndProvider } from './ItemDragAndDrop';import { FloatRegion } from './mobile/float-regions/FloatRegion';import { FloatRegionHost } from './mobile/float-regions/FloatRegionHost';+import { installGlassPress } from './mobile/glassPress';import { MobileDockRow } from './mobile/MobileDockRow';import { MobileViewsRow } from './mobile/MobileViewsRow';import { SwipeDownDismissKeyboard } from './mobile/SwipeDownDismissKeyboard';@@ -127,7 +130,9 @@ export function Layout(props: RouteSectionProps) {expand: () => setSidebarState('expanded'),}}>- <LayoutInner {...props} />+ <MobileSettingsProvider>+ <LayoutInner {...props} />+ </MobileSettingsProvider></SidebarCollapseContext.Provider></SidebarVisibilityContext.Provider>);@@ -413,6 +418,7 @@ function LayoutInner(props: RouteSectionProps) {});onMount(() => {+ onCleanup(installGlassPress());if (sessionStorage.getItem('showUpgradeModal') === 'true') {showPaywall();sessionStorage.removeItem('showUpgradeModal');@@ -554,6 +560,9 @@ function LayoutInner(props: RouteSectionProps) {}><FloatRegionHost />+ <Show when={isMobile()}>+ <MobileSettings />+ </Show><MobileViewsRow /><FloatRegionregion="dock"diff --git a/apps/web/src/components/app/app-sidebar/sidebar-search-menu.tsx b/apps/web/src/components/app/app-sidebar/sidebar-search-menu.tsxnew file mode 100644index 0000000000..5cde99e32c--- /dev/null+++ b/apps/web/src/components/app/app-sidebar/sidebar-search-menu.tsx@@ -0,0 +1,71 @@+import { CommandState } from '@app/features/command';+import { ContextMenuContent, MenuItem } from '@core/component/ContextMenu';+import { TOKENS } from '@core/hotkey/tokens';+import { DropdownMenu } from '@kobalte/core/dropdown-menu';+import MagnifyingGlassIcon from '@phosphor/magnifying-glass.svg';+import { Dropdown } from '@ui';+import type { ComponentProps } from 'solid-js';++/** Shared discovery menu for the expanded sidebar and compact rail. */+export function SidebarSearchMenu(props: {+ onSearch: (newSplit: boolean) => void;+ triggerProps?: ComponentProps<typeof Dropdown.Trigger>;+}) {+ let selectedAction: (() => void) | undefined;+ let newSplit = false;+ // MenuItem's onSelect callback omits the event. Capture its modifier first.+ const captureSplitIntent = (event: PointerEvent | KeyboardEvent) => {+ newSplit = event.shiftKey;+ };+ return (+ <Dropdown+ placement="right-start"+ onOpenChange={(open) => {+ if (open) {+ selectedAction = undefined;+ newSplit = false;+ }+ }}+ >+ <Dropdown.Trigger {...props.triggerProps} label="Search">+ <MagnifyingGlassIcon class="size-5" />+ </Dropdown.Trigger>+ <DropdownMenu.Portal>+ <ContextMenuContent+ contentComponent={(contentProps) => (+ <DropdownMenu.Content+ {...contentProps}+ oncapture:pointerup={captureSplitIntent}+ oncapture:keydown={captureSplitIntent}+ />+ )}+ class="z-tool-tip! min-w-56 text-xs text-ink-muted"+ // Open the destination after dismissal so the menu cannot steal its focus.+ onCloseAutoFocus={(event) => {+ if (!selectedAction) return;+ event.preventDefault();+ // Let Kobalte restore trigger focus before focusing the destination.+ queueMicrotask(selectedAction);+ selectedAction = undefined;+ }}+ >+ <MenuItem+ text="Command Menu"+ shortcut="cmd+k"+ onClick={() => {+ selectedAction = () => CommandState.open();+ }}+ />+ <MenuItem+ text="Search everything"+ hotkeyToken={TOKENS.sidebar.goTo.search}+ onClick={() => {+ const openInNewSplit = newSplit;+ selectedAction = () => props.onSearch(openInNewSplit);+ }}+ />+ </ContextMenuContent>+ </DropdownMenu.Portal>+ </Dropdown>+ );+}diff --git a/apps/web/src/components/app/app-sidebar/sidebar.tsx b/apps/web/src/components/app/app-sidebar/sidebar.tsxindex ed596486c7..88b68176b3 100644--- a/apps/web/src/components/app/app-sidebar/sidebar.tsx+++ b/apps/web/src/components/app/app-sidebar/sidebar.tsx@@ -91,7 +91,6 @@ import CaretUpIcon from '@phosphor/caret-up.svg';import CompassIcon from '@phosphor/compass.svg';import DotsThreeIcon from '@phosphor/dots-three.svg';import GearIcon from '@phosphor/gear.svg';-import MagnifyingGlassIcon from '@phosphor/magnifying-glass.svg';import SignOutIcon from '@phosphor/sign-out.svg';import UsersThreeIcon from '@phosphor/users-three.svg';import XIcon from '@phosphor/x.svg';@@ -124,6 +123,7 @@ import {} from 'solid-js';import { Dynamic } from 'solid-js/web';import { CalendarSidebarPreview } from './calendar-sidebar-preview';+import { SidebarSearchMenu } from './sidebar-search-menu';// TODO(sidebar-next): move to app-sidebar/navigation.tsx once SidebarRail ships.export interface SidebarItem {@@ -772,12 +772,13 @@ const SidebarHeaderSearchButton = (props: { link: SidebarItem }) => {const analytics = useAnalytics();const layout = useSplitLayout();- const openSearch = (event: MouseEvent) => {+ const openSearch = (newSplit: boolean) => {analytics.track('sidebar_click', { view: props.link.id });let currentContentHandle = globalSplitManager()?.activeSplit();const content = currentContentHandle?.content();if (+ !newSplit &¤tContentHandle &&content?.type === 'component' &&content.id === 'search'@@ -790,7 +791,7 @@ const SidebarHeaderSearchButton = (props: { link: SidebarItem }) => {currentContentHandle = navigateToSidebarView({viewId: props.link.id,params: props.link.params,- shiftKey: event.shiftKey,+ shiftKey: newSplit,activeSplit: currentContentHandle,openWithSplit: layout.openWithSplit,referredFrom: 'sidebar',@@ -800,19 +801,14 @@ const SidebarHeaderSearchButton = (props: { link: SidebarItem }) => {};return (- <Button- size="icon-sm"- class="[&_svg]:size-4!"- label="Search"- hotkey={props.link.hotkeyToken}- onMouseDown={(e) => {- if (e.button !== 0) return;- e.preventDefault();+ <SidebarSearchMenu+ onSearch={openSearch}+ triggerProps={{+ size: 'icon-sm',+ class: '[&_svg]:size-4!',+ hotkey: props.link.hotkeyToken,}}- onClick={openSearch}- >- <MagnifyingGlassIcon />- </Button>+ />);};diff --git a/apps/web/src/components/app/mobile/ConfirmDrawer.tsx b/apps/web/src/components/app/mobile/ConfirmDrawer.tsxindex 0e92128966..161ad5f36b 100644--- a/apps/web/src/components/app/mobile/ConfirmDrawer.tsx+++ b/apps/web/src/components/app/mobile/ConfirmDrawer.tsx@@ -1,76 +1,87 @@-import { Button, type ConfirmDialogProps } from '@ui';-import { createSignal, Show } from 'solid-js';+import SpinnerIcon from '@phosphor/spinner.svg';+import CloseIcon from '@phosphor/x.svg';+import { Button } from '@ui/components/Button';+import type { ConfirmDialogProps } from '@ui/components/ConfirmDialog';+import { cn } from '@ui/utils/classname';+import { createUniqueId, Show } from 'solid-js';import { MobileDrawer } from './MobileDrawer';-const TONE_VARIANT = {- default: 'accent',- danger: 'danger',- success: 'success',-} as const;--/** Slide-out length; keep ≥ MobileDrawer's `duration-200` transition. */-const CLOSE_MS = 250;--/**- * The mobile presentation of `confirmDialog`: the same confirmation contract- * rendered as a bottom sheet. `position` and `class` are dialog-presentation- * options and are ignored here.- */+/** Controlled confirmation sheet; pending actions remain visible until resolved. */export function ConfirmDrawer(props: ConfirmDialogProps) {- // A managed dismissal disposes the entry immediately, which would cut the- // drawer's slide-out. Close internally first so the transition plays, then- // hand the dismissal to the manager.- const [internalOpen, setInternalOpen] = createSignal(true);- const requestClose = () => {- if (!internalOpen()) return;- setInternalOpen(false);- setTimeout(() => props.onOpenChange(false), CLOSE_MS);- };- const confirm = () => {- if (!internalOpen()) return;- setInternalOpen(false);- setTimeout(() => props.onConfirm(), CLOSE_MS);+ const titleId = createUniqueId();+ const descriptionId = createUniqueId();+ const close = () => {+ if (!props.pending) props.onOpenChange(false);};-return (<MobileDrawerside="bottom"- open={props.open && internalOpen()}- onOpenChange={(open) => {- if (!open) requestClose();- }}- closeOnOutsidePointerStrategy="pointerdown"+ open={props.open}+ onOpenChange={(open) => !open && close()}+ closeOnOutsidePointer={!props.pending}+ closeOnEscapeKeyDown={!props.pending}><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />- <MobileDrawer.Content aria-label="Confirmation">- <MobileDrawer.Handle />- <div class="flex flex-col gap-1 px-4 pb-4 pt-1">- <div class="text-base font-semibold text-ink">{props.title}</div>- <Show when={props.body ?? props.children}>- {(body) => <div class="text-sm text-ink-muted">{body()}</div>}- </Show>- </div>- <div class="flex flex-col gap-2 px-4 pb-4">+ <MobileDrawer.Overlay />+ <MobileDrawer.Content+ aria-labelledby={titleId}+ aria-describedby={descriptionId}+ class="overflow-hidden"+ >+ <MobileDrawer.Handle class="pb-1" />+ <div class="flex shrink-0 items-center justify-between gap-3 px-6 pb-4">+ <h2 id={titleId} class="text-lg font-semibold text-ink">+ {props.title}+ </h2><Button- type="button"- variant={TONE_VARIANT[props.tone ?? 'default']}- size="lg"- class="w-full rounded-lg"- onClick={confirm}- >- {props.confirmLabel ?? 'Confirm'}- </Button>- <MobileDrawer.Close- as={Button}- type="button"variant="ghost"- size="lg"- class="w-full rounded-lg"+ size="icon-lg"+ aria-label="Close confirmation"+ class="rounded-full bg-ink/6"+ disabled={props.pending}+ onClick={close}>- {props.cancelLabel ?? 'Cancel'}- </MobileDrawer.Close>+ <CloseIcon class="size-5" />+ </Button></div>+ <MobileDrawer.ScrollBody>+ <div+ id={descriptionId}+ class="px-6 pb-5 text-base leading-6 text-ink-muted"+ >+ {props.body ?? props.children}+ </div>+ <div class="flex gap-3 px-6 pb-2">+ <Button+ variant="ghost"+ size="xl"+ class="min-w-0 flex-1 rounded-full bg-ink/6"+ disabled={props.pending}+ onClick={close}+ >+ {props.cancelLabel ?? 'Cancel'}+ </Button>+ <Button+ variant="ghost"+ size="xl"+ class={cn(+ 'min-w-0 flex-1 rounded-full',+ props.tone === 'danger'+ ? 'bg-failure-bg text-failure'+ : props.tone === 'success'+ ? 'bg-success-bg text-success'+ : 'bg-accent-bg text-accent'+ )}+ disabled={props.pending}+ onClick={() => !props.pending && props.onConfirm()}+ >+ <Show when={props.pending}>+ <SpinnerIcon class="size-4 animate-spin" />+ </Show>+ {props.confirmLabel ?? 'Confirm'}+ </Button>+ </div>+ </MobileDrawer.ScrollBody></MobileDrawer.Content></MobileDrawer.Portal></MobileDrawer>diff --git a/apps/web/src/components/app/mobile/MobileCreateMenu.css b/apps/web/src/components/app/mobile/MobileCreateMenu.cssnew file mode 100644index 0000000000..569452e7a1--- /dev/null+++ b/apps/web/src/components/app/mobile/MobileCreateMenu.css@@ -0,0 +1,70 @@+.mobile-create-menu-overlay {+ backdrop-filter: blur(8px) saturate(1.05);+ animation: mobile-create-backdrop-in 220ms ease-out both;+}++.mobile-create-menu-overlay[data-closed] {+ animation: mobile-create-backdrop-out 180ms ease-in both;+}++.mobile-create-menu[data-expanded] .mobile-create-menu-item {+ transform-origin: right center;+ animation: mobile-create-item-in 360ms cubic-bezier(0.16, 1.12, 0.3, 1)+ var(--create-delay) both;+}++.mobile-create-menu[data-closed] {+ animation: mobile-create-backdrop-out 180ms ease-in both;+}++.mobile-create-menu[data-closed] .mobile-create-menu-item {+ animation: mobile-create-item-out 180ms ease-in both;+}++.mobile-create-menu-plus {+ rotate: 45deg;+ animation: mobile-create-plus-in 320ms cubic-bezier(0.22, 1.3, 0.36, 1) both;+}++.mobile-create-menu[data-closed] .mobile-create-menu-plus {+ animation: mobile-create-plus-out 180ms ease-in both;+}++@keyframes mobile-create-backdrop-in {+ from { opacity: 0; }+ to { opacity: 1; }+}++@keyframes mobile-create-backdrop-out {+ from { opacity: 1; }+ to { opacity: 0; }+}++@keyframes mobile-create-item-in {+ from { opacity: 0; transform: translateY(var(--create-rise)) scale(0.82); }+ to { opacity: 1; transform: translateY(0) scale(1); }+}++@keyframes mobile-create-item-out {+ from { opacity: 1; transform: translateY(0) scale(1); }+ to { opacity: 0; transform: translateY(12px) scale(0.96); }+}++@keyframes mobile-create-plus-in {+ from { rotate: 0deg; }+ to { rotate: 45deg; }+}++@keyframes mobile-create-plus-out {+ from { rotate: 45deg; }+ to { rotate: 0deg; }+}++@media (prefers-reduced-motion: reduce) {+ .mobile-create-menu,+ .mobile-create-menu-overlay,+ .mobile-create-menu .mobile-create-menu-item,+ .mobile-create-menu .mobile-create-menu-plus {+ animation: none !important;+ }+}diff --git a/apps/web/src/components/app/mobile/MobileCreateMenu.tsx b/apps/web/src/components/app/mobile/MobileCreateMenu.tsxnew file mode 100644index 0000000000..12d251b9d7--- /dev/null+++ b/apps/web/src/components/app/mobile/MobileCreateMenu.tsx@@ -0,0 +1,153 @@+import './MobileCreateMenu.css';+import { hapticImpact } from '@core/mobile/haptics';+import { Dialog } from '@kobalte/core/dialog';+import PlusIcon from '@phosphor/plus.svg';+import { Layer } from '@ui/components/Layer';+import {+ type Component,+ createEffect,+ createSignal,+ For,+ type JSX,+ on,+ onCleanup,+} from 'solid-js';+import { Dynamic } from 'solid-js/web';+import { MobileDockIsland } from './MobileDockIsland';++export type MobileCreateMenuItem = {+ label: string;+ icon: Component<JSX.SvgSVGAttributes<SVGSVGElement>>;+ onSelect: () => void;+ disabled?: boolean;+};++/** Floating create actions that unfold from the mobile New button. */+export function MobileCreateMenu(props: {+ items: readonly MobileCreateMenuItem[];+}) {+ const [open, setOpen] = createSignal(false);+ const [position, setPosition] = createSignal({+ right: 12,+ bottom: 70,+ width: 86,+ });+ let triggerRef!: HTMLButtonElement;+ let selectedAction: (() => void) | undefined;++ const updatePosition = () => {+ const rect = triggerRef.getBoundingClientRect();+ setPosition({+ right: Math.max(12, window.innerWidth - rect.right),+ bottom: Math.max(12, window.innerHeight - rect.bottom),+ width: rect.width,+ });+ };++ createEffect(+ on(open, (isOpen) => {+ if (!isOpen) return;+ // Keep the X over New when rotation or the software keyboard moves the dock.+ window.addEventListener('resize', updatePosition);+ window.visualViewport?.addEventListener('resize', updatePosition);+ onCleanup(() => {+ window.removeEventListener('resize', updatePosition);+ window.visualViewport?.removeEventListener('resize', updatePosition);+ });+ })+ );++ const changeOpen = (next: boolean) => {+ if (next) {+ updatePosition();+ selectedAction = undefined;+ }+ setOpen(next);+ };++ const select = (item: MobileCreateMenuItem) => {+ selectedAction = item.onSelect;+ hapticImpact('light');+ setOpen(false);+ };++ return (+ <Dialog open={open()} onOpenChange={changeOpen} modal>+ <MobileDockIsland class="shrink-0">+ <Dialog.Trigger+ ref={triggerRef}+ aria-label="New"+ onPointerDown={() => hapticImpact('light')}+ class="relative flex h-(--mobile-chrome-button-size) items-center justify-center gap-1.5 rounded-full pl-3 pr-4 text-[15px] font-medium whitespace-nowrap"+ >+ <PlusIcon class="size-5.5 shrink-0" />+ <span>New</span>+ </Dialog.Trigger>+ </MobileDockIsland>+ <Dialog.Portal>+ <Dialog.Overlay class="mobile-create-menu-overlay fixed inset-0 z-modal scrim-glass" />+ <Layer depth={3}>+ <Dialog.Content+ class="mobile-create-menu fixed z-modal flex max-w-[calc(100vw-24px)] flex-col items-end gap-3 outline-none"+ style={{+ right: `${position().right}px`,+ bottom: `${position().bottom}px`,+ 'max-height': `calc(100dvh - ${position().bottom}px - var(--safe-top) - 12px)`,+ }}+ onCloseAutoFocus={() => {+ // Let the dialog restore New first, then hand focus to the next+ // composer/menu after its focus trap has been removed.+ const action = selectedAction;+ selectedAction = undefined;+ if (action) queueMicrotask(action);+ }}+ >+ <Dialog.Title class="sr-only">Create new</Dialog.Title>+ <Dialog.Description class="sr-only">+ Choose what to create.+ </Dialog.Description>+ <div class="-m-1 flex min-h-0 flex-col items-end gap-2 overflow-y-auto p-1">+ <For each={props.items}>+ {(item, index) => (+ <div+ class="mobile-create-menu-item shrink-0"+ style={{+ '--create-rise': `${(props.items.length - index()) * 54 + 4}px`,+ '--create-delay': `${(props.items.length - index() - 1) * 22}ms`,+ }}+ >+ <MobileDockIsland>+ <button+ type="button"+ disabled={item.disabled}+ onClick={() => select(item)}+ class="flex h-(--mobile-chrome-button-size) items-center gap-3 rounded-full px-5 text-base font-medium text-ink outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-40"+ >+ <Dynamic+ component={item.icon}+ class="size-5.5 shrink-0"+ />+ <span>{item.label}</span>+ </button>+ </MobileDockIsland>+ </div>+ )}+ </For>+ </div>+ <MobileDockIsland class="shrink-0">+ <Dialog.CloseButton+ aria-label="Close create menu"+ style={{ width: `${position().width}px` }}+ onPointerDown={() => hapticImpact('light')}+ class="flex h-(--mobile-chrome-button-size) items-center justify-center gap-1.5 rounded-full pl-3 pr-4 text-[15px] font-medium outline-none focus-visible:ring-2 focus-visible:ring-accent"+ >+ <PlusIcon class="mobile-create-menu-plus size-5.5 shrink-0" />+ <span>New</span>+ </Dialog.CloseButton>+ </MobileDockIsland>+ </Dialog.Content>+ </Layer>+ </Dialog.Portal>+ </Dialog>+ );+}diff --git a/apps/web/src/components/app/mobile/MobileDockButton.test.tsx b/apps/web/src/components/app/mobile/MobileDockButton.test.tsxnew file mode 100644index 0000000000..9d9dd59c9e--- /dev/null+++ b/apps/web/src/components/app/mobile/MobileDockButton.test.tsx@@ -0,0 +1,148 @@+import { hapticImpact } from '@core/mobile/haptics';+import {+ cleanup,+ fireEvent,+ render,+ screen,+ waitFor,+} from '@solidjs/testing-library';+import type { ParentProps } from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { MobileDockButton } from './MobileDockButton';+import { MobileDrawer } from './MobileDrawer';++vi.mock('@core/mobile/haptics', () => ({ hapticImpact: vi.fn() }));+vi.mock('@ui', () => ({+ cn: (...values: unknown[]) => values.filter(Boolean).join(' '),+ Layer: (props: ParentProps) => props.children,+}));+vi.mock('@core/mobile/virtualKeyboard', () => ({+ virtualKeyboardVisible: () => false,+}));+let drawerStyles: HTMLStyleElement;+beforeEach(() => {+ // Supply browser motion defaults missing in jsdom for Corvu's presence tracking.+ drawerStyles = document.createElement('style');+ drawerStyles.textContent =+ '[data-corvu-drawer-content], [data-corvu-drawer-overlay] { transition-duration: 0s; animation-name: none; }';+ document.head.append(drawerStyles);+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+ vi.stubGlobal('scrollTo', vi.fn());+});+afterEach(() => {+ cleanup();+ drawerStyles.remove();+ vi.clearAllMocks();+ vi.unstubAllGlobals();+});+function setup() {+ const activate = vi.fn();+ const { getByRole } = render(() => (+ <MobileDockButton+ icon={() => <svg />}+ ariaLabel="Calendar"+ onClick={activate}+ />+ ));+ const button = getByRole('button');+ const press = (pointerType: string, isPrimary = true, mouseButton = 0) => {+ const event = new Event('pointerdown', { bubbles: true, cancelable: true });+ Object.assign(event, { pointerType, isPrimary, button: mouseButton });+ fireEvent(button, event);+ return event;+ };+ return { activate, button, press };+}+describe('mobile dock activation', () => {+ it.each(['touch', 'pen', 'mouse'])(+ 'gives haptic feedback on %s down and activates on click',+ (pointerType) => {+ const { activate, button, press } = setup();+ expect(press(pointerType).defaultPrevented).toBe(false);+ expect(hapticImpact).toHaveBeenCalledExactlyOnceWith('light');+ expect(activate).not.toHaveBeenCalled();+ fireEvent.pointerUp(button);+ expect(activate).not.toHaveBeenCalled();+ fireEvent.click(button, { detail: 1 });+ expect(activate).toHaveBeenCalledTimes(1);+ expect(hapticImpact).toHaveBeenCalledTimes(1);+ press(pointerType);+ expect(activate).toHaveBeenCalledTimes(1);+ }+ );+ it('does not activate a cancelled touch and still accepts keyboard or assistive clicks', () => {+ const { activate, button, press } = setup();+ press('touch');+ fireEvent.pointerCancel(button);+ expect(activate).not.toHaveBeenCalled();+ fireEvent.click(button, { detail: 0 });+ expect(activate).toHaveBeenCalledTimes(1);+ });+ it('allows compatibility mouse-down without activating before click', () => {+ const { activate, button, press } = setup();+ press('touch');+ const event = new MouseEvent('mousedown', {+ bubbles: true,+ cancelable: true,+ });+ fireEvent(button, event);+ expect(event.defaultPrevented).toBe(false);+ expect(activate).not.toHaveBeenCalled();+ fireEvent.click(button, { detail: 1 });+ expect(activate).toHaveBeenCalledTimes(1);+ });++ it('forwards the drawer trigger ref, accessibility props, and click event', async () => {+ let triggerRef: HTMLButtonElement | undefined;+ const onClick = vi.fn();+ const select = vi.fn();+ const { getByRole, queryByRole } = render(() => (+ <MobileDrawer preventScroll={false} preventScrollbarShift={false}>+ <MobileDrawer.Trigger+ as={MobileDockButton}+ ref={(element) => {+ triggerRef = element;+ }}+ icon={() => <svg />}+ ariaLabel="More views"+ onClick={onClick}+ />+ <MobileDrawer.Portal>+ <MobileDrawer.Content aria-label="More views">+ <MobileDrawer.Close+ as={MobileDrawer.Item}+ aria-label="Calendar"+ onClick={select}+ >+ Calendar+ </MobileDrawer.Close>+ </MobileDrawer.Content>+ </MobileDrawer.Portal>+ </MobileDrawer>+ ));+ const trigger = getByRole('button', { name: 'More views' });+ expect(triggerRef).toBe(trigger);+ expect(trigger.getAttribute('aria-haspopup')).toBe('dialog');+ expect(trigger.getAttribute('aria-expanded')).toBe('false');+ fireEvent.pointerDown(trigger);+ fireEvent.pointerUp(trigger);+ expect(queryByRole('dialog')).toBeNull();+ fireEvent.click(trigger);+ expect(onClick.mock.calls[0][0]).toBeInstanceOf(MouseEvent);+ expect(trigger.getAttribute('aria-expanded')).toBe('true');+ expect(screen.getByRole('dialog').id).toBe(+ trigger.getAttribute('aria-controls')+ );+ fireEvent.click(screen.getByRole('button', { name: 'Calendar' }));+ expect(select).toHaveBeenCalledTimes(1);+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ expect(trigger.getAttribute('aria-expanded')).toBe('false');+ });+});diff --git a/apps/web/src/components/app/mobile/MobileDockButton.tsx b/apps/web/src/components/app/mobile/MobileDockButton.tsxnew file mode 100644index 0000000000..1656599712--- /dev/null+++ b/apps/web/src/components/app/mobile/MobileDockButton.tsx@@ -0,0 +1,51 @@+import { hapticImpact } from '@core/mobile/haptics';+import { cn } from '@ui';+import { type Component, type ComponentProps, splitProps } from 'solid-js';+import { Dynamic } from 'solid-js/web';++export type MobileDockIcon = Component<{ class?: string }>;++type MobileDockButtonProps = Omit<ComponentProps<'button'>, 'children'> & {+ icon: MobileDockIcon;+ /** Accessible name for the icon-only button. */+ ariaLabel: string;+ active?: boolean;+ iconClass?: string;+};++/**+ * Renders flat: hosts wrap it in a MobileDockIsland (alone or grouped with+ * other controls) to give it the floating chrome.+ */+export function MobileDockButton(props: MobileDockButtonProps) {+ const [local, rest] = splitProps(props, [+ 'icon',+ 'ariaLabel',+ 'active',+ 'class',+ 'iconClass',+ ]);++ return (+ <button+ type="button"+ aria-label={local.ariaLabel}+ onPointerDown={() => hapticImpact('light')}+ class={cn(+ 'relative flex size-(--mobile-chrome-button-size) shrink-0 items-center justify-center rounded-full',+ local.active && 'text-accent',+ local.class+ )}+ {...rest}+ >+ <div+ class={cn(+ 'size-(--mobile-chrome-icon-size) shrink-0 [&_svg]:size-(--mobile-chrome-icon-size)',+ local.iconClass+ )}+ >+ <Dynamic component={local.icon} />+ </div>+ </button>+ );+}diff --git a/apps/web/src/components/app/mobile/MobileDockIsland.tsx b/apps/web/src/components/app/mobile/MobileDockIsland.tsxindex 3ea2b95f13..0b52e368b5 100644--- a/apps/web/src/components/app/mobile/MobileDockIsland.tsx+++ b/apps/web/src/components/app/mobile/MobileDockIsland.tsx@@ -2,17 +2,17 @@ import { cn } from '@ui';import type { JSX, ParentProps } from 'solid-js';/**- * The floating pill surface for dock controls. Controls (MobileDockButton,- * MobileTouchMenu.Trigger) render flat and always sit inside one of these —+ * The floating pill surface for dock controls. MobileDockButton renders flat+ * and always sits inside one of these —* alone for a single round button, or grouped so several share the pill:** ```tsx* <MobileDockIsland class="h-(--mobile-chrome-button-size) justify-between gap-(--mobile-chrome-gap)">* <MobileDockButton icon={BellIcon} … />- * <MobileTouchMenu>- * <MobileTouchMenu.Trigger icon={CaretUpIcon} … />+ * <MobileDrawer>+ * <MobileDrawer.Trigger as={MobileDockButton} icon={CaretUpIcon} … />* …- * </MobileTouchMenu>+ * </MobileDrawer>* </MobileDockIsland>* ```*@@ -31,6 +31,7 @@ export function MobileDockIsland(<divref={props.ref}style={props.style}+ data-mobile-dock-islandclass={cn('island pointer-events-auto flex items-center rounded-full',props.classdiff --git a/apps/web/src/components/app/mobile/MobileDockRow.test.tsx b/apps/web/src/components/app/mobile/MobileDockRow.test.tsxnew file mode 100644index 0000000000..b4b7595a1d--- /dev/null+++ b/apps/web/src/components/app/mobile/MobileDockRow.test.tsx@@ -0,0 +1,109 @@+import {+ cleanup,+ fireEvent,+ render,+ screen,+ waitFor,+ within,+} from '@solidjs/testing-library';+import type { ParentProps } from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { MobileDockRow } from './MobileDockRow';++const { navigate, toggleSettings } = vi.hoisted(() => ({+ navigate: vi.fn(),+ toggleSettings: vi.fn(),+}));+vi.mock('@app/features/command/mobile/MobileSearchInput', () => ({+ MobileAskAiButton: () => null,+ MobileSearchInput: () => null,+}));+vi.mock('@app/features/command/mobile/mobileSearchState', () => ({+ SearchState: { isOpen: () => false },+}));+vi.mock('@core/constant/SettingsState', () => ({+ useSettingsState: () => ({ settingsOpen: () => false, toggleSettings }),+}));+vi.mock('@core/directive/focusInput', () => ({ triggerFocusInput: vi.fn() }));+vi.mock('@core/mobile/haptics', () => ({ hapticImpact: vi.fn() }));+vi.mock('@core/mobile/virtualKeyboard', () => ({+ virtualKeyboardVisible: () => false,+}));+vi.mock('@ui', () => ({+ cn: (...values: unknown[]) => values.filter(Boolean).join(' '),+ Layer: (props: ParentProps) => props.children,+}));+vi.mock('@solid-primitives/resize-observer', () => ({+ createElementSize: () => ({ width: 80, height: 40 }),+}));+vi.mock('./use-mobile-nav', () => ({+ useForegroundMobileView: () => () => 'tasks',+ useMobileNavNavigate: () => navigate,+}));+vi.mock('./mobile-dock-views', () => ({+ useMobileDockViews: () => () => [+ { id: 'calendar', label: 'Calendar', icon: () => <svg /> },+ { id: 'documents', label: 'Files', icon: () => <svg /> },+ { id: 'tasks', label: 'Tasks', icon: () => <svg /> },+ { id: 'calls', label: 'Calls', icon: () => <svg /> },+ ],+}));++let drawerStyles: HTMLStyleElement;+beforeEach(() => {+ // Supply browser motion defaults missing in jsdom for Corvu's presence tracking.+ drawerStyles = document.createElement('style');+ drawerStyles.textContent =+ '[data-corvu-drawer-content], [data-corvu-drawer-overlay] { transition-duration: 0s; animation-name: none; }';+ document.head.append(drawerStyles);+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+ vi.stubGlobal('scrollTo', vi.fn());+});+afterEach(() => {+ cleanup();+ drawerStyles.remove();+ vi.clearAllMocks();+ vi.unstubAllGlobals();+});++describe('dock overflow drawer', () => {+ it('keeps Settings first, reverses overflow views, and closes after navigation', async () => {+ render(() => <MobileDockRow />);+ const trigger = screen.getByRole('button', { name: 'More views' });+ fireEvent.pointerDown(trigger);+ expect(screen.queryByRole('dialog')).toBeNull();+ fireEvent.pointerUp(trigger);+ fireEvent.click(trigger);+ const drawer = within(screen.getByRole('dialog', { name: 'More views' }));+ expect(+ drawer.getAllByRole('button').map((button) => button.textContent)+ ).toEqual(['Settings', 'Calls', 'Tasks', 'Files', 'Views']);+ expect(+ drawer.getByRole('button', { name: 'Tasks' }).getAttribute('aria-current')+ ).toBe('page');+ fireEvent.click(drawer.getByRole('button', { name: 'Files' }));+ expect(navigate).toHaveBeenCalledExactlyOnceWith('documents');+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ });++ it('closes after opening Settings and supports dismissing without selection', async () => {+ render(() => <MobileDockRow />);+ const trigger = screen.getByRole('button', { name: 'More views' });+ fireEvent.click(trigger);+ fireEvent.click(screen.getByRole('button', { name: 'Settings' }));+ expect(toggleSettings).toHaveBeenCalledTimes(1);+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ fireEvent.click(trigger);+ fireEvent.click(screen.getByRole('button', { name: 'Views' }));+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ expect(toggleSettings).toHaveBeenCalledTimes(1);+ expect(navigate).not.toHaveBeenCalled();+ });+});diff --git a/apps/web/src/components/app/mobile/MobileDockRow.tsx b/apps/web/src/components/app/mobile/MobileDockRow.tsxindex a976671826..e4b2f40084 100644--- a/apps/web/src/components/app/mobile/MobileDockRow.tsx+++ b/apps/web/src/components/app/mobile/MobileDockRow.tsx@@ -1,113 +1,30 @@-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 { useOpenEventComposer } from '@block-calendar/components/use-open-event-composer';import { useSettingsState } from '@core/constant/SettingsState';import { triggerFocusInput } from '@core/directive/focusInput';import { hapticImpact } from '@core/mobile/haptics';-import { virtualKeyboardVisible } from '@core/mobile/virtualKeyboard';import CaretUpIcon from '@phosphor/caret-up.svg';import IconGear from '@phosphor/gear.svg';import SearchIcon from '@phosphor/magnifying-glass.svg';-import CreateIcon from '@phosphor/plus.svg';import { createElementSize } from '@solid-primitives/resize-observer';import { cn } from '@ui';import { createSignal, For, Show } from 'solid-js';import { Dynamic } from 'solid-js/web';-import { FloatRegion } from './float-regions/FloatRegion';+import { MobileDockButton } from './MobileDockButton';import { MobileDockIsland } from './MobileDockIsland';+import { MobileDrawer } from './MobileDrawer';import { MobileBottomEdgeFade } from './MobileEdgeFade';-import {- type MobileTouchIconComponent,- MobileTouchMenu,-} from './MobileTouchMenu';import { type MobileDockView, useMobileDockViews } from './mobile-dock-views';-import { mobilePageCreateAction } from './mobile-page-create-action';-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 MobilePageCreateButton() {- const foregroundView = useForegroundMobileView();- const createBlocks = useCreateMenuBlocks();- const openEventComposer = useOpenEventComposer();- const action = () => {- if (foregroundView() === 'calendar') {- return { label: 'New event', run: () => openEventComposer() };- }- return mobilePageCreateAction(foregroundView(), createBlocks());- };-- return (- <FloatRegion- region="accessory"- priority={-1}- active={() =>- !!action() && !SearchState.isOpen() && !virtualKeyboardVisible()- }- >- <Show when={action()}>- {(create) => (- <div class="flex justify-end px-(--mobile-chrome-gutter)">- <MobileDockIsland>- <MobileDockButton- icon={CreateIcon}- ariaLabel={create().label}- onClick={() => create().run()}- />- </MobileDockIsland>- </div>- )}- </Show>- </FloatRegion>- );-}--type MobileDockButtonProps = {- icon: MobileTouchIconComponent;- /** Accessible name for the icon-only button. */- ariaLabel: string;- onClick: () => void;- active?: 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) {- return (- <button- type="button"- aria-label={props.ariaLabel}- use:pressPulse- onPointerDown={() => hapticImpact('light')}- // Fires on release; the press pulse holds the on-state while touched.- onClick={() => {- props.onClick();- }}- class={cn(- 'relative flex size-(--mobile-chrome-button-size) shrink-0 items-center justify-center rounded-full',- props.active && 'text-accent'- )}- >- <div class="size-(--mobile-chrome-icon-size) shrink-0 [&_svg]:size-(--mobile-chrome-icon-size)">- <Dynamic component={props.icon} />- </div>- </button>- );-}--function MoreViewsMenu(props: {+function MoreViewsDrawer(props: {views: readonly MobileDockView[];isActive: (id: MobileDockNavId) => boolean;onNavigate: (id: MobileDockNavId) => void;@@ -115,43 +32,68 @@ function MoreViewsMenu(props: {const { settingsOpen, toggleSettings } = useSettingsState();return (- <MobileTouchMenu>- <MobileTouchMenu.Trigger+ <MobileDrawer+ side="bottom"+ preventScroll={false}+ preventScrollbarShift={false}+ closeOnOutsidePointerStrategy="pointerdown"+ >+ <MobileDrawer.Trigger+ as={MobileDockButton}ariaLabel="More views"icon={CaretUpIcon}- class="size-(--mobile-chrome-button-size) shrink-0"- iconClass="size-(--mobile-chrome-icon-size) [&_svg]:size-(--mobile-chrome-icon-size)"/>- <MobileTouchMenu.Content>- <MobileTouchMenu.Item- id="settings"- icon={IconGear}- active={settingsOpen()}- animateIcon={false}- onSelect={toggleSettings}- >- Settings- </MobileTouchMenu.Item>- <Show when={props.views.length > 0}>- <MobileTouchMenu.Separator />- </Show>- <For each={props.views.toReversed()}>- {(view) => (- <MobileTouchMenu.Item- id={view.id}- icon={view.icon}- animateIcon={false}- active={props.isActive(view.id)}- onSelect={() => props.onNavigate(view.id)}- >- {view.label}- </MobileTouchMenu.Item>- )}- </For>- <MobileTouchMenu.Separator />- <MobileTouchMenu.Footer>Views</MobileTouchMenu.Footer>- </MobileTouchMenu.Content>- </MobileTouchMenu>+ <MobileDrawer.Portal>+ <MobileDrawer.Overlay />+ <MobileDrawer.Content aria-label="More views">+ <MobileDrawer.Handle />+ <MobileDrawer.ScrollBody>+ <div class="mx-3 flex flex-col gap-1 px-1">+ <MobileDrawer.Close+ as={MobileDrawer.Item}+ aria-label="Settings"+ class={settingsOpen() ? 'text-accent' : undefined}+ onClick={() => {+ hapticImpact('light');+ toggleSettings();+ }}+ >+ <IconGear class="size-4 shrink-0" />+ <span>Settings</span>+ </MobileDrawer.Close>+ <Show when={props.views.length > 0}>+ <div class="-mx-1 h-px shrink-0 bg-edge" />+ </Show>+ <For each={props.views.toReversed()}>+ {(view) => (+ <MobileDrawer.Close+ as={MobileDrawer.Item}+ aria-label={view.label}+ class={props.isActive(view.id) ? 'text-accent' : undefined}+ aria-current={props.isActive(view.id) ? 'page' : undefined}+ onClick={() => {+ hapticImpact('light');+ props.onNavigate(view.id);+ }}+ >+ <Dynamic component={view.icon} class="size-4 shrink-0" />+ <span>{view.label}</span>+ </MobileDrawer.Close>+ )}+ </For>+ <div class="-mx-1 h-px shrink-0 bg-edge" />+ <MobileDrawer.Close+ aria-label="Views"+ class="flex h-9 shrink-0 items-center px-3 text-sm font-medium text-ink-muted"+ onClick={() => hapticImpact('light')}+ >+ Views+ </MobileDrawer.Close>+ </div>+ </MobileDrawer.ScrollBody>+ </MobileDrawer.Content>+ </MobileDrawer.Portal>+ </MobileDrawer>);}@@ -198,7 +140,7 @@ function MobileNavigationDockRow() {/>)}</For>- <MoreViewsMenu+ <MoreViewsDrawerviews={dockViews().slice(visibleCount())}isActive={(id) => foregroundView() === id}onNavigate={navigate}@@ -245,7 +187,6 @@ export function MobileDockRow(props: MobileDockRowProps) {)}><MobileBottomEdgeFade />- <MobilePageCreateButton /><Show when={SearchState.isOpen()} fallback={<MobileNavigationDockRow />}><MobileSearchInput /><MobileAskAiButton />diff --git a/apps/web/src/components/app/mobile/MobileDrawer.tsx b/apps/web/src/components/app/mobile/MobileDrawer.tsxindex fae61d8a58..13b150b818 100644--- a/apps/web/src/components/app/mobile/MobileDrawer.tsx+++ b/apps/web/src/components/app/mobile/MobileDrawer.tsx@@ -1,7 +1,8 @@import { virtualKeyboardVisible } from '@core/mobile/virtualKeyboard';import { isEditableInput } from '@core/util/isEditableInput';import Drawer from '@corvu/drawer';-import { cn, Layer } from '@ui';+import { Layer } from '@ui/components/Layer';+import { cn } from '@ui/utils/classname';import {type ComponentProps,onCleanup,@@ -23,7 +24,9 @@ export function scrollToFocusedInput(e: FocusEvent, offset = 40) {if (!isEditableInput(e.target as Element) || scrollTimer !== undefined)return;const input = e.target as HTMLElement;- const container = e.currentTarget as HTMLElement;+ const container =+ input.closest<HTMLElement>('[data-drawer-scroll-body]') ??+ (e.currentTarget as HTMLElement);// Has to be delayed until after browser's native keyboard-show scroll completesscrollTimer = setTimeout(() => {scrollTimer = undefined;@@ -40,10 +43,8 @@ export function scrollToFocusedInput(e: FocusEvent, offset = 40) {* Drop-in replacement for `Drawer.Content` that handles mobile keyboard* behaviour automatically:*- * - Positions itself above the virtual keyboard via `bottom-(--virtual-keyboard-height)`- * - Switches between `pb-(--safe-bottom)` and `pb-0` based on whether any- * input/textarea inside the drawer currently has focus (detected via- * bubbling focusin/focusout — no per-input wiring needed)+ * - Keeps an 8px gutter above the screen edge or virtual keyboard.+ * - Clamps its height to the visible viewport when the keyboard opens.* - When a `MobileDrawer.ScrollBody` is present, hands the safe-area padding* to it so the scroll viewport reaches the drawer's bottom edge*@@ -80,25 +81,18 @@ function MobileDrawerContent(scrollToFocusedInput(e);}}style={{- '--drawer-max-h': `${maxHeight()}vh`,+ '--drawer-max-h': `${maxHeight()}dvh`,...(targetHeight() != null- ? { '--drawer-h': `${targetHeight()}vh` }+ ? { '--drawer-h': `${targetHeight()}dvh` }: {}),}}class={cn('portal-scope',- 'bottom-0 fixed inset-x-0 z-modal bg-surface rounded-t-2xl flex flex-col max-h-(--drawer-max-h) data-transitioning:transition-transform data-transitioning:duration-200 ease-out',+ 'fixed! inset-x-2 bottom-[calc(var(--virtual-keyboard-height,0px)+8px)] z-modal mobile-sheet glass bg-menu-glass [--color-dialog:var(--color-menu-glass)] flex flex-col max-h-[min(var(--drawer-max-h),calc(100dvh-var(--safe-top,0px)-var(--virtual-keyboard-height,0px)-16px))] data-transitioning:transition-transform data-transitioning:duration-200 ease-out motion-reduce:transition-none',targetHeight() != null ? 'h-(--drawer-h)' : 'h-fit',virtualKeyboardVisible()- ? [- 'pb-(--virtual-keyboard-height) max-h-[calc(100vh-var(--safe-top))] overflow-y-auto',- // A fixed-height drawer grows by the keyboard so its content- // keeps its designed height; a fit-content drawer has no- // --drawer-h and just clamps.- targetHeight() != null &&- 'h-[min(calc(100vh-var(--safe-top)),calc(var(--drawer-h)+var(--virtual-keyboard-height)))]',- ]- : 'pb-(--safe-bottom) has-[[data-drawer-scroll-body]]:pb-0',+ ? 'pb-4 has-[[data-drawer-scroll-body]]:pb-0'+ : 'pb-[max(16px,var(--mobile-sheet-safe-padding))] has-[[data-drawer-scroll-body]]:pb-0',local.class)}{...rest}@@ -107,6 +101,30 @@ function MobileDrawerContent();}+function MobileDrawerOverlay(props: ComponentProps<typeof Drawer.Overlay>) {+ const [local, rest] = splitProps(props, ['class']);+ return (+ <Drawer.Overlay+ class={cn('fixed inset-0 z-modal-overlay scrim-glass', local.class)}+ {...rest}+ />+ );+}++function MobileDrawerItem(props: ComponentProps<'button'>) {+ const [local, rest] = splitProps(props, ['class']);+ return (+ <button+ type="button"+ class={cn(+ 'flex min-h-11 w-full items-center gap-3 rounded-[20px] px-3 py-2.5 text-left text-sm text-ink transition-colors hover:bg-ink/6 active:bg-ink/10 aria-checked:bg-ink/8 aria-pressed:bg-ink/8 aria-[checked=mixed]:bg-ink/8 focus-visible:outline-2 focus-visible:outline-accent disabled:opacity-40',+ local.class+ )}+ {...rest}+ />+ );+}+type ExtendDiv<T extends ValidComponent = 'div'> = ComponentProps<T> & {as?: T;};@@ -122,7 +140,7 @@ function MobileDrawerSectionLabel<T extends ValidComponent = 'div'>(<Dynamiccomponent={local.as ?? 'div'}class={cn(- 'px-3 pb-2 text-xs font-medium text-ink-muted uppercase tracking-wide',+ 'px-6 pb-2 text-xs font-medium text-ink-extra-muted',local.class)}{...rest}@@ -143,7 +161,7 @@ function MobileDrawerSection<T extends ValidComponent = 'div'>(<Layer depth={2}><Dynamiccomponent={(local.as ?? 'div') as ValidComponent}- class={cn('rounded-2xl mx-3 overflow-clip', local.class)}+ class={cn('rounded-3xl mx-3 p-1 bg-ink/3 overflow-clip', local.class)}{...rest}>{local.children}@@ -177,8 +195,10 @@ function MobileDrawerScrollBody<T extends ValidComponent = 'div'>(component={(local.as ?? 'div') as ValidComponent}data-drawer-scroll-bodyclass={cn(- 'flex min-h-0 flex-auto flex-col overflow-y-auto',- !virtualKeyboardVisible() && 'pb-(--safe-bottom)',+ 'flex min-h-0 flex-auto flex-col overflow-y-auto rounded-b-(--mobile-sheet-radius) [corner-shape:inherit]',+ virtualKeyboardVisible()+ ? 'pb-4'+ : 'pb-[max(16px,var(--mobile-sheet-safe-padding))]',local.class)}{...rest}@@ -199,10 +219,10 @@ function MobileDrawerHandle<T extends ValidComponent = 'div'>(return (<Dynamiccomponent={local.as ?? 'div'}- class={cn('flex justify-center pt-3 pb-2 shrink-0', local.class)}+ class={cn('flex justify-center pt-2 pb-3 shrink-0', local.class)}{...rest}>- {local.children ?? <div class="w-10 h-1 rounded-full bg-edge-muted" />}+ {local.children ?? <div class="w-9 h-1 rounded-full bg-ink/15" />}</Dynamic>);}@@ -223,12 +243,15 @@ export const MobileDrawer = Object.assign({Trigger: Drawer.Trigger,Portal: Drawer.Portal,- Overlay: Drawer.Overlay,+ Overlay: MobileDrawerOverlay,Content: MobileDrawerContent,Close: Drawer.Close,+ Title: Drawer.Label,+ Description: Drawer.Description,ScrollBody: MobileDrawerScrollBody,Handle: MobileDrawerHandle,Section: MobileDrawerSection,Label: MobileDrawerSectionLabel,+ Item: MobileDrawerItem,});diff --git a/apps/web/src/components/app/mobile/MobileEdgeFade.tsx b/apps/web/src/components/app/mobile/MobileEdgeFade.tsxindex 739e112d27..63238f5de9 100644--- a/apps/web/src/components/app/mobile/MobileEdgeFade.tsx+++ b/apps/web/src/components/app/mobile/MobileEdgeFade.tsx@@ -8,7 +8,7 @@ import { Show } from 'solid-js';*//** Extra distance the gradients bleed past the chrome they cover. */-const TOP_FALLOFF = '0px';+const TOP_FALLOFF = '32px';const BOTTOM_FALLOFF = '32px';export function MobileTopEdgeFade() {diff --git a/apps/web/src/components/app/mobile/MobilePageActionRow.test.tsx b/apps/web/src/components/app/mobile/MobilePageActionRow.test.tsxnew file mode 100644index 0000000000..6341b9e1f0--- /dev/null+++ b/apps/web/src/components/app/mobile/MobilePageActionRow.test.tsx@@ -0,0 +1,372 @@+import type { MobileNavViewId } from '@components/app/mobile/mobile-nav-views';+import {+ cleanup,+ fireEvent,+ render,+ screen,+ waitFor,+ within,+} from '@solidjs/testing-library';+import { createSignal, onCleanup } from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';++const mocks = vi.hoisted(() => ({+ send: vi.fn(),+ mountComposer: vi.fn(),+ unmountComposer: vi.fn(),+ view: 'mail' as MobileNavViewId | undefined,+ createItem: vi.fn(),+ createMenu: vi.fn(),+ openEvent: vi.fn(),+ openCompany: vi.fn(),+}));++import { TOKENS } from '@core/hotkey/tokens';++vi.mock('@app/features/command/Launcher', () => ({+ setCreateMenuOpen: mocks.createMenu,+ useCreateMenuBlocks: () => () =>+ ['Message', 'Email', 'Document', 'Task', 'Agent'].map((label) => ({+ label,+ hotkeyToken: (+ {+ Message: TOKENS.create.message,+ Email: TOKENS.create.email,+ Document: TOKENS.create.note,+ Task: TOKENS.create.task,+ Agent: TOKENS.create.agent,+ } as Record<string, string>+ )[label],+ keyDownHandler: () => mocks.createItem(label),+ })),+}));+vi.mock('@block-calendar/components/use-open-event-composer', () => ({+ useOpenEventComposer: () => mocks.openEvent,+}));+vi.mock('@app/features/calendar/hooks/use-calendar-ui-flag', () => ({+ useCalendarUiFlag: () => () => true,+}));+vi.mock('@app/features/companies/CreateCompanyModal', () => ({+ openCreateCompanyModal: mocks.openCompany,+}));+vi.mock('@core/mobile/haptics', () => ({ hapticImpact: vi.fn() }));+vi.mock('@components/app/mobile/use-mobile-nav', () => ({+ useForegroundMobileView: () => () => mocks.view,+ useMobileNavNavigate: () => vi.fn(),+}));+vi.mock('@components/app/mobile/mobile-dock-views', () => ({+ useMobileDockViews: () => () => [],+}));+vi.mock('@components/app/mobile/PillTabs', () => ({+ PillTabs: () => <div role="tablist" aria-label="Search scopes" />,+}));+vi.mock('@components/app/mobile/MobileDockIsland', () => ({+ MobileDockIsland: (props: { children: import('solid-js').JSX.Element }) => (+ <div>{props.children}</div>+ ),+}));+vi.mock('@core/mobile/isTouchDevice', () => ({ isTouchDevice: () => true }));+vi.mock('@components/app/split-layout/layoutUtils', () => ({+ useSplitPanel: () => undefined,+}));+vi.mock('@app/features/chat/SoupChatInput', () => ({+ SoupChatInput: () => {+ mocks.mountComposer();+ onCleanup(mocks.unmountComposer);+ return (+ <div>+ <textarea aria-label="Chat draft" />+ <button onClick={mocks.send}>Send</button>+ </div>+ );+ },+}));++import { SearchState } from '@app/features/command/mobile/mobileSearchState';+import type { CreatableBlock } from '@app/features/command/types';+import { mountGlobalFocusListener } from '@app/signal/focus';+import { FloatRegion } from '@components/app/mobile/float-regions/FloatRegion';+import { FloatRegions } from '@components/app/mobile/float-regions/float-region-state';+import { MobileViewsRow } from '@components/app/mobile/MobileViewsRow';+import { mobilePageCreateBlock } from '@components/app/mobile/mobile-page-create-action';+import { setVirtualKeyboardVisible } from '@core/mobile/virtualKeyboard';+import { MobilePageActionRow } from './MobilePageActionRow';++let mount: HTMLDivElement;+afterEach(() => {+ cleanup();+ mount.remove();+ setVirtualKeyboardVisible(false);+ vi.restoreAllMocks();+});+beforeEach(() => {+ vi.clearAllMocks();+ mocks.view = 'mail';+ setVirtualKeyboardVisible(false);+ SearchState.close();+ vi.spyOn(window, 'scrollTo').mockImplementation(() => {});+ // jsdom reports an empty animation name; browsers report `none`. Let+ // Kobalte finish dismissal here; actual motion is checked in the browser.+ const getComputedStyle = window.getComputedStyle;+ vi.spyOn(window, 'getComputedStyle').mockImplementation((element) => {+ const style = getComputedStyle(element);+ if (!style.animationName) {+ Object.defineProperty(style, 'animationName', { value: 'none' });+ }+ return style;+ });+ mount = document.createElement('div');+ document.body.append(mount);+ FloatRegions.setMount('accessory', mount);+ render(() => {+ mountGlobalFocusListener();+ return null;+ });+});++describe('Mobile page action row', () => {+ it.each(['input', 'textarea', 'contenteditable'] as const)(+ 'hides while an outside %s is focused and preserves the AI draft',+ (kind) => {+ render(() => <MobilePageActionRow />);+ const draft = screen.getByRole('textbox', {+ name: 'Chat draft',+ }) as HTMLTextAreaElement;+ draft.value = 'Keep this draft';+ draft.focus();+ setVirtualKeyboardVisible(true);+ expect(screen.getByRole('textbox', { name: 'Chat draft' })).toBe(draft);++ const external = document.createElement(+ kind === 'contenteditable' ? 'div' : kind+ );+ if (kind === 'contenteditable') {+ external.setAttribute('contenteditable', 'true');+ external.tabIndex = 0;+ }+ document.body.append(external);+ external.focus();+ expect(document.activeElement).toBe(external);+ expect(screen.queryByRole('textbox', { name: 'Chat draft' })).toBeNull();+ expect(screen.queryByRole('button', { name: 'Send' })).toBeNull();+ // Focus also hides the bar with a hardware keyboard or before the virtual+ // keyboard visibility signal arrives.+ setVirtualKeyboardVisible(false);+ expect(screen.queryByRole('textbox', { name: 'Chat draft' })).toBeNull();+ expect(screen.queryByRole('button', { name: 'New email' })).toBeNull();++ external.blur();+ external.remove();+ expect(screen.getByRole('textbox', { name: 'Chat draft' })).toBe(draft);+ expect(draft.value).toBe('Keep this draft');+ draft.focus();+ expect(document.activeElement).toBe(draft);+ expect(screen.getByRole('button', { name: 'Send' })).toBeTruthy();+ expect(mocks.mountComposer).toHaveBeenCalledOnce();+ expect(mocks.unmountComposer).not.toHaveBeenCalled();+ }+ );++ it('starts hidden when another field is already focused and returns for a non-editable control', () => {+ render(() => (+ <>+ <input aria-label="Email subject" />+ <button type="button">Email options</button>+ </>+ ));+ screen.getByRole('textbox', { name: 'Email subject' }).focus();+ render(() => <MobilePageActionRow />);+ expect(screen.queryByRole('textbox', { name: 'Chat draft' })).toBeNull();+ screen.getByRole('button', { name: 'Email options' }).focus();+ expect(screen.getByRole('textbox', { name: 'Chat draft' })).toBeTruthy();+ expect(mocks.mountComposer).toHaveBeenCalledOnce();+ });++ it('starts compact and yields to screen-specific controls, then returns', () => {+ const page = render(() => <MobilePageActionRow />);+ const draft = screen.getByRole('textbox', { name: 'Chat draft' });+ fireEvent.input(draft, { target: { value: 'Keep this draft' } });+ expect(screen.getByRole('button', { name: 'New email' })).toBeTruthy();+ const reply = render(() => (+ <FloatRegion region="accessory">+ <button>Reply</button>+ </FloatRegion>+ ));+ expect(screen.queryByRole('button', { name: 'Send' })).toBeNull();+ expect(screen.queryByRole('button', { name: 'New email' })).toBeNull();+ expect(screen.getByRole('button', { name: 'Reply' })).toBeTruthy();+ reply.unmount();+ expect(screen.getByRole('textbox', { name: 'Chat draft' })).toBe(draft);+ expect((draft as HTMLTextAreaElement).value).toBe('Keep this draft');+ expect(mocks.mountComposer).toHaveBeenCalledOnce();+ expect(mocks.unmountComposer).not.toHaveBeenCalled();+ expect(screen.getByRole('button', { name: 'Send' })).toBeTruthy();+ expect(screen.getByRole('button', { name: 'New email' })).toBeTruthy();+ page.unmount();+ expect(mocks.unmountComposer).toHaveBeenCalledOnce();+ });+ it('lets search take precedence over a document composer, then restores the available accessory', () => {+ const [canComment, setCanComment] = createSignal(true);+ // Mount the fallback last to ensure priority, rather than mount order, wins.+ render(() => (+ <>+ <MobileViewsRow />+ <FloatRegion region="accessory" active={canComment}>+ <button>Leave a comment</button>+ </FloatRegion>+ <MobilePageActionRow />+ </>+ ));+ expect(+ screen.getByRole('button', { name: 'Leave a comment' })+ ).toBeTruthy();+ expect(screen.queryByRole('button', { name: 'Send' })).toBeNull();++ SearchState.open();+ expect(screen.getByRole('tablist', { name: 'Search scopes' })).toBeTruthy();+ expect(+ screen.queryByRole('button', { name: 'Leave a comment' })+ ).toBeNull();+ expect(screen.queryByRole('button', { name: 'Send' })).toBeNull();+ expect(screen.queryByRole('button', { name: 'New email' })).toBeNull();++ SearchState.close();+ expect(+ screen.getByRole('button', { name: 'Leave a comment' })+ ).toBeTruthy();+ setCanComment(false);+ expect(screen.getByRole('button', { name: 'Send' })).toBeTruthy();+ expect(screen.getByRole('button', { name: 'New email' })).toBeTruthy();++ SearchState.open();+ expect(screen.getByRole('tablist', { name: 'Search scopes' })).toBeTruthy();+ expect(screen.queryByRole('button', { name: 'Send' })).toBeNull();+ SearchState.close();+ expect(screen.getByRole('button', { name: 'Send' })).toBeTruthy();+ setCanComment(true);+ expect(+ screen.getByRole('button', { name: 'Leave a comment' })+ ).toBeTruthy();+ expect(screen.queryByRole('button', { name: 'Send' })).toBeNull();+ });+ it('replaces the Agents floating create button without removing other page actions', () => {+ const blocks: CreatableBlock[] = [+ {+ label: 'Mail draft',+ description: 'Create email',+ blockName: 'email',+ hotkeyToken: TOKENS.create.email,+ hotkey: 'e',+ keyDownHandler: vi.fn(() => true),+ },+ {+ label: 'Task',+ description: 'Create task',+ blockName: 'task',+ hotkeyToken: TOKENS.create.task,+ hotkey: 't',+ keyDownHandler: vi.fn(() => true),+ },+ ];++ expect(mobilePageCreateBlock('agents', blocks)).toBeUndefined();+ expect(mobilePageCreateBlock('mail', blocks)).toBe(blocks[0]);+ expect(mobilePageCreateBlock('tasks', blocks)).toBe(blocks[1]);+ expect(mobilePageCreateBlock('mail', [])).toBeUndefined();+ });+ it.each([+ ['mail', 'Email'],+ ['tasks', 'Task'],+ ['documents', 'Document'],+ ['channels', 'Message'],+ ] as const)('keeps New on %s alongside the AI composer', (view, label) => {+ mocks.view = view;+ render(() => <MobilePageActionRow />);+ const createButton = screen.getByRole('button', {+ name: `New ${label.toLowerCase()}`,+ });+ expect(createButton.textContent).toBe(label);+ fireEvent.click(createButton);+ expect(mocks.createItem).toHaveBeenCalledWith(label);+ expect(mocks.send).not.toHaveBeenCalled();+ expect(screen.getByRole('button', { name: 'Send' })).toBeTruthy();+ });+ it('shows only the AI composer on Agents, without a redundant create button', () => {+ mocks.view = 'agents';+ render(() => <MobilePageActionRow />);+ expect(screen.queryByRole('button', { name: /^New/ })).toBeNull();+ expect(screen.getByRole('button', { name: 'Send' })).toBeTruthy();+ });+ it('opens company creation from CRM alongside the AI composer', () => {+ mocks.view = 'companies';+ render(() => <MobilePageActionRow />);+ const createButton = screen.getByRole('button', { name: 'New company' });+ expect(createButton.textContent).toBe('Company');+ fireEvent.click(createButton);+ expect(mocks.openCompany).toHaveBeenCalledOnce();+ expect(mocks.createMenu).not.toHaveBeenCalled();+ expect(screen.getByRole('button', { name: 'Send' })).toBeTruthy();+ });+ it('opens the event composer from the calendar New button', () => {+ mocks.view = 'calendar';+ render(() => <MobilePageActionRow />);+ const createButton = screen.getByRole('button', { name: 'New event' });+ expect(createButton.textContent).toBe('Event');+ fireEvent.click(createButton);+ expect(mocks.openEvent).toHaveBeenCalledOnce();+ });+ it('opens the create menu on views without a specific New action', () => {+ mocks.view = undefined;+ render(() => <MobilePageActionRow />);+ fireEvent.click(screen.getByRole('button', { name: 'New' }));+ expect(mocks.createMenu).toHaveBeenCalledWith(true);+ });+ it('opens Home’s quick create actions in the requested order and restores focus on dismissal', async () => {+ mocks.view = 'inbox';+ render(() => <MobilePageActionRow />);+ const trigger = screen.getByRole('button', { name: 'New' });+ expect(screen.queryByRole('button', { name: 'New message' })).toBeNull();+ fireEvent.click(trigger);+ const menu = await screen.findByRole('dialog', { name: 'Create new' });+ expect(+ within(menu)+ .getAllByRole('button')+ .map((item) => item.textContent)+ ).toEqual(['Email', 'Message', 'Document', 'Event', 'Task', 'More', 'New']);+ fireEvent.click(+ within(menu).getByRole('button', { name: 'Close create menu' })+ );+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ await waitFor(() => expect(document.activeElement).toBe(trigger));+ expect(mocks.createItem).not.toHaveBeenCalled();+ });+ it.each(['Email', 'Message', 'Document', 'Event', 'Task', 'More'])(+ 'hands off Home’s %s action after closing the quick menu',+ async (label) => {+ mocks.view = 'inbox';+ render(() => <MobilePageActionRow />);+ fireEvent.click(screen.getByRole('button', { name: 'New' }));+ const menu = await screen.findByRole('dialog', { name: 'Create new' });+ fireEvent.click(within(menu).getByRole('button', { name: label }));+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ await waitFor(() => {+ if (label === 'More')+ expect(mocks.createMenu).toHaveBeenCalledWith(true);+ else if (label === 'Event')+ expect(mocks.openEvent).toHaveBeenCalledOnce();+ else expect(mocks.createItem).toHaveBeenCalledWith(label);+ });+ expect(mocks.send).not.toHaveBeenCalled();+ }+ );+ it('hides only the page action while the keyboard is visible', () => {+ render(() => <MobilePageActionRow />);+ const draft = screen.getByRole('textbox', { name: 'Chat draft' });+ setVirtualKeyboardVisible(true);+ expect(screen.queryByRole('button', { name: 'New email' })).toBeNull();+ expect(screen.getByRole('textbox', { name: 'Chat draft' })).toBe(draft);+ setVirtualKeyboardVisible(false);+ expect(screen.getByRole('button', { name: 'New email' })).toBeTruthy();+ expect(mocks.mountComposer).toHaveBeenCalledOnce();+ });+});diff --git a/apps/web/src/components/app/mobile/MobilePageActionRow.tsx b/apps/web/src/components/app/mobile/MobilePageActionRow.tsxnew file mode 100644index 0000000000..09ac63760f--- /dev/null+++ b/apps/web/src/components/app/mobile/MobilePageActionRow.tsx@@ -0,0 +1,31 @@+import { SoupChatInput } from '@app/features/chat/SoupChatInput';+import { activeElement } from '@app/signal/focus';+import { isEditableInput } from '@core/util/isEditableInput';+import { FloatRegion } from './float-regions/FloatRegion';+import { MobilePageCreateButton } from './MobilePageCreateButton';++/** The default mobile accessory: an AI composer beside the page's New action. */+export function MobilePageActionRow() {+ // Keep the editor and its draft alive while typing elsewhere or while another+ // accessory owns the slot.+ let composerRef!: HTMLDivElement;+ const composer = (+ <div ref={composerRef} class="pointer-events-auto min-w-0 flex-1">+ <SoupChatInput />+ </div>+ );+ const isAvailable = () => {+ const focused = activeElement();+ return !isEditableInput(focused) || composerRef.contains(focused);+ };++ return (+ // Screen composers (0) and search scopes (100) take precedence.+ <FloatRegion region="accessory" priority={-1} active={isAvailable}>+ <div class="flex items-end gap-(--mobile-chrome-gutter) px-(--mobile-chrome-gutter)">+ {composer}+ <MobilePageCreateButton />+ </div>+ </FloatRegion>+ );+}diff --git a/apps/web/src/components/app/mobile/MobilePageCreateButton.test.tsx b/apps/web/src/components/app/mobile/MobilePageCreateButton.test.tsxnew file mode 100644index 0000000000..ac5cece088--- /dev/null+++ b/apps/web/src/components/app/mobile/MobilePageCreateButton.test.tsx@@ -0,0 +1,108 @@+import type { CreatableBlock } from '@app/features/command/types';+import { TOKENS } from '@core/hotkey/tokens';+import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';+import { createSignal } from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { MobilePageCreateButton } from './MobilePageCreateButton';+import type { MobileNavViewId } from './mobile-nav-views';++const sources = vi.hoisted(() => ({+ view: vi.fn(),+ blocks: vi.fn(),+ calendar: vi.fn(),+ openEvent: vi.fn(),+ openCompany: vi.fn(),+ openMenu: vi.fn(),+}));++vi.mock('./use-mobile-nav', () => ({+ useForegroundMobileView: () => sources.view,+}));+vi.mock('@app/features/command/Launcher', () => ({+ useCreateMenuBlocks: () => sources.blocks,+ setCreateMenuOpen: sources.openMenu,+}));+vi.mock('@app/features/calendar/hooks/use-calendar-ui-flag', () => ({+ useCalendarUiFlag: () => sources.calendar,+}));+vi.mock('@block-calendar/components/use-open-event-composer', () => ({+ useOpenEventComposer: () => sources.openEvent,+}));+vi.mock('@app/features/companies/CreateCompanyModal', () => ({+ openCreateCompanyModal: sources.openCompany,+}));+vi.mock('@core/mobile/haptics', () => ({ hapticImpact: vi.fn() }));+vi.mock('@ui', () => ({+ cn: (...values: unknown[]) => values.filter(Boolean).join(' '),+}));++beforeEach(() => {+ vi.stubGlobal('scrollTo', vi.fn());+ const computedStyle = window.getComputedStyle;+ vi.stubGlobal('getComputedStyle', (element: Element) => {+ const style = computedStyle(element);+ // JSDOM returns an empty name, which presence treats as an animation.+ style.animationName ||= 'none';+ return style;+ });+});+afterEach(() => {+ cleanup();+ vi.resetAllMocks();+ vi.unstubAllGlobals();+});++function setup(view: MobileNavViewId = 'inbox') {+ const [calendar, setCalendar] = createSignal(false);+ const [blocks, setBlocks] = createSignal<CreatableBlock[]>([]);+ sources.view.mockReturnValue(view);+ sources.calendar.mockImplementation(calendar);+ sources.blocks.mockImplementation(blocks);+ render(() => <MobilePageCreateButton />);+ return { setCalendar, setBlocks };+}++describe('mobile create availability', () => {+ it('reacts to the calendar flag in the inbox quick menu', () => {+ const { setCalendar } = setup();+ fireEvent.click(screen.getByRole('button', { name: 'New' }));+ expect(screen.queryByRole('button', { name: 'Event' })).toBeNull();++ setCalendar(true);+ expect(screen.getByRole('button', { name: 'Event' })).toBeTruthy();+ setCalendar(false);+ expect(screen.queryByRole('button', { name: 'Event' })).toBeNull();+ expect(sources.openEvent).not.toHaveBeenCalled();+ });++ it('omits Task when unavailable and invokes its launcher action when available', async () => {+ const { setBlocks } = setup();+ fireEvent.click(screen.getByRole('button', { name: 'New' }));+ expect(screen.queryByRole('button', { name: 'Task' })).toBeNull();+ const createTask = vi.fn(() => true);+ setBlocks([+ {+ label: 'Task',+ description: 'Create task',+ blockName: 'task',+ hotkeyToken: TOKENS.create.task,+ hotkey: 't',+ icon: () => <svg />,+ keyDownHandler: createTask,+ },+ ]);+ fireEvent.click(screen.getByRole('button', { name: 'Task' }));+ await vi.waitFor(() => expect(createTask).toHaveBeenCalledOnce());+ });++ it('uses the same calendar gate for the page action and falls back to New', () => {+ const { setCalendar } = setup('calendar');+ fireEvent.click(screen.getByRole('button', { name: 'New' }));+ expect(sources.openMenu).toHaveBeenCalledWith(true);+ expect(sources.openEvent).not.toHaveBeenCalled();++ setCalendar(true);+ fireEvent.click(screen.getByRole('button', { name: 'New event' }));+ expect(sources.openEvent).toHaveBeenCalledOnce();+ });+});diff --git a/apps/web/src/components/app/mobile/MobilePageCreateButton.tsx b/apps/web/src/components/app/mobile/MobilePageCreateButton.tsxnew file mode 100644index 0000000000..1e71906270--- /dev/null+++ b/apps/web/src/components/app/mobile/MobilePageCreateButton.tsx@@ -0,0 +1,98 @@+import { useCalendarUiFlag } from '@app/features/calendar/hooks/use-calendar-ui-flag';+import {+ setCreateMenuOpen,+ useCreateMenuBlocks,+} from '@app/features/command/Launcher';+import { openCreateCompanyModal } from '@app/features/companies/CreateCompanyModal';+import { useOpenEventComposer } from '@block-calendar/components/use-open-event-composer';+import { hapticImpact } from '@core/mobile/haptics';+import { virtualKeyboardVisible } from '@core/mobile/virtualKeyboard';+import CalendarIcon from '@phosphor/calendar-blank.svg';+import MessageIcon from '@phosphor/chat-circle.svg';+import MoreIcon from '@phosphor/dots-three.svg';+import EmailIcon from '@phosphor/envelope-simple.svg';+import DocumentIcon from '@phosphor/file-text.svg';+import TaskIcon from '@phosphor/list-checks.svg';+import CreateIcon from '@phosphor/plus.svg';+import { Show } from 'solid-js';+import {+ MobileCreateMenu,+ type MobileCreateMenuItem,+} from './MobileCreateMenu';+import { MobileDockIsland } from './MobileDockIsland';+import type { MobileNavViewId } from './mobile-nav-views';+import { mobilePageCreateBlock } from './mobile-page-create-action';+import { useForegroundMobileView } from './use-mobile-nav';++const QUICK_CREATE_VIEWS = [+ { view: 'mail', icon: EmailIcon },+ { view: 'channels', icon: MessageIcon },+ { view: 'documents', icon: DocumentIcon },+ { view: 'calendar', icon: CalendarIcon },+ { view: 'tasks', icon: TaskIcon },+] as const;++/** The current view's New action, alongside the mobile AI composer. */+export function MobilePageCreateButton() {+ const foregroundView = useForegroundMobileView();+ const createBlocks = useCreateMenuBlocks();+ const calendarEnabled = useCalendarUiFlag();+ const openEventComposer = useOpenEventComposer();+ const openCreateMenu = () => setCreateMenuOpen(true);++ const actionForView = (+ view: MobileNavViewId | undefined+ ): Pick<MobileCreateMenuItem, 'label' | 'onSelect'> | undefined => {+ if (view === 'companies') {+ return { label: 'Company', onSelect: openCreateCompanyModal };+ }+ if (view === 'calendar') {+ return calendarEnabled()+ ? { label: 'Event', onSelect: () => openEventComposer() }+ : undefined;+ }+ const block = mobilePageCreateBlock(view, createBlocks());+ return block && { label: block.label, onSelect: block.keyDownHandler };+ };++ const quickActions = (): MobileCreateMenuItem[] => [+ ...QUICK_CREATE_VIEWS.flatMap(({ view, icon }) => {+ const action = actionForView(view);+ return action ? [{ ...action, icon }] : [];+ }),+ { label: 'More', icon: MoreIcon, onSelect: openCreateMenu },+ ];+ const action = () =>+ actionForView(foregroundView()) ?? {+ label: 'New',+ onSelect: openCreateMenu,+ };++ return (+ <Show when={foregroundView() !== 'agents' && !virtualKeyboardVisible()}>+ <Show+ when={foregroundView() === 'inbox'}+ fallback={+ <MobileDockIsland class="shrink-0">+ <button+ type="button"+ aria-label={+ action().label === 'New'+ ? 'New'+ : `New ${action().label.toLowerCase()}`+ }+ onPointerDown={() => hapticImpact('light')}+ onClick={() => action().onSelect()}+ class="relative flex h-(--mobile-chrome-button-size) shrink-0 items-center justify-center gap-1.5 rounded-full pl-3 pr-4 text-[15px] font-medium whitespace-nowrap"+ >+ <CreateIcon class="size-5.5 shrink-0" />+ <span>{action().label}</span>+ </button>+ </MobileDockIsland>+ }+ >+ <MobileCreateMenu items={quickActions()} />+ </Show>+ </Show>+ );+}diff --git a/apps/web/src/components/app/mobile/MobileTouchMenu.css b/apps/web/src/components/app/mobile/MobileTouchMenu.cssdeleted file mode 100644index 39c3a54baf..0000000000--- a/apps/web/src/components/app/mobile/MobileTouchMenu.css+++ /dev/null@@ -1,37 +0,0 @@-@keyframes mobile-touch-menu-show {- from {- width: 160px;- height: 80px;- }- to {- width: var(- --mobile-touch-menu-width,- calc(100vw - 2 * var(--mobile-chrome-gutter, 12px))- );- height: var(--mobile-touch-menu-height, 376px);- }-}--@keyframes mobile-touch-menu-hide {- from {- width: var(- --mobile-touch-menu-width,- calc(100vw - 2 * var(--mobile-chrome-gutter, 12px))- );- height: var(--mobile-touch-menu-height, 376px);- opacity: 1;- }- to {- width: 0px;- height: 0px;- opacity: 0;- }-}--.mobile-touch-menu-content {- animation: mobile-touch-menu-hide 120ms ease-in forwards;-}--.mobile-touch-menu-content[data-expanded] {- animation: mobile-touch-menu-show 150ms cubic-bezier(0.2, 1.05, 1, 1.1);-}diff --git a/apps/web/src/components/app/mobile/MobileTouchMenu.tsx b/apps/web/src/components/app/mobile/MobileTouchMenu.tsxdeleted file mode 100644index 88b976bb91..0000000000--- a/apps/web/src/components/app/mobile/MobileTouchMenu.tsx+++ /dev/null@@ -1,368 +0,0 @@-import './MobileTouchMenu.css';-import { hapticImpact } from '@core/mobile/haptics';-import { ICON_ANIMATION_DURATION_MS } from '@icon/animation';-import { createElementSize } from '@solid-primitives/resize-observer';-import { cn, Layer } from '@ui';-import {- type Component,- createContext,- createEffect,- createSignal,- onCleanup,- type ParentProps,- Show,- useContext,-} from 'solid-js';-import { Dynamic, Portal } from 'solid-js/web';-import { pressPulse } from './pressPulse';--// Keeps the directive import from being tree-shaken / lint-flagged.-false && pressPulse;--export type MobileTouchIconComponentProps = {- triggerAnimation?: boolean;- class?: string;-};--export type MobileTouchIconComponent = Component<MobileTouchIconComponentProps>;--type MobileTouchMenuContextValue = {- open: () => boolean;- mounted: () => boolean;- hoveredId: () => string | null;- triggerBottomOffset: () => number;- toggle: () => void;- /** Animated close: plays the hide animation, then Content unmounts. */- close: () => void;- /** Instant removal, once the hide animation ends or a row is selected. */- unmount: () => void;- select: (id: string | null) => void;- registerItem: (id: string, onSelect: () => void) => void;- unregisterItem: (id: string) => void;- setTriggerRef: (el: HTMLElement) => void;- onTriggerTouchMove: (e: TouchEvent) => void;- onTriggerTouchEnd: () => void;-};--const MobileTouchMenuContext = createContext<MobileTouchMenuContextValue>();--function useMenu(part: string) {- const menu = useContext(MobileTouchMenuContext);- if (!menu)- throw new Error(`${part} must be rendered inside <MobileTouchMenu>`);- return menu;-}--type MobileTouchMenuButtonProps = {- ariaLabel?: string;- icon: MobileTouchIconComponent;- ref?: HTMLButtonElement | ((el: HTMLButtonElement) => void);- onPointerDown: () => void;- onTouchMove?: (e: TouchEvent) => void;- onTouchEnd?: (e: TouchEvent) => void;- class?: string;- iconClass?: string;- animateIcon?: boolean;-};--function MobileTouchMenuButton(props: MobileTouchMenuButtonProps) {- const [animating, setAnimating] = createSignal(false);-- return (- <button- type="button"- aria-label={props.ariaLabel}- ref={props.ref}- use:pressPulse- onPointerDown={(e) => {- e.preventDefault();- hapticImpact('light');- if (props.animateIcon !== false) {- setAnimating(true);- setTimeout(() => setAnimating(false), ICON_ANIMATION_DURATION_MS);- }- props.onPointerDown();- }}- onTouchMove={props.onTouchMove}- onTouchEnd={props.onTouchEnd}- class={cn('flex items-center justify-center', props.class)}- >- <div class={cn('size-6 [&_svg]:size-6', props.iconClass)}>- {props.animateIcon === false ? (- <Dynamic component={props.icon} />- ) : (- <Dynamic component={props.icon} triggerAnimation={animating()} />- )}- </div>- </button>- );-}--/**- * A native-feeling touch menu: press the trigger and the menu springs open;- * slide the still-down finger over rows (hover styling + haptics) and release- * to select. Composed Kobalte-style — this root owns the open/selection state- * and the parts wire up through context:- *- * ```tsx- * <MobileTouchMenu>- * <MobileTouchMenu.Trigger icon={CaretUpIcon} />- * <MobileTouchMenu.Content>- * <MobileTouchMenu.Item id="settings" onSelect={…}>Settings</MobileTouchMenu.Item>- * <MobileTouchMenu.Separator />- * <MobileTouchMenu.Footer>Views</MobileTouchMenu.Footer>- * </MobileTouchMenu.Content>- * </MobileTouchMenu>- * ```- *- * The trigger renders flat: hosts wrap it in a MobileDockIsland (alone or- * grouped with other controls) to give it the floating chrome.- */-function MobileTouchMenuRoot(props: ParentProps) {- // `open` drives the show/hide animation (via data-expanded); `mounted`- // keeps the overlay in the DOM until the hide animation finishes.- const [open, setOpen] = createSignal(false);- const [mounted, setMounted] = createSignal(false);- const [hoveredId, setHoveredId] = createSignal<string | null>(null);- const [triggerRef, setTriggerRef] = createSignal<HTMLElement>();- const [triggerBottomOffset, setTriggerBottomOffset] = createSignal(0);-- // Items register their action so slide-select — which hit-tests DOM rows- // from the trigger's touch events — can dispatch by row id.- const itemActions = new Map<string, () => void>();-- const openMenu = () => {- // The open menu rests on the trigger's bottom edge, measured at open- // time: dock triggers put it on the dock row, higher triggers (e.g. the- // PillTabs overflow) hold it at their own height.- const trigger = triggerRef();- setTriggerBottomOffset(- trigger- ? Math.max(- 0,- window.innerHeight - trigger.getBoundingClientRect().bottom- )- : 0- );- setMounted(true);- setOpen(true);- };-- const closeMenu = () => {- setOpen(false);- setHoveredId(null);- };-- // Row selection unmounts instantly; the animated close is kept for plain- // dismissals where the main thread is idle.- const dismissMenu = () => {- setOpen(false);- setMounted(false);- setHoveredId(null);- };-- const select = (id: string | null) => {- const action = id ? itemActions.get(id) : undefined;- if (!action) return;- action();- dismissMenu();- };-- const handleTouchMove = (e: TouchEvent) => {- if (!open()) return;- const touch = e.touches[0];- const el = document.elementFromPoint(touch.clientX, touch.clientY);- const button = el?.closest(- '[data-mobile-touch-menu-item]'- ) as HTMLElement | null;- const id = button?.dataset.mobileTouchMenuItem ?? null;- if (id !== hoveredId()) {- setHoveredId(id);- if (id) hapticImpact('light');- }- };-- const handleTouchEnd = () => {- const id = hoveredId();- setHoveredId(null);- select(id);- };-- return (- <MobileTouchMenuContext.Provider- value={{- open,- mounted,- hoveredId,- triggerBottomOffset,- toggle: () => (open() ? closeMenu() : openMenu()),- close: closeMenu,- unmount: () => setMounted(false),- select,- registerItem: (id, onSelect) => itemActions.set(id, onSelect),- unregisterItem: (id) => itemActions.delete(id),- setTriggerRef: (el) => setTriggerRef(el),- onTriggerTouchMove: handleTouchMove,- onTriggerTouchEnd: handleTouchEnd,- }}- >- {props.children}- </MobileTouchMenuContext.Provider>- );-}--function MobileTouchMenuTrigger(props: {- ariaLabel?: string;- icon: MobileTouchIconComponent;- class?: string;- iconClass?: string;-}) {- const menu = useMenu('MobileTouchMenu.Trigger');-- return (- <MobileTouchMenuButton- ariaLabel={props.ariaLabel}- ref={menu.setTriggerRef}- icon={props.icon}- animateIcon={false}- onPointerDown={menu.toggle}- onTouchMove={menu.onTriggerTouchMove}- onTouchEnd={menu.onTriggerTouchEnd}- class={cn('size-10 rounded-full', props.class)}- iconClass={props.iconClass}- />- );-}--function MobileTouchMenuContent(props: ParentProps) {- const menu = useMenu('MobileTouchMenu.Content');- // The menu's natural size, fed to the open/close animation as CSS vars.- const [menuRef, setMenuRef] = createSignal<HTMLDivElement>();- const menuSize = createElementSize(menuRef);-- return (- <Show when={menu.mounted()}>- <Portal>- {/* Portaled to <body>, outside FloatRegionHost's Layer. Re-apply- depth 3 so the menu's surface matches the rest of the chrome. */}- <Layer depth={3}>- <div- class="fixed inset-0 z-modal flex items-end justify-center"- style={{ 'padding-bottom': `${menu.triggerBottomOffset()}px` }}- onPointerDown={(e) => {- if (e.target === e.currentTarget) menu.close();- }}- >- <div- class="mobile-touch-menu-content flex items-end justify-start overflow-hidden rounded-2xl border border-edge bg-menu-glass glass"- data-expanded={menu.open() ? '' : undefined}- style={{- '--mobile-touch-menu-width': menuSize.width- ? `${menuSize.width}px`- : undefined,- '--mobile-touch-menu-height': menuSize.height- ? `${menuSize.height}px`- : undefined,- }}- onAnimationEnd={(e) => {- // Icon animations bubble animationend; only unmount when the- // container's own hide animation completes.- if (e.target === e.currentTarget && !menu.open())- menu.unmount();- }}- >- <div- class="flex w-[calc(100vw-2*var(--mobile-chrome-gutter))] shrink-0 flex-col gap-1 p-1"- ref={setMenuRef}- >- {props.children}- </div>- </div>- </div>- </Layer>- </Portal>- </Show>- );-}--function MobileTouchMenuItem(- props: ParentProps<{- id: string;- icon?: MobileTouchIconComponent;- active?: boolean;- /** Plain svg icons (e.g. Gear) don't accept `triggerAnimation`. */- animateIcon?: boolean;- onSelect: () => void;- }>-) {- const menu = useMenu('MobileTouchMenu.Item');-- createEffect(() => {- const id = props.id;- menu.registerItem(id, () => props.onSelect());- onCleanup(() => menu.unregisterItem(id));- });-- return (- <button- type="button"- data-mobile-touch-menu-item={props.id}- class={cn(- 'flex h-11 items-center gap-2 rounded-lg px-3 text-sm',- props.active ? 'text-accent' : 'text-ink',- menu.hoveredId() === props.id ? 'bg-hover' : 'hover:bg-hover'- )}- onClick={() => {- hapticImpact('light');- menu.select(props.id);- }}- >- <Show when={props.icon}>- {(Icon) => (- <div class="size-4 shrink-0 [&_svg]:size-4">- <Show- when={props.animateIcon !== false}- fallback={<Dynamic component={Icon()} />}- >- <Dynamic- component={Icon()}- triggerAnimation={menu.hoveredId() === props.id}- />- </Show>- </div>- )}- </Show>- <span>{props.children}</span>- </button>- );-}--function MobileTouchMenuSeparator() {- return <div class="-mx-1 h-px shrink-0 bg-edge" />;-}--/** The bottom row labeling the menu; pressing it closes without selecting. */-function MobileTouchMenuFooter(props: ParentProps) {- const menu = useMenu('MobileTouchMenu.Footer');-- return (- <button- type="button"- class="flex h-9 shrink-0 items-center px-3 text-sm font-medium text-ink-muted"- onPointerDown={() => {- hapticImpact('light');- menu.close();- }}- >- <span>{props.children}</span>- </button>- );-}--export const MobileTouchMenu = Object.assign(MobileTouchMenuRoot, {- Trigger: MobileTouchMenuTrigger,- Content: MobileTouchMenuContent,- Item: MobileTouchMenuItem,- Separator: MobileTouchMenuSeparator,- Footer: MobileTouchMenuFooter,-});diff --git a/apps/web/src/components/app/mobile/PillTabs.test.tsx b/apps/web/src/components/app/mobile/PillTabs.test.tsxnew file mode 100644index 0000000000..eb0b36540b--- /dev/null+++ b/apps/web/src/components/app/mobile/PillTabs.test.tsx@@ -0,0 +1,126 @@+import {+ cleanup,+ fireEvent,+ render,+ screen,+ waitFor,+ within,+} from '@solidjs/testing-library';+import { createSignal, type ParentProps } from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { PillTabs } from './PillTabs';++vi.mock('@core/mobile/haptics', () => ({ hapticImpact: vi.fn() }));+vi.mock('@core/mobile/virtualKeyboard', () => ({+ virtualKeyboardVisible: () => false,+}));+vi.mock('@ui', () => ({+ cn: (...values: unknown[]) => values.filter(Boolean).join(' '),+ Layer: (props: ParentProps) => props.children,+}));+vi.mock('@solid-primitives/resize-observer', () => ({+ createElementSize: () => ({ width: 200, height: 40 }),+}));++let drawerStyles: HTMLStyleElement;+beforeEach(() => {+ // Supply browser motion defaults missing in jsdom for Corvu's presence tracking.+ drawerStyles = document.createElement('style');+ drawerStyles.textContent =+ '[data-corvu-drawer-content], [data-corvu-drawer-overlay] { transition-duration: 0s; animation-name: none; }';+ document.head.append(drawerStyles);+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+ vi.stubGlobal('scrollTo', vi.fn());+ vi.spyOn(HTMLElement.prototype, 'clientWidth', 'get').mockReturnValue(200);+ vi.spyOn(HTMLElement.prototype, 'offsetWidth', 'get').mockImplementation(+ function (this: HTMLElement) {+ return this.matches('button') && this.childNodes.length === 0 ? 40 : 100;+ }+ );+});+afterEach(() => {+ cleanup();+ drawerStyles.remove();+ vi.restoreAllMocks();+ vi.unstubAllGlobals();+});++async function setup() {+ const [value, setValue] = createSignal('all');+ const onChange = vi.fn(setValue);+ render(() => (+ <PillTabs+ items={[+ { value: 'all', label: 'All' },+ { value: 'files', label: 'Files' },+ {+ value: 'shared',+ label: (+ <span>+ Shared <span>files</span>+ </span>+ ),+ },+ {+ value: 'notifications',+ label: <svg />,+ iconOnly: true,+ ariaLabel: 'Notifications',+ },+ ]}+ value={value()}+ onChange={onChange}+ />+ ));+ const trigger = await screen.findByRole('button', { name: 'More tabs' });+ return { trigger, value, onChange };+}++describe('pill overflow drawer', () => {+ it.each([+ ['Files', 'files'],+ ['Shared files', 'shared'],+ ['Notifications', 'notifications'],+ ])(+ 'names the overflow tab "%s" and closes on selection',+ async (name, selectedValue) => {+ const { trigger, value, onChange } = await setup();+ fireEvent.pointerDown(trigger);+ fireEvent.touchMove(trigger, { touches: [{ clientX: 10, clientY: 10 }] });+ expect(screen.queryByRole('dialog')).toBeNull();+ fireEvent.touchEnd(trigger);+ fireEvent.click(trigger);+ const drawer = screen.getByRole('dialog', { name: 'More tabs' });+ fireEvent.click(within(drawer).getByRole('button', { name }));+ expect(onChange).toHaveBeenCalledExactlyOnceWith(selectedValue);+ expect(value()).toBe(selectedValue);+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ expect(screen.getByRole('button', { name, pressed: true })).toBeTruthy();+ fireEvent.click(trigger, { detail: 0 });+ expect(+ within(screen.getByRole('dialog')).queryByRole('button', {+ name,+ })+ ).toBeNull();+ }+ );++ it('ignores cancelled gestures and dismisses keyboard-opened drawers without selecting', async () => {+ const { trigger, onChange } = await setup();+ fireEvent.pointerDown(trigger);+ fireEvent.pointerCancel(trigger);+ expect(screen.queryByRole('dialog')).toBeNull();+ fireEvent.click(trigger, { detail: 0 });+ expect(screen.getByRole('dialog')).toBeTruthy();+ fireEvent.keyDown(document, { key: 'Escape' });+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ expect(onChange).not.toHaveBeenCalled();+ });+});diff --git a/apps/web/src/components/app/mobile/PillTabs.tsx b/apps/web/src/components/app/mobile/PillTabs.tsxindex 0196f70706..6850a3f839 100644--- a/apps/web/src/components/app/mobile/PillTabs.tsx+++ b/apps/web/src/components/app/mobile/PillTabs.tsx@@ -12,13 +12,10 @@ import {onCleanup,Show,} from 'solid-js';+import { MobileDockButton } from './MobileDockButton';import { MobileDockIsland } from './MobileDockIsland';-import { MobileTouchMenu } from './MobileTouchMenu';+import { MobileDrawer } from './MobileDrawer';import { computeVisiblePillValues } from './pillTabsLayout';-import { pressPulse } from './pressPulse';--// Keeps the directive import from being tree-shaken / lint-flagged.-false && pressPulse;const PILL_CLASS ='h-10 shrink-0 whitespace-nowrap rounded-full px-3.5 text-xs font-medium island';@@ -63,9 +60,9 @@ type PillTabsProps<T extends string> = {value: T | undefined;onChange: (value: T) => void;/**- * Overflow strategy: by default pills that do not fit collapse into an- * ellipsis menu; when set the strip scrolls horizontally instead and the- * active pill is kept scrolled into view.+ * Overflow strategy: by default pills that do not fit move into a drawer+ * opened by an ellipsis button. When set, the strip scrolls horizontally+ * and the active pill is kept scrolled into view.*/scrollable?: boolean;/** Extra classes on the scroll strip (the outer, clipping box). */@@ -117,14 +114,15 @@ function PillButton<T extends string>(props: {return (<buttontype="button"- use:pressPulsedata-checked={props.active ? '' : undefined}aria-pressed={props.active}aria-label={props.item.ariaLabel}class={cn(PILL_CLASS,props.item.iconOnly && ICON_PILL_CLASS,- props.active ? 'bg-accent text-surface' : 'text-ink-extra-muted'+ props.active+ ? 'bg-accent text-surface'+ : 'bg-chrome text-ink-extra-muted')}onPointerDown={(e) => {e.preventDefault();@@ -350,7 +348,7 @@ function ScrollablePillTabs<T extends string>(props: PillTabsProps<T>) {);}-/** Pills that do not fit move into an ellipsis overflow menu. */+/** Pills that do not fit move into a drawer opened by the ellipsis button. */function MenuOverflowPillTabs<T extends string>(props: PillTabsProps<T>) {const [stripRef, setStripRef] = createSignal<HTMLDivElement>();const [measureRef, setMeasureRef] = createSignal<HTMLDivElement>();@@ -457,24 +455,59 @@ function MenuOverflowPillTabs<T extends string>(props: PillTabsProps<T>) {</For><Show when={overflowItems().length > 0}><MobileDockIsland class="shrink-0">- <MobileTouchMenu>- <MobileTouchMenu.Trigger icon={DotsThreeIcon} />- <MobileTouchMenu.Content>- <For each={overflowItems()}>- {(item) => (- <MobileTouchMenu.Item- id={item.value}- active={props.value === item.value}- onSelect={() => props.onChange(item.value)}- >- {item.label}- </MobileTouchMenu.Item>- )}- </For>- <MobileTouchMenu.Separator />- <MobileTouchMenu.Footer>Tabs</MobileTouchMenu.Footer>- </MobileTouchMenu.Content>- </MobileTouchMenu>+ <MobileDrawer+ side="bottom"+ preventScroll={false}+ preventScrollbarShift={false}+ closeOnOutsidePointerStrategy="pointerdown"+ >+ <MobileDrawer.Trigger+ as={MobileDockButton}+ ariaLabel="More tabs"+ icon={DotsThreeIcon}+ class="size-10"+ iconClass="size-6 [&_svg]:size-6"+ />+ <MobileDrawer.Portal>+ <MobileDrawer.Overlay />+ <MobileDrawer.Content aria-label="More tabs">+ <MobileDrawer.Handle />+ <MobileDrawer.ScrollBody>+ <div class="mx-3 flex flex-col gap-1 px-1">+ <For each={overflowItems()}>+ {(item) => (+ <MobileDrawer.Close+ as={MobileDrawer.Item}+ // Let text tabs name themselves instead of Close's default label.+ aria-label={item.ariaLabel ?? ''}+ aria-pressed={props.value === item.value}+ class={+ props.value === item.value+ ? 'text-accent'+ : undefined+ }+ onClick={() => {+ hapticImpact('light');+ props.onChange(item.value);+ }}+ >+ {item.label}+ </MobileDrawer.Close>+ )}+ </For>+ <div class="-mx-1 h-px shrink-0 bg-edge" />+ <MobileDrawer.Close+ aria-label="Tabs"+ class="flex h-9 shrink-0 items-center px-3 text-sm font-medium text-ink-muted"+ onClick={() => hapticImpact('light')}+ >+ Tabs+ </MobileDrawer.Close>+ </div>+ </MobileDrawer.ScrollBody>+ </MobileDrawer.Content>+ </MobileDrawer.Portal>+ </MobileDrawer></MobileDockIsland></Show><divdiff --git a/apps/web/src/components/app/mobile/glassPress.test.ts b/apps/web/src/components/app/mobile/glassPress.test.tsnew file mode 100644index 0000000000..fe4388c017--- /dev/null+++ b/apps/web/src/components/app/mobile/glassPress.test.ts@@ -0,0 +1,165 @@+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';++vi.mock('@core/mobile/isTouchDevice', () => ({ isTouchDevice: () => true }));++import { glassPressGeometry, installGlassPress } from './glassPress';++let dispose: () => void;+function pointer(element: Element, type: string, x = 20, y = 20) {+ const event = new MouseEvent(type, {+ bubbles: true,+ button: 0,+ clientX: x,+ clientY: y,+ });+ Object.defineProperties(event, {+ pointerId: { value: 1 },+ isPrimary: { value: true },+ pointerType: { value: 'touch' },+ });+ element.dispatchEvent(event);+}+function surface(width = 300, height = 46) {+ const group = document.createElement('div');+ group.dataset.mobileDockIsland = '';+ group.innerHTML =+ '<button><span>First</span></button><button>Second</button>';+ Object.defineProperties(group, {+ offsetWidth: { value: width },+ offsetHeight: { value: height },+ });+ group.getBoundingClientRect = () => new DOMRect(0, 0, width, height);+ document.body.append(group);+ return group;+}+beforeEach(() => {+ vi.useFakeTimers();+ dispose = installGlassPress();+});+afterEach(() => {+ dispose();+ document.body.replaceChildren();+ vi.restoreAllMocks();+ vi.useRealTimers();+});++describe('mobile glass surface press', () => {+ it('keeps round growth at 20% and caps wide displacement independently of width', () => {+ expect(glassPressGeometry(46, 46).round).toBe(true);+ expect(glassPressGeometry(46, 46).scale).toBeCloseTo(1.2);+ expect(glassPressGeometry(300, 46).outset).toBe(3);+ expect(glassPressGeometry(600, 46).outset).toBe(3);+ expect(glassPressGeometry(600, 80).outset).toBe(3);+ });+ it('owns the press and tap-centered highlight on the outer dock', () => {+ const group = surface();+ const button = group.querySelector('button')!;+ pointer(button.querySelector('span')!, 'pointerdown');+ expect(group.dataset.glassPress).toBe('wide');+ expect(button.hasAttribute('data-glass-press')).toBe(false);+ expect(group.style.getPropertyValue('--press-x')).toBe('20px');+ expect(group.style.getPropertyValue('--press-y')).toBe('20px');+ expect(group.children).toHaveLength(2);+ });+ it.each(['glass', 'island', 'touch:island'])(+ 'animates standalone %s buttons without per-control setup',+ (className) => {+ const button = document.createElement('button');+ button.className = className;+ button.innerHTML = '<span>Open filters</span>';+ Object.defineProperties(button, {+ offsetWidth: { value: 40 },+ offsetHeight: { value: 40 },+ });+ button.getBoundingClientRect = () => new DOMRect(0, 0, 40, 40);+ document.body.append(button);++ pointer(button.querySelector('span')!, 'pointerdown');++ expect(button.dataset.glassPress).toBe('round');+ expect(button.children).toHaveLength(1);++ pointer(button, 'pointerup');+ expect(button.hasAttribute('data-glass-press')).toBe(false);+ expect(vi.getTimerCount()).toBe(0);+ }+ );+ it('places the highlight in local coordinates on a translated, scaled surface', () => {+ const group = surface(46, 46);+ group.getBoundingClientRect = () => new DOMRect(100, 200, 59.8, 59.8);+ pointer(group.querySelector('button')!, 'pointerdown', 129.9, 229.9);+ expect(parseFloat(group.style.getPropertyValue('--press-x'))).toBeCloseTo(+ 23+ );+ expect(parseFloat(group.style.getPropertyValue('--press-y'))).toBeCloseTo(+ 23+ );+ });+ it('ignores disabled controls inside an otherwise enabled group', () => {+ const group = surface();+ const button = group.querySelector('button')!;+ button.disabled = true;+ pointer(button, 'pointerdown');+ expect(group.hasAttribute('data-glass-press')).toBe(false);+ });+ it.each(['pointerup', 'pointercancel', 'pointermove'])(+ 'releases on %s without scheduling cleanup',+ (event) => {+ const group = surface();+ const button = group.querySelector('button')!;+ pointer(button, 'pointerdown');+ pointer(button, event, event === 'pointermove' ? 400 : 20);+ expect(group.hasAttribute('data-glass-press')).toBe(false);+ expect(group.style.getPropertyValue('--press-fill')).toBe('');+ // The last position stays available to CSS while the sheen fades.+ expect(group.style.getPropertyValue('--press-x')).toBe('20px');+ expect(vi.getTimerCount()).toBe(0);+ }+ );+ it('keeps a rapid second press alive and disposes the active press', () => {+ const group = surface();+ const button = group.querySelector('button')!;+ pointer(button, 'pointerdown');+ pointer(button, 'pointerup');+ vi.advanceTimersByTime(100);+ pointer(button, 'pointerdown', 120);+ vi.advanceTimersByTime(1000);+ expect(group.dataset.glassPress).toBe('wide');+ expect(group.style.getPropertyValue('--press-x')).toBe('120px');+ expect(vi.getTimerCount()).toBe(0);+ dispose();+ expect(group.hasAttribute('data-glass-press')).toBe(false);+ pointer(button, 'pointerdown');+ expect(group.hasAttribute('data-glass-press')).toBe(false);+ });+ it('does not strand a released surface when the next press has no layout', () => {+ const group = surface();+ const button = group.querySelector('button')!;+ pointer(button, 'pointerdown');+ pointer(button, 'pointerup');+ group.getBoundingClientRect = () => new DOMRect();+ pointer(button, 'pointerdown');+ expect(group.hasAttribute('data-glass-press')).toBe(false);+ expect(vi.getTimerCount()).toBe(0);+ });+ it('never snapshots styles or takes ownership of reactive children', () => {+ const group = surface();+ const button = group.querySelector('button')!;+ const originalContent = group.innerHTML;+ const getStyle = vi.spyOn(window, 'getComputedStyle');+ pointer(button, 'pointerdown');+ expect(group.innerHTML).toBe(originalContent);+ button.replaceChildren();+ pointer(button, 'pointerup');+ pointer(button, 'pointerdown');+ expect(button.childNodes).toHaveLength(0);+ expect(group.children).toHaveLength(2);+ expect(getStyle).not.toHaveBeenCalled();+ });+ it('releases on window blur', () => {+ const group = surface();+ pointer(group.querySelector('button')!, 'pointerdown');+ window.dispatchEvent(new Event('blur'));+ expect(group.hasAttribute('data-glass-press')).toBe(false);+ });+});diff --git a/apps/web/src/components/app/mobile/glassPress.ts b/apps/web/src/components/app/mobile/glassPress.tsnew file mode 100644index 0000000000..9b8a6c3471--- /dev/null+++ b/apps/web/src/components/app/mobile/glassPress.ts@@ -0,0 +1,97 @@+import { isTouchDevice } from '@core/mobile/isTouchDevice';++const GROUP =+ '[data-mobile-dock-island], [data-header-island], [data-slot="button-group"].glass';+const CONTROL =+ 'button, a, [role="button"], [role="tab"], [data-header-island]';+const DISABLED = ':disabled, [data-disabled], [aria-disabled="true"]';++/** Round controls retain their 20% press; wide surfaces grow at most 3px per edge. */+export function glassPressGeometry(width: number, height: number) {+ const outset = Math.min(3, width * 0.15, height * 0.15);+ return {+ outset,+ round: width <= height * 1.15,+ scale: 1.2,+ };+}++/**+ * Automatically animate glass/island controls and their enclosing groups,+ * including controls rendered through portals. CSS owns the persistent paint+ * layers and their release transitions; controls own action timing.+ */+export function installGlassPress() {+ let pressed:+ | { element: HTMLElement; pointerId: number; bounds: DOMRect }+ | undefined;+ const release = () => {+ if (!pressed) return;+ pressed.element.removeAttribute('data-glass-press');+ // Keep the last tap geometry for the fading shimmer. These values belong+ // to the element, so removing it needs no timer or retained reference.+ pressed = undefined;+ };+ const down = (event: PointerEvent) => {+ if (!isTouchDevice() || !event.isPrimary || event.button !== 0) return;+ if (!(event.target instanceof Element)) return;+ const control = event.target.closest<HTMLElement>(CONTROL);+ if (!control || control.closest(DISABLED)) return;+ const group = control.closest<HTMLElement>(GROUP);+ if (!group && !control.matches('.glass, .island, [class~="touch:island"]'))+ return;+ release();+ const element = group ?? control;+ const bounds = element.getBoundingClientRect();+ if (!bounds.width || !bounds.height) return;+ const width = element.offsetWidth;+ const height = element.offsetHeight;+ if (!width || !height) return;+ const geometry = glassPressGeometry(width, height);+ element.style.setProperty('--press-outset', `${geometry.outset}px`);+ element.style.setProperty('--press-scale', String(geometry.scale));+ // Convert the tap into local coordinates, including a partially scaled+ // round control when a second press interrupts its release.+ element.style.setProperty(+ '--press-x',+ `${Math.max(0, Math.min(width, ((event.clientX - bounds.left) * width) / bounds.width))}px`+ );+ element.style.setProperty(+ '--press-y',+ `${Math.max(0, Math.min(height, ((event.clientY - bounds.top) * height) / bounds.height))}px`+ );+ element.style.setProperty(+ '--press-shimmer-size',+ `${Math.max(100, Math.min(260, height * 3))}px`+ );+ element.setAttribute('data-glass-press', geometry.round ? 'round' : 'wide');+ pressed = { element, pointerId: event.pointerId, bounds };+ };+ const up = (event: PointerEvent) => {+ if (event.pointerId === pressed?.pointerId) release();+ };+ const move = (event: PointerEvent) => {+ if (event.pointerId !== pressed?.pointerId || !pressed) return;+ const { bounds } = pressed;+ if (+ event.clientX < bounds.left ||+ event.clientX > bounds.right ||+ event.clientY < bounds.top ||+ event.clientY > bounds.bottom+ )+ release();+ };+ document.addEventListener('pointerdown', down, true);+ document.addEventListener('pointerup', up, true);+ document.addEventListener('pointercancel', up, true);+ document.addEventListener('pointermove', move, true);+ window.addEventListener('blur', release);+ return () => {+ release();+ document.removeEventListener('pointerdown', down, true);+ document.removeEventListener('pointerup', up, true);+ document.removeEventListener('pointercancel', up, true);+ document.removeEventListener('pointermove', move, true);+ window.removeEventListener('blur', release);+ };+}diff --git a/apps/web/src/components/app/mobile/mobile-dock-views.ts b/apps/web/src/components/app/mobile/mobile-dock-views.tsindex b2656be0e2..e599b46b07 100644--- a/apps/web/src/components/app/mobile/mobile-dock-views.ts+++ b/apps/web/src/components/app/mobile/mobile-dock-views.ts@@ -1,4 +1,7 @@import { useCalendarUiFlag } from '@app/features/calendar/hooks/use-calendar-ui-flag';+import { useFeatureFlag } from '@app/lib/analytics/posthog';+import { enableCrm } from '@core/constant/featureFlags';+import CompanyIcon from '@icon/wide-company.svg';import BellIcon from '@phosphor/bell.svg';import CalendarIcon from '@phosphor/calendar-blank.svg';import ChatsIcon from '@phosphor/chats-circle.svg';@@ -13,17 +16,17 @@ import ChatsFillIcon from '@phosphor-fill/chats-circle-fill.svg';import EmailFillIcon from '@phosphor-fill/envelope-fill.svg';import FilesFillIcon from '@phosphor-fill/folder-simple-fill.svg';import { createMemo } from 'solid-js';-import type { MobileTouchIconComponent } from './MobileTouchMenu';+import type { MobileDockIcon } from './MobileDockButton';import type { MobileNavViewId } from './mobile-nav-views';export type MobileDockView = {id: Exclude<MobileNavViewId, 'search' | 'settings'>;label: string;/** Same Phosphor glyph as the desktop sidebar. */- icon: MobileTouchIconComponent;- iconActive?: MobileTouchIconComponent;+ icon: MobileDockIcon;+ iconActive?: MobileDockIcon;/** When set, the scope pill renders icon-only with this icon. */- pillIcon?: MobileTouchIconComponent;+ pillIcon?: MobileDockIcon;};/**@@ -67,13 +70,15 @@ const MOBILE_DOCK_VIEWS: readonly MobileDockView[] = [{ id: 'agents', label: 'Agents', icon: AgentsIcon },{ id: 'tasks', label: 'Tasks', icon: TasksIcon },{ id: 'calls', label: 'Calls', icon: CallsIcon },+ { id: 'companies', label: 'CRM', icon: CompanyIcon },];export function useMobileDockViews() {const calendarEnabled = useCalendarUiFlag();+ const crm = useFeatureFlag(enableCrm);return createMemo(() =>MOBILE_DOCK_VIEWS.filter((view) => view.id !== 'calendar' || calendarEnabled()- )+ ).filter((view) => view.id !== 'companies' || crm().enabled));}diff --git a/apps/web/src/components/app/mobile/mobile-nav-views.ts b/apps/web/src/components/app/mobile/mobile-nav-views.tsindex f3bd8f19aa..055bd9a8a9 100644--- a/apps/web/src/components/app/mobile/mobile-nav-views.ts+++ b/apps/web/src/components/app/mobile/mobile-nav-views.ts@@ -14,6 +14,7 @@ export const MOBILE_NAV_VIEW_IDS = ['agents','tasks','calls',+ 'companies','settings',] as const;diff --git a/apps/web/src/components/app/mobile/mobile-page-create-action.ts b/apps/web/src/components/app/mobile/mobile-page-create-action.tsindex 3cc2012a5e..2a516d24e4 100644--- a/apps/web/src/components/app/mobile/mobile-page-create-action.ts+++ b/apps/web/src/components/app/mobile/mobile-page-create-action.ts@@ -12,18 +12,12 @@ const PAGE_CREATE_TOKENS: Partial<Record<MobileNavViewId, HotkeyToken>> = {};/** Resolve from the available launcher entries so feature gates apply here too. */-export function mobilePageCreateAction(+export function mobilePageCreateBlock(view: MobileNavViewId | undefined,blocks: readonly CreatableBlock[]) {const token = view ? PAGE_CREATE_TOKENS[view] : undefined;if (!token) return undefined;- const block = blocks.find((entry) => entry.hotkeyToken === token);- if (!block) return undefined;-- return {- label: `New ${block.label.toLowerCase()}`,- run: block.keyDownHandler,- };+ return blocks.find((entry) => entry.hotkeyToken === token);}diff --git a/apps/web/src/components/app/mobile/pressPulse.ts b/apps/web/src/components/app/mobile/pressPulse.tsdeleted file mode 100644index e7bbf51339..0000000000--- a/apps/web/src/components/app/mobile/pressPulse.ts+++ /dev/null@@ -1,24 +0,0 @@-declare module 'solid-js' {- namespace JSX {- interface Directives {- pressPulse: true;- }- }-}--/**- * Press feedback for floating mobile chrome buttons (`[data-press-pulse]`- * in index.css): pointer-down eases the button to its on-state and holds- * it; release bounces it back. Marks the element and manages- * `data-pressed`. Fire the button's action from `onClick` (release), not- * pointer-down.- */-export function pressPulse(el: HTMLElement) {- el.setAttribute('data-press-pulse', '');- const press = () => el.setAttribute('data-pressed', '');- const release = () => el.removeAttribute('data-pressed');- el.addEventListener('pointerdown', press);- el.addEventListener('pointerup', release);- el.addEventListener('pointercancel', release);- el.addEventListener('pointerleave', release);-}diff --git a/apps/web/src/components/app/sidebar-next/search-bar-button.test.tsx b/apps/web/src/components/app/sidebar-next/search-bar-button.test.tsxnew file mode 100644index 0000000000..fe780082f7--- /dev/null+++ b/apps/web/src/components/app/sidebar-next/search-bar-button.test.tsx@@ -0,0 +1,137 @@+import {+ cleanup,+ fireEvent,+ render,+ screen,+ waitFor,+} from '@solidjs/testing-library';+import type { ParentProps } from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { SearchRailButton } from './search-bar-button';++const mocks = vi.hoisted(() => ({+ activeView: 'home',+ navigate: vi.fn(() => ({ id: 'destination' })),+ focus: vi.fn(),+ returnFocus: vi.fn(),+ command: vi.fn(),+}));++vi.mock('@app/features/command', () => ({+ CommandState: { open: mocks.command },+}));+vi.mock('@app/lib/analytics/analytics-context', () => ({+ useAnalytics: () => ({ track: vi.fn() }),+}));+vi.mock('@app/features/next-soup/soup-view/search-controllers', () => ({+ requestSearchFocus: mocks.focus,+}));+vi.mock('@app/signal/splitLayout', () => ({+ globalSplitManager: () => ({+ activeSplit: () => ({+ id: 'active',+ content: () => ({ type: 'component', id: mocks.activeView }),+ }),+ returnFocus: mocks.returnFocus,+ }),+}));+vi.mock('@components/app/app-sidebar/sidebar', () => ({+ navigateToSidebarView: mocks.navigate,+}));+vi.mock('@components/app/split-layout/layout', () => ({+ useSplitLayout: () => ({ openWithSplit: vi.fn() }),+}));+vi.mock('@core/mobile/isMobile', () => ({ isMobile: () => false }));+vi.mock('@ui/components/Hotkey', () => ({ Hotkey: () => null }));+vi.mock('@ui/components/Tooltip', () => ({+ Tooltip: (props: ParentProps) => props.children,+}));+vi.mock('@ui', async () => ({+ ...(await import('@ui/utils/classname')),+ ...(await import('@ui/utils/menuKeyboardNavigation')),+ ...(await import('@ui/components/Layer')),+ ...(await import('@ui/components/Dropdown')),+}));++let menuStyles: HTMLStyleElement;+beforeEach(() => {+ mocks.activeView = 'home';+ vi.clearAllMocks();+ // jsdom omits the motion defaults used by Kobalte's presence tracking.+ menuStyles = document.createElement('style');+ menuStyles.textContent =+ '[role="menu"] { animation-name: none; transition-duration: 0s; }';+ document.head.append(menuStyles);+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+ vi.stubGlobal('PointerEvent', MouseEvent);+ vi.stubGlobal('scrollTo', vi.fn());+});++afterEach(() => {+ cleanup();+ menuStyles.remove();+ vi.unstubAllGlobals();+});++async function openMenu() {+ render(() => <SearchRailButton />);+ const trigger = screen.getByRole('button', { name: 'Search' });+ fireEvent.keyDown(trigger, { key: 'Enter' });+ return screen.findByRole('menuitem', { name: 'Search everything' });+}++describe.each(['home', 'search'])('search menu from %s', (activeView) => {+ it.each([+ ['pointer', false],+ ['pointer', true],+ ['keyboard', false],+ ['keyboard', true],+ ] as const)(+ 'honors %s selection with Shift=%s after dismissal',+ async (input, shiftKey) => {+ mocks.activeView = activeView;+ const item = await openMenu();+ if (input === 'pointer') {+ fireEvent.pointerUp(item, { button: 0, shiftKey });+ } else {+ fireEvent.keyDown(item, { key: 'Enter', shiftKey });+ }+ expect(mocks.focus).not.toHaveBeenCalled();+ await waitFor(() => expect(mocks.focus).toHaveBeenCalledTimes(1));+ expect(screen.queryByRole('menu')).toBeNull();+ if (activeView === 'search' && !shiftKey) {+ expect(mocks.navigate).not.toHaveBeenCalled();+ expect(mocks.focus).toHaveBeenCalledWith('active');+ } else {+ expect(mocks.navigate).toHaveBeenCalledExactlyOnceWith(+ expect.objectContaining({ viewId: 'search', shiftKey })+ );+ expect(mocks.focus).toHaveBeenCalledWith('destination');+ }+ }+ );+});++it('dismisses without navigating and still opens the command menu', async () => {+ await openMenu();+ fireEvent.keyDown(document, { key: 'Escape' });+ await waitFor(() => expect(screen.queryByRole('menu')).toBeNull());+ expect(mocks.navigate).not.toHaveBeenCalled();+ expect(mocks.focus).not.toHaveBeenCalled();+ fireEvent.keyDown(screen.getByRole('button', { name: 'Search' }), {+ key: 'Enter',+ });+ fireEvent.keyDown(+ await screen.findByRole('menuitem', { name: /Command Menu/ }),+ { key: 'Enter', shiftKey: true }+ );+ await waitFor(() => expect(mocks.command).toHaveBeenCalledTimes(1));+ expect(mocks.navigate).not.toHaveBeenCalled();+});diff --git a/apps/web/src/components/app/sidebar-next/search-bar-button.tsx b/apps/web/src/components/app/sidebar-next/search-bar-button.tsxindex 9ab52db664..6458c2fadd 100644--- a/apps/web/src/components/app/sidebar-next/search-bar-button.tsx+++ b/apps/web/src/components/app/sidebar-next/search-bar-button.tsx@@ -4,32 +4,25 @@ import { globalSplitManager } from '@app/signal/splitLayout';import { navigateToSidebarView } from '@components/app/app-sidebar/sidebar';import { useSplitLayout } from '@components/app/split-layout/layout';import { TOKENS } from '@core/hotkey/tokens';-import MagnifyingGlassIcon from '@phosphor/magnifying-glass.svg';-import { Button } from '@ui';+import { SidebarSearchMenu } from '../app-sidebar/sidebar-search-menu';-/**- * The rail's search button: the magnifier alone, its label in the tooltip.- *- * An `@ui` Button on the same geometry as the create CTA beside it — same size,- * rounding and lift — so the pair reads as one row of actions and either can be- * restyled through `variant` and `class` alone.- *- * Takes the active split to the search view and focuses its input — the same- * behaviour as the old sidebar's magnifier (`SidebarHeaderSearchButton`), not- * the command menu. Already on search, it just refocuses the input rather than- * pushing a second entry.- */+/** Search and command-menu discovery in the compact rail. */export const SearchRailButton = () => {const analytics = useAnalytics();const layout = useSplitLayout();- const openSearch = (event: MouseEvent) => {+ const openSearch = (newSplit: boolean) => {analytics.track('sidebar_click', { view: 'search' });let split = globalSplitManager()?.activeSplit();const content = split?.content();- if (split && content?.type === 'component' && content.id === 'search') {+ if (+ !newSplit &&+ split &&+ content?.type === 'component' &&+ content.id === 'search'+ ) {requestSearchFocus(split.id);globalSplitManager()?.returnFocus();return;@@ -37,7 +30,7 @@ export const SearchRailButton = () => {split = navigateToSidebarView({viewId: 'search',- shiftKey: event.shiftKey,+ shiftKey: newSplit,activeSplit: split,openWithSplit: layout.openWithSplit,referredFrom: 'sidebar',@@ -47,17 +40,16 @@ export const SearchRailButton = () => {};return (- <Button- size="icon-md"- variant="ghost"- // class="rounded-full shadow-md shadow-drop-shadow bg-surface-2"- label="Search"- tooltipPlacement="right"- hotkey={TOKENS.sidebar.goTo.search}- data-sidebar-next-search=""- onClick={openSearch}- >- <MagnifyingGlassIcon class="size-5" />- </Button>+ <SidebarSearchMenu+ onSearch={openSearch}+ triggerProps={{+ size: 'icon-md',+ variant: 'ghost',+ tooltipPlacement: 'right',+ hotkey: TOKENS.sidebar.goTo.search,+ 'data-sidebar-next-search': '',+ class: '[&_svg]:size-5',+ }}+ />);};diff --git a/apps/web/src/components/app/split-layout/components/PopoverSplitRenderer.tsx b/apps/web/src/components/app/split-layout/components/PopoverSplitRenderer.tsxindex b0bfe2e4d4..71d2e903b8 100644--- a/apps/web/src/components/app/split-layout/components/PopoverSplitRenderer.tsx+++ b/apps/web/src/components/app/split-layout/components/PopoverSplitRenderer.tsx@@ -194,10 +194,9 @@ function PopoverSplitModal(props: {onOpenChange={onOpenChange}><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay" />+ <MobileDrawer.Overlay /><MobileDrawer.Contentref={attachPanel}- class="bg-dialog"aria-label={displayName()}maxHeight={92}>diff --git a/apps/web/src/components/app/split-layout/components/SplitFileMenu.tsx b/apps/web/src/components/app/split-layout/components/SplitFileMenu.tsxindex 3f845287c9..20763774e2 100644--- a/apps/web/src/components/app/split-layout/components/SplitFileMenu.tsx+++ b/apps/web/src/components/app/split-layout/components/SplitFileMenu.tsx@@ -223,28 +223,22 @@ function MobileRender(<Showwhen={children().length > 0}fallback={- <button+ <MobileDrawer.Itemtype="button"- class={cn(- 'w-full bg-surface flex items-center gap-3 py-3 text-sm hover:bg-hover hover-transition-bg text-left not-last:mb-px text-ink',- nested ? 'pl-9 pr-4' : 'px-4'- )}+ class={cn(nested ? 'pl-9 pr-4' : 'px-4')}onClick={(e) => {action.action?.(e);props.onOpenChange(false);}}><SplitMenuItemContent {...action} showHotkey={false} />- </button>+ </MobileDrawer.Item>}>- <div class="w-full bg-surface">- <button+ <div class="w-full">+ <MobileDrawer.Itemtype="button"- class={cn(- 'w-full flex items-center gap-3 py-3 text-sm hover:bg-hover hover-transition-bg text-left text-ink',- nested ? 'pl-9 pr-4' : 'px-4'- )}+ class={cn(nested ? 'pl-9 pr-4' : 'px-4')}onClick={() => {setExpandedSubmenu(expanded() ? undefined : action);}}@@ -254,9 +248,9 @@ function MobileRender(component={expanded() ? CaretDown : CaretRight}class="size-3.5 shrink-0"/>- </button>+ </MobileDrawer.Item><Show when={expanded()}>- <div class="border-t border-edge-muted/60">+ <div class="pt-1"><For each={children()}>{(child) => item(child, true)}</For></div></Show>@@ -274,7 +268,7 @@ function MobileRender(preventScrollbarShift={false}><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Overlay /><MobileDrawer.Content aria-label="File actions"><MobileDrawer.Handle /><MobileDrawer.ScrollBody>@@ -291,11 +285,10 @@ function MobileRender(><For each={views().options}>{(option) => (- <button+ <MobileDrawer.Itemtype="button"role="radio"aria-checked={views().value === option.value}- class="w-full bg-surface flex items-center gap-3 py-3 px-4 text-sm hover:bg-hover hover-transition-bg text-left not-last:mb-px text-ink"onClick={() => {views().onSelect(option.value);props.onOpenChange(false);@@ -309,7 +302,7 @@ function MobileRender(<Show when={views().value === option.value}><Check class="size-3.5 text-accent shrink-0" /></Show>- </button>+ </MobileDrawer.Item>)}</For></MobileDrawer.Section>diff --git a/apps/web/src/components/app/split-layout/components/SplitPanel.tsx b/apps/web/src/components/app/split-layout/components/SplitPanel.tsxindex d5ad6a0b96..a1d9550ca9 100644--- a/apps/web/src/components/app/split-layout/components/SplitPanel.tsx+++ b/apps/web/src/components/app/split-layout/components/SplitPanel.tsx@@ -4,6 +4,7 @@ import { SoupContextProvider } from '@app/features/next-soup/soup-context';import { SoupViewContextProvider } from '@app/features/next-soup/soup-view/soup-view-context';import { globalSplitManager } from '@app/signal/splitLayout';import { MobileTopEdgeFade } from '@components/app/mobile/MobileEdgeFade';+import { MobilePageActionRow } from '@components/app/mobile/MobilePageActionRow';import { SplitPanelControllerProvider } from '@components/app/split-panel';import { isSoloSettings } from '@core/constant/SettingsState';import { BlockOpenTrackingDelayContext } from '@core/context/blockOpenTracking';@@ -387,6 +388,11 @@ export function SplitPanel(props: SplitPanelProps) {</Show></Panel.Body></Panel>+ <Show when={isTouchDevice()}>+ <Suspense>+ <MobilePageActionRow />+ </Suspense>+ </Show></div></SplitDrawerGroup></SplitPanelContext.Provider>diff --git a/apps/web/src/components/ui/components/Button.tsx b/apps/web/src/components/ui/components/Button.tsxindex 99b234535e..b2413ff322 100644--- a/apps/web/src/components/ui/components/Button.tsx+++ b/apps/web/src/components/ui/components/Button.tsx@@ -15,8 +15,9 @@ import { Tooltip } from './Tooltip';const BUTTON_TOUCH_STYLES ="touch:min-h-9 touch:min-w-9 touch:[&>svg:not([class*='size-'])]:size-6";-// Hover/press feedback is painted as a translucent scrim *on top of* each-// variant's base background-color (via the `overlay-*` background-image utility)+// Touch controls use the enclosing glass shimmer; desktop hover/press feedback+// is painted as a translucent scrim over the variant's base background-color+// (via the `overlay-*` background-image utility)// rather than replacing/thinning the base color, so buttons keep their full// color on hover. The `cta`/`contrast` variants use a surface scrim so their// solid backgrounds lighten toward the text color instead of washing out.@@ -31,17 +32,18 @@ export const buttonVariants = createVariants({variant: {danger:- 'bg-failure-bg text-failure dark:bg-failure-bg not-disabled:hover:bg-failure/25 not-disabled:active:bg-failure/30',+ 'bg-failure-bg text-failure dark:bg-failure-bg not-touch:not-disabled:hover:bg-failure/25 not-touch:not-disabled:active:bg-failure/30',outline:- 'bg-surface/70 text-ink-muted border-edge-muted not-disabled:hover:overlay-hover not-disabled:hover:text-ink not-disabled:active:overlay-active',- accent: 'bg-accent-bg not-disabled:hover:overlay-accent-bg text-accent',+ 'bg-surface/70 text-ink-muted border-edge-muted not-touch:not-disabled:hover:overlay-hover not-touch:not-disabled:hover:text-ink not-touch:not-disabled:active:overlay-active',+ accent:+ 'bg-accent-bg not-touch:not-disabled:hover:overlay-accent-bg text-accent',success:- 'bg-success-bg not-disabled:hover:overlay-success-bg text-success',+ 'bg-success-bg not-touch:not-disabled:hover:overlay-success-bg text-success',ghost:- 'bg-transparent text-ink-muted not-disabled:hover:overlay-hover not-disabled:hover:text-ink not-disabled:active:overlay-active',+ 'bg-transparent text-ink-muted not-touch:not-disabled:hover:overlay-hover not-touch:not-disabled:hover:text-ink not-touch:not-disabled:active:overlay-active',strong:- 'bg-ink text-surface-4 focus-visible:ring-surface-4/70 not-disabled:hover:overlay-[color-mix(in_oklch,var(--color-surface-4)_12%,transparent)] not-disabled:active:overlay-[color-mix(in_oklch,var(--color-surface-4)_22%,transparent)]',- cta: 'bg-accent text-accent-contrast focus-visible:ring-accent-contrast/70 [--color-edge:var(--color-accent-contrast-muted)] [--color-edge-muted:var(--color-accent-contrast-muted)] not-disabled:hover:overlay-[color-mix(in_oklch,var(--color-surface)_12%,transparent)] not-disabled:active:overlay-[color-mix(in_oklch,var(--color-surface)_22%,transparent)]',+ 'bg-ink text-surface-4 focus-visible:ring-surface-4/70 not-touch:not-disabled:hover:overlay-[color-mix(in_oklch,var(--color-surface-4)_12%,transparent)] not-touch:not-disabled:active:overlay-[color-mix(in_oklch,var(--color-surface-4)_22%,transparent)]',+ cta: 'bg-accent text-accent-contrast focus-visible:ring-accent-contrast/70 [--color-edge:var(--color-accent-contrast-muted)] [--color-edge-muted:var(--color-accent-contrast-muted)] not-touch:not-disabled:hover:overlay-[color-mix(in_oklch,var(--color-surface)_12%,transparent)] not-touch:not-disabled:active:overlay-[color-mix(in_oklch,var(--color-surface)_22%,transparent)]',},size: {xs: "h-5 gap-1 px-1 text-xs [&>svg:not([class*='size-'])]:size-3",diff --git a/apps/web/src/components/ui/components/ButtonGroup.tsx b/apps/web/src/components/ui/components/ButtonGroup.tsxindex 616a2322d6..ee3fb77d4b 100644--- a/apps/web/src/components/ui/components/ButtonGroup.tsx+++ b/apps/web/src/components/ui/components/ButtonGroup.tsx@@ -45,7 +45,7 @@ const glassClass = (variant: ButtonVariant): string => {/** Canonical classes for the button-group frame. */export const buttonGroupVariants = createVariants(cn(- 'inline-flex items-center justify-center overflow-hidden',+ 'inline-flex items-center justify-center','data-[orientation=horizontal]:flex-row','data-[orientation=vertical]:flex-col',// strip per-button rounding + borders so the group owns the frame@@ -138,7 +138,10 @@ export const ButtonGroup = (props: ButtonGroupProps) => {)}role="group">- {props.children}+ {/* Clip the segments independently of the expanding glass frame. */}+ <div class="flex size-full min-w-0 items-center justify-center overflow-hidden rounded-[inherit] [flex-direction:inherit]">+ {props.children}+ </div></div></Layer></ButtonGroupContext.Provider>diff --git a/apps/web/src/components/ui/components/Calendar.tsx b/apps/web/src/components/ui/components/Calendar.tsxindex 8068024fc1..4a39b401a0 100644--- a/apps/web/src/components/ui/components/Calendar.tsx+++ b/apps/web/src/components/ui/components/Calendar.tsx@@ -388,7 +388,7 @@ export function CalendarMonthMenu(props: CalendarMonthMenuProps) {<divclass={cn('h-72 overflow-y-auto overscroll-contain',- props.presentation === 'radio-group' && 'rounded-2xl'+ props.presentation === 'radio-group' && 'rounded-[20px]')}style={{ contain: 'strict' }}>@@ -414,11 +414,12 @@ export function CalendarMonthMenu(props: CalendarMonthMenuProps) {aria-current={option.value === todayValue ? 'date' : undefined}data-month-index={index()}class={cn(- 'flex w-full items-center gap-1.5 text-left outline-none hover:bg-hover focus-visible:bg-hover',- selected() ? 'text-accent' : 'text-ink',+ 'flex w-full items-center gap-1.5 text-left outline-none',props.presentation === 'radio-group'- ? 'relative h-11 bg-surface px-4 text-sm'- : 'h-8 rounded-lg px-2 text-xs'+ ? 'relative h-11 rounded-[20px] px-3 text-sm text-ink transition-colors hover:bg-ink/6 active:bg-ink/10 aria-checked:bg-ink/8 focus-visible:outline-2 focus-visible:outline-accent'+ : 'h-8 rounded-lg px-2 text-xs hover:bg-hover focus-visible:bg-hover',+ props.presentation !== 'radio-group' &&+ (selected() ? 'text-accent' : 'text-ink'))}tabIndex={selected() ? 0 : -1}onClick={() => props.onChange(option.date)}@@ -436,17 +437,6 @@ export function CalendarMonthMenu(props: CalendarMonthMenuProps) {class="ml-auto size-3.5 text-accent"classList={{ invisible: !selected() }}/>- <Show- when={- props.presentation === 'radio-group' &&- index() < options().length - 1- }- >- <span- aria-hidden="true"- class="absolute inset-x-2 bottom-0 h-px bg-edge-muted"- />- </Show></button>);}}@@ -457,10 +447,10 @@ export function CalendarMonthMenu(props: CalendarMonthMenuProps) {<div class="flex pt-3"><ButtonfullWidth- variant="outline"+ variant="ghost"size="sm"depth={3}- class="rounded-full bg-surface px-3 text-ink shadow-menu"+ class="min-h-11 rounded-[20px] bg-ink/6 px-3 text-ink"label="Go To Today"onClick={() => {if (props.onToday) {diff --git a/apps/web/src/components/ui/components/ConfirmDialog.test.tsx b/apps/web/src/components/ui/components/ConfirmDialog.test.tsxnew file mode 100644index 0000000000..7ba8f90687--- /dev/null+++ b/apps/web/src/components/ui/components/ConfirmDialog.test.tsx@@ -0,0 +1,113 @@+import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';+import { createRoot, createSignal, getOwner, type ParentProps } from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { ConfirmDialog, confirmDialog } from './ConfirmDialog';+import { ImperativeDialogHost } from './ImperativeDialog';++const mobile = vi.hoisted(() => ({ value: true }));+vi.mock('@core/mobile/isMobile', () => ({ isMobile: () => mobile.value }));+vi.mock('@ui', () => ({+ cn: (...values: unknown[]) => values.filter(Boolean).join(' '),+ Layer: (props: ParentProps) => props.children,+}));++beforeEach(() => {+ mobile.value = true;+ vi.useFakeTimers();+ vi.stubGlobal('scrollTo', vi.fn());+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe = vi.fn();+ unobserve = vi.fn();+ disconnect = vi.fn();+ }+ );+});++afterEach(() => {+ cleanup();+ vi.useRealTimers();+ vi.unstubAllGlobals();+});++describe('controlled confirmation', () => {+ it('stays open while pending and can reopen after dismissal', () => {+ const [open, setOpen] = createSignal(true);+ const [pending, setPending] = createSignal(false);+ const onConfirm = vi.fn(() => setPending(true));+ render(() => (+ <ConfirmDialog+ title="Remove Member"+ body="Remove this member?"+ open={open()}+ onOpenChange={setOpen}+ pending={pending()}+ onConfirm={onConfirm}+ />+ ));++ fireEvent.click(screen.getByRole('button', { name: 'Confirm' }));+ expect(onConfirm).toHaveBeenCalledOnce();+ expect(open()).toBe(true);+ expect(screen.getByRole('dialog', { name: 'Remove Member' })).toBeTruthy();+ for (const name of ['Confirm', 'Cancel', 'Close confirmation']) {+ expect(+ screen.getByRole('button', { name }).hasAttribute('disabled')+ ).toBe(true);+ }++ setPending(false);+ fireEvent.click(screen.getByRole('button', { name: 'Cancel' }));+ expect(open()).toBe(false);+ setOpen(true);+ expect(screen.getByRole('dialog', { name: 'Remove Member' })).toBeTruthy();+ fireEvent.click(screen.getByRole('button', { name: 'Confirm' }));+ expect(onConfirm).toHaveBeenCalledTimes(2);+ });+});++describe('imperative confirmation', () => {+ it.each([+ ['Confirm', true],+ ['Cancel', false],+ ['Close confirmation', false],+ ] as const)(+ 'resolves %s after the mobile closing animation',+ async (name, choice) => {+ render(() => <ImperativeDialogHost />);+ const result = confirmDialog({ title: 'Start call?' });+ const resolved = vi.fn();+ const resolution = (async () => resolved(await result))();++ fireEvent.click(screen.getByRole('button', { name }));+ await vi.advanceTimersByTimeAsync(249);+ expect(resolved).not.toHaveBeenCalled();+ await vi.advanceTimersByTimeAsync(1);+ expect(await result).toBe(choice);+ await resolution;+ expect(resolved).toHaveBeenCalledOnce();+ }+ );++ it('resolves immediately on desktop', async () => {+ mobile.value = false;+ render(() => <ImperativeDialogHost />);+ const result = confirmDialog({ title: 'Start call?' });+ fireEvent.click(screen.getByRole('button', { name: 'Confirm' }));+ expect(await result).toBe(true);+ });++ it('cancels an unfinished confirmation when its owner is disposed', async () => {+ render(() => <ImperativeDialogHost />);+ const { dispose, result } = createRoot((dispose) => ({+ dispose,+ result: confirmDialog({ title: 'Start call?' }, { owner: getOwner() }),+ }));+ fireEvent.click(screen.getByRole('button', { name: 'Confirm' }));+ dispose();+ expect(await result).toBe(false);+ await vi.advanceTimersByTimeAsync(250);+ expect(screen.queryByRole('dialog')).toBeNull();+ });+});diff --git a/apps/web/src/components/ui/components/ConfirmDialog.tsx b/apps/web/src/components/ui/components/ConfirmDialog.tsxindex 9486d789a1..f0c88ea69c 100644--- a/apps/web/src/components/ui/components/ConfirmDialog.tsx+++ b/apps/web/src/components/ui/components/ConfirmDialog.tsx@@ -1,11 +1,10 @@import { ConfirmDrawer } from '@components/app/mobile/ConfirmDrawer';import { isMobile } from '@core/mobile/isMobile';-import type { JSX } from 'solid-js';+import { createSignal, type JSX, onCleanup, Show } from 'solid-js';import { cn } from '../utils/classname';import { Button } from './Button';import { Dialog, type DialogProps } from './Dialog';import {- type DialogHandle,type ManagedDialogProps,type OpenDialogOptions,openDialog,@@ -37,78 +36,111 @@ const TONE_VARIANT = {export type ConfirmDialogProps = ManagedDialogProps &ConfirmDialogDisplayProps & {onConfirm: () => void;+ pending?: boolean;};-/** Complete dialog used by `confirmDialog`. */+/** Controlled confirmation UI: a dialog on desktop, a drawer on mobile. */export function ConfirmDialog(props: ConfirmDialogProps) {return (- <Dialog- open={props.open}- onOpenChange={props.onOpenChange}- position={props.position}- class={cn('w-[90%] max-w-120', props.class)}- visibleScrim+ <Show+ when={isMobile()}+ fallback={+ <Dialog+ open={props.open}+ onOpenChange={(open) => !props.pending && props.onOpenChange(open)}+ position={props.position}+ class={cn('w-[90%] max-w-120', props.class)}+ visibleScrim+ >+ <Surface depth={2} class="rounded-xl text-ink">+ <div class="flex flex-col gap-1 px-5 py-4">+ <Dialog.Title class="text-base font-semibold">+ {props.title}+ </Dialog.Title>+ <Dialog.Description+ as="div"+ class="text-sm leading-5 text-ink-muted"+ >+ {props.body ?? props.children}+ </Dialog.Description>+ </div>+ <div class="flex items-center justify-end gap-2 px-5 py-3">+ <Button+ type="button"+ variant="ghost"+ depth={2}+ class="rounded-lg"+ disabled={props.pending}+ onClick={() => props.onOpenChange(false)}+ >+ {props.cancelLabel ?? 'Cancel'}+ </Button>+ <Button+ type="button"+ variant={TONE_VARIANT[props.tone ?? 'default']}+ depth={2}+ class="rounded-lg"+ disabled={props.pending}+ onClick={props.onConfirm}+ >+ {props.confirmLabel ?? 'Confirm'}+ </Button>+ </div>+ </Surface>+ </Dialog>+ }>- <Surface depth={2} class="rounded-xl text-ink">- <div class="flex flex-col gap-1 px-5 py-4">- <Dialog.Title class="text-base font-semibold">- {props.title}- </Dialog.Title>- <Dialog.Description as="div" class="text-sm leading-5 text-ink-muted">- {props.body ?? props.children}- </Dialog.Description>- </div>- <div class="flex items-center justify-end gap-2 px-5 py-3">- <Button- type="button"- variant="ghost"- depth={2}- class="rounded-lg"- onClick={() => props.onOpenChange(false)}- >- {props.cancelLabel ?? 'Cancel'}- </Button>- <Button- type="button"- variant={TONE_VARIANT[props.tone ?? 'default']}- depth={2}- class="rounded-lg"- onClick={props.onConfirm}- >- {props.confirmLabel ?? 'Confirm'}- </Button>- </div>- </Surface>- </Dialog>+ <ConfirmDrawer {...props} />+ </Show>);}-function resolveProps<P extends object>(source: PropsSource<P>): P {- return typeof source === 'function' ? source() : source;-}+/** Slide-out length; keep ≥ MobileDrawer's `duration-200` transition. */+const CLOSE_MS = 250;/*** Opens the shared confirmation UI and resolves with the user's choice —* this dialog on desktop, a bottom drawer (`ConfirmDrawer`) on mobile.*/-export function confirmDialog(+export async function confirmDialog(props: PropsSource<ConfirmDialogDisplayProps>,options?: OpenDialogOptions): Promise<boolean> {let confirmed = false;- let handle!: DialogHandle;- handle = openDialog(- isMobile() ? ConfirmDrawer : ConfirmDialog,- () => ({- ...resolveProps(props),- onConfirm: () => {- confirmed = true;- handle.close();- },- }),+ const handle = openDialog(+ (managedProps: ManagedDialogProps & ConfirmDialogDisplayProps) => {+ const [open, setOpen] = createSignal(true);+ let closeTimer: ReturnType<typeof setTimeout> | undefined;+ onCleanup(() => clearTimeout(closeTimer));++ const close = (choice: boolean) => {+ if (!open()) return;+ setOpen(false);+ const finalize = () => {+ confirmed = choice;+ managedProps.onOpenChange(false);+ };++ // The manager disposes immediately. Let the mobile drawer animate+ // closed before handing dismissal to it.+ if (isMobile()) closeTimer = setTimeout(finalize, CLOSE_MS);+ else finalize();+ };++ return (+ <ConfirmDialog+ {...managedProps}+ open={managedProps.open && open()}+ onOpenChange={(open) => !open && close(false)}+ onConfirm={() => close(true)}+ />+ );+ },+ props,options);- return handle.closed.then(() => confirmed);+ await handle.closed;+ return confirmed;}diff --git a/apps/web/src/components/ui/components/Dialog.test.tsx b/apps/web/src/components/ui/components/Dialog.test.tsxnew file mode 100644index 0000000000..791f70458d--- /dev/null+++ b/apps/web/src/components/ui/components/Dialog.test.tsx@@ -0,0 +1,214 @@+import {+ cleanup,+ fireEvent,+ render,+ screen,+ waitFor,+} from '@solidjs/testing-library';+import { createSignal } from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { Button } from './Button';+import { Dialog, type DialogProps } from './Dialog';++const mobile = vi.hoisted(() => ({ value: true }));+vi.mock('@core/mobile/isMobile', () => ({ isMobile: () => mobile.value }));+vi.mock('@core/mobile/virtualKeyboard', () => ({+ virtualKeyboardVisible: () => false,+}));++let motionStyles: HTMLStyleElement;+beforeEach(() => {+ mobile.value = true;+ motionStyles = document.createElement('style');+ // jsdom does not load the app CSS; give both primitives concrete motion defaults.+ motionStyles.textContent =+ '* { transition-duration: 0s; animation-name: none; }';+ document.head.append(motionStyles);+ vi.stubGlobal('scrollTo', vi.fn());+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+});+afterEach(() => {+ cleanup();+ motionStyles.remove();+ vi.unstubAllGlobals();+});++function setup(props: Partial<Omit<DialogProps, 'children' | 'open'>> = {}) {+ const [open, setOpen] = createSignal(false);+ const [disabled, setDisabled] = createSignal(false);+ render(() => (+ <>+ <button type="button" onClick={() => setOpen(true)}>+ Open editor+ </button>+ <button type="button">Return here</button>+ <Dialog open={open()} onOpenChange={setOpen} {...props}>+ <Dialog.Title as="h3" id="editor-title">+ Edit name+ </Dialog.Title>+ <Dialog.Description as="div" id="editor-description">+ Choose a display name.+ </Dialog.Description>+ <input aria-label="Name" />+ <Dialog.CloseButton+ as={Button}+ disabled={disabled()}+ aria-label="Close editor"+ >+ Close+ </Dialog.CloseButton>+ <Button onClick={() => setOpen(false)}>Cancel</Button>+ </Dialog>+ </>+ ));+ const trigger = screen.getByRole('button', { name: 'Open editor' });+ trigger.focus();+ fireEvent.click(trigger);+ return { open, setDisabled, trigger };+}++describe('responsive dialog', () => {+ it.each([+ { mobile: true, fullscreen: false, drawer: true },+ { mobile: false, fullscreen: false, drawer: false },+ { mobile: true, fullscreen: true, drawer: false },+ ])(+ 'preserves slots and refs with $mobile mobile and $fullscreen fullscreen',+ async (mode) => {+ mobile.value = mode.mobile;+ let content: HTMLDivElement | undefined;+ const { open, setDisabled } = setup({+ fullscreen: mode.fullscreen,+ contentRef: (element) => {+ content = element;+ },+ });+ const dialog = await screen.findByRole('dialog', { name: 'Edit name' });+ expect(content).toBe(dialog);+ expect(dialog.hasAttribute('data-corvu-drawer-content')).toBe(+ mode.drawer+ );+ expect(+ document.getElementById(dialog.getAttribute('aria-labelledby')!)+ ?.tagName+ ).toBe('H3');+ expect(+ document.getElementById(dialog.getAttribute('aria-describedby')!)+ ?.textContent+ ).toBe('Choose a display name.');+ if (mode.drawer) {+ expect(+ screen.queryByRole('button', { name: 'Close editor' })+ ).toBeNull();+ fireEvent.click(screen.getByRole('button', { name: 'Cancel' }));+ } else {+ const close = screen.getByRole('button', { name: 'Close editor' });+ setDisabled(true);+ close.click();+ expect(open()).toBe(true);+ setDisabled(false);+ fireEvent.click(close);+ }+ expect(open()).toBe(false);+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ }+ );++ it('focuses the first control and restores the opener on opening and reopening a drawer', async () => {+ const onOpenAutoFocus = vi.fn();+ const onCloseAutoFocus = vi.fn();+ const { trigger } = setup({ onOpenAutoFocus, onCloseAutoFocus });+ for (let attempt = 0; attempt < 2; attempt++) {+ if (attempt > 0) fireEvent.click(trigger);+ await waitFor(() =>+ expect(document.activeElement).toBe(+ screen.getByRole('textbox', { name: 'Name' })+ )+ );+ fireEvent.keyDown(document, { key: 'Escape' });+ await waitFor(() => expect(document.activeElement).toBe(trigger));+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ }+ expect(onOpenAutoFocus).toHaveBeenCalledTimes(2);+ expect(onCloseAutoFocus).toHaveBeenCalledTimes(2);+ });++ it('keeps accessible IDs linked when slot IDs change or use generated defaults', async () => {+ const [titleId, setTitleId] = createSignal<string>();+ const [descriptionId, setDescriptionId] = createSignal<string>();+ render(() => (+ <Dialog open>+ <Dialog.Title id={titleId()}>Details</Dialog.Title>+ <Dialog.Description id={descriptionId()}>+ Edit the details.+ </Dialog.Description>+ </Dialog>+ ));+ const dialog = await screen.findByRole('dialog', { name: 'Details' });+ for (const id of ['custom', undefined]) {+ setTitleId(id && `${id}-title`);+ setDescriptionId(id && `${id}-description`);+ expect(+ document.getElementById(dialog.getAttribute('aria-labelledby')!)+ ?.textContent+ ).toBe('Details');+ expect(+ document.getElementById(dialog.getAttribute('aria-describedby')!)+ ?.textContent+ ).toBe('Edit the details.');+ }+ });++ it('dismisses the drawer when its backdrop is tapped', async () => {+ const { open } = setup();+ await screen.findByRole('dialog');+ const overlay = document.querySelector('[data-corvu-drawer-overlay]')!;+ fireEvent.pointerDown(overlay, { button: 0 });+ fireEvent.pointerUp(overlay, { button: 0 });+ expect(open()).toBe(false);+ });++ it('honors cancellable autofocus callbacks', async () => {+ const onOpenAutoFocus = vi.fn((event: Event) => {+ event.preventDefault();+ screen.getByRole('button', { name: 'Cancel' }).focus();+ });+ const onCloseAutoFocus = vi.fn((event: Event) => {+ event.preventDefault();+ screen.getByRole('button', { name: 'Return here' }).focus();+ });+ setup({ onOpenAutoFocus, onCloseAutoFocus });+ const close = screen.getByRole('button', { name: 'Cancel' });+ await waitFor(() => expect(document.activeElement).toBe(close));+ fireEvent.click(close);+ await waitFor(() =>+ expect(document.activeElement).toBe(+ screen.getByRole('button', { name: 'Return here' })+ )+ );+ expect(onOpenAutoFocus).toHaveBeenCalledOnce();+ expect(onCloseAutoFocus).toHaveBeenCalledOnce();+ });++ it('honors a prevented Escape before dismissing on a later Escape', async () => {+ let prevent = true;+ const onEscapeKeyDown = vi.fn((event: KeyboardEvent) => {+ if (prevent) event.preventDefault();+ });+ const { open } = setup({ onEscapeKeyDown });+ await screen.findByRole('dialog');+ fireEvent.keyDown(document, { key: 'Escape' });+ expect(onEscapeKeyDown).toHaveBeenCalledOnce();+ expect(open()).toBe(true);+ prevent = false;+ fireEvent.keyDown(document, { key: 'Escape' });+ expect(open()).toBe(false);+ });+});diff --git a/apps/web/src/components/ui/components/Dialog.tsx b/apps/web/src/components/ui/components/Dialog.tsxindex a39fc3dcc9..4f0c27eb70 100644--- a/apps/web/src/components/ui/components/Dialog.tsx+++ b/apps/web/src/components/ui/components/Dialog.tsx@@ -1,6 +1,16 @@+import { MobileDrawer } from '@components/app/mobile/MobileDrawer';+import { isMobile } from '@core/mobile/isMobile';import { Dialog as KobalteDialog } from '@kobalte/core/dialog';-import type { JSX, Ref } from 'solid-js';-import { createEffect, createSignal, onCleanup } from 'solid-js';+import type { Accessor, JSX, Ref, Setter, ValidComponent } from 'solid-js';+import {+ createContext,+ createEffect,+ createSignal,+ onCleanup,+ Show,+ splitProps,+ useContext,+} from 'solid-js';import { cn } from '../utils/classname';const DIALOG_HANDOFF_WINDOW_MS = 180;@@ -8,11 +18,16 @@ const DIALOG_HANDOFF_WINDOW_MS = 180;let openDialogCount = 0;let lastAllDialogsClosedAt = Number.NEGATIVE_INFINITY;+const DialogDrawerContext = createContext<{+ setTitleId: Setter<Accessor<string | undefined> | undefined>;+ setDescriptionId: Setter<Accessor<string | undefined> | undefined>;+}>();+export type DialogProps = {- onEscapeKeyDown?: (event: KeyboardEvent) => void /* Forwarded to Kobalte */;- onCloseAutoFocus?: (event: Event) => void /* Forwarded to Kobalte */;- onOpenAutoFocus?: (event: Event) => void /* Forwarded to Kobalte */;- onOpenChange?: (open: boolean) => void /* Forwarded to Kobalte */;+ onEscapeKeyDown?: (event: KeyboardEvent) => void;+ onCloseAutoFocus?: (event: Event) => void;+ onOpenAutoFocus?: (event: Event) => void;+ onOpenChange?: (open: boolean) => void;contentRef?: Ref<HTMLDivElement> /* content element ref */;position?: 'top' | 'center' /* Vertical position */;/** Edge-to-edge takeover: fills the viewport with no gutter or centering. */@@ -21,10 +36,68 @@ export type DialogProps = {class?: string /* classes for content */;open: boolean /* if dialog is open */;visibleScrim?: boolean /* if the scrim is visible */;- animate?: boolean /* is the menu/dialog animated on open */;+ /** Desktop opening animation; mobile drawers own their transitions. */+ animate?: boolean;};export function Dialog(props: DialogProps) {+ return (+ <Show+ when={isMobile() && !props.fullscreen}+ fallback={+ <DialogDrawerContext.Provider value={undefined}>+ <DesktopDialog {...props} />+ </DialogDrawerContext.Provider>+ }+ >+ <DialogDrawer {...props} />+ </Show>+ );+}++function DialogDrawer(props: DialogProps) {+ const [titleId, setTitleId] = createSignal<Accessor<string | undefined>>();+ const [descriptionId, setDescriptionId] =+ createSignal<Accessor<string | undefined>>();+ return (+ <DialogDrawerContext.Provider value={{ setTitleId, setDescriptionId }}>+ <MobileDrawer+ labelId={titleId()?.()}+ descriptionId={descriptionId()?.()}+ side="bottom"+ open={props.open}+ onOpenChange={props.onOpenChange}+ onEscapeKeyDown={props.onEscapeKeyDown}+ onInitialFocus={props.onOpenAutoFocus}+ onFinalFocus={props.onCloseAutoFocus}+ restoreFocus+ noOutsidePointerEvents+ >+ <MobileDrawer.Portal>+ <MobileDrawer.Overlay+ class={cn(props.visibleScrim && 'bg-modal-overlay')}+ />+ <MobileDrawer.Content+ ref={props.contentRef}+ maxHeight={100}+ class={cn('mx-auto max-w-[calc(100vw-16px)]', props.class)}+ >+ <MobileDrawer.Handle aria-hidden="true" />+ <MobileDrawer.ScrollBody>+ {/* Give desktop surfaces their natural height so their size-full+ and overflow-clip styles cannot clip the drawer's scroll body. */}+ <div class="shrink-0 [&>[data-layer]>[data-surface]]:border-0! [&>[data-layer]>[data-surface]]:rounded-none [&>[data-layer]>[data-surface]]:bg-transparent">+ {props.children}+ </div>+ </MobileDrawer.ScrollBody>+ </MobileDrawer.Content>+ </MobileDrawer.Portal>+ </MobileDrawer>+ </DialogDrawerContext.Provider>+ );+}++function DesktopDialog(props: DialogProps) {const [animateOnOpen, setAnimateOnOpen] = createSignal(false);let countedOpen = false;@@ -100,7 +173,7 @@ export function Dialog(props: DialogProps) {// chrome (e.g. cmd+k's toolbar/footer) reads as the same pane.props.fullscreen? 'size-full'- : 'w-200 max-w-[calc(100vw-16px)] glass bg-menu-glass [--color-dialog:var(--color-menu-glass)] [&>[data-surface]]:border-0!',+ : 'w-200 max-w-[calc(100vw-16px)] glass bg-menu-glass [--color-dialog:var(--color-menu-glass)] [&>[data-layer]>[data-surface]]:border-0!',animateOnOpen() &&(props.fullscreen? 'dialog-fullscreen-open-animation'@@ -119,6 +192,30 @@ export function Dialog(props: DialogProps) {);}-Dialog.CloseButton = KobalteDialog.CloseButton; /* Forwarded to Kobalte */-Dialog.Description = KobalteDialog.Description; /* Forwarded to Kobalte */-Dialog.Title = KobalteDialog.Title; /* Forwarded to Kobalte */+const DialogCloseButton: typeof KobalteDialog.CloseButton = (props) => {+ if (useContext(DialogDrawerContext)) return null;+ return <KobalteDialog.CloseButton {...props} />;+};++const DialogDescription: typeof KobalteDialog.Description = (props) => {+ const drawer = useContext(DialogDrawerContext);+ if (!drawer) return <KobalteDialog.Description {...props} />;+ const [, rest] = splitProps(props, ['id']);+ // Corvu registers IDs on its root, while Kobalte accepts them on each slot.+ drawer.setDescriptionId(() => () => props.id);+ onCleanup(() => drawer.setDescriptionId(undefined));+ return <MobileDrawer.Description<ValidComponent> {...rest} />;+};++const DialogTitle: typeof KobalteDialog.Title = (props) => {+ const drawer = useContext(DialogDrawerContext);+ if (!drawer) return <KobalteDialog.Title {...props} />;+ const [, rest] = splitProps(props, ['id']);+ drawer.setTitleId(() => () => props.id);+ onCleanup(() => drawer.setTitleId(undefined));+ return <MobileDrawer.Title<ValidComponent> {...rest} />;+};++Dialog.CloseButton = DialogCloseButton;+Dialog.Description = DialogDescription;+Dialog.Title = DialogTitle;diff --git a/apps/web/src/components/ui/components/Dropdown.tsx b/apps/web/src/components/ui/components/Dropdown.tsxindex 4a8fa98b9a..7ca1e79ecc 100644--- a/apps/web/src/components/ui/components/Dropdown.tsx+++ b/apps/web/src/components/ui/components/Dropdown.tsx@@ -204,10 +204,9 @@ function DropdownContent(props: DropdownContentProps) {><KobalteDropdownMenu.Contentclass={cn(- // Glass: the content is the pane (blur + rim + shadow) and goes- // transparent; the groups inside paint the menu color, which the- // redefined --color-menu makes translucent so the blur shows.- 'rounded-xl size-auto z-action-menu menu-open-animation glass bg-transparent text-sm [--color-menu:var(--color-menu-glass)]',+ // Paint the same surface as context menus, including custom+ // contents (calendar month lists) without a Dropdown.Group.+ 'rounded-xl size-auto z-action-menu menu-open-animation glass bg-menu-glass text-sm [--color-surface:var(--color-menu)]',local.class)}depth={local.depth ?? 2}@@ -249,7 +248,7 @@ function DropdownSubContent(props: DropdownSubContentProps) {><KobalteDropdownMenu.SubContentclass={cn(- 'rounded-xl size-auto z-action-menu menu-open-animation glass bg-transparent text-sm [--color-menu:var(--color-menu-glass)] [--color-surface:var(--color-menu)]',+ 'rounded-xl size-auto z-action-menu menu-open-animation glass bg-menu-glass text-sm [--color-surface:var(--color-menu)]',local.class)}depth={local.depth ?? 2}diff --git a/apps/web/src/components/ui/components/EmptyStatePanel.tsx b/apps/web/src/components/ui/components/EmptyStatePanel.tsxindex f4a3962a40..f4afc41b30 100644--- a/apps/web/src/components/ui/components/EmptyStatePanel.tsx+++ b/apps/web/src/components/ui/components/EmptyStatePanel.tsx@@ -48,11 +48,9 @@ export function EmptyStatePanel(props: EmptyStatePanelProps) {// too tight, so we widen the padding and let the centered column keep// comfortable space from the split's edges (content stays left-aligned).'flex size-full flex-col overflow-y-auto px-10 pb-8 @4xl:px-2',- // Centered states can span full-bleed mobile panels (e.g. the entity- // load gate), where the panel extends behind the floating top chrome- // — inset the content below it like other full-bleed content.- props.centered &&- 'items-center text-center touch:pt-(--mobile-content-inset-top)',+ // Both alignments inset their content below the floating mobile chrome.+ 'touch:pt-(--mobile-content-inset-top)',+ props.centered && 'items-center text-center',props.class)}>@@ -60,7 +58,7 @@ export function EmptyStatePanel(props: EmptyStatePanelProps) {the same baseline for every empty state, regardless of what's belowit. The graphic box has a fixed height too, so the title's verticalposition is constant; the bottom grows to fill. On mobile the viewport- is short and the wrapper already adds a top inset, so the spacer is+ is short and the panel already adds a top inset, so the spacer isreduced to keep content from overflowing the visible area. */}<div aria-hidden="true" class="shrink-0 basis-[28%] mobile:basis-[8%]" /><divdiff --git a/apps/web/src/components/view-shell/MobileFilterDrawer.tsx b/apps/web/src/components/view-shell/MobileFilterDrawer.tsxindex 6be60c7da3..973ef802a1 100644--- a/apps/web/src/components/view-shell/MobileFilterDrawer.tsx+++ b/apps/web/src/components/view-shell/MobileFilterDrawer.tsx@@ -2,7 +2,6 @@ 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 CaretDownIcon from '@phosphor/caret-down.svg';@@ -53,7 +52,6 @@ function Root(props: MobileFilterDrawerProps) {'island bg-chrome pointer-events-auto relative size-10 shrink-0 rounded-full [&_svg]:size-6',props.class)}- ref={pressPulse}><SlidersHorizontalIcon /><Show when={props.activeCount > 0}>@@ -63,18 +61,32 @@ function Root(props: MobileFilterDrawerProps) {</Show></MobileDrawer.Trigger><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Overlay /><MobileDrawer.Contentaria-label={props.label ?? 'Filters'}class="h-[80vh]"><MobileDrawer.Handle class="pb-1" />+ <div class="flex shrink-0 items-center justify-between gap-3 px-6 pb-3">+ <h2 class="truncate text-lg font-semibold text-ink">+ {props.label ?? 'Filters'}+ </h2>+ <MobileDrawer.Close+ as={Button}+ variant="ghost"+ size="icon-sm"+ aria-label="Close filters"+ class="shrink-0 rounded-full bg-ink/6"+ >+ <XIcon class="size-4" />+ </MobileDrawer.Close>+ </div><div class="relative min-h-0 flex-1"><ScrollIndicators scrollRef={scrollRef} noBorderStart noBorderEnd /><divref={setScrollRef}onFocusIn={(e) => scrollToFocusedInput(e)}- class="h-full overflow-y-auto pb-1 scrollbar-hidden"+ class="h-full overflow-y-auto pb-3 scrollbar-hidden"><ScrollContext.Provider value={scrollRef}>{props.children}@@ -82,13 +94,13 @@ function Root(props: MobileFilterDrawerProps) {</div></div><Show when={props.activeCount > 0}>- <div class="shrink-0 border-t border-edge-muted p-2">+ <div class="shrink-0 px-6 pt-3 pb-2"><div class="flex flex-wrap items-center gap-2">{props.footer}<Button- variant="outline"+ variant="ghost"size="sm"- class="min-h-10 rounded-lg bg-active!"+ class="min-h-10 rounded-full bg-ink/6 px-4"onClick={() => props.onClear()}><XIcon class="size-3!" />@@ -137,7 +149,8 @@ function Section(props: {><Accordion.Header><Accordion.Trigger- class="group mb-px flex w-full items-center justify-between bg-surface p-3 text-sm text-ink outline-none transition-colors hover:bg-hover"+ as={MobileDrawer.Item}+ class="group justify-between font-medium data-expanded:bg-ink/5"onClick={scrollToSection}><span class="font-medium">{props.label}</span>@@ -147,11 +160,11 @@ function Section(props: {{props.activeCount}</span></Show>- <CaretDownIcon class="size-3.5 text-ink-muted transition-transform duration-200 group-data-expanded:rotate-180" />+ <CaretDownIcon class="size-4 text-ink-muted transition-transform duration-200 group-data-expanded:rotate-180" /></div></Accordion.Trigger></Accordion.Header>- <Accordion.Content>{props.children}</Accordion.Content>+ <Accordion.Content class="pt-1">{props.children}</Accordion.Content></MobileDrawer.Section>);}@@ -162,35 +175,29 @@ function Option(props: {checked: boolean;onChange: (checked: boolean) => void;selectionMode?: 'single' | 'multiple';+ class?: string;}) {return (- <button- type="button"+ <MobileDrawer.Itemrole={props.selectionMode === 'single' ? 'radio' : 'checkbox'}aria-checked={props.checked}- class="flex w-full items-center gap-3 bg-surface px-3 py-2.5 text-left text-sm transition-colors hover:bg-hover not-last:mb-px"+ class={props.class}onClick={() => props.onChange(!props.checked)}>- <span- class={cn(- 'flex size-4 shrink-0 items-center justify-center border transition-colors',- props.selectionMode === 'single' && 'rounded-full',- props.checked ? 'border-accent bg-accent' : 'border-edge'- )}- >- <Show when={props.checked}>- <CheckIcon class="size-2.5 text-surface" />- </Show>- </span><Show when={props.icon}>{(icon) => (- <span class="flex size-4 shrink-0 items-center justify-center">+ <span class="flex size-5 shrink-0 items-center justify-center text-ink-muted [&>svg]:size-5">{icon()}</span>)}</Show><span class="min-w-0 flex-1 truncate">{props.children}</span>- </button>+ <span class="flex size-5 shrink-0 items-center justify-center">+ <Show when={props.checked}>+ <CheckIcon class="size-4 text-accent" />+ </Show>+ </span>+ </MobileDrawer.Item>);}diff --git a/apps/web/src/features/auth/mobile-onboarding/OnboardingInbox.tsx b/apps/web/src/features/auth/mobile-onboarding/OnboardingInbox.tsxindex 7c67639cb1..c8529e4990 100644--- a/apps/web/src/features/auth/mobile-onboarding/OnboardingInbox.tsx+++ b/apps/web/src/features/auth/mobile-onboarding/OnboardingInbox.tsx@@ -190,7 +190,7 @@ export function OnboardingInbox() {}}><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay" />+ <MobileDrawer.Overlay /><MobileDrawer.Content aria-label="Entity actions"><MobileDrawer.Handle />diff --git a/apps/web/src/features/block-agent/ui/AgentModelSelector.tsx b/apps/web/src/features/block-agent/ui/AgentModelSelector.tsxindex 6104166c6b..eeccda9842 100644--- a/apps/web/src/features/block-agent/ui/AgentModelSelector.tsx+++ b/apps/web/src/features/block-agent/ui/AgentModelSelector.tsx@@ -140,7 +140,7 @@ export function AgentModelSelector(props: AgentModelSelectorProps) {<CaretDown class="size-3.5 shrink-0" /></MobileDrawer.Trigger><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Overlay /><MobileDrawer.Content aria-label="Choose a model"><MobileDrawer.Handle /><Show when={searchable()}>@@ -177,12 +177,11 @@ export function AgentModelSelector(props: AgentModelSelectorProps) {><For each={group.options}>{(option) => (- <button+ <MobileDrawer.Itemtype="button"role="radio"aria-checked={option.id === shown()}title={option.description ?? undefined}- class="flex w-full items-center gap-3 bg-surface px-4 py-3 text-left text-sm text-ink hover:bg-hover hover-transition-bg not-last:mb-px"onClick={() => pick(option.id)}><span class="min-w-0 flex-1 truncate">@@ -191,7 +190,7 @@ export function AgentModelSelector(props: AgentModelSelectorProps) {<Show when={option.id === shown()}><Check class="size-3.5 shrink-0 text-accent" /></Show>- </button>+ </MobileDrawer.Item>)}</For></MobileDrawer.Section>diff --git a/apps/web/src/features/block-calendar/components/EventRsvpScopeDialog.tsx b/apps/web/src/features/block-calendar/components/EventRsvpScopeDialog.tsxnew file mode 100644index 0000000000..8f25b7d22d--- /dev/null+++ b/apps/web/src/features/block-calendar/components/EventRsvpScopeDialog.tsx@@ -0,0 +1,166 @@+import { MobileDrawer } from '@components/app/mobile/MobileDrawer';+import { isMobile } from '@core/mobile/isMobile';+import { RadioGroup } from '@kobalte/core/radio-group';+import CheckIcon from '@phosphor/check.svg';+import CloseIcon from '@phosphor/x.svg';+import type { CalendarRsvpScope } from '@service-email/client';+import { Button, Dialog, Panel } from '@ui';+import { For, Show } from 'solid-js';++const SCOPE_OPTIONS = [+ { scope: 'this_event', label: 'This event' },+ { scope: 'all', label: 'All events' },+] as const satisfies readonly {+ scope: CalendarRsvpScope;+ label: string;+}[];++/** The caller owns the pending response; dismissing never submits it. */+export function EventRsvpScopeDialog(props: {+ open: boolean;+ scope: CalendarRsvpScope;+ onScopeChange: (scope: CalendarRsvpScope) => void;+ onClose: () => void;+ onConfirm: () => void;+}) {+ return (+ <Show+ when={isMobile()}+ fallback={+ <Dialog+ open={props.open}+ onOpenChange={(open) => !open && props.onClose()}+ >+ <Panel depth={2} class="max-w-[calc(100vw-2rem)] rounded-xl text-ink">+ <Panel.Header class="gap-1 px-2">+ <Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">+ <CloseIcon />+ </Dialog.CloseButton>+ <Dialog.Title as="span" class="m-0 p-0 text-sm font-medium">+ RSVP to recurring event+ </Dialog.Title>+ </Panel.Header>+ <Panel.Body class="flex flex-col gap-3 p-3">+ <div class="flex max-w-80 flex-col gap-2 text-sm text-ink-muted">+ <For each={SCOPE_OPTIONS}>+ {(option) => (+ <label class="flex items-center gap-2">+ <input+ type="radio"+ name="rsvp-scope"+ checked={props.scope === option.scope}+ onChange={() => props.onScopeChange(option.scope)}+ />+ {option.label}+ </label>+ )}+ </For>+ </div>+ <div class="flex justify-end gap-1 pt-2">+ <Button+ variant="ghost"+ class="rounded-lg"+ onClick={props.onClose}+ >+ Cancel+ </Button>+ <Button+ variant="accent"+ class="rounded-lg"+ onClick={props.onConfirm}+ >+ OK+ </Button>+ </div>+ </Panel.Body>+ </Panel>+ </Dialog>+ }+ >+ <MobileDrawer+ side="bottom"+ open={props.open}+ onOpenChange={(open) => !open && props.onClose()}+ preventScroll={false}+ preventScrollbarShift={false}+ >+ <MobileDrawer.Portal>+ <MobileDrawer.Overlay />+ <MobileDrawer.Content+ aria-label="RSVP to recurring event"+ class="overflow-hidden"+ >+ <MobileDrawer.Handle class="pb-1" />+ <div class="flex shrink-0 items-center justify-between gap-3 px-6 pb-4">+ <h2 class="text-lg font-semibold text-ink">+ RSVP to recurring event+ </h2>+ <MobileDrawer.Close+ as={Button}+ variant="ghost"+ size="icon-sm"+ aria-label="Close RSVP"+ class="size-11 shrink-0 rounded-full bg-ink/6"+ >+ <CloseIcon class="size-5" />+ </MobileDrawer.Close>+ </div>+ <MobileDrawer.ScrollBody>+ <p class="px-6 pb-3 text-sm text-ink-muted">+ Apply your response to:+ </p>+ <MobileDrawer.Section>+ <RadioGroup+ value={props.scope}+ onChange={(value) => {+ const option = SCOPE_OPTIONS.find(+ (option) => option.scope === value+ );+ if (option) props.onScopeChange(option.scope);+ }}+ aria-label="Response applies to"+ class="flex flex-col gap-1"+ >+ <For each={SCOPE_OPTIONS}>+ {(option) => (+ <RadioGroup.Item+ value={option.scope}+ class="relative rounded-[20px] text-ink data-checked:bg-ink/8 focus-within:outline-2 focus-within:outline-accent"+ >+ <RadioGroup.ItemInput />+ <RadioGroup.ItemLabel class="flex min-h-12 items-center justify-between gap-3 px-4 py-3 text-base">+ {option.label}+ <RadioGroup.ItemControl class="flex size-5 items-center justify-center">+ <RadioGroup.ItemIndicator>+ <CheckIcon class="size-5 text-accent" />+ </RadioGroup.ItemIndicator>+ </RadioGroup.ItemControl>+ </RadioGroup.ItemLabel>+ </RadioGroup.Item>+ )}+ </For>+ </RadioGroup>+ </MobileDrawer.Section>+ <div class="flex gap-3 px-6 pt-5 pb-2">+ <Button+ variant="ghost"+ class="min-h-11 flex-1 rounded-full bg-ink/6"+ onClick={props.onClose}+ >+ Cancel+ </Button>+ <Button+ variant="cta"+ class="min-h-11 flex-1 rounded-full"+ onClick={props.onConfirm}+ >+ Save response+ </Button>+ </div>+ </MobileDrawer.ScrollBody>+ </MobileDrawer.Content>+ </MobileDrawer.Portal>+ </MobileDrawer>+ </Show>+ );+}diff --git a/apps/web/src/features/block-calendar/components/EventRsvpSection.test.tsx b/apps/web/src/features/block-calendar/components/EventRsvpSection.test.tsxnew file mode 100644index 0000000000..b370ba430c--- /dev/null+++ b/apps/web/src/features/block-calendar/components/EventRsvpSection.test.tsx@@ -0,0 +1,107 @@+import {+ type CalendarEvent,+ DEFAULT_CALENDAR_SOURCE,+} from '@app/features/calendar/types';+import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';+import { type JSX, Show } from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { EventRsvpSection } from './EventRsvpSection';++const mutate = vi.hoisted(() => vi.fn());+vi.mock('@queries/calendar/mutations', () => ({+ useRsvpCalendarEventMutation: () => ({ mutate }),+}));+vi.mock('@core/component/Toast/Toast', () => ({ toast: { failure: vi.fn() } }));+vi.mock('@ui', () => ({+ Button: (props: JSX.ButtonHTMLAttributes<HTMLButtonElement>) => (+ <button onClick={props.onClick}>{props.children}</button>+ ),+}));+vi.mock('./EventRsvpScopeDialog', () => ({+ EventRsvpScopeDialog: (props: {+ open: boolean;+ scope: string;+ onScopeChange: (value: string) => void;+ onClose: () => void;+ onConfirm: () => void;+ }) => (+ <Show when={props.open}>+ <div role="dialog">+ <span>{props.scope}</span>+ <button onClick={() => props.onScopeChange('all')}>All events</button>+ <button onClick={props.onClose}>Cancel</button>+ <button onClick={props.onConfirm}>Save response</button>+ </div>+ </Show>+ ),+}));+afterEach(cleanup);+beforeEach(() => mutate.mockClear());+const event: CalendarEvent = {+ id: 'occurrence',+ eventId: 'event',+ occurrenceKey: '2026-09-11',+ recurrenceId: 'instance',+ isCancelled: false,+ isReadOnly: false,+ sourceCalendarIds: [],+ recurrenceLines: ['RRULE:FREQ=WEEKLY'],+ title: 'Team meeting',+ start: '2026-09-11T13:00:00Z',+ end: '2026-09-11T13:30:00Z',+ allDay: false,+ calendar: DEFAULT_CALENDAR_SOURCE,+ visibleCalendars: [],+ attendees: [+ {+ email: '[email protected]',+ isSelf: true,+ isOrganizer: false,+ isOptional: false,+ responseStatus: 'accepted',+ },+ ],+};+describe('event RSVP confirmation', () => {+ it('cancels without submitting and resets the scope on the next response', () => {+ render(() => <EventRsvpSection event={event} />);+ fireEvent.click(screen.getByText('Yes'));+ fireEvent.click(screen.getByText('All events'));+ fireEvent.click(screen.getByText('Cancel'));+ expect(mutate).not.toHaveBeenCalled();+ fireEvent.click(screen.getByText('Maybe'));+ expect(screen.getByText('this_event')).toBeTruthy();+ fireEvent.click(screen.getByText('Save response'));+ expect(mutate).toHaveBeenCalledExactlyOnceWith({+ eventId: 'event',+ response: 'tentative',+ scope: 'this_event',+ recurrenceId: 'instance',+ occurrenceKey: '2026-09-11',+ });+ expect(screen.queryByRole('dialog')).toBeNull();+ });+ it('applies a confirmed series response without occurrence identifiers', () => {+ render(() => <EventRsvpSection event={event} />);+ fireEvent.click(screen.getByText('No'));+ fireEvent.click(screen.getByText('All events'));+ fireEvent.click(screen.getByText('Save response'));+ expect(mutate).toHaveBeenCalledExactlyOnceWith({+ eventId: 'event',+ response: 'declined',+ scope: 'all',+ recurrenceId: undefined,+ occurrenceKey: undefined,+ });+ });+ it('submits non-recurring events without opening a scope prompt', () => {+ render(() => (+ <EventRsvpSection+ event={{ ...event, recurrenceLines: [], recurrenceId: undefined }}+ />+ ));+ fireEvent.click(screen.getByText('Yes'));+ expect(screen.queryByRole('dialog')).toBeNull();+ expect(mutate).toHaveBeenCalledOnce();+ });+});diff --git a/apps/web/src/features/block-calendar/components/EventRsvpSection.tsx b/apps/web/src/features/block-calendar/components/EventRsvpSection.tsxindex 8980a694a2..fbea06055b 100644--- a/apps/web/src/features/block-calendar/components/EventRsvpSection.tsx+++ b/apps/web/src/features/block-calendar/components/EventRsvpSection.tsx@@ -1,11 +1,11 @@import type { CalendarEvent } from '@app/features/calendar/types';import { toast } from '@core/component/Toast/Toast';-import CloseIcon from '@phosphor/x.svg';import { useRsvpCalendarEventMutation } from '@queries/calendar/mutations';import type { CalendarRsvpScope } from '@service-email/client';import type { AttendeeResponseStatus } from '@service-storage/generated/schemas/attendeeResponseStatus';-import { Button, Dialog, Panel } from '@ui';+import { Button } from '@ui';import { createMemo, createSignal, For, Show } from 'solid-js';+import { EventRsvpScopeDialog } from './EventRsvpScopeDialog';type RsvpResponse = Exclude<AttendeeResponseStatus, 'needs_action'>;@@ -18,14 +18,6 @@ const RSVP_OPTIONS = [label: string;}[];-const SCOPE_OPTIONS = [- { scope: 'this_event', label: 'This event' },- { scope: 'all', label: 'All events' },-] as const satisfies readonly {- scope: CalendarRsvpScope;- label: string;-}[];-/*** RSVP controls for the connected account's own attendance.*@@ -95,20 +87,19 @@ export function EventRsvpSection(props: {return (<Show when={canRespond()}>- <div class="border-edge-muted flex items-center gap-3 border-t bg-active px-4 py-2.5 text-sm text-ink-muted sm:text-xs">+ <div class="border-edge-muted flex items-center gap-3 border-t bg-active px-4 py-2.5 text-sm text-ink-muted sm:text-xs mobile:border-0 mobile:bg-transparent mobile:px-6 mobile:pt-4 mobile:pb-2"><span>Going?</span><div class="ml-auto flex shrink-0 gap-3 lg:gap-2"><For each={RSVP_OPTIONS}>{(option) => (<Button- variant={- selfAttendee()?.responseStatus === option.response- ? 'accent'- : 'outline'- }+ variant="ghost"size={props.buttonSize ?? 'sm'}depth={3}- class="rounded-lg px-3"+ class="rounded-lg bg-ink/5 px-3 aria-pressed:bg-accent-bg aria-pressed:text-accent mobile:min-h-11 mobile:rounded-full"+ aria-pressed={+ selfAttendee()?.responseStatus === option.response+ }onClick={() => respond(option.response)}>{option.label}@@ -117,50 +108,13 @@ export function EventRsvpSection(props: {</For></div></div>- <Dialog+ <EventRsvpScopeDialogopen={pendingResponse() !== undefined}- onOpenChange={(open) => !open && setPendingResponse(undefined)}- >- <Panel depth={2} class="max-w-[calc(100vw-2rem)] rounded-xl text-ink">- <Panel.Header class="gap-1 px-2">- <Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">- <CloseIcon />- </Dialog.CloseButton>- <Dialog.Title as="span" class="m-0 p-0 text-sm font-medium">- RSVP to recurring event- </Dialog.Title>- </Panel.Header>- <Panel.Body class="flex flex-col gap-3 p-3">- <div class="flex max-w-80 flex-col gap-2 text-sm text-ink-muted">- <For each={SCOPE_OPTIONS}>- {(option) => (- <label class="flex items-center gap-2">- <input- type="radio"- name="rsvp-scope"- checked={scope() === option.scope}- onChange={() => setScope(option.scope)}- />- {option.label}- </label>- )}- </For>- </div>- <div class="flex justify-end gap-1 pt-2">- <Button- variant="ghost"- class="rounded-lg"- onClick={() => setPendingResponse(undefined)}- >- Cancel- </Button>- <Button variant="accent" class="rounded-lg" onClick={confirm}>- OK- </Button>- </div>- </Panel.Body>- </Panel>- </Dialog>+ scope={scope()}+ onScopeChange={setScope}+ onClose={() => setPendingResponse(undefined)}+ onConfirm={confirm}+ /></Show>);}diff --git a/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsx b/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsxindex f5b32e54ee..704503bf31 100644--- a/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsx+++ b/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsx@@ -242,20 +242,20 @@ function EventDetailsDrawer(props: EventDetailsOverlayProps) {preventScrollbarShift={false}><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Overlay /><MobileDrawer.Contentaria-label={props.event.title}class="overflow-hidden">- <MobileDrawer.Handle class="pointer-events-none absolute inset-x-0 top-0 z-1" />- <div class="flex shrink-0 items-center justify-between px-2 pb-3 pt-2">+ <MobileDrawer.Handle class="pb-1" />+ <div class="flex shrink-0 items-center justify-between gap-3 px-6 pb-4"><MobileDrawer.Closeas={Button}aria-label="Close event details"variant="ghost"size="icon-md"depth={3}- class="rounded-md text-ink-extra-muted [&_svg]:size-4"+ class="size-11 rounded-full bg-ink/6 text-ink-muted [&_svg]:size-5"><CloseIcon /></MobileDrawer.Close>@@ -265,7 +265,7 @@ function EventDetailsDrawer(props: EventDetailsOverlayProps) {variant="ghost"size="icon-md"depth={3}- class="rounded-md text-ink-extra-muted [&_svg]:size-4"+ class="size-11 rounded-full bg-ink/6 text-ink-muted [&_svg]:size-5"onClick={() => copyCalendarEventMention(props.event)}><LinkIcon />@@ -276,7 +276,7 @@ function EventDetailsDrawer(props: EventDetailsOverlayProps) {variant="ghost"size="icon-md"depth={3}- class="rounded-md text-ink-extra-muted [&_svg]:size-4"+ class="size-11 rounded-full bg-ink/6 text-ink-muted [&_svg]:size-5"onClick={openEditor}><PencilSimpleIcon />@@ -286,7 +286,7 @@ function EventDetailsDrawer(props: EventDetailsOverlayProps) {variant="ghost"size="icon-md"depth={3}- class="rounded-md text-ink-extra-muted [&_svg]:size-4"+ class="size-11 rounded-full bg-ink/6 text-ink-muted [&_svg]:size-5"onClick={deleteDialog.open}><TrashIcon />diff --git a/apps/web/src/features/block-call/component/CallRecording/CallRecordingSplitHeader.tsx b/apps/web/src/features/block-call/component/CallRecording/CallRecordingSplitHeader.tsxindex fba082a43d..79d0e3d71a 100644--- a/apps/web/src/features/block-call/component/CallRecording/CallRecordingSplitHeader.tsx+++ b/apps/web/src/features/block-call/component/CallRecording/CallRecordingSplitHeader.tsx@@ -135,7 +135,7 @@ export function CallRecordingSplitHeader(props: {<div class="-order-1"><BlockLiveIndicators /></div>- <Show when={!record().isActive}>+ <Show when={!isMobile() && !record().isActive}><div class="order-[900] flex items-center"><HeaderIsland><Buttondiff --git a/apps/web/src/features/block-md/comments/CommentThreadDrawer.tsx b/apps/web/src/features/block-md/comments/CommentThreadDrawer.tsxindex 19d47e1ca8..0d6be08ab6 100644--- a/apps/web/src/features/block-md/comments/CommentThreadDrawer.tsx+++ b/apps/web/src/features/block-md/comments/CommentThreadDrawer.tsx@@ -210,7 +210,7 @@ export function CommentThreadDrawer() {initialFocusEl={getCommentComposerInput() ?? undefined}><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Overlay /><MobileDrawer.Contentaria-label="Comments"// Viewing a thread opens at a fixed half-screen height — shortdiff --git a/apps/web/src/features/block-md/component/DocumentDiscussion.test.tsx b/apps/web/src/features/block-md/component/DocumentDiscussion.test.tsxnew file mode 100644index 0000000000..23eaa7b87d--- /dev/null+++ b/apps/web/src/features/block-md/component/DocumentDiscussion.test.tsx@@ -0,0 +1,90 @@+import { FloatRegion } from '@components/app/mobile/float-regions/FloatRegion';+import { FloatRegions } from '@components/app/mobile/float-regions/float-region-state';+import { setVirtualKeyboardVisible } from '@core/mobile/virtualKeyboard';+import { cleanup, render, screen } from '@solidjs/testing-library';+import { createSignal, onCleanup, type ParentProps } from 'solid-js';+import { afterEach, describe, expect, it, vi } from 'vitest';+import { DocumentDiscussion } from './DocumentDiscussion';++const mocks = vi.hoisted(() => ({ mount: vi.fn(), unmount: vi.fn() }));++vi.mock('@core/mobile/isTouchDevice', () => ({ isTouchDevice: () => true }));+vi.mock('@components/app/split-layout/layoutUtils', () => ({+ useSplitPanel: () => undefined,+}));+vi.mock('../comments/documentDiscussionSource', () => ({+ createDocumentDiscussionSource: () => ({+ canEdit: () => true,+ threads: () => [],+ }),+}));+vi.mock(+ '@core/component/LexicalMarkdown/component/core/StaticMarkdown',+ () => ({+ StaticMarkdownContext: (props: ParentProps) => props.children,+ })+);+vi.mock('@core/comments/discussion', () => ({+ DiscussionProvider: (props: ParentProps) => props.children,+ Discussion: () => null,+ DiscussionComposer: () => {+ mocks.mount();+ onCleanup(mocks.unmount);+ return <textarea aria-label="Comment draft" />;+ },+}));++afterEach(() => {+ cleanup();+ setVirtualKeyboardVisible(false);+ vi.clearAllMocks();+});++function setup() {+ const [editorHasFocus, setEditorHasFocus] = createSignal(false);+ render(() => (+ <>+ <div ref={(element) => FloatRegions.setMount('accessory', element)} />+ <FloatRegion region="accessory" priority={-1}>+ <button>Ask AI</button>+ </FloatRegion>+ <DocumentDiscussion editorHasFocus={editorHasFocus()} />+ </>+ ));+ const input = screen.getByRole('textbox') as HTMLTextAreaElement;+ input.value = 'Unsent comment';+ return { input, setEditorHasFocus };+}++describe('mobile document discussion accessory', () => {+ it('hides during document typing and restores the same draft when the keyboard closes', () => {+ const { input, setEditorHasFocus } = setup();+ setEditorHasFocus(true);+ expect(screen.getByRole('textbox')).toBe(input);++ setVirtualKeyboardVisible(true);+ expect(screen.queryByRole('textbox')).toBeNull();+ expect(screen.queryByRole('button', { name: 'Ask AI' })).toBeNull();+ expect(mocks.unmount).not.toHaveBeenCalled();++ setVirtualKeyboardVisible(false);+ expect(screen.getByRole('textbox')).toBe(input);+ expect(input.value).toBe('Unsent comment');+ expect(mocks.mount).toHaveBeenCalledOnce();+ });++ it('stays available for commenting with the keyboard open and responds to focus changes', () => {+ const { input, setEditorHasFocus } = setup();+ input.focus();+ setVirtualKeyboardVisible(true);+ expect(screen.getByRole('textbox')).toBe(input);+ expect(document.activeElement).toBe(input);++ setEditorHasFocus(true);+ expect(screen.queryByRole('textbox')).toBeNull();+ setEditorHasFocus(false);+ expect(screen.getByRole('textbox')).toBe(input);+ expect(input.value).toBe('Unsent comment');+ expect(mocks.mount).toHaveBeenCalledOnce();+ });+});diff --git a/apps/web/src/features/block-md/component/DocumentDiscussion.tsx b/apps/web/src/features/block-md/component/DocumentDiscussion.tsxindex d23dab494c..b68552833d 100644--- a/apps/web/src/features/block-md/component/DocumentDiscussion.tsx+++ b/apps/web/src/features/block-md/component/DocumentDiscussion.tsx@@ -1,12 +1,49 @@-import { Discussion, DiscussionProvider } from '@core/comments/discussion';+import { ChannelInputContainer } from '@channel/Input/ChannelInputContainer';+import { FloatRegion } from '@components/app/mobile/float-regions/FloatRegion';+import {+ Discussion,+ DiscussionComposer,+ DiscussionProvider,+} from '@core/comments/discussion';+import { StaticMarkdownContext } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';+import { isTouchDevice } from '@core/mobile/isTouchDevice';+import { virtualKeyboardVisible } from '@core/mobile/virtualKeyboard';+import { Show } from 'solid-js';import { createDocumentDiscussionSource } from '../comments/documentDiscussionSource';+function MobileDiscussionComposer(props: { hidden: boolean }) {+ // Preserve the editor and draft while its placement is hidden.+ const input = <DiscussionComposer collapsible blurOnSend />;++ return (+ <FloatRegion region="accessory">+ <Show when={!props.hidden}>+ <ChannelInputContainer>{input}</ChannelInputContainer>+ </Show>+ </FloatRegion>+ );+}+/** Document discussion: the document annotations source feeding the shared UI. */-export function DocumentDiscussion() {+export function DocumentDiscussion(props: { editorHasFocus: boolean }) {const source = createDocumentDiscussionSource();return (<DiscussionProvider source={source}>- <Discussion />+ <Show+ when={+ !isTouchDevice() ||+ source.threads().some((thread) => thread.comments.length > 0)+ }+ >+ <Discussion hideComposer={isTouchDevice()} />+ </Show>+ <Show when={isTouchDevice() && source.canEdit()}>+ <StaticMarkdownContext>+ <MobileDiscussionComposer+ hidden={props.editorHasFocus && virtualKeyboardVisible()}+ />+ </StaticMarkdownContext>+ </Show></DiscussionProvider>);}diff --git a/apps/web/src/features/block-md/component/MarkdownPopup.tsx b/apps/web/src/features/block-md/component/MarkdownPopup.tsxindex ef59a3ea35..156a768ceb 100644--- a/apps/web/src/features/block-md/component/MarkdownPopup.tsx+++ b/apps/web/src/features/block-md/component/MarkdownPopup.tsx@@ -713,6 +713,7 @@ export function MarkdownPopup(props: {}><GeneralizedPopup+ class="z-action-menu"anchor={{ref: anchorRef()!,blockId: `${blockId}`,@@ -793,7 +794,8 @@ export function MarkdownPopup(props: {)}</Show><Show when={showPopup() && anchorRef()}>- <ScopedPortal scope="local">+ {/* Touch menus must escape the split's isolation to sit above mobile chrome. */}+ <ScopedPortal scope={isTouchDevice() ? 'global' : 'local'}><PopupToolbar /></ScopedPortal></Show>@@ -862,7 +864,7 @@ export function MarkdownPopup(props: {preventScrollbarShift={false}><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Overlay /><MobileDrawer.Content aria-label="Edit with AI"><MobileDrawer.Handle class="pb-1" /><div class="flex items-center gap-2 px-4 pb-3">diff --git a/apps/web/src/features/block-md/component/Notebook.tsx b/apps/web/src/features/block-md/component/Notebook.tsxindex 8acde5ad8a..07423a19b8 100644--- a/apps/web/src/features/block-md/component/Notebook.tsx+++ b/apps/web/src/features/block-md/component/Notebook.tsx@@ -423,7 +423,7 @@ export function Notebook(props: {<DocumentAiEditBar documentId={props.documentId} /></div></Show>- <DocumentDiscussion />+ <DocumentDiscussion editorHasFocus={editorHasFocus()} /></Show></ParamsProvider></div>diff --git a/apps/web/src/features/calendar/components/CalendarSettingsDropdown.tsx b/apps/web/src/features/calendar/components/CalendarSettingsDropdown.tsxindex 41b28d769c..7d955aa307 100644--- a/apps/web/src/features/calendar/components/CalendarSettingsDropdown.tsx+++ b/apps/web/src/features/calendar/components/CalendarSettingsDropdown.tsx@@ -6,8 +6,9 @@ import { isMobile } from '@core/mobile/isMobile';import CaretRightIcon from '@phosphor/caret-right.svg';import CheckIcon from '@phosphor/check.svg';import GearIcon from '@phosphor/gear.svg';+import MinusIcon from '@phosphor/minus.svg';import PlusIcon from '@phosphor/plus.svg';-import { Button, Checkbox, Dropdown } from '@ui';+import { Button, Dropdown } from '@ui';import { createMemo, createSignal, For, Show } from 'solid-js';import { match } from 'ts-pattern';import {@@ -314,9 +315,6 @@ function DesktopCalendarSettings(props: {);}-const DRAWER_ROW_CLASS =- "relative flex w-full items-center gap-3 bg-surface px-4 py-3 text-left text-sm text-ink not-last:after:absolute not-last:after:inset-x-2 not-last:after:bottom-0 not-last:after:h-px not-last:after:bg-edge-muted not-last:after:content-['']";-function MobileCalendarSettings(props: { controls: CalendarSettingsControls }) {const controls = props.controls;const calendarView = controls.calendarView;@@ -341,7 +339,7 @@ function MobileCalendarSettings(props: { controls: CalendarSettingsControls }) {</MobileDrawer.Trigger><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Overlay /><MobileDrawer.Contentaria-label="Calendar settings"class="overflow-y-auto"@@ -354,19 +352,37 @@ function MobileCalendarSettings(props: { controls: CalendarSettingsControls }) {<MobileDrawer.Section class="flex shrink-0 flex-col"><For each={groupCalendarSourcesByAccount(calendarView.sources())}>{(group) => (- <Checkbox- checked={controls.isAccountVisible(group)}- indeterminate={controls.isAccountPartiallyVisible(group)}- onChange={(checked) =>- controls.changeAccountVisibility(group, checked)+ <MobileDrawer.Item+ role="checkbox"+ aria-checked={+ controls.isAccountPartiallyVisible(group)+ ? 'mixed'+ : controls.isAccountVisible(group)+ }+ onClick={() =>+ controls.changeAccountVisibility(+ group,+ !controls.isAccountVisible(group)+ )}- class={DRAWER_ROW_CLASS}>- <Checkbox.Label class="min-w-0 flex-1 truncate">+ <span class="min-w-0 flex-1 truncate">{group.emailAddress}- </Checkbox.Label>- <Checkbox.Control />- </Checkbox>+ </span>+ <Show+ when={controls.isAccountPartiallyVisible(group)}+ fallback={+ <CheckIcon+ class="size-4 shrink-0 text-accent"+ classList={{+ invisible: !controls.isAccountVisible(group),+ }}+ />+ }+ >+ <MinusIcon class="size-4 shrink-0 text-accent" />+ </Show>+ </MobileDrawer.Item>)}</For></MobileDrawer.Section>@@ -375,25 +391,30 @@ function MobileCalendarSettings(props: { controls: CalendarSettingsControls }) {<MobileDrawer.Label>Display</MobileDrawer.Label><MobileDrawer.Section class="flex shrink-0 flex-col">- <Checkbox- checked={calendarView.displaySettings.showWeekends}- onChange={controls.changeShowWeekends}- class={DRAWER_ROW_CLASS}+ <MobileDrawer.Item+ role="checkbox"+ aria-checked={calendarView.displaySettings.showWeekends}+ onClick={() =>+ controls.changeShowWeekends(+ !calendarView.displaySettings.showWeekends+ )+ }>- <Checkbox.Label class="min-w-0 flex-1 truncate">- Show weekends- </Checkbox.Label>- <Checkbox.Control />- </Checkbox>+ <span class="min-w-0 flex-1 truncate">Show weekends</span>+ <CheckIcon+ class="size-4 shrink-0 text-accent"+ classList={{+ invisible: !calendarView.displaySettings.showWeekends,+ }}+ />+ </MobileDrawer.Item></MobileDrawer.Section><MobileDrawer.Label class="pt-4">Week starts on</MobileDrawer.Label><MobileDrawer.Section class="flex shrink-0 flex-col"><For each={WEEK_START_OPTIONS}>{(option) => (- <button- type="button"- class={DRAWER_ROW_CLASS}+ <MobileDrawer.Itemaria-pressed={calendarView.displaySettings.weekStartsOn === option.value}@@ -408,7 +429,7 @@ function MobileCalendarSettings(props: { controls: CalendarSettingsControls }) {option.value,}}/>- </button>+ </MobileDrawer.Item>)}</For></MobileDrawer.Section>@@ -417,9 +438,7 @@ function MobileCalendarSettings(props: { controls: CalendarSettingsControls }) {<MobileDrawer.Section class="flex shrink-0 flex-col"><For each={TIME_FORMAT_OPTIONS}>{(option) => (- <button- type="button"- class={DRAWER_ROW_CLASS}+ <MobileDrawer.Itemaria-pressed={calendarView.displaySettings.timeFormat === option.value}@@ -434,7 +453,7 @@ function MobileCalendarSettings(props: { controls: CalendarSettingsControls }) {option.value,}}/>- </button>+ </MobileDrawer.Item>)}</For></MobileDrawer.Section>@@ -448,9 +467,7 @@ function MobileCalendarSettings(props: { controls: CalendarSettingsControls }) {<MobileDrawer.Section class="mb-3 flex shrink-0 flex-col"><For each={controls.accounts()}>{(account) => (- <button- type="button"- class={DRAWER_ROW_CLASS}+ <MobileDrawer.ItemonClick={() => {setOpen(false);controls.runAccountAction(account);@@ -468,13 +485,11 @@ function MobileCalendarSettings(props: { controls: CalendarSettingsControls }) {>{account.action === 'enable' ? 'Enable' : 'Turn off'}</span>- </button>+ </MobileDrawer.Item>)}</For><Show when={controls.showConnectAccount()}>- <button- type="button"- class={DRAWER_ROW_CLASS}+ <MobileDrawer.ItemonClick={() => {setOpen(false);controls.connectAnotherAccount();@@ -484,7 +499,7 @@ function MobileCalendarSettings(props: { controls: CalendarSettingsControls }) {<span class="min-w-0 flex-1 truncate">Connect another account</span>- </button>+ </MobileDrawer.Item></Show></MobileDrawer.Section></Show>diff --git a/apps/web/src/features/calendar/components/EventDetails.tsx b/apps/web/src/features/calendar/components/EventDetails.tsxindex 85fb005784..4c8e5d59fb 100644--- a/apps/web/src/features/calendar/components/EventDetails.tsx+++ b/apps/web/src/features/calendar/components/EventDetails.tsx@@ -1,6 +1,7 @@import { openDocument } from '@core/component/LexicalMarkdown/component/core/BlockLink';import { UserIcon, type UserIconProps } from '@core/component/UserIcon';import { ScrollIndicators } from '@core/component/VerticalScrollIndicators';+import { isMobile } from '@core/mobile/isMobile';import {emailToMacroId,getDisplayName,@@ -285,12 +286,17 @@ function ScrollableAttendeeList(props: { attendees: CalendarAttendee[] }) {return (<div class="relative min-w-0 flex-1">- <div ref={setScrollContainer} class="max-h-40 overflow-y-auto pr-4">+ <div+ ref={setScrollContainer}+ class="max-h-40 overflow-y-auto pr-4 mobile:max-h-none mobile:overflow-visible mobile:pr-0"+ ><div class="flex flex-col gap-3"><CalendarAttendeeList attendees={props.attendees} /></div></div>- <ScrollIndicators scrollRef={scrollContainer} appearance="gradient" />+ <Show when={!isMobile()}>+ <ScrollIndicators scrollRef={scrollContainer} appearance="gradient" />+ </Show></div>);}diff --git a/apps/web/src/features/calendar/components/MonthDrawer.tsx b/apps/web/src/features/calendar/components/MonthDrawer.tsxindex a83b0523d9..a7862c9247 100644--- a/apps/web/src/features/calendar/components/MonthDrawer.tsx+++ b/apps/web/src/features/calendar/components/MonthDrawer.tsx@@ -34,14 +34,14 @@ export function MonthDrawer(props: MonthDrawerProps) {<MobileDrawer.Triggeras={Button}aria-label="Choose month"- class="max-w-full min-w-0 justify-start gap-1 rounded-full border-none bg-transparent px-1 text-base font-semibold text-ink hover:bg-hover"+ class="max-w-full min-w-0 justify-start gap-1 rounded-full border-none bg-transparent px-1 text-base font-semibold text-ink not-touch:hover:bg-hover"><span class="min-w-0 truncate">{formatCalendarMonth(props.month)}</span><CaretDownIcon class="size-3 shrink-0 text-ink-muted" /></MobileDrawer.Trigger><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Overlay /><MobileDrawer.Content aria-label="Choose month"><MobileDrawer.Handle /><MobileDrawer.Section class="mb-3 overflow-visible">diff --git a/apps/web/src/features/calendar/components/PeriodSelector.tsx b/apps/web/src/features/calendar/components/PeriodSelector.tsxindex bf87acea41..de2b33ce47 100644--- a/apps/web/src/features/calendar/components/PeriodSelector.tsx+++ b/apps/web/src/features/calendar/components/PeriodSelector.tsx@@ -34,9 +34,6 @@ const CALENDAR_VIEWS = [hotkeyToken: HotkeyToken;}>;-const DRAWER_ROW_CLASS =- "relative flex w-full items-center gap-3 bg-surface px-4 py-3 text-left text-sm text-ink not-last:after:absolute not-last:after:inset-x-2 not-last:after:bottom-0 not-last:after:h-px not-last:after:bg-edge-muted not-last:after:content-['']";-function createCalendarPeriodControls(onSelect?: () => void) {const calendarView = useCalendarView();const calendarPager = useCalendarPager();@@ -208,9 +205,7 @@ export function MobilePeriodControls(props: { onSelect: () => void }) {<MobileDrawer.Section class="flex shrink-0 flex-col"><For each={CALENDAR_VIEWS}>{(view) => (- <button- type="button"- class={DRAWER_ROW_CLASS}+ <MobileDrawer.Itemaria-pressed={controls.activeView() === view.value}onClick={() => controls.changeView(view.value)}>@@ -221,7 +216,7 @@ export function MobilePeriodControls(props: { onSelect: () => void }) {invisible: controls.activeView() !== view.value,}}/>- </button>+ </MobileDrawer.Item>)}</For></MobileDrawer.Section>diff --git a/apps/web/src/features/channel/Mobile/ActionDrawer.tsx b/apps/web/src/features/channel/Mobile/ActionDrawer.tsxindex b99ad13bea..777e50da07 100644--- a/apps/web/src/features/channel/Mobile/ActionDrawer.tsx+++ b/apps/web/src/features/channel/Mobile/ActionDrawer.tsx@@ -202,15 +202,13 @@ export function ActionDrawer() {restoreFocus={false}><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Overlay /><MobileDrawer.Contentaria-label="Message actions"class={showEmojiSearch() ? 'h-[80vh]' : undefined}>{/* Drag handle */}- <div class="flex justify-center pt-3 pb-2 shrink-0">- <div class="w-10 h-1 rounded-full bg-edge-muted" />- </div>+ <MobileDrawer.Handle /><Showwhen={!showEmojiSearch()}@@ -259,10 +257,9 @@ export function ActionDrawer() {<MobileDrawer.Section class="flex flex-col shrink-0"><For each={nonDestructiveActions()}>{(action) => (- <button+ <MobileDrawer.Itemtype="button"data-message-action={action.id}- class="flex items-center gap-3 px-4 py-3 text-sm text-ink hover:bg-hover hover-transition-bg text-left not-last:mb-px bg-surface"ref={(el) => {const getTarget = action.getFocusTarget;if (getTarget) focusInput(el, () => ({ getTarget }));@@ -273,7 +270,7 @@ export function ActionDrawer() {{renderIcon(action.icon)}</span>{action.label}- </button>+ </MobileDrawer.Item>)}</For></MobileDrawer.Section>@@ -284,10 +281,10 @@ export function ActionDrawer() {<MobileDrawer.Section class="flex flex-col shrink-0 mt-3"><For each={destructiveActions()}>{(action) => (- <button+ <MobileDrawer.Itemtype="button"data-message-action={action.id}- class="flex items-center gap-3 px-4 py-3 text-sm text-failure-ink hover:bg-hover hover-transition-bg text-left not-last:mb-px bg-surface"+ class="text-failure-ink"ref={(el) => {const getTarget = action.getFocusTarget;if (getTarget) focusInput(el, () => ({ getTarget }));@@ -298,7 +295,7 @@ export function ActionDrawer() {{renderIcon(action.icon)}</span>{action.label}- </button>+ </MobileDrawer.Item>)}</For></MobileDrawer.Section>diff --git a/apps/web/src/features/chat/SoupChatInput.test.tsx b/apps/web/src/features/chat/SoupChatInput.test.tsxindex 6366a8db4c..dae39b8481 100644--- a/apps/web/src/features/chat/SoupChatInput.test.tsx+++ b/apps/web/src/features/chat/SoupChatInput.test.tsx@@ -13,9 +13,7 @@ const mocks = vi.hoisted(() => ({pending: vi.fn(),rename: vi.fn(),}));-vi.mock('@components/app/mobile/float-regions/FloatRegion', () => ({- FloatRegionOrInline: (props: { children: unknown }) => props.children,-}));+vi.mock('@components/app/split-layout/layoutUtils', () => ({useSplitPanelOrThrow: () => ({ handle: { replace: mocks.replace } }),}));@@ -23,8 +21,14 @@ vi.mock('@core/component/AI/component/input/buildChatEditor', () => ({buildChatEditor: () => ({ withMentions: () => ({}) }),}));vi.mock('@core/component/AI/component/input/ChatInput', () => ({- ChatInput: (props: { onSend: (request: unknown) => void }) => (+ ChatInput: (props: {+ onSend: (request: unknown) => void;+ variant?: string;+ collapseOnBlur?: boolean;+ }) => (<button+ data-variant={props.variant}+ data-collapse-on-blur={props.collapseOnBlur}onClick={() =>props.onSend({content: 'Summarize this document',@@ -76,15 +80,20 @@ vi.mock('@service-cognition/client', () => ({cognitionApiServiceClient: { createChat: mocks.createChat },}));-import type { CreatableBlock } from '@app/features/command/types';-import { mobilePageCreateAction } from '@components/app/mobile/mobile-page-create-action';-import { TOKENS } from '@core/hotkey/tokens';import { SoupChatInput } from './SoupChatInput';-afterEach(cleanup);beforeEach(() => vi.clearAllMocks());+afterEach(cleanup);-describe('Agents list composer', () => {+describe('SoupChatInput', () => {+ it('renders the compact chat input inline without page actions', () => {+ const { container } = render(() => <SoupChatInput />);+ const send = screen.getByRole('button', { name: 'Send' });+ expect(container.contains(send)).toBe(true);+ expect(send.getAttribute('data-variant')).toBe('default');+ expect(send.getAttribute('data-collapse-on-blur')).toBe('true');+ expect(screen.queryByRole('button', { name: /^New/ })).toBeNull();+ });it('creates and opens a chat with the first prompt, selected model, and attachments', async () => {mocks.createChat.mockResolvedValue({isErr: () => false,@@ -115,35 +124,4 @@ describe('Agents list composer', () => {expect(mocks.pending).not.toHaveBeenCalled();expect(mocks.replace).not.toHaveBeenCalled();});- it('replaces the Agents floating create button without removing other page actions', () => {- const blocks: CreatableBlock[] = [- {- label: 'Mail draft',- description: 'Create email',- blockName: 'email',- hotkeyToken: TOKENS.create.email,- hotkey: 'e',- keyDownHandler: vi.fn(() => true),- },- {- label: 'Task',- description: 'Create task',- blockName: 'task',- hotkeyToken: TOKENS.create.task,- hotkey: 't',- keyDownHandler: vi.fn(() => true),- },- ];-- expect(mobilePageCreateAction('agents', blocks)).toBeUndefined();- expect(mobilePageCreateAction('mail', blocks)).toEqual({- label: 'New mail draft',- run: blocks[0].keyDownHandler,- });- expect(mobilePageCreateAction('tasks', blocks)).toEqual({- label: 'New task',- run: blocks[1].keyDownHandler,- });- expect(mobilePageCreateAction('mail', [])).toBeUndefined();- });});diff --git a/apps/web/src/features/chat/SoupChatInput.tsx b/apps/web/src/features/chat/SoupChatInput.tsxindex 2d13e34d01..7d141370ab 100644--- a/apps/web/src/features/chat/SoupChatInput.tsx+++ b/apps/web/src/features/chat/SoupChatInput.tsx@@ -1,4 +1,3 @@-import { FloatRegionOrInline } from '@components/app/mobile/float-regions/FloatRegion';import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';import { buildChatEditor } from '@core/component/AI/component/input/buildChatEditor';import type { ChatSendInput } from '@core/component/AI/component/input/buildRequest';@@ -22,7 +21,7 @@ import { isPaymentError } from '@core/util/handlePaymentError';import { createRenameDssEntityMutation } from '@entity';import { invalidateAllSoup } from '@queries/soup/cache';import { cognitionApiServiceClient } from '@service-cognition/client';-import { createEffect, onMount } from 'solid-js';+import { createEffect } from 'solid-js';function SoupChatInputInner() {const splitPanelContext = useSplitPanelOrThrow();@@ -49,12 +48,6 @@ function SoupChatInputInner() {const [attachHotkeys] = useHotkeyDOMScope('soup.chatInput');- let containerRef!: HTMLDivElement;-- onMount(() => {- attachHotkeys(containerRef);- });-// cmd+j - Focus AI chatregisterHotkey({hotkey: 'cmd+j',@@ -119,27 +112,20 @@ function SoupChatInputInner() {};return (- <FloatRegionOrInline region="accessory">- <div- ref={containerRef}- class="absolute bottom-0 inset-x-px pb-2.5 px-2 flex justify-center pointer-events-none touch:static touch:pb-0 touch:px-(--mobile-chrome-gutter)"- >- <div class="w-full max-w-3xl">- <div class="pointer-events-auto">- <ChatInput- editor={editor}- onSend={handleSend}- onEscape={() => {- splitPanelContext.panelRef()?.focus();- return true;- }}- isPersistent={true}- autoFocusOnMount={false}- />- </div>- </div>- </div>- </FloatRegionOrInline>+ <div ref={attachHotkeys}>+ <ChatInput+ variant="default"+ collapseOnBlur+ editor={editor}+ onSend={handleSend}+ onEscape={() => {+ splitPanelContext.panelRef()?.focus();+ return true;+ }}+ isPersistent={true}+ autoFocusOnMount={false}+ />+ </div>);}diff --git a/apps/web/src/features/command/Launcher.tsx b/apps/web/src/features/command/Launcher.tsxindex b764aea4f9..e133f94889 100644--- a/apps/web/src/features/command/Launcher.tsx+++ b/apps/web/src/features/command/Launcher.tsx@@ -92,6 +92,7 @@ import {} from 'solid-js';import { createStore } from 'solid-js/store';import { Dynamic } from 'solid-js/web';+import { MobileCreateSheet } from './mobile/MobileCreateSheet';import type { CreatableBlock, CreatableName } from './types';const LAUNCHER_FRECENCY_STORE = 'launcher-frecency-v1';@@ -130,6 +131,18 @@ function launcherFrecencyScore(item: CreatableBlock, now = Date.now()) {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);+}+function trackLauncherItemUsage(item: CreatableBlock) {const key = launcherItemKey(item);const previous = launcherFrecencyStore[key];@@ -802,18 +815,7 @@ export const LauncherInner = (props: LauncherInnerProps) => {const availableBlocks = useCreateMenuBlocks(() => props.blocks ?? CREATABLE_BLOCKS);- const sortedBlocks = createMemo(() => {- const now = Date.now();-- return availableBlocks()- .map((item, index) => ({- item,- index,- score: launcherFrecencyScore(item, now),- }))- .sort((a, b) => b.score - a.score || a.index - b.index)- .map(({ item }) => item);- });+ const sortedBlocks = createMemo(() => sortLauncherBlocks(availableBlocks()));const [searchQuery, setSearchQuery] = createSignal('');const searchMode = launcherSearchMode;const blocks = createMemo(() => {@@ -1004,10 +1006,17 @@ 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="w-200 max-w-[calc(100vw-16px)] rounded-xl glass bg-menu-glass [--color-dialog:var(--color-menu-glass)]">+ <div class="create-menu-pane w-200 max-w-[calc(100vw-16px)] rounded-xl touch:mobile-sheet touch:overflow-hidden touch:pb-[var(--mobile-sheet-safe-padding,0px)] glass bg-menu-glass [--color-dialog:var(--color-menu-glass)]">+ <div+ aria-hidden="true"+ class="hidden touch:flex h-5 shrink-0 items-center justify-center"+ >+ <div class="h-1 w-9 rounded-full bg-ink/15" />+ </div><CommandMenuShelldepth={2}- class="h-auto w-full outline-none"+ hideBorder+ class="h-auto w-full max-h-[75vh] outline-none touch:rounded-none"ref={ref}tabindex={-1}>@@ -1051,12 +1060,12 @@ export const LauncherInner = (props: LauncherInnerProps) => {class="ml-auto flex-row-reverse gap-1.5 px-2 py-1"/></CommandMenuShell.Header>- <CommandMenuShell.Body>+ <CommandMenuShell.Body class="touch:flex touch:flex-col"><CommandMenuListitems={blocks()}selectedIndex={focusedIndex()}scrollSelectedIntoView={listController.shouldScrollSelectedIntoView()}- class="max-h-[min(60vh,26rem)]"+ class="max-h-[min(60vh,26rem)] touch:min-h-0"itemId={(item) => `create-menu-${launcherItemKey(item)}`}onSelect={(item) => runLauncherItem(item)}onItemMouseMove={(index) =>@@ -1072,7 +1081,7 @@ export const LauncherInner = (props: LauncherInnerProps) => {)}</CommandMenuList></CommandMenuShell.Body>- <CommandMenuShell.Footer>+ <CommandMenuShell.Footer class="touch:px-6 touch:py-4"><style>{`@keyframes shift-ripple {0% { transform: scale(1); opacity: 0.6; }@@ -1128,29 +1137,48 @@ type LauncherProps = {onOpenChange: (open: boolean, shouldReturnFocus?: boolean) => void;};-export const Launcher = (props: LauncherProps) => {+function MobileLauncher(props: LauncherProps) {+ const availableBlocks = useCreateMenuBlocks();+ const items = createMemo(() => sortLauncherBlocks(availableBlocks()));+ return (+ <MobileCreateSheet+ open={props.open}+ onOpenChange={props.onOpenChange}+ items={items()}+ onSelect={(item) => {+ trackLauncherItemUsage(item);+ item.keyDownHandler();+ props.onOpenChange(false);+ }}+ />+ );+}++export const Launcher = (props: LauncherProps) => (+ <Show when={isMobile()} fallback={<DesktopLauncher {...props} />}>+ <MobileLauncher {...props} />+ </Show>+);++const DesktopLauncher = (props: LauncherProps) => {return (<Dialog open={props.open} onOpenChange={props.onOpenChange} modal={true}><Dialog.Portal><Dialog.Overlay class="fixed inset-0 z-modal scrim-glass dialog-overlay-open-animation" />- <Dialog.Content class="[--color-surface:var(--color-dialog)]">- <div- class={cn(- 'fixed top-0 bottom-(--virtual-keyboard-height,0) inset-x-0 z-modal w-screen flex justify-center px-2',- isMobile() ? 'items-center' : 'items-start pt-[10vh]'- )}- onClick={(e) => {- if (e.target === e.currentTarget) {- props.onOpenChange(false);- }- }}- >- <LauncherInner- onClose={(shouldReturnFocus) =>- props.onOpenChange(false, shouldReturnFocus)- }- />- </div>+ <Dialog.Content+ aria-label="Create New"+ class="fixed inset-x-0 top-0 bottom-(--virtual-keyboard-height,0) z-modal flex items-start justify-center px-2 pt-[10vh] outline-none [--color-surface:var(--color-dialog)]"+ onClick={(e) => {+ if (e.target === e.currentTarget) {+ props.onOpenChange(false);+ }+ }}+ >+ <LauncherInner+ onClose={(shouldReturnFocus) =>+ props.onOpenChange(false, shouldReturnFocus)+ }+ /></Dialog.Content></Dialog.Portal></Dialog>diff --git a/apps/web/src/features/command/mobile/MobileCreateSheet.tsx b/apps/web/src/features/command/mobile/MobileCreateSheet.tsxnew file mode 100644index 0000000000..bf4d9f6ba3--- /dev/null+++ b/apps/web/src/features/command/mobile/MobileCreateSheet.tsx@@ -0,0 +1,64 @@+import { MobileDrawer } from '@components/app/mobile/MobileDrawer';+import CloseIcon from '@phosphor/x.svg';+import { Button } from '@ui/components/Button';+import { createUniqueId, For, Show } from 'solid-js';+import { Dynamic } from 'solid-js/web';+import type { CreatableBlock } from '../types';++/** Touch presentation of the launcher; creation and feature gates belong to the host. */+export function MobileCreateSheet(props: {+ open: boolean;+ onOpenChange: (open: boolean) => void;+ items: CreatableBlock[];+ onSelect: (item: CreatableBlock) => void;+}) {+ const titleId = createUniqueId();+ return (+ <MobileDrawer open={props.open} onOpenChange={props.onOpenChange}>+ <MobileDrawer.Portal>+ <MobileDrawer.Overlay />+ <MobileDrawer.Content aria-labelledby={titleId} class="overflow-hidden">+ <MobileDrawer.Handle class="pb-1" />+ <header class="flex shrink-0 items-center justify-between gap-3 px-6 pb-5">+ <h2 id={titleId} class="text-lg font-semibold text-ink">+ Create new+ </h2>+ <MobileDrawer.Close+ as={Button}+ variant="ghost"+ size="icon-lg"+ aria-label="Close create menu"+ class="rounded-full bg-ink/6"+ >+ <CloseIcon class="size-5" />+ </MobileDrawer.Close>+ </header>+ <MobileDrawer.ScrollBody>+ <MobileDrawer.Section>+ <For each={props.items}>+ {(item) => (+ <MobileDrawer.Item+ class="min-h-14 gap-4 px-4 py-3"+ onClick={() => props.onSelect(item)}+ >+ <span class="size-5 shrink-0 text-ink-muted">+ <Dynamic component={item.icon} />+ </span>+ <span class="min-w-0 flex-1 text-base font-medium">+ {item.label}+ <Show when={item.launcherHint}>+ <span class="mt-0.5 block text-sm font-normal leading-5 text-ink-muted">+ {item.launcherHint}+ </span>+ </Show>+ </span>+ </MobileDrawer.Item>+ )}+ </For>+ </MobileDrawer.Section>+ </MobileDrawer.ScrollBody>+ </MobileDrawer.Content>+ </MobileDrawer.Portal>+ </MobileDrawer>+ );+}diff --git a/apps/web/src/features/command/mobile/MobileSearchInput.tsx b/apps/web/src/features/command/mobile/MobileSearchInput.tsxindex c525822c69..e7d67a061d 100644--- a/apps/web/src/features/command/mobile/MobileSearchInput.tsx+++ b/apps/web/src/features/command/mobile/MobileSearchInput.tsx@@ -1,5 +1,4 @@import { openChatWithMessage } from '@app/features/chat/ChatWithAgentButton';-import { pressPulse } from '@components/app/mobile/pressPulse';import {useForegroundMobileView,useMobileNavNavigate,@@ -11,9 +10,6 @@ import { cn } from '@ui';import { createEffect, on } from 'solid-js';import { SearchState } from './mobileSearchState';-// Keeps the directive import from being tree-shaken / lint-flagged.-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 lives in the app chrome outside every split and@@ -42,7 +38,6 @@ export function MobileAskAiButton() {return (<buttontype="button"- use:pressPulse// Tapping it must not drop the keyboard before the action runs.data-keep-keyboardclass={cn(diff --git a/apps/web/src/features/companies/CreateCompanyModal.tsx b/apps/web/src/features/companies/CreateCompanyModal.tsxindex 3ea59450e2..c753d3ac9c 100644--- a/apps/web/src/features/companies/CreateCompanyModal.tsx+++ b/apps/web/src/features/companies/CreateCompanyModal.tsx@@ -1,4 +1,5 @@import { useSplitLayout } from '@components/app/split-layout/layout';+import { isMobile } from '@core/mobile/isMobile';import { useFocusLock } from '@core/util/createControlledOpenSignal';import { ThrownResultError } from '@core/util/result';import BuildingsIcon from '@phosphor/buildings.svg';@@ -94,21 +95,24 @@ export function CreateCompanyModal() {onOpenChange={(open) => !open && close()}class="w-120">- <Panel depth={2} class="rounded-xl *:max-h-[75vh]">+ <Panel+ depth={2}+ hideBorder={isMobile()}+ class="rounded-xl touch:h-auto *:max-h-[75vh]"+ ><Panel.Body><form class="flex flex-col gap-4 p-4" onSubmit={handleSubmit}>- <div class="flex items-center gap-1">- <div class="flex-1" />- <Dialog.CloseButton- as={Button}- size="icon-sm"- label="Close"- tabIndex={-1}- disabled={createCompanyMutation.isPending}- >- <XIcon />- </Dialog.CloseButton>- </div>+ <Dialog.CloseButton+ as={Button}+ size="icon-sm"+ label="Close"+ aria-label="Close company creation"+ class="self-end"+ tabIndex={-1}+ disabled={createCompanyMutation.isPending}+ >+ <XIcon />+ </Dialog.CloseButton><div class="flex flex-col gap-4"><div class="flex items-center gap-2 px-2">diff --git a/apps/web/src/features/email-compose/views/compose-toolbar.tsx b/apps/web/src/features/email-compose/views/compose-toolbar.tsxindex 79935a9971..fea38fb161 100644--- a/apps/web/src/features/email-compose/views/compose-toolbar.tsx+++ b/apps/web/src/features/email-compose/views/compose-toolbar.tsx@@ -164,45 +164,44 @@ function MobileToolbar(props: {return (<SplitHeaderRight>- <HeaderIsland>- <div class="flex items-center gap-1 pl-2">- <Show when={!ctx.hideAttachments}>- <div class="relative" ref={props.attachButtonRef}>- <Button- ref={(el) =>- fileSelector(el, () => ({- multiple: true,- onSelect: props.handleAddAttachments,- }))- }- size="icon-sm"- disabled={ctx.disabled()}- >- <PaperclipIcon />- </Button>- </div>- </Show>+ <HeaderIsland class="h-(--mobile-chrome-button-size) p-[5px]">+ <Show when={!ctx.hideAttachments}>+ <div class="relative" ref={props.attachButtonRef}>+ <Button+ ref={(el) =>+ fileSelector(el, () => ({+ multiple: true,+ onSelect: props.handleAddAttachments,+ }))+ }+ size="icon-sm"+ disabled={ctx.disabled()}+ >+ <PaperclipIcon />+ </Button>+ </div>+ </Show>- <Show when={ctx.scheduleEnabled && ctx.onSendTimeChange}>- <EmailDateSelector- mobile={ctx.isMobile()}- sendTime={ctx.sendTime()}- onSendTimeChange={ctx.onSendTimeChange}- disabled={ctx.scheduleSendDisabled?.()}- compact- />- </Show>- <SendButton- disabled={- ctx.isSending() ||- ctx.isSavingDraft?.() ||- ctx.disabled() ||- !!ctx.sendTime()- }- pending={ctx.isSending()}- onClick={() => ctx.onSend()}+ <Show when={ctx.scheduleEnabled && ctx.onSendTimeChange}>+ <EmailDateSelector+ mobile={ctx.isMobile()}+ sendTime={ctx.sendTime()}+ onSendTimeChange={ctx.onSendTimeChange}+ disabled={ctx.scheduleSendDisabled?.()}+ compact/>- </div>+ </Show>+ <SendButton+ tooltip="Send email"+ disabled={+ ctx.isSending() ||+ ctx.isSavingDraft?.() ||+ ctx.disabled() ||+ !!ctx.sendTime()+ }+ pending={ctx.isSending()}+ onClick={() => ctx.onSend()}+ /></HeaderIsland></SplitHeaderRight>);diff --git a/apps/web/src/features/email-compose/views/email-compose.tsx b/apps/web/src/features/email-compose/views/email-compose.tsxindex c2d955835c..025f1fb24f 100644--- a/apps/web/src/features/email-compose/views/email-compose.tsx+++ b/apps/web/src/features/email-compose/views/email-compose.tsx@@ -154,7 +154,7 @@ export function EmailComposeView(props: EmailComposeViewProps) {preventScrollbarShift={false}><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Overlay /><MobileDrawer.Content aria-label="Draft options"><MobileDrawer.Handle /><MobileDrawer.Section class="mb-3">diff --git a/apps/web/src/features/email-thread/views/mobile-email-compose-drawer.tsx b/apps/web/src/features/email-thread/views/mobile-email-compose-drawer.tsxindex 5ea2e81c72..80ee7449f8 100644--- a/apps/web/src/features/email-thread/views/mobile-email-compose-drawer.tsx+++ b/apps/web/src/features/email-thread/views/mobile-email-compose-drawer.tsx@@ -50,7 +50,7 @@ export function MobileEmailComposeDrawer(props: {breakPoints={[0.85]}><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Overlay /><MobileDrawer.Contentaria-label="Reply composer"maxHeight={90}diff --git a/apps/web/src/features/email-view/components/EmailEmptyState.tsx b/apps/web/src/features/email-view/components/EmailEmptyState.tsxindex 4464c083a4..38cee55a1a 100644--- a/apps/web/src/features/email-view/components/EmailEmptyState.tsx+++ b/apps/web/src/features/email-view/components/EmailEmptyState.tsx@@ -12,11 +12,6 @@ import type { EmailTab } from '../types';const EMAIL_DOCS_URL = `${DOCS_BASE}/product/email`;-// EmptyStatePanel only insets `centered` panels below the floating mobile-// chrome, and the list wrapper leaves the inset to the panels so the centered-// ones are not padded twice. Left-aligned panels add it themselves.-const MOBILE_TOP_INSET_CLASS = 'touch:pt-(--mobile-content-inset-top)';-function tabCopy(tab: EmailTab): { title: string; description: string } {return match(tab).with('important', () => ({@@ -73,7 +68,6 @@ export function EmailEmptyState() {onClick: () => void startAddInbox(),}}documentationUrl={EMAIL_DOCS_URL}- class={MOBILE_TOP_INSET_CLASS}/></Match>@@ -123,7 +117,6 @@ export function EmailEmptyState() {title={copy().title}description={copy().description}documentationUrl={EMAIL_DOCS_URL}- class={MOBILE_TOP_INSET_CLASS}/>)}</Match>diff --git a/apps/web/src/features/email-view/components/EmailList.tsx b/apps/web/src/features/email-view/components/EmailList.tsxindex 14129c4014..5fc524e6f0 100644--- a/apps/web/src/features/email-view/components/EmailList.tsx+++ b/apps/web/src/features/email-view/components/EmailList.tsx@@ -496,10 +496,7 @@ export function EmailList(props: EmailListProps) {</Match><Match when={forceEmptyState() || rows().length === 0}>- {/* No top inset on the wrapper: each EmptyStatePanel pads itself- below the floating chrome (centered ones by default, the- left-aligned ones in EmailEmptyState), so padding here too- would double it. */}+ {/* EmptyStatePanel owns the top inset below the mobile chrome. */}<divref={setEmptyViewport}class="min-h-0 flex-1 overflow-y-auto touch:pb-(--mobile-content-inset-bottom)"diff --git a/apps/web/src/features/getting-started/getting-started.tsx b/apps/web/src/features/getting-started/getting-started.tsxindex 528ebc0dc1..f06fd55f98 100644--- a/apps/web/src/features/getting-started/getting-started.tsx+++ b/apps/web/src/features/getting-started/getting-started.tsx@@ -111,13 +111,12 @@ function GettingStartedContent() {};const openSettingsTab = (tab: SettingsTab) => {- setActiveTabId(tab);if (isMobile()) {- // Mobile has no Preview Pair; the docked settings split is the- // full-screen path there.+ // The mobile entry point opens this section in the settings sheet.openSettingsInSplit(tab);return;}+ setActiveTabId(tab);// Deliberately not openSettings(): on desktop it collapses to solo// settings, destroying the Controller/Viewer pair.openInPreview({ type: 'component', id: 'settings' });diff --git a/apps/web/src/features/inbox-view/components/InboxHeader.tsx b/apps/web/src/features/inbox-view/components/InboxHeader.tsxindex 7b6ead9201..5cb03aa7c4 100644--- a/apps/web/src/features/inbox-view/components/InboxHeader.tsx+++ b/apps/web/src/features/inbox-view/components/InboxHeader.tsx@@ -1,10 +1,11 @@+import { MobileTopEdgeFade } from '@components/app/mobile/MobileEdgeFade';import { SplitPanel } from '@components/app/split-panel';import { isTouchDevice } from '@core/mobile/isTouchDevice';-import { type ParentProps, Show } from 'solid-js';+import { type JSX, type ParentProps, Show } from 'solid-js';-export function InboxHeader(props: ParentProps) {+function InboxHeader(props: ParentProps) {return (- <header class="flex shrink-0 flex-col gap-3 px-4 pt-2 touch:px-(--mobile-chrome-gutter) touch:pt-[calc(var(--safe-top,0px)+0.5rem)]">+ <header class="flex shrink-0 flex-col gap-3 px-4 pt-2 touch:px-(--mobile-chrome-gutter) touch:pt-[calc(var(--safe-top,0px)+0.5rem)] touch:absolute touch:inset-x-0 touch:top-0 touch:z-split-panel-chrome touch:pointer-events-none"><Show when={!isTouchDevice()}><div class="flex items-center"><SplitPanel.ControlGroup>@@ -21,9 +22,27 @@ export function InboxHeader(props: ParentProps) {</h1></div></Show>- <div class="flex h-8 min-w-0 items-center touch:h-10">+ <div class="flex h-8 min-w-0 items-center touch:h-10 touch:pointer-events-auto">{props.children}</div></header>);}++/** Keep mobile chrome above a full-height list so rows fade beneath it. */+export function InboxListLayout(props: ParentProps<{ tabs: JSX.Element }>) {+ return (+ <div+ class="relative flex size-full min-h-0 min-w-0 flex-col"+ style={{+ '--mobile-content-inset-top': 'calc(var(--safe-top, 0px) + 3.75rem)',+ }}+ >+ <InboxHeader>{props.tabs}</InboxHeader>+ {props.children}+ <Show when={isTouchDevice()}>+ <MobileTopEdgeFade />+ </Show>+ </div>+ );+}diff --git a/apps/web/src/features/inbox-view/components/InboxList.tsx b/apps/web/src/features/inbox-view/components/InboxList.tsxindex 932fca71d4..e7a44939b5 100644--- a/apps/web/src/features/inbox-view/components/InboxList.tsx+++ b/apps/web/src/features/inbox-view/components/InboxList.tsx@@ -38,6 +38,7 @@ import {import CaretDownIcon from '@phosphor/caret-down.svg';import CheckIcon from '@phosphor/check.svg';import SpinnerIcon from '@phosphor/spinner.svg';+import { createElementSize } from '@solid-primitives/resize-observer';import { debounce } from '@solid-primitives/scheduled';import { Button, cn } from '@ui';import {@@ -208,6 +209,8 @@ export function InboxList(props: InboxListProps) {}const [viewport, setViewport] = createSignal<HTMLDivElement>();+ const [topSpacer, setTopSpacer] = createSignal<HTMLDivElement>();+ const topSpacerSize = createElementSize(topSpacer);const [emptyViewport, setEmptyViewport] = createSignal<HTMLDivElement>();const [virtualizer, setVirtualizer] = createSignal<VirtualizerHandle>();const [isPullRefreshing, setIsPullRefreshing] = createSignal(false);@@ -449,8 +452,7 @@ export function InboxList(props: InboxListProps) {aria-multiselectable="true"aria-activedescendant={list.focus.key()}tabIndex={0}- class="soup-list relative mt-3 flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden outline-none"- style={{ '--mobile-content-inset-top': '0px' }}+ class="soup-list relative mt-3 flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden outline-none touch:mt-0"><PullToRefreshscrollContainer={pullScrollContainer}@@ -481,7 +483,7 @@ export function InboxList(props: InboxListProps) {!forceEmptyState() && source.isLoading() && !isPullRefreshing()}>- <div class="grid min-h-0 flex-1 place-items-center text-ink-muted">+ <div class="grid min-h-0 flex-1 place-items-center text-ink-muted touch:pt-(--mobile-content-inset-top)"><SpinnerIconaria-label="Loading notifications"class="size-5 animate-spin"@@ -492,7 +494,7 @@ export function InboxList(props: InboxListProps) {<Match when={!forceEmptyState() && source.error()}><divref={setEmptyViewport}- class="flex min-h-0 flex-1 flex-col items-center justify-center gap-3 overflow-y-auto pb-[max(1rem,var(--mobile-content-inset-bottom,0px))] text-sm text-ink-muted"+ class="flex min-h-0 flex-1 flex-col items-center justify-center gap-3 overflow-y-auto pb-[max(1rem,var(--mobile-content-inset-bottom,0px))] touch:pt-(--mobile-content-inset-top) text-sm text-ink-muted"><span>Notifications couldn’t be loaded.</span><Button@@ -522,10 +524,19 @@ export function InboxList(props: InboxListProps) {}}class="scrollbar-hidden min-h-0 flex-1 overflow-y-auto overscroll-none pb-[max(0.5rem,var(--mobile-content-inset-bottom,0px))]">+ {/* The spacer scrolls away; the viewport stays behind the filters. */}+ <div+ ref={setTopSpacer}+ aria-hidden="true"+ class="h-0 touch:h-(--mobile-content-inset-top)"+ /><Virtualizerref={registerVirtualizer}data={rows()}scrollRef={viewport()}+ startMargin={+ isTouchDevice() ? (topSpacerSize.height ?? 0) : 0+ }bufferSize={500}itemSize={88}keepMounted={diff --git a/apps/web/src/features/inbox-view/inbox-view.tsx b/apps/web/src/features/inbox-view/inbox-view.tsxindex b45d055622..9f90c05653 100644--- a/apps/web/src/features/inbox-view/inbox-view.tsx+++ b/apps/web/src/features/inbox-view/inbox-view.tsx@@ -10,7 +10,7 @@ import { type EntityData, ListEntityMetadataQueryProvider } from '@entity';import SpinnerIcon from '@phosphor/spinner.svg';import { EmptyStatePanel } from '@ui';import { createEffect, createSignal, onMount, Show, Suspense } from 'solid-js';-import { InboxHeader } from './components/InboxHeader';+import { InboxListLayout } from './components/InboxHeader';import { InboxList } from './components/InboxList';import { InboxTabs } from './components/InboxTabs';import { InboxViewProvider, useInboxView } from './inbox-view-context';@@ -37,17 +37,14 @@ function NotificationsListPane(props: {onPreviewEntityChange: (entity: EntityData | undefined) => void;}) {return (- <>- <InboxHeader>- <InboxTabs />- </InboxHeader>+ <InboxListLayout tabs={<InboxTabs />}><Suspense fallback={<InboxFallback />}><InboxListpreviewEntity={props.previewEntity}onPreviewEntityChange={props.onPreviewEntityChange}/></Suspense>- </>+ </InboxListLayout>);}diff --git a/apps/web/src/features/next-soup/soup-view/filters-bar/mobile-filter-drawer.tsx b/apps/web/src/features/next-soup/soup-view/filters-bar/mobile-filter-drawer.tsxindex 8da183ea97..5de70a19ab 100644--- a/apps/web/src/features/next-soup/soup-view/filters-bar/mobile-filter-drawer.tsx+++ b/apps/web/src/features/next-soup/soup-view/filters-bar/mobile-filter-drawer.tsx@@ -29,12 +29,10 @@ import { enableMultiInbox } from '@core/constant/featureFlags';import { useUserId } from '@core/context/user';import { useAddInboxFlow } from '@core/email-link';import { Accordion } from '@kobalte/core/accordion';-import CheckIcon from '@phosphor/check.svg';import CircleDashedIcon from '@phosphor/circle-dashed.svg';import SearchIcon from '@phosphor/magnifying-glass.svg';import PlusIcon from '@phosphor/plus.svg';import { useContacts } from '@queries/contacts/contacts';-import { cn } from '@ui';import { createMemo, createSignal, For, Show } from 'solid-js';import { ConsolidatedFilterChip } from './consolidated-filter-chip';import { useInboxPicker } from './inbox-picker';@@ -321,25 +319,14 @@ export const MobileFilterDrawer = (props: {{(option) => {const active = () => activeSort() === option.value;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={() => setSort(option.value)}+ <FilterDrawer.Option+ selectionMode="single"+ checked={active()}+ onChange={() => setSort(option.value)}+ icon={option.icon?.()}>- <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>+ {option.label}+ </FilterDrawer.Option>);}}</For>@@ -377,44 +364,19 @@ export const MobileFilterDrawer = (props: {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={() => toggleInbox(option.id)}+ <div class="w-full flex items-stretch gap-1">+ <FilterDrawer.Option+ class="min-w-0 flex-1"+ checked={active()}+ onChange={() => toggleInbox(option.id)}+ icon={option.icon?.()}>- <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>+ {option.label}+ </FilterDrawer.Option><Show when={picker.hasMultiple()}><buttontype="button"- class="shrink-0 px-3 text-xs text-ink-muted hover:text-ink hover:bg-hover transition-colors"+ class="shrink-0 rounded-xl px-3 text-xs text-ink-muted hover:text-ink hover:bg-ink/6 transition-colors"aria-label={isSole()? 'Show all inboxes'@@ -430,16 +392,15 @@ export const MobileFilterDrawer = (props: {}}</For><Show when={multiInboxFlag().enabled}>- <button+ <MobileDrawer.Itemtype="button"- class="w-full flex items-center gap-3 px-3 py-2.5 text-sm hover:bg-hover transition-colors text-left bg-surface not-last:mb-px"onClick={() => void addInbox()}><span class="size-4 flex items-center justify-center shrink-0"><PlusIcon class="size-4 text-ink-muted" /></span><span class="flex-1 truncate">Connect another account</span>- </button>+ </MobileDrawer.Item></Show></FilterDrawer.Section></Show>@@ -489,7 +450,7 @@ export const MobileFilterDrawer = (props: {activeCount={assigneeFilter().length}>{/* Search */}- <div class="flex items-center gap-2 px-3 py-2 muted bg-surface mb-px">+ <div class="flex min-h-11 items-center gap-2 rounded-[20px] px-3 py-2 bg-ink/5 mb-1"><SearchIcon class="size-3.5 text-ink-muted shrink-0" /><inputtype="text"@@ -497,7 +458,7 @@ export const MobileFilterDrawer = (props: {value={assigneeSearch()}onInput={(e) => setAssigneeSearch(e.currentTarget.value)}placeholder="Search assignees..."- class="flex-1 bg-transparent text-sm outline-none placeholder:text-ink-placeholder"+ class="min-w-0 flex-1 bg-transparent text-base outline-none placeholder:text-ink-placeholder"/></div><div class="max-h-[calc(50*var(--dvh))] overflow-y-auto scrollbar-hidden">@@ -505,35 +466,13 @@ export const MobileFilterDrawer = (props: {{(option) => {const active = () => assigneeFilter().includes(option.id);return (- <button- type="button"- role="checkbox"- aria-checked={active()}- class="w-full flex items-center gap-3 px-4 py-2.5 text-sm hover:bg-hover transition-colors text-left bg-surface not-last:mb-px"- onClick={() => toggleAssignee(option.id)}+ <FilterDrawer.Option+ checked={active()}+ onChange={() => toggleAssignee(option.id)}+ icon={option.icon()}>- <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>- <span class="size-4 flex items-center justify-center shrink-0">- {option.icon()}- </span>- <span- class={cn(- 'flex-1 truncate',- active() ? 'text-ink' : 'text-ink-muted'- )}- >- {option.label}- </span>- </button>+ {option.label}+ </FilterDrawer.Option>);}}</For>@@ -552,7 +491,7 @@ export const MobileFilterDrawer = (props: {label="Created by"activeCount={createdByIds().length}>- <div class="flex items-center gap-2 px-3 py-2 muted bg-surface mb-px">+ <div class="flex min-h-11 items-center gap-2 rounded-[20px] px-3 py-2 bg-ink/5 mb-1"><SearchIcon class="size-3.5 text-ink-muted shrink-0" /><inputtype="text"@@ -560,7 +499,7 @@ export const MobileFilterDrawer = (props: {value={createdBySearch()}onInput={(e) => setCreatedBySearch(e.currentTarget.value)}placeholder="Search creators..."- class="flex-1 bg-transparent text-sm outline-none placeholder:text-ink-placeholder"+ class="min-w-0 flex-1 bg-transparent text-base outline-none placeholder:text-ink-placeholder"/></div><div class="max-h-[calc(50*var(--dvh))] overflow-y-auto scrollbar-hidden">@@ -568,35 +507,13 @@ export const MobileFilterDrawer = (props: {{(option) => {const active = () => createdByIds().includes(option.id);return (- <button- type="button"- role="checkbox"- aria-checked={active()}- class="w-full flex items-center gap-3 px-4 py-2.5 text-sm hover:bg-hover transition-colors text-left bg-surface not-last:mb-px"- onClick={() => toggleCreatedBy(option.id)}+ <FilterDrawer.Option+ checked={active()}+ onChange={() => toggleCreatedBy(option.id)}+ icon={option.icon()}>- <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>- <span class="size-4 flex items-center justify-center shrink-0">- {option.icon()}- </span>- <span- class={cn(- 'flex-1 truncate',- active() ? 'text-ink' : 'text-ink-muted'- )}- >- {option.label}- </span>- </button>+ {option.label}+ </FilterDrawer.Option>);}}</For>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.tsxindex de9a923de1..3d681d38f7 100644--- 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.tsx@@ -1,16 +1,9 @@-import {- MobileDrawer,- scrollToFocusedInput,-} from '@components/app/mobile/MobileDrawer';-import { pressPulse } from '@components/app/mobile/pressPulse';-import { ScrollIndicators } from '@core/component/VerticalScrollIndicators';+import { MobileFilterDrawer } from '@app/components/view-shell/MobileFilterDrawer';+import { MobileDrawer } from '@components/app/mobile/MobileDrawer';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 { 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';@@ -27,25 +20,14 @@ function SingleFacetContent(props: { facet: SingleFacet }) {{(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)}+ <MobileFilterDrawer.Option+ selectionMode="single"+ checked={active()}+ onChange={() => props.facet.onSelect(option.id)}+ icon={option.icon?.()}>- <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>+ {option.label}+ </MobileFilterDrawer.Option>);}}</For>@@ -75,7 +57,11 @@ function MultiFacetContent(props: { facet: MultiFacet }) {<>{/* 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">+ <div+ class="flex gap-1 rounded-[20px] bg-ink/5 p-1 mb-1"+ role="radiogroup"+ aria-label="Match"+ ><Foreach={[{ id: 'any', label: 'Match any' } as const,@@ -90,7 +76,7 @@ function MultiFacetContent(props: { facet: MultiFacet }) {role="radio"aria-checked={active()}class={cn(- 'flex-1 px-3 py-2 text-sm transition-colors hover:bg-hover',+ 'min-h-10 flex-1 rounded-2xl px-3 py-2 text-sm transition-colors hover:bg-ink/6 aria-checked:bg-ink/8',active() ? 'text-accent font-medium' : 'text-ink-muted')}onClick={() => props.facet.mode?.onSelect(option.id)}@@ -104,7 +90,7 @@ function MultiFacetContent(props: { facet: MultiFacet }) {</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">+ <div class="flex min-h-11 items-center gap-2 rounded-[20px] px-3 py-2 bg-ink/5 mb-1"><SearchIcon class="size-3.5 text-ink-muted shrink-0" /><inputtype="text"@@ -112,7 +98,7 @@ function MultiFacetContent(props: { facet: MultiFacet }) {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"+ class="min-w-0 flex-1 bg-transparent text-base outline-none placeholder:text-ink-placeholder"/></div></Show>@@ -126,46 +112,21 @@ function MultiFacetContent(props: { facet: MultiFacet }) {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)}+ <div class="w-full flex items-stretch gap-1">+ <MobileFilterDrawer.Option+ class="min-w-0 flex-1"+ checked={active()}+ onChange={() => toggle(option.id)}+ icon={option.icon?.()}>- <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>+ {option.label}+ </MobileFilterDrawer.Option><Showwhen={props.facet.onOnly && props.facet.options().length > 1}><buttontype="button"- class="shrink-0 px-3 text-xs text-ink-muted hover:text-ink hover:bg-hover transition-colors"+ class="shrink-0 rounded-xl px-3 text-xs text-ink-muted hover:text-ink hover:bg-ink/6 transition-colors"aria-label={isSole()? `Show all ${props.facet.label.toLowerCase()}`@@ -196,7 +157,10 @@ function FacetSection(props: { facet: SearchFacetVM }) {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">+ <Accordion.Trigger+ as={MobileDrawer.Item}+ class="group justify-between font-medium data-expanded:bg-ink/5"+ ><span class="font-medium">{props.facet.label}</span><div class="flex items-center gap-2"><Show when={!props.facet.isDefault()}>@@ -219,7 +183,7 @@ function FacetSection(props: { facet: SearchFacetVM }) {</div></Accordion.Trigger></Accordion.Header>- <Accordion.Content>+ <Accordion.Content class="pt-1"><Switch><Match when={props.facet.kind === 'single' && props.facet}>{(facet) => <SingleFacetContent facet={facet()} />}@@ -252,71 +216,17 @@ export const MobileSearchFilterDrawer = (props: { class?: string }) => {for (const facet of facets()) facet.reset();};- const [scrollRef, setScrollRef] = createSignal<HTMLElement>();-return (- <MobileDrawer- side="bottom"- preventScroll={false}- preventScrollbarShift={false}- breakPoints={[0.85]}+ <MobileFilterDrawer+ class={props.class}+ triggerLabel="Open search filters"+ label="Search filters"+ activeCount={activeCount()}+ onClear={resetAll}>- <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="outline"- size="sm"- class="min-h-10 rounded-lg bg-active!"- >- <XIcon class="size-3!" />- Clear all- </Button>- </div>- </Show>- </MobileDrawer.Content>- </MobileDrawer.Portal>- </MobileDrawer>+ <Accordion multiple collapsible defaultValue={['type']}>+ <For each={facets()}>{(facet) => <FacetSection facet={facet} />}</For>+ </Accordion>+ </MobileFilterDrawer>);};diff --git a/apps/web/src/features/next-soup/soup-view/sort-options.tsx b/apps/web/src/features/next-soup/soup-view/sort-options.tsxindex 297e0dcbb2..0d592b8c21 100644--- a/apps/web/src/features/next-soup/soup-view/sort-options.tsx+++ b/apps/web/src/features/next-soup/soup-view/sort-options.tsx@@ -8,9 +8,9 @@ import {getTaskPriorityOptionId,getTaskStatusOptionId,} from '@entity/utils/task-properties';-import ArrowClockwiseIcon from '@phosphor/arrow-clockwise.svg';-import ClockIcon from '@phosphor/clock.svg';-import EyeIcon from '@phosphor/eye.svg';+import CalendarIcon from '@icon/wide-calendar.svg';+import EditIcon from '@icon/wide-edit.svg';+import EyeIcon from '@icon/wide-eye.svg';import FlagIcon from '@phosphor/flag.svg';import ListChecksIcon from '@phosphor/list-checks.svg';import { PROPERTY_OPTION_IDS } from '@property/constants';@@ -179,12 +179,12 @@ const SORT_OPTIONS = [{value: 'updated_at',label: 'Last updated',- icon: () => <ArrowClockwiseIcon class="size-3.5" />,+ icon: () => <EditIcon class="size-3.5" />,},{value: 'created_at',label: 'Date created',- icon: () => <ClockIcon class="size-3.5" />,+ icon: () => <CalendarIcon class="size-3.5" />,},{value: 'priority',diff --git a/apps/web/src/features/next-soup/soup-view/soup-view-context.tsx b/apps/web/src/features/next-soup/soup-view/soup-view-context.tsxindex 19e63b5841..a128312073 100644--- a/apps/web/src/features/next-soup/soup-view/soup-view-context.tsx+++ b/apps/web/src/features/next-soup/soup-view/soup-view-context.tsx@@ -623,7 +623,7 @@ export const SoupViewContextProvider: FlowComponent<// List/board display mode — per-entry state so back/forward restores the// mode the user left each entry with.const [viewMode, setViewMode] = useEntryState<SoupViewMode>('soup.viewMode', {- default: 'board',+ default: isTouchDevice() ? 'list' : 'board',});const [readFilter, setReadFilter] = makeFlaggedPersisted(useEntryState<ReadFilter>('soup.readFilter', { default: 'all' }),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 02ea6d8902..67024f75c5 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@@ -453,7 +453,9 @@ export const SoupView = (props: SoupViewProps) => {if (owners.length > 0 !== soup.predicates.isActive('company-owner')) {soup.predicates.toggle({ and: ['company-owner'] });}- soupView.setViewMode(initialCrmView.viewMode ?? 'board');+ soupView.setViewMode(+ initialCrmView.viewMode ?? (isTouchDevice() ? 'list' : 'board')+ );}});});@@ -768,16 +770,19 @@ export const SoupView = (props: SoupViewProps) => {content that is already constrained in both layouts. */}<Showwhen={- (isTouchDevice()- ? isComponentListView('agents')- : ENABLE_UNIFIED_LIST_AI_INPUT) &&+ !isTouchDevice() &&+ ENABLE_UNIFIED_LIST_AI_INPUT &&!isInboxView() &&!panel.handle.isControllerSplit() &&!isBoardRendered() &&!isComponentListView('search')}>- <SoupChatInput />+ <div class="absolute bottom-0 inset-x-px pb-2.5 px-2 flex justify-center pointer-events-none">+ <div class="pointer-events-auto w-full min-w-0 max-w-3xl">+ <SoupChatInput />+ </div>+ </div></Show></Suspense></div>@@ -1338,7 +1343,7 @@ const SoupViewListContent = (props: SoupViewListProps) => {<Match when={showLoadError()}><divref={setEmptyStateRef}- class="flex-1 min-h-0 flex flex-col touch:pt-(--mobile-content-inset-top) touch:pb-(--mobile-content-inset-bottom)"+ class="flex-1 min-h-0 flex flex-col touch:pb-(--mobile-content-inset-bottom)"><LoadErrorPanel onRetry={retryLoad} /></div>@@ -1370,7 +1375,7 @@ const SoupViewListContent = (props: SoupViewListProps) => {<Match when={showEmptyState()}><divref={setEmptyStateRef}- class="flex-1 min-h-0 flex flex-col touch:pt-(--mobile-content-inset-top) touch:pb-(--mobile-content-inset-bottom)"+ class="flex-1 min-h-0 flex flex-col touch:pb-(--mobile-content-inset-bottom)"><EmptyStatelistView={currentView()}diff --git a/apps/web/src/features/next-soup/soup-view/views/companies/CrmDefaultView.test.tsx b/apps/web/src/features/next-soup/soup-view/views/companies/CrmDefaultView.test.tsxnew file mode 100644index 0000000000..df58230e68--- /dev/null+++ b/apps/web/src/features/next-soup/soup-view/views/companies/CrmDefaultView.test.tsx@@ -0,0 +1,55 @@+import type { CrmViewConfig } from '@companies/crm/saved-views';+import { cleanup, render } from '@solidjs/testing-library';+import { afterEach, describe, expect, it, vi } from 'vitest';++const mocks = vi.hoisted(() => ({+ mobile: true,+ apply: vi.fn(),+ config: {+ kind: 'crm',+ viewMode: 'board',+ searchText: 'Acme',+ } as CrmViewConfig,+}));+vi.mock('@core/mobile/isTouchDevice', () => ({+ isTouchDevice: () => mocks.mobile,+}));+vi.mock('@companies/crm/saved-views', () => ({+ usePersonalCrmViews: () => ({+ isLoading: () => false,+ defaultView: () => ({ config: mocks.config }),+ }),+ useTeamCrmViews: () => ({+ isLoading: () => false,+ defaultView: () => undefined,+ }),+}));+vi.mock(+ '@app/features/next-soup/soup-view/views/companies/use-apply-crm-view',+ () => ({+ useApplyCrmView: () => mocks.apply,+ })+);++import { CrmDefaultViewLoader } from './CrmDefaultView';++afterEach(() => {+ cleanup();+ vi.clearAllMocks();+});+describe('CRM default saved layout', () => {+ it('uses a list on mobile while retaining the saved filters', () => {+ mocks.mobile = true;+ render(() => <CrmDefaultViewLoader />);+ expect(mocks.apply).toHaveBeenCalledWith({+ ...mocks.config,+ viewMode: 'list',+ });+ expect(mocks.config.viewMode).toBe('board');+ });+ it('retains the saved desktop layout', () => {+ mocks.mobile = false;+ render(() => <CrmDefaultViewLoader />);+ expect(mocks.apply).toHaveBeenCalledWith(mocks.config);+ });+});diff --git a/apps/web/src/features/next-soup/soup-view/views/companies/CrmDefaultView.tsx b/apps/web/src/features/next-soup/soup-view/views/companies/CrmDefaultView.tsxindex 330cf3dc18..8135559900 100644--- a/apps/web/src/features/next-soup/soup-view/views/companies/CrmDefaultView.tsx+++ b/apps/web/src/features/next-soup/soup-view/views/companies/CrmDefaultView.tsx@@ -4,6 +4,7 @@ import {usePersonalCrmViews,useTeamCrmViews,} from '@companies/crm/saved-views';+import { isTouchDevice } from '@core/mobile/isTouchDevice';import { createEffect } from 'solid-js';/**@@ -25,7 +26,9 @@ export function CrmDefaultViewLoader() {const config =personal.defaultView()?.config ??(team.defaultView()?.config as CrmViewConfig | undefined);- if (config) applyView(config);+ if (config) {+ applyView(isTouchDevice() ? { ...config, viewMode: 'list' } : config);+ }});return null;diff --git a/apps/web/src/features/next-soup/soup-view/views/companies/use-apply-crm-view.ts b/apps/web/src/features/next-soup/soup-view/views/companies/use-apply-crm-view.tsindex f375f57107..5c78392370 100644--- a/apps/web/src/features/next-soup/soup-view/views/companies/use-apply-crm-view.ts+++ b/apps/web/src/features/next-soup/soup-view/views/companies/use-apply-crm-view.ts@@ -1,6 +1,7 @@import type { Query } from '@app/features/next-soup/filters/filter-store';import { useSoupView } from '@app/features/next-soup/soup-view/soup-view-context';import type { CrmViewConfig } from '@companies/crm/saved-views';+import { isTouchDevice } from '@core/mobile/isTouchDevice';import { batch } from 'solid-js';/**@@ -45,7 +46,7 @@ export function useApplyCrmView() {if (owners.length > 0 !== soup.predicates.isActive('company-owner')) {soup.predicates.toggle({ and: ['company-owner'] });}- setViewMode(config.viewMode ?? 'board');+ setViewMode(config.viewMode ?? (isTouchDevice() ? 'list' : 'board'));});};}diff --git a/apps/web/src/features/property/extractors/PropertyPill.test.tsx b/apps/web/src/features/property/extractors/PropertyPill.test.tsxindex b8bcbd2bb9..9efe3853cc 100644--- a/apps/web/src/features/property/extractors/PropertyPill.test.tsx+++ b/apps/web/src/features/property/extractors/PropertyPill.test.tsx@@ -61,7 +61,9 @@ describe('PropertyPill', () => {expect(pill.classList).toContain('border-transparent');expect(pill.classList).toContain('bg-transparent');expect(pill.classList).toContain('rounded-full');- expect(pill.classList).toContain('not-disabled:hover:overlay-hover');+ expect(pill.classList).toContain(+ 'not-touch:not-disabled:hover:overlay-hover'+ );await fireEvent.click(pill);expect(onEdit).toHaveBeenCalledOnce();@@ -75,7 +77,9 @@ describe('PropertyPill', () => {));const pill = screen.getByRole('button', { name: 'Status' });- expect(pill.classList).not.toContain('not-disabled:hover:overlay-hover');+ expect(pill.classList).not.toContain(+ 'not-touch:not-disabled:hover:overlay-hover'+ );expect(pill.getAttribute('aria-disabled')).toBe('true');expect(pill.dataset.readonly).toBe('');});diff --git a/apps/web/src/features/settings/MobileSettings.tsx b/apps/web/src/features/settings/MobileSettings.tsxnew file mode 100644index 0000000000..641b50627c--- /dev/null+++ b/apps/web/src/features/settings/MobileSettings.tsx@@ -0,0 +1,70 @@+import { useLogout } from '@core/auth/logout';+import { UserIcon } from '@core/component/UserIcon';+import { useSettingsTabs } from '@core/constant/settingsTabsConfig';+import { useEmail, useUserId } from '@core/context/user';+import { isRealNamePart, useOwnUserName } from '@queries/auth/user-name-self';+import { Show, Suspense } from 'solid-js';+import { useMobileSettings } from './context/mobile-settings';+import { MobileSettingsSheet } from './MobileSettingsSheet';+import { SettingsTabContent } from './SettingsTabContent';++export function MobileSettings() {+ const settings = useMobileSettings();+ const { groups } = useSettingsTabs();+ const userId = useUserId();+ const email = useEmail();+ const name = useOwnUserName();+ const logout = useLogout();+ const displayName = () => {+ const value = name();+ return (+ [value?.first_name, value?.last_name].filter(isRealNamePart).join(' ') ||+ email()?.split('@')[0] ||+ 'Your account'+ );+ };+ const mobileGroups = () => {+ const general =+ groups().find((group) => group.label === 'General')?.items ?? [];+ const preferences = general.filter((item) =>+ ['Appearance', 'Notifications'].includes(item.tab)+ );+ return [+ {+ label: 'Account',+ items: general.filter((item) => !preferences.includes(item)),+ },+ { label: 'Preferences', items: preferences },+ ...groups().filter((group) => group.label !== 'General'),+ ].filter((group) => group.items.length > 0);+ };++ return (+ <MobileSettingsSheet+ open={settings.open()}+ page={settings.page()}+ groups={mobileGroups()}+ name={displayName()}+ email={email() ?? ''}+ avatar={+ <Suspense fallback={<span>{displayName().slice(0, 1)}</span>}>+ <Show+ when={userId()}+ keyed+ fallback={<span>{displayName().slice(0, 1)}</span>}+ >+ {(id) => (+ <UserIcon id={id} size="fill" suppressClick showTooltip={false} />+ )}+ </Show>+ </Suspense>+ }+ onClose={settings.close}+ onNavigate={settings.selectPage}+ onLogout={() => {+ void logout();+ }}+ renderPage={(page) => <SettingsTabContent tab={page} />}+ />+ );+}diff --git a/apps/web/src/features/settings/MobileSettingsSheet.css b/apps/web/src/features/settings/MobileSettingsSheet.cssnew file mode 100644index 0000000000..32e6c5750a--- /dev/null+++ b/apps/web/src/features/settings/MobileSettingsSheet.css@@ -0,0 +1,16 @@+@keyframes mobile-settings-enter {+ from { opacity: 0; transform: translateX(12px); }+ to { opacity: 1; transform: translateX(0); }+}++.mobile-settings-detail,+.mobile-settings-home {+ animation: mobile-settings-enter 180ms ease-out;+}++@media (prefers-reduced-motion: reduce) {+ .mobile-settings-detail,+ .mobile-settings-home {+ animation: none;+ }+}diff --git a/apps/web/src/features/settings/MobileSettingsSheet.test.tsx b/apps/web/src/features/settings/MobileSettingsSheet.test.tsxnew file mode 100644index 0000000000..e957937dd6--- /dev/null+++ b/apps/web/src/features/settings/MobileSettingsSheet.test.tsx@@ -0,0 +1,108 @@+import type { SettingsTab } from '@core/constant/SettingsState';+import type { SettingsTabGroup } from '@core/constant/settingsTabsConfig';+import {+ cleanup,+ fireEvent,+ render,+ screen,+ waitFor,+} from '@solidjs/testing-library';+import { createSignal, type JSX, type ParentProps } from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { createMobileSettingsState } from './context/mobile-settings';+import { MobileSettingsSheet } from './MobileSettingsSheet';++vi.mock('@core/mobile/virtualKeyboard', () => ({+ virtualKeyboardVisible: () => false,+}));+vi.mock('@ui', () => ({+ cn: (...values: unknown[]) => values.filter(Boolean).join(' '),+ Layer: (props: ParentProps) => props.children,+ Button: (props: JSX.ButtonHTMLAttributes<HTMLButtonElement>) => (+ <button {...props} />+ ),+}));++class ResizeObserverStub {+ observe() {}+ unobserve() {}+ disconnect() {}+}++beforeEach(() => {+ vi.stubGlobal('ResizeObserver', ResizeObserverStub);+ vi.stubGlobal('scrollTo', vi.fn());+});++afterEach(() => {+ cleanup();+ vi.unstubAllGlobals();+});++const groups: SettingsTabGroup[] = [+ {+ label: 'Account',+ items: [{ tab: 'Account', label: 'Account', icon: () => <svg /> }],+ },+];++function setup(tab: SettingsTab) {+ const settings = createMobileSettingsState();+ const [availableGroups, setAvailableGroups] = createSignal(groups);+ const onClose = vi.fn(settings.close);+ const renderPage = vi.fn((page: SettingsTab) => <div>{page} form</div>);+ settings.openSettings(tab);+ render(() => (+ <MobileSettingsSheet+ open={settings.open()}+ page={settings.page()}+ groups={availableGroups()}+ name="Test User"+ email="[email protected]"+ avatar={<span>T</span>}+ onClose={onClose}+ onNavigate={settings.selectPage}+ onLogout={() => {}}+ renderPage={renderPage}+ />+ ));+ return { settings, setAvailableGroups, onClose, renderPage };+}++describe('unavailable mobile settings sections', () => {+ it.each<SettingsTab>(['Admin', 'CRM', 'Subscription'])(+ 'shows a recovery action for unavailable %s without mounting its form',+ async (tab) => {+ const { settings, onClose, renderPage } = setup(tab);+ expect(screen.getByRole('status').textContent).toBe(+ 'This settings section is unavailable.'+ );+ expect(renderPage).not.toHaveBeenCalled();+ fireEvent.click(screen.getByText('Back to settings'));+ expect(settings.page()).toBeUndefined();+ expect(settings.open()).toBe(true);+ expect(onClose).not.toHaveBeenCalled();+ expect(screen.queryByRole('status')).toBeNull();+ expect(screen.getByRole('button', { name: 'Edit profile' })).toBeTruthy();+ await waitFor(() => {+ expect(document.activeElement).toBe(+ screen.getByRole('heading', { name: 'Settings' })+ );+ });+ }+ );++ it('renders available sections and reacts when availability changes', () => {+ const { setAvailableGroups } = setup('Account');+ expect(screen.getByText('Account form')).toBeTruthy();+ expect(screen.queryByRole('status')).toBeNull();+ setAvailableGroups([]);+ expect(screen.queryByText('Account form')).toBeNull();+ expect(screen.getByRole('status').textContent).toBe(+ 'This settings section is unavailable.'+ );+ setAvailableGroups(groups);+ expect(screen.getByText('Account form')).toBeTruthy();+ expect(screen.queryByRole('status')).toBeNull();+ });+});diff --git a/apps/web/src/features/settings/MobileSettingsSheet.tsx b/apps/web/src/features/settings/MobileSettingsSheet.tsxnew file mode 100644index 0000000000..f113b559cc--- /dev/null+++ b/apps/web/src/features/settings/MobileSettingsSheet.tsx@@ -0,0 +1,231 @@+import './MobileSettingsSheet.css';+import { MobileDrawer } from '@components/app/mobile/MobileDrawer';+import type { SettingsTab } from '@core/constant/SettingsState';+import type { SettingsTabGroup } from '@core/constant/settingsTabsConfig';+import CaretLeftIcon from '@phosphor/caret-left.svg';+import CaretRightIcon from '@phosphor/caret-right.svg';+import PencilIcon from '@phosphor/pencil-simple.svg';+import SignOutIcon from '@phosphor/sign-out.svg';+import XIcon from '@phosphor/x.svg';+import { Button } from '@ui';+import { ErrorBoundary, For, type JSX, Show, Suspense } from 'solid-js';+import { Dynamic } from 'solid-js/web';+import { SettingsSheetContext } from './primitives';++type MobileSettingsSheetProps = {+ open: boolean;+ page?: SettingsTab;+ groups: SettingsTabGroup[];+ name: string;+ email: string;+ avatar: JSX.Element;+ onClose: () => void;+ onNavigate: (page?: SettingsTab) => void;+ onLogout: () => void;+ renderPage: (page: SettingsTab) => JSX.Element;+};++/** Mobile presentation; account data and settings actions are supplied by the host. */+export function MobileSettingsSheet(props: MobileSettingsSheetProps) {+ let mainScrollTop = 0;+ let scrollRef: HTMLDivElement | undefined;+ let headingRef: HTMLHeadingElement | undefined;++ const pageLabel = () =>+ props.groups+ .flatMap((group) => group.items)+ .find((item) => item.tab === props.page)?.label ??+ props.page ??+ 'Settings';++ const navigate = (page?: SettingsTab) => {+ if (!props.page) mainScrollTop = scrollRef?.scrollTop ?? 0;+ props.onNavigate(page);+ queueMicrotask(() => headingRef?.focus({ preventScroll: true }));+ };++ return (+ <MobileDrawer+ open={props.open}+ onOpenChange={(open) => {+ if (!open) {+ mainScrollTop = 0;+ props.onClose();+ }+ }}+ side="bottom"+ closeOnOutsidePointerStrategy="pointerdown"+ >+ <MobileDrawer.Portal>+ <MobileDrawer.Overlay />+ <MobileDrawer.Content+ aria-label="Settings"+ targetHeight={94}+ maxHeight={94}+ class="mobile-settings-sheet overflow-hidden [--mobile-content-inset-top:0px] [--mobile-content-inset-bottom:0px]"+ >+ <MobileDrawer.Handle class="pb-1" />+ <header class="grid shrink-0 grid-cols-[44px_1fr_44px] items-center gap-2 px-5 pb-3 pt-1">+ <Show when={props.page} fallback={<span />}>+ <Button+ variant="ghost"+ size="icon-sm"+ aria-label="Back to settings"+ class="size-11 rounded-full bg-ink/6"+ onClick={() => navigate()}+ >+ <CaretLeftIcon class="size-5" />+ </Button>+ </Show>+ <h1+ ref={headingRef}+ tabIndex={-1}+ class="text-center text-lg font-semibold text-ink outline-none"+ >+ {pageLabel()}+ </h1>+ <MobileDrawer.Close+ as={Button}+ variant="ghost"+ size="icon-sm"+ aria-label="Close settings"+ class="size-11 rounded-full bg-ink/6"+ >+ <XIcon class="size-5" />+ </MobileDrawer.Close>+ </header>+ <Show+ when={props.page}+ keyed+ fallback={+ <MobileDrawer.ScrollBody+ ref={(el: HTMLDivElement) => {+ scrollRef = el;+ queueMicrotask(() => {+ el.scrollTop = mainScrollTop;+ });+ }}+ class="mobile-settings-home"+ >+ <button+ type="button"+ aria-label="Edit profile"+ onClick={() => navigate('Account')}+ class="mx-6 mb-7 flex shrink-0 flex-col items-center rounded-3xl px-4 pb-3 pt-2 text-center active:bg-ink/3"+ >+ <span class="relative mb-3 block size-20">+ <span class="flex size-20 items-center justify-center overflow-hidden rounded-full bg-ink/8 text-2xl font-medium">+ {props.avatar}+ </span>+ <span class="absolute! -bottom-1 -right-1 flex size-7 items-center justify-center rounded-full border-2 border-menu-glass bg-menu text-ink">+ <PencilIcon class="size-3.5" />+ </span>+ </span>+ <span class="ph-no-capture max-w-full truncate text-xl font-semibold text-ink">+ {props.name}+ </span>+ <span class="ph-no-capture mt-1 max-w-full truncate text-sm text-ink-muted">+ {props.email}+ </span>+ </button>+ <div class="flex flex-col gap-6 px-3">+ <For each={props.groups}>+ {(group) => (+ <section>+ <h2 class="px-4 pb-2 text-sm font-medium text-ink-muted">+ {group.label}+ </h2>+ <div class="overflow-hidden rounded-[26px] bg-ink/5 p-1">+ <For each={group.items}>+ {(item, index) => (+ <>+ <Show when={index() > 0}>+ <div class="ml-12 mr-3 h-px bg-ink/6" />+ </Show>+ <MobileDrawer.Item+ onClick={() => navigate(item.tab)}+ class="min-h-13 gap-3.5 px-3.5 text-base"+ >+ <Dynamic+ component={item.icon}+ class="size-5 shrink-0"+ />+ <span class="min-w-0 flex-1 text-left">+ {item.label}+ </span>+ <CaretRightIcon class="size-4 shrink-0 text-ink-extra-muted" />+ </MobileDrawer.Item>+ </>+ )}+ </For>+ </div>+ </section>+ )}+ </For>+ <div class="mb-3 rounded-[26px] bg-ink/5 p-1">+ <MobileDrawer.Item+ onClick={props.onLogout}+ class="min-h-13 gap-3.5 px-3.5 text-base text-failure"+ >+ <SignOutIcon class="size-5" />+ Log out+ </MobileDrawer.Item>+ </div>+ </div>+ </MobileDrawer.ScrollBody>+ }+ >+ {(page) => (+ <SettingsSheetContext.Provider value={true}>+ <div+ class="mobile-settings-detail relative min-h-0 flex-1"+ data-settings-detail={page}+ >+ <ErrorBoundary+ fallback={(_error, reset) => (+ <div class="flex h-full flex-col items-center justify-center gap-4 px-8 text-center">+ <p class="text-sm text-ink-muted">+ This settings page couldn’t load.+ </p>+ <Button onClick={reset}>Try again</Button>+ </div>+ )}+ >+ <Suspense+ fallback={+ <div+ role="status"+ class="p-8 text-center text-sm text-ink-muted"+ >+ Loading settings…+ </div>+ }+ >+ <Show+ when={props.groups.some((group) =>+ group.items.some((item) => item.tab === page)+ )}+ fallback={+ <div class="flex h-full flex-col items-center justify-center gap-4 px-8 text-center">+ <p role="status" class="text-sm text-ink-muted">+ This settings section is unavailable.+ </p>+ <Button onClick={() => navigate()}>+ Back to settings+ </Button>+ </div>+ }+ >+ {props.renderPage(page)}+ </Show>+ </Suspense>+ </ErrorBoundary>+ </div>+ </SettingsSheetContext.Provider>+ )}+ </Show>+ </MobileDrawer.Content>+ </MobileDrawer.Portal>+ </MobileDrawer>+ );+}diff --git a/apps/web/src/features/settings/Settings.tsx b/apps/web/src/features/settings/Settings.tsxindex 1ddffd26f3..713d13ff78 100644--- a/apps/web/src/features/settings/Settings.tsx+++ b/apps/web/src/features/settings/Settings.tsx@@ -1,5 +1,4 @@-import { Billing } from '@app/features/settings/Billing';-import { Bots } from '@app/features/settings/Bots';+import { toBaseRelative } from '@app/constants/routerBase';import { PillTabs } from '@components/app/mobile/PillTabs';import { HeaderIsland } from '@components/app/split-layout/components/HeaderIsland';import {@@ -14,6 +13,7 @@ import {settingsTabFromSplitPath,useSettingsState,} from '@core/constant/SettingsState';+import { stripSettingsSplitFromUrl } from '@core/constant/settingsSplitUrl';import { useSettingsTabs } from '@core/constant/settingsTabsConfig';import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';import type { ValidHotkey } from '@core/hotkey/types';@@ -24,7 +24,7 @@ import ArrowsIn from '@phosphor/arrows-in.svg';import ArrowsOut from '@phosphor/arrows-out.svg';import CaretLeftIcon from '@phosphor/caret-left.svg';import SignOutIcon from '@phosphor/sign-out.svg';-import { useLocation } from '@solidjs/router';+import { useLocation, useNavigate } from '@solidjs/router';import { Button, cn, Layer, SideNav } from '@ui';import {createRenderEffect,@@ -33,23 +33,9 @@ import {onCleanup,onMount,Show,- Suspense,untrack,} from 'solid-js';-import { Account } from './Account';-import { Admin } from './Admin';-import { Agent } from './Agent';-import { Agents } from './Agents';-import { ApiKeys } from './ApiKeys';-import { Appearance } from './Appearance';-import { ConnectedAccounts } from './ConnectedAccounts';-import { Crm } from './Crm';-import { Harness } from './Harness';-import { MobileApp } from './MobileApp';-import { Notifications } from './Notifications';-import { Shortcuts } from './Shortcuts';-import { Tags } from './Tags';-import { Team } from './Team';+import { SettingsTabContent } from './SettingsTabContent';/** Where the settings panel is mounted, which determines its header chrome. */export type SettingsVariant = 'split' | 'fullscreen';@@ -75,7 +61,29 @@ export function SettingsPanelComponentWrapper() {const tab = settingsTabFromSplitPath(location.pathname);if (tab && untrack(activeTabId) !== tab) setActiveTabId(tab);});- return <SettingsPanel variant={isSoloSettings() ? 'fullscreen' : 'split'} />;+ return (+ <Show when={!isMobile()} fallback={<MobileSettingsDeepLink />}>+ <SettingsPanel variant={isSoloSettings() ? 'fullscreen' : 'split'} />+ </Show>+ );+}++/** Old settings URLs still open their section, over the restored app surface. */+function MobileSettingsDeepLink() {+ const location = useLocation();+ const navigate = useNavigate();+ const { openSettings } = useSettingsState();+ onMount(() => {+ const tab = settingsTabFromSplitPath(location.pathname) ?? activeTabId();+ openSettings(tab);+ navigate(+ stripSettingsSplitFromUrl(+ `${toBaseRelative(location.pathname)}${location.search}${location.hash}`+ ),+ { replace: true }+ );+ });+ return null;}type SettingsPanelProps = {@@ -92,16 +100,11 @@ export function SettingsPanel(props: SettingsPanelProps) {activeTabId,selectTab,} = useSettingsState();- const { groups, flatTabs, isAvailable } = useSettingsTabs();+ const { groups, flatTabs } = useSettingsTabs();const logout = useLogout();const variant = () => props.variant ?? 'split';- // A tab's content renders only when it's both selected and still available- // (gating lives solely in the settings tab config).- const isCurrentTab = (tab: SettingsTab) =>- activeTabId() === tab && isAvailable(tab);-// Responsive state, driven by the panel's own width (see breakpoints above).const [panelWidth, setPanelWidth] = createSignal(Number.POSITIVE_INFINITY);const compact = () => !isTouchDevice() && panelWidth() < COMPACT_WIDTH;@@ -388,69 +391,8 @@ export function SettingsPanel(props: SettingsPanelProps) {so content scrolls under the floating header/dock like everyother block instead of being boxed between them. */}<div class="relative min-h-0 flex-1 overflow-hidden">- <Show when={isCurrentTab('Account')}>- <Suspense>- <Account />- </Suspense>- </Show>- <Show when={isCurrentTab('API Keys')}>- <Suspense>- <ApiKeys />- </Suspense>- </Show>- <Show when={isCurrentTab('Notifications')}>- <Notifications />- </Show>- <Show when={isCurrentTab('Billing')}>- <Suspense>- <Billing />- </Suspense>- </Show>- <Show when={isCurrentTab('Appearance')}>- <Appearance />- </Show>- <Show when={isCurrentTab('Shortcuts')}>- <Shortcuts />- </Show>- <Show when={isCurrentTab('Team')}>- <Suspense>- <Team />- </Suspense>- </Show>- <Show when={isCurrentTab('Tags')}>- <Suspense>- <Tags />- </Suspense>- </Show>- <Show when={isCurrentTab('CRM')}>- <Suspense>- <Crm />- </Suspense>- </Show>- <Show when={isCurrentTab('Connected')}>- <Suspense>- <ConnectedAccounts />- </Suspense>- </Show>- <Show when={isCurrentTab('Mobile App')}>- <MobileApp />- </Show>- <Show when={isCurrentTab('Agent')}>- <Agent />- </Show>- <Show when={isCurrentTab('Agents')}>- <Agents />- </Show>- <Show when={isCurrentTab('Harness')}>- <Harness />- </Show>- <Show when={isCurrentTab('Bots')}>- <Suspense>- <Bots />- </Suspense>- </Show>- <Show when={isCurrentTab('Admin')}>- <Admin />+ <Show when={activeTabId()}>+ {(tab) => <SettingsTabContent tab={tab()} />}</Show></div></div>diff --git a/apps/web/src/features/settings/SettingsTabContent.tsx b/apps/web/src/features/settings/SettingsTabContent.tsxnew file mode 100644index 0000000000..aaa7302628--- /dev/null+++ b/apps/web/src/features/settings/SettingsTabContent.tsx@@ -0,0 +1,84 @@+import type { SettingsTab } from '@core/constant/SettingsState';+import { useSettingsTabAvailable } from '@core/constant/settingsTabsConfig';+import { Show, Suspense } from 'solid-js';+import { Account } from './Account';+import { Admin } from './Admin';+import { Agent } from './Agent';+import { Agents } from './Agents';+import { ApiKeys } from './ApiKeys';+import { Appearance } from './Appearance';+import { Billing } from './Billing';+import { Bots } from './Bots';+import { ConnectedAccounts } from './ConnectedAccounts';+import { Crm } from './Crm';+import { Harness } from './Harness';+import { MobileApp } from './MobileApp';+import { Notifications } from './Notifications';+import { Shortcuts } from './Shortcuts';+import { Tags } from './Tags';+import { Team } from './Team';++/** Shared forms for desktop panels and mobile sheet detail pages. */+export function SettingsTabContent(props: { tab: SettingsTab }) {+ const isAvailable = useSettingsTabAvailable();+ const isCurrentTab = (tab: SettingsTab) =>+ props.tab === tab && isAvailable(tab);+ return (+ <Suspense+ fallback={+ <div role="status" class="p-8 text-center text-sm text-ink-muted">+ Loading settings…+ </div>+ }+ >+ <Show when={isCurrentTab('Account')}>+ <Account />+ </Show>+ <Show when={isCurrentTab('API Keys')}>+ <ApiKeys />+ </Show>+ <Show when={isCurrentTab('Notifications')}>+ <Notifications />+ </Show>+ <Show when={isCurrentTab('Billing')}>+ <Billing />+ </Show>+ <Show when={isCurrentTab('Appearance')}>+ <Appearance />+ </Show>+ <Show when={isCurrentTab('Shortcuts')}>+ <Shortcuts />+ </Show>+ <Show when={isCurrentTab('Team')}>+ <Team />+ </Show>+ <Show when={isCurrentTab('Tags')}>+ <Tags />+ </Show>+ <Show when={isCurrentTab('CRM')}>+ <Crm />+ </Show>+ <Show when={isCurrentTab('Connected')}>+ <ConnectedAccounts />+ </Show>+ <Show when={isCurrentTab('Mobile App')}>+ <MobileApp />+ </Show>+ <Show when={isCurrentTab('Agent')}>+ <Agent />+ </Show>+ <Show when={isCurrentTab('Agents')}>+ <Agents />+ </Show>+ <Show when={isCurrentTab('Harness')}>+ <Harness />+ </Show>+ <Show when={isCurrentTab('Bots')}>+ <Bots />+ </Show>+ <Show when={isCurrentTab('Admin')}>+ <Admin />+ </Show>+ </Suspense>+ );+}diff --git a/apps/web/src/features/settings/Team.tsx b/apps/web/src/features/settings/Team.tsxindex 06fb58104b..c58b21928e 100644--- a/apps/web/src/features/settings/Team.tsx+++ b/apps/web/src/features/settings/Team.tsx@@ -54,6 +54,7 @@ import type { TeamMember } from '@service-auth/generated/schemas/teamMember';import { TeamRole } from '@service-auth/generated/schemas/teamRole';import {Button,+ ConfirmDialog,cn,Dialog,Panel,@@ -1559,95 +1560,40 @@ function TeamManagement(props: {</Panel></Dialog>- <Dialog+ <ConfirmDialogopen={!!showRemoveModal()}- onOpenChange={() => setShowRemoveModal(null)}- >- <Panel depth={2} class="max-h-[75vh] text-ink rounded-xl">- <Panel.Header class="px-2 gap-1">- <Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">- <XIcon />- </Dialog.CloseButton>- <Dialog.Title as="span" class="text-sm font-medium p-0 m-0">- Remove Member- </Dialog.Title>- </Panel.Header>- <Panel.Body class="p-3 flex flex-col gap-3">- <p>- Are you sure you want to remove{' '}- <Show when={showRemoveModal()}>- {(member) => <MemberName memberId={member().user_id} />}- </Show>{' '}- from the team?- </p>- <div class="flex justify-end gap-1 pt-2">- <Button- variant="ghost"- class="rounded-xs"- disabled={removeUserMutation.isPending}- onClick={() => setShowRemoveModal(null)}- >- Cancel- </Button>- <Button- variant="danger"- class="rounded-xs"- disabled={removeUserMutation.isPending}- onClick={handleRemoveMember}- >- <Show when={removeUserMutation.isPending} fallback="Remove">- <SpinnerIcon class="size-4 animate-spin" />- </Show>- </Button>- </div>- </Panel.Body>- </Panel>- </Dialog>-- <Dialog+ onOpenChange={(open) => !open && setShowRemoveModal(null)}+ title="Remove Member"+ tone="danger"+ confirmLabel="Remove"+ pending={removeUserMutation.isPending}+ onConfirm={handleRemoveMember}+ body={+ <>+ Are you sure you want to remove{' '}+ <Show when={showRemoveModal()}>+ {(member) => <MemberName memberId={member().user_id} />}+ </Show>{' '}+ from the team?+ </>+ }+ />+ <ConfirmDialogopen={!!showCancelInviteModal()}- onOpenChange={() => setShowCancelInviteModal(null)}- >- <Panel depth={2} class="max-h-[75vh] text-ink rounded-xl">- <Panel.Header class="px-2 gap-1">- <Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">- <XIcon />- </Dialog.CloseButton>- <Dialog.Title as="span" class="text-sm font-medium p-0 m-0">- Cancel Invitation- </Dialog.Title>- </Panel.Header>- <Panel.Body class="p-3 flex flex-col gap-3">- <p>- Are you sure you want to cancel the invitation for{' '}- <span class="font-medium">{showCancelInviteModal()?.email}</span>?- </p>- <div class="flex justify-end gap-1 pt-2">- <Button- variant="ghost"- class="rounded-xs"- disabled={deleteInviteMutation.isPending}- onClick={() => setShowCancelInviteModal(null)}- >- Keep- </Button>- <Button- variant="danger"- class="rounded-xs"- disabled={deleteInviteMutation.isPending}- onClick={handleCancelInvite}- >- <Show- when={deleteInviteMutation.isPending}- fallback="Cancel Invite"- >- <SpinnerIcon class="size-4 animate-spin" />- </Show>- </Button>- </div>- </Panel.Body>- </Panel>- </Dialog>+ onOpenChange={(open) => !open && setShowCancelInviteModal(null)}+ title="Cancel Invitation"+ tone="danger"+ confirmLabel="Cancel Invite"+ cancelLabel="Keep"+ pending={deleteInviteMutation.isPending}+ onConfirm={handleCancelInvite}+ body={+ <>+ Are you sure you want to cancel the invitation for{' '}+ <span class="font-medium">{showCancelInviteModal()?.email}</span>?+ </>+ }+ /><Dialog open={showInviteModal()} onOpenChange={handleInviteModalClose}><Panel depth={2} class="max-h-[75vh] text-ink rounded-xl">diff --git a/apps/web/src/features/settings/context/mobile-settings.tsx b/apps/web/src/features/settings/context/mobile-settings.tsxnew file mode 100644index 0000000000..7fb337fc98--- /dev/null+++ b/apps/web/src/features/settings/context/mobile-settings.tsx@@ -0,0 +1,42 @@+import type { SettingsTab } from '@core/constant/SettingsState';+import {+ createContext,+ createSignal,+ type ParentProps,+ useContext,+} from 'solid-js';++export function createMobileSettingsState() {+ const [open, setOpen] = createSignal(false);+ const [page, setPage] = createSignal<SettingsTab>();++ return {+ open,+ page,+ openSettings: (tab?: SettingsTab) => {+ setPage(tab);+ setOpen(true);+ },+ selectPage: (tab?: SettingsTab) => setPage(tab),+ close: () => setOpen(false),+ };+}++const MobileSettingsContext =+ createContext<ReturnType<typeof createMobileSettingsState>>();++export function MobileSettingsProvider(props: ParentProps) {+ return (+ <MobileSettingsContext.Provider value={createMobileSettingsState()}>+ {props.children}+ </MobileSettingsContext.Provider>+ );+}++export function useMobileSettings() {+ const settings = useContext(MobileSettingsContext);+ if (!settings) {+ throw new Error('useMobileSettings requires MobileSettingsProvider');+ }+ return settings;+}diff --git a/apps/web/src/features/settings/primitives.tsx b/apps/web/src/features/settings/primitives.tsxindex 2e14044d0d..b41c529a8c 100644--- a/apps/web/src/features/settings/primitives.tsx+++ b/apps/web/src/features/settings/primitives.tsx@@ -1,5 +1,8 @@import { cn, Layer } from '@ui';-import { type JSX, Show } from 'solid-js';+import { createContext, type JSX, Show, useContext } from 'solid-js';++/** Detail pages inherit the mobile sheet's header and compact spacing. */+export const SettingsSheetContext = createContext(false);/** Shared building blocks for the settings panels. Every settings tab composes@@ -29,18 +32,38 @@ export function SettingsPage(props: {actions?: JSX.Element;children: JSX.Element;}) {+ const inSheet = useContext(SettingsSheetContext);return (- <div class="h-full min-h-0 overflow-y-auto [overflow-anchor:none] select-children">+ <div+ data-drawer-scroll-body={inSheet ? true : undefined}+ class="h-full min-h-0 overflow-y-auto [overflow-anchor:none] select-children"+ >{/* On mobile/tablet the page is full-frame: the chrome insets live inside thescroll content (plus the usual breathing room) so pages scroll underthe floating header and bottom rows like every other block. */}- <div class="mx-auto w-full max-w-[710px] px-10 pt-14 pb-24 touch:px-5 touch:pt-[calc(var(--mobile-content-inset-top,0px)+2rem)] touch:pb-[calc(var(--mobile-content-inset-bottom,0px)+3rem)]">+ <div+ class={cn(+ 'mx-auto w-full max-w-[710px]',+ inSheet+ ? '@container px-3 pt-2 pb-[max(24px,var(--mobile-sheet-safe-padding))]'+ : 'px-10 pt-14 pb-24 touch:px-5 touch:pt-[calc(var(--mobile-content-inset-top,0px)+2rem)] touch:pb-[calc(var(--mobile-content-inset-bottom,0px)+3rem)]'+ )}+ >{/* Headers are inset by the card's inner padding so the title andsection labels line up with the leftmost content inside the cards,while the cards themselves stay full-width. */}- <header class="flex items-start justify-between gap-4 px-6">+ <header+ class={cn(+ 'flex items-start justify-between gap-4',+ inSheet ? 'px-4' : 'px-6'+ )}+ ><div class="flex flex-col gap-1.5 min-w-0">- <h1 class="text-2xl/tight font-semibold text-ink">{props.title}</h1>+ <Show when={!inSheet}>+ <h1 class="text-2xl/tight font-semibold text-ink">+ {props.title}+ </h1>+ </Show><Show when={props.description}><p class="text-sm text-ink-muted">{props.description}</p></Show>@@ -49,7 +72,11 @@ export function SettingsPage(props: {<div class="shrink-0 pt-1">{props.actions}</div></Show></header>- <div class="mt-9 flex flex-col gap-10">{props.children}</div>+ <div+ class={cn('flex flex-col', inSheet ? 'gap-6 mt-3' : 'mt-9 gap-10')}+ >+ {props.children}+ </div></div></div>);@@ -95,6 +122,7 @@ export function SettingsSection(props: {* no divider, so it doubles as a plain container.*/export function SettingsCard(props: { class?: string; children: JSX.Element }) {+ const inSheet = useContext(SettingsSheetContext);// Raised a level above the content panel so the card reads as a subtly// lighter surface (theme-safe via the depth system) rather than just an// outline on the same fill.@@ -102,7 +130,10 @@ export function SettingsCard(props: { class?: string; children: JSX.Element }) {<Layer depth={2}><divclass={cn(- 'rounded-xl border border-ink/[0.05] bg-surface overflow-hidden settings-row-dividers',+ 'overflow-hidden settings-row-dividers',+ inSheet+ ? 'rounded-[26px] bg-ink/5'+ : 'rounded-xl border border-ink/[0.05] bg-surface',props.class)}>@@ -131,10 +162,12 @@ export function SettingsRow(props: {stackOnNarrow?: boolean;class?: string;}) {+ const inSheet = useContext(SettingsSheetContext);return (<divclass={cn(- 'flex gap-4 px-6 py-3.5 min-h-[60px]',+ 'flex gap-4 py-3.5 min-h-[60px]',+ inSheet ? 'px-4 flex-wrap' : 'px-6',props.stackOnNarrow? 'flex-col gap-1.5 @[460px]:flex-row @[460px]:justify-between @[460px]:gap-4': 'justify-between',@@ -167,6 +200,7 @@ export function SettingsRow(props: {<divclass={cn('flex items-center gap-2',+ inSheet && 'min-w-0 max-w-full break-words [&_input]:max-w-full',props.stackOnNarrow? '@[460px]:shrink-0 @[460px]:justify-end @[460px]:text-right': 'shrink-0 justify-end text-right'diff --git a/apps/web/src/features/sharing/ios-share-sheet/IosShareSheet.tsx b/apps/web/src/features/sharing/ios-share-sheet/IosShareSheet.tsxindex 599eaf01c0..e59d363549 100644--- a/apps/web/src/features/sharing/ios-share-sheet/IosShareSheet.tsx+++ b/apps/web/src/features/sharing/ios-share-sheet/IosShareSheet.tsx@@ -543,7 +543,7 @@ export function IosShareSheet() {}}><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay" />+ <MobileDrawer.Overlay /><MobileDrawer.Content aria-label="Share to Macro" targetHeight={80}><MobileDrawer.Handle /><Show when={isOpen() ? shareBatchKey() : undefined} keyed>diff --git a/apps/web/src/features/soup/SoupEntityActionDrawer.tsx b/apps/web/src/features/soup/SoupEntityActionDrawer.tsxindex 4999ef6fe6..e9e18a6a6e 100644--- a/apps/web/src/features/soup/SoupEntityActionDrawer.tsx+++ b/apps/web/src/features/soup/SoupEntityActionDrawer.tsx@@ -40,7 +40,7 @@ export function SoupEntityActionDrawer(props: SoupEntityActionDrawerProps) {noOutsidePointerEvents={false}><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Overlay /><MobileDrawer.Content aria-label="Entity actions"><MobileDrawer.Handle />@@ -62,11 +62,10 @@ export function SoupEntityActionDrawer(props: SoupEntityActionDrawerProps) {<MobileDrawer.Section class="flex flex-col shrink-0"><For each={group.items}>{(action) => (- <button+ <MobileDrawer.Itemtype="button"disabled={action.disabled}class={cn(- 'flex items-center gap-3 px-4 py-3 text-sm hover:bg-hover hover-transition-bg text-left not-last:mb-px bg-surface',action.destructive? 'text-failure-ink': 'text-ink',@@ -79,7 +78,7 @@ export function SoupEntityActionDrawer(props: SoupEntityActionDrawerProps) {}}>{action.label}- </button>+ </MobileDrawer.Item>)}</For></MobileDrawer.Section>diff --git a/apps/web/src/features/tasks-view/components/TasksFilterDrawer.tsx b/apps/web/src/features/tasks-view/components/TasksFilterDrawer.tsxindex 10588b4525..1bd6e1c9aa 100644--- a/apps/web/src/features/tasks-view/components/TasksFilterDrawer.tsx+++ b/apps/web/src/features/tasks-view/components/TasksFilterDrawer.tsx@@ -1,8 +1,7 @@import { MobileFilterDrawer } from '@app/components/view-shell/MobileFilterDrawer';import { MobileDrawer } from '@components/app/mobile/MobileDrawer';import { Accordion } from '@kobalte/core/accordion';-import CheckIcon from '@phosphor/check.svg';-import { createMemo, For, Show } from 'solid-js';+import { createMemo, For } from 'solid-js';import { TASK_GROUP_OPTIONS, TASK_SORT_OPTIONS } from '../constants';import { useTaskFilters } from '../filters/use-task-filters';import { useTasksView } from '../tasks-view-context';@@ -28,18 +27,13 @@ export function TasksFilterDrawer() {const selected = () => primarySort() === option.id;return (- <button- type="button"- role="radio"- aria-checked={selected()}- class="flex w-full items-center gap-3 bg-surface px-3 py-2.5 text-left text-sm transition-colors not-last:border-edge-muted not-last:border-b hover:bg-hover"- onClick={() => setPrimarySort(option.id)}+ <MobileFilterDrawer.Option+ selectionMode="single"+ checked={selected()}+ onChange={() => setPrimarySort(option.id)}>- <span class="min-w-0 flex-1 truncate">{option.label}</span>- <Show when={selected()}>- <CheckIcon class="size-3.5 shrink-0 text-accent" />- </Show>- </button>+ {option.label}+ </MobileFilterDrawer.Option>);}}</For>@@ -57,18 +51,13 @@ export function TasksFilterDrawer() {const selected = () => state.groupBy === option.id;return (- <button- type="button"- role="radio"- aria-checked={selected()}- class="flex w-full items-center gap-3 bg-surface px-3 py-2.5 text-left text-sm transition-colors not-last:border-edge-muted not-last:border-b hover:bg-hover"- onClick={() => setState('groupBy', option.id)}+ <MobileFilterDrawer.Option+ selectionMode="single"+ checked={selected()}+ onChange={() => setState('groupBy', option.id)}>- <span class="min-w-0 flex-1 truncate">{option.label}</span>- <Show when={selected()}>- <CheckIcon class="size-3.5 shrink-0 text-accent" />- </Show>- </button>+ {option.label}+ </MobileFilterDrawer.Option>);}}</For>diff --git a/apps/web/src/index.css b/apps/web/src/index.cssindex e0d68450eb..378c61431d 100644--- a/apps/web/src/index.css+++ b/apps/web/src/index.css@@ -379,8 +379,8 @@ body.tauri-ios {default covers first paint, before the mode attribute is written. */--color-avatar-edge: oklch(0 0 0 / 0.4);--color-skeleton: color-mix(in oklch, var(--color-ink) 10%, transparent);- --color-list-hover: color-mix(in oklch, var(--color-hover) 65%, transparent);- --color-list-highlighted: var(--color-hover);+ --color-list-hover: color-mix(in oklch, var(--color-ink) 6%, transparent);+ --color-list-highlighted: color-mix(in oklch, var(--color-ink) 8%, transparent);--color-list-selected: var(--color-selected);--color-list-selected-highlighted: color-mix(in oklch, var(--color-accent) 16%, transparent);@@ -524,6 +524,12 @@ body.tauri-ios {/* scuffed: might wan to use signals for this */@custom-variant touch (&:where(html[data-touch-device="true"] *));+@custom-variant not-touch (&:where(html:not([data-touch-device="true"]) *));++/* Restore native feedback suppressed by Tailwind's reset; glass opts out below. */+html[data-touch-device='true'] {+ -webkit-tap-highlight-color: initial;+}@custom-variant mobile {&:where(html[data-touch-device="true"] *) {@@ -574,6 +580,12 @@ html[data-theme-light='false'] {--glass-blur: 18px;--glass-saturate: 1.5;+ @variant light-mode {+ --glass-backdrop: none;+ --glass-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow),+ var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);+ }+/* A quiet continuous edge, with broad reflections at the upper-left andlower-right. Unlike desktop glass, the rim never disappears entirelybetween the highlights. Glass owns the rim's geometry and mask. */@@ -614,12 +626,14 @@ html[data-theme-light='false'] {one makes it collapse the pair down to just the prefixed declaration,which Chrome ignores: the glass loses its blur in production builds whilestill looking right in dev. */- backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));- box-shadow:+ --glass-backdrop: blur(var(--glass-blur)) saturate(var(--glass-saturate));+ --glass-shadow:inset 0 1px 0 color-mix(in oklch, var(--glass-tint) calc(var(--glass-highlight-base) * var(--glass-scale)), transparent),inset 0 -1px 0 color-mix(in oklch, var(--glass-shade-color) calc(var(--glass-shade-base) * var(--glass-scale)), transparent),0 var(--glass-shadow-y) var(--glass-shadow-blur) var(--glass-shadow-spread)oklch(0 0 0 / calc(var(--glass-shadow-alpha) * var(--glass-shadow-scale, var(--glass-scale))));+ backdrop-filter: var(--glass-backdrop);+ box-shadow: var(--glass-shadow);&::after {content: "";@@ -672,7 +686,38 @@ html[data-theme-light='false'] {backdrop-filter: blur(2px) saturate(1.05);}+/* Shared phone sheet geometry: match the screen curve with an even outer+ gutter. Consumers put home-indicator clearance inside their scroll area. */+@utility mobile-sheet {+ --mobile-sheet-radius: clamp(36px, 11.2vmin, 48px);+ --mobile-sheet-safe-padding: max(0px, calc(var(--safe-bottom, 0px) - 8px));+ border-radius: var(--mobile-sheet-radius);++ @supports (corner-shape: superellipse(1.25)) {+ corner-shape: superellipse(1.25);++ &::after {+ corner-shape: inherit;+ }+ }+}++@utility mobile-sheet-open-animation {+ animation: mobile-sheet-in 340ms cubic-bezier(0.22, 1, 0.36, 1) both;++ @media (prefers-reduced-motion: reduce) {+ animation: none;+ }+}++@keyframes mobile-sheet-in {+ from { transform: translateY(100%); opacity: 0; }+ to { transform: translateY(0); opacity: 1; }+}+@utility glass-none {+ --glass-backdrop: none;+ --glass-shadow: none;backdrop-filter: none;box-shadow: none;&::after {@@ -715,12 +760,133 @@ html[data-theme-light='true'] .glass-input {outline-offset: -1px;}-[data-press-pulse] {- transition: transform 100ms cubic-bezier(0.34, 1.56, 0.64, 1);+/* Background utilities supply the same live color to the host and its glass+ layer. Keep arbitrary colors typed (bg-[color:...] / bg-(color:...)); an+ inline glass fill uses --glass-fill. Unrelated backgrounds render normally. */+@utility bg-* {+ --glass-fill: --value(--color-*, [color], "transparent");+ --glass-fill: color-mix(in oklab, --value(--color-*, [color]) calc(--modifier(number) * 1%), transparent);+ --glass-fill: color-mix(in oklab, --value(--color-*, [color]) calc(--modifier([number]) * 100%), transparent);+ --glass-fill: color-mix(in oklab, --value(--color-*, [color]) --modifier([percentage]), transparent);+}++@utility bg-current {+ --glass-fill: currentColor;+}++@utility bg-inherit {+ --glass-fill: inherit;+}++/* Each control owns its fill; pseudo-elements inherit it normally. */+@layer base {+ :is(button, a, [role='button'], [role='tab'], [data-mobile-dock-island], [data-header-island], [data-slot='button-group']) {+ --glass-fill: transparent;+ }+}++@property --press-light {+ syntax: "<number>";+ inherits: false;+ initial-value: 0;+}++@property --press-spread {+ syntax: "<number>";+ inherits: false;+ initial-value: 0.45;}-[data-press-pulse][data-pressed] {- transform: scale(1.08);- transition: transform 100ms ease-out;++@property --press-expansion {+ syntax: "<length>";+ inherits: true;+ initial-value: 0px;+}++/* Persistent paint layers belong to the material, including native controls.+ ::before paints the live fill, shadow and tap-centered sheen; ::after keeps+ the glass rim. No child nodes, computed-style snapshots or release cleanup.+ Keep this scope in sync with glassPress.ts's surface selection. */+html[data-touch-device='true'] :is(+ [data-mobile-dock-island],+ [data-header-island],+ [data-slot='button-group'].glass,+ :is(button, a, [role='button'], [role='tab']):is(.glass, .island, [class~='touch:island'])+) {+ /* The shimmer replaces native tap feedback only on these press surfaces. */+ -webkit-tap-highlight-color: transparent;+ --press-expansion: 0px;+ position: relative;+ isolation: isolate;+ overflow: visible;+ background-color: transparent !important;+ backdrop-filter: none;+ box-shadow: none;+ scale: 1;+ transform-origin: center;+ transition: scale 300ms cubic-bezier(0.22, 1, 0.36, 1),+ --press-expansion 300ms cubic-bezier(0.22, 1, 0.36, 1);++ & button {+ scale: 1 !important;+ }++ &::before {+ content: "";+ position: absolute;+ z-index: -1;+ pointer-events: none;+ background-color: var(--glass-fill);+ background-image: radial-gradient(+ circle calc(var(--press-shimmer-size, 100px) * var(--press-spread) / 2)+ at calc(var(--press-x, 50%) + var(--press-expansion)) calc(var(--press-y, 50%) + var(--press-expansion)),+ color-mix(in oklch, var(--glass-tint) calc(12% * var(--press-light)), transparent),+ color-mix(in oklch, var(--glass-tint) calc(5% * var(--press-light)), transparent) 45%,+ transparent 100%+ );+ backdrop-filter: var(--glass-backdrop, none);+ box-shadow: var(--glass-shadow, none);+ transition: --press-light 220ms ease-out,+ --press-spread 350ms cubic-bezier(0.22, 1, 0.36, 1);+ }++ &::before, &::after {+ inset: calc(-1 * var(--press-expansion));+ border-radius: inherit;+ }++ & svg {+ scale: 1;+ transform-origin: center;+ transform-box: view-box;+ transition: scale 300ms cubic-bezier(0.22, 1, 0.36, 1);+ }++ &[data-glass-press]::before {+ --press-light: 1;+ }++ @media (prefers-reduced-motion: no-preference) {+ &[data-glass-press='round'] {+ scale: var(--press-scale);+ }+ &[data-glass-press='wide'] {+ --press-expansion: var(--press-outset);++ & svg {+ scale: 1.08;+ }+ }+ &[data-glass-press]::before {+ --press-spread: 1;+ }+ }++ @media (prefers-reduced-motion: reduce) {+ &, &::before, &::after, & svg {+ transition: none;+ }+ }}@layer base {diff --git a/apps/web/src/lib/core/comments/discussion/Discussion.tsx b/apps/web/src/lib/core/comments/discussion/Discussion.tsxindex 9f28088427..37f7ae16a1 100644--- a/apps/web/src/lib/core/comments/discussion/Discussion.tsx+++ b/apps/web/src/lib/core/comments/discussion/Discussion.tsx@@ -38,7 +38,7 @@ import type {* [`DiscussionSource`]. Backend-agnostic: drive it via a `DiscussionProvider`* supplying a document/task or CRM source.*/-export function Discussion() {+export function Discussion(props: { hideComposer?: boolean }) {const source = useDiscussion();const [isExpanded, setIsExpanded] = createSignal(true);const [mountedCommentsVersion, setMountedCommentsVersion] = createSignal(0);@@ -101,8 +101,6 @@ export function Discussion() {});});- let newThreadInputHandle: { clear: () => void } | undefined;-const rootMetaById = createMemo(() => {const messages = source.threads().flatMap((thread) => {const root = thread.comments[0];@@ -116,13 +114,6 @@ export function Discussion() {return metaById;});- const handleCreateThread = async (snapshot: InputSnapshot) => {- const text = snapshot.value.trim();- if (!text) return;- await source.createThread(text, snapshot.mentions);- newThreadInputHandle?.clear();- };-return (<section class="mt-3 pb-12"><div class="flex items-center gap-2">@@ -163,16 +154,9 @@ export function Discussion() {</For></div>- <Show when={source.canEdit()}>+ <Show when={!props.hideComposer && source.canEdit()}><div class="mt-4">- <DiscussionInput- input={{ mode: 'channel', placeholder: 'Leave a comment...' }}- onSend={handleCreateThread}- onReady={(handle) => {- newThreadInputHandle = handle;- }}- autofocus={false}- />+ <DiscussionComposer /></div></Show></div>@@ -182,6 +166,38 @@ export function Discussion() {);}+/** The new-thread composer can be placed independently of the thread list. */+export function DiscussionComposer(props: {+ collapsible?: boolean;+ /** Dismiss the keyboard after submitting from a floating mobile composer. */+ blurOnSend?: boolean;+}) {+ const source = useDiscussion();+ let inputHandle: { clear: () => void } | undefined;++ const handleCreateThread = async (snapshot: InputSnapshot) => {+ const text = snapshot.value.trim();+ if (!text) return;+ await source.createThread(text, snapshot.mentions);+ inputHandle?.clear();+ };++ return (+ <Show when={source.canEdit()}>+ <DiscussionInput+ input={{ mode: 'channel', placeholder: 'Leave a comment...' }}+ collapsible={props.collapsible}+ blurOnSend={props.blurOnSend}+ onSend={handleCreateThread}+ onReady={(handle) => {+ inputHandle = handle;+ }}+ autofocus={false}+ />+ </Show>+ );+}+export function DiscussionThreadView(props: {thread: ViewThread;listMeta?: ChannelMessageListMeta;diff --git a/apps/web/src/lib/core/comments/discussion/DiscussionInput.test.tsx b/apps/web/src/lib/core/comments/discussion/DiscussionInput.test.tsxnew file mode 100644index 0000000000..88321daf34--- /dev/null+++ b/apps/web/src/lib/core/comments/discussion/DiscussionInput.test.tsx@@ -0,0 +1,243 @@+import type { InputHandle } from '@channel/Input/types';+import { cleanup, render, screen } from '@solidjs/testing-library';+import type { JSX, ParentProps } from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { DiscussionInput } from './DiscussionInput';++const editor = vi.hoisted(() => ({+ root: undefined as HTMLTextAreaElement | undefined,+ isIOS: true,+}));+const pickPhotos = vi.hoisted(() => vi.fn<() => Promise<File[] | null>>());+const addMedia = vi.hoisted(() => vi.fn());++vi.mock('@solid-primitives/platform', () => ({+ get isIOS() {+ return editor.isIOS;+ },+}));+vi.mock('@core/mobile/isMobile', () => ({ isMobile: () => true }));+vi.mock('@core/mobile/nativePhotoLibrary', () => ({+ pickNativePhotoLibraryMedia: pickPhotos,+}));+vi.mock('@core/util/platform', () => ({+ isPlatform: (platform: string) => platform === 'ios' && editor.isIOS,+}));+vi.mock('@channel/Input/ActionButton', () => ({}));+vi.mock('@channel/Input/context', () => ({}));+vi.mock('@channel/Input/FormatButtons', () => ({ FormatButtons: () => null }));+vi.mock('@channel/Input/utils/formatting', () => ({}));+vi.mock('@core/component/LexicalMarkdown/plugins/media', () => ({+ addMediaFromFile: addMedia,+}));+vi.mock('@core/component/LexicalMarkdown/theme', () => ({+ singleLineMarkdownTheme: {},+}));+vi.mock(+ '@core/component/LexicalMarkdown/component/core/StaticMarkdown',+ () => ({+ StaticMarkdown: () => null,+ })+);+vi.mock('@channel/Input/Input', () => {+ const Slot = (props: ParentProps) => props.children;+ return {+ Input: {+ Root: Slot,+ Layout: Slot,+ EditorShell: Slot,+ Editor: Slot,+ Footer: Slot,+ FormatRibbon: () => null,+ },+ };+});+vi.mock('@ui', () => ({+ ComposerSurface: (props: JSX.HTMLAttributes<HTMLDivElement>) => (+ <div data-testid="composer" {...props} />+ ),+ CollapsedInput: (props: { onAttach: () => void }) => (+ <div data-testid="compact-input">+ <button onClick={props.onAttach}>Attach images</button>+ </div>+ ),+}));++// Keep the component's real send, clear, and collapse handlers; replace the+// rich editor with a native field so focus and blur still dispatch DOM events.+vi.mock('./configured-discussion-markdown-editor', () => ({+ createConfiguredDiscussionMarkdownEditor: () => ({+ buildHandle: () => {},+ lexical: { getRootElement: () => editor.root },+ controls: {+ focus: () => editor.root?.focus(),+ blur: () => editor.root?.blur(),+ clear: () => {+ if (editor.root) editor.root.value = '';+ },+ },+ }),+}));+vi.mock('@core/component/LexicalMarkdown/builder/MarkdownShell', () => ({+ MarkdownShell: (props: { initialValue: string }) => (+ <textarea+ aria-label="Comment"+ ref={(element) => {+ editor.root = element;+ }}+ value={props.initialValue}+ />+ ),+}));++beforeEach(() => {+ editor.isIOS = true;+ pickPhotos.mockReset().mockResolvedValue([]);+ addMedia.mockReset();+ vi.useFakeTimers();+});++afterEach(() => {+ cleanup();+ editor.root = undefined;+ vi.restoreAllMocks();+ vi.useRealTimers();+});++describe('collapsed discussion attachments', () => {+ function renderCollapsed() {+ render(() => (+ <DiscussionInput input={{ mode: 'channel' }} collapsible>+ <span />+ </DiscussionInput>+ ));+ return vi.spyOn(HTMLInputElement.prototype, 'click');+ }++ it('inserts images selected from the native iOS photo library', async () => {+ const photo = new File(['photo'], 'photo.jpg', { type: 'image/jpeg' });+ pickPhotos.mockResolvedValue([photo]);+ const browserPicker = renderCollapsed();++ screen.getByRole('button', { name: 'Attach images' }).click();+ await vi.runAllTimersAsync();++ expect(pickPhotos).toHaveBeenCalledOnce();+ expect(browserPicker).not.toHaveBeenCalled();+ expect(addMedia).toHaveBeenCalledExactlyOnceWith(+ expect.any(Object),+ photo,+ 'image'+ );+ });++ it.each([true, false])(+ 'opens the browser picker when native selection is unavailable (iOS: %s)',+ async (isIOS) => {+ editor.isIOS = isIOS;+ pickPhotos.mockResolvedValue(null);+ const browserPicker = renderCollapsed();++ screen.getByRole('button', { name: 'Attach images' }).click();+ await vi.runAllTimersAsync();++ expect(pickPhotos).toHaveBeenCalledTimes(isIOS ? 1 : 0);+ expect(browserPicker).toHaveBeenCalledOnce();+ expect(addMedia).not.toHaveBeenCalled();+ }+ );++ it('does not open another picker when native selection is cancelled', async () => {+ const browserPicker = renderCollapsed();++ screen.getByRole('button', { name: 'Attach images' }).click();+ await vi.runAllTimersAsync();++ expect(pickPhotos).toHaveBeenCalledOnce();+ expect(browserPicker).not.toHaveBeenCalled();+ expect(addMedia).not.toHaveBeenCalled();+ });+});++function setup(+ options: { blurOnSend?: boolean; submit?: () => Promise<void> } = {}+) {+ let handle!: InputHandle;+ render(() => (+ <DiscussionInput+ input={{ mode: 'channel', value: 'My comment' }}+ collapsible+ blurOnSend={options.blurOnSend}+ onReady={(value) => {+ handle = value;+ }}+ onSend={async () => {+ await options.submit?.();+ handle.clear();+ }}+ >+ <span />+ </DiscussionInput>+ ));+ handle.focus();+ return { handle, field: screen.getByRole('textbox') as HTMLTextAreaElement };+}++describe('discussion submission focus', () => {+ it.each([true, false])(+ 'blurs and collapses after sending (iOS: %s)',+ async (isIOS) => {+ editor.isIOS = isIOS;+ const { handle, field } = setup({ blurOnSend: true });+ expect(document.activeElement).toBe(field);++ expect(await handle.send()).toBe(true);+ await vi.runAllTimersAsync();++ expect(field.value).toBe('');+ expect(document.activeElement).not.toBe(field);+ expect(screen.getByTestId('composer').className).toBe('hidden');+ expect(screen.queryByTestId('compact-input')).not.toBeNull();+ }+ );++ it('waits for submission before dismissing the input', async () => {+ let finish!: () => void;+ const { handle, field } = setup({+ blurOnSend: true,+ submit: () =>+ new Promise<void>((resolve) => {+ finish = resolve;+ }),+ });+ const sending = handle.send();+ expect(document.activeElement).toBe(field);+ expect(field.value).toBe('My comment');+ finish();+ await sending;+ expect(document.activeElement).not.toBe(field);+ });++ it('keeps focus and the draft when the submit callback rejects', async () => {+ const { handle, field } = setup({+ blurOnSend: true,+ submit: async () => {+ throw new Error('Send failed');+ },+ });+ await expect(handle.send()).rejects.toThrow('Send failed');+ await vi.runAllTimersAsync();+ expect(document.activeElement).toBe(field);+ expect(field.value).toBe('My comment');+ expect(screen.queryByTestId('compact-input')).toBeNull();+ });++ it('preserves the default iOS refocus for other discussion inputs', async () => {+ const { handle, field } = setup();+ await handle.send();+ await vi.runAllTimersAsync();+ expect(field.value).toBe('');+ expect(document.activeElement).toBe(field);+ expect(screen.queryByTestId('compact-input')).toBeNull();+ });+});diff --git a/apps/web/src/lib/core/comments/discussion/DiscussionInput.tsx b/apps/web/src/lib/core/comments/discussion/DiscussionInput.tsxindex 36969f4720..7cbe95256e 100644--- a/apps/web/src/lib/core/comments/discussion/DiscussionInput.tsx+++ b/apps/web/src/lib/core/comments/discussion/DiscussionInput.tsx@@ -1,5 +1,6 @@import { InputActionButton } from '@channel/Input/ActionButton';import { useInputCommands } from '@channel/Input/context';+import { createCollapsedInputState } from '@channel/Input/create-collapsed-input-state';import { FormatButtons } from '@channel/Input/FormatButtons';import { Input } from '@channel/Input/Input';import type {@@ -14,13 +15,15 @@ import {applyNodeFormat,} from '@channel/Input/utils/formatting';import { MarkdownShell } from '@core/component/LexicalMarkdown/builder/MarkdownShell';+import { StaticMarkdown } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';import type { ItemMention } from '@core/component/LexicalMarkdown/plugins';import { addMediaFromFile } from '@core/component/LexicalMarkdown/plugins/media';+import { singleLineMarkdownTheme } from '@core/component/LexicalMarkdown/theme';import { isMobile } from '@core/mobile/isMobile';import type { IUser } from '@core/user/types';import PaperclipIcon from '@phosphor-icons/core/regular/paperclip.svg?component-solid';import { isIOS } from '@solid-primitives/platform';-import { ComposerSurface } from '@ui';+import { CollapsedInput, ComposerSurface } from '@ui';import {type Accessor,createSignal,@@ -39,6 +42,10 @@ export type DiscussionInputProps = InputCallbacks & {children?: JSX.Element;/** Whether to auto-focus the input on mount. Defaults to `!isMobile()`. */autofocus?: boolean;+ /** Use the channel-style compact mobile composer until tapped. */+ collapsible?: boolean;+ /** Blur and collapse after onSend completes; other inputs retain focus. */+ blurOnSend?: boolean;};function AttachImagesAction() {@@ -99,6 +106,7 @@ export function DiscussionInput(props: DiscussionInputProps) {const [mentions, setMentions] = createSignal<ItemMention[]>([]);const [showFormatRibbon, setShowFormatRibbon] = createSignal(false);const [isSending, setIsSending] = createSignal(false);+ let isInternalRefocus = false;const inputView = () => ({...props.input,@@ -153,6 +161,10 @@ export function DiscussionInput(props: DiscussionInputProps) {setIsSending(true);try {await props.onSend?.(snapshot);+ if (props.blurOnSend) {+ markdownEditor.controls.blur();+ collapsedInput.collapse();+ }return true;} finally {setIsSending(false);@@ -176,20 +188,40 @@ export function DiscussionInput(props: DiscussionInputProps) {},};+ const collapsedInput = createCollapsedInputState({+ inputId: () => props.input.id,+ attachFiles: commands.attachFiles,+ });+ const isCollapsed = () => !!props.collapsible && collapsedInput.isCollapsed();+ const focusEditor = () => {+ collapsedInput.expand();+ markdownEditor.controls.focus();+ };+props.onReady?.({clear: () => {// On iOS, blur before clearing so dictation finalizes and discards its buffer- if (isIOS) {+ const root = markdownEditor.lexical.getRootElement();+ if (isIOS && root?.contains(document.activeElement)) {+ isInternalRefocus = true;markdownEditor.controls.blur();markdownEditor.controls.clear();- requestAnimationFrame(() => markdownEditor.controls.focus());+ if (props.blurOnSend && isSending()) {+ // Sending will collapse this input; an iOS refocus would reopen the keyboard.+ isInternalRefocus = false;+ } else {+ requestAnimationFrame(() => {+ markdownEditor.controls.focus();+ isInternalRefocus = false;+ });+ }} else {markdownEditor.controls.clear();}setValue('');setMentions([]);},- focus: () => markdownEditor.controls.focus(),+ focus: focusEditor,send: () => commands.send(),attachFiles: async (files: File[]) => {// Insert images into the editor@@ -201,13 +233,53 @@ export function DiscussionInput(props: DiscussionInputProps) {markdownEditor.controls.setMarkdown(snapshot.value);setMentions(snapshot.mentions);setValue(snapshot.value);- markdownEditor.controls.focus();+ focusEditor();},});return (<Input.Root input={inputView()} commands={commands}>- <ComposerSurface class="h-auto">+ <Show when={isCollapsed()}>+ <input+ ref={collapsedInput.setFilePickerRef}+ type="file"+ class="hidden"+ multiple+ accept="image/*"+ onChange={collapsedInput.onFilePickerChange}+ />+ <CollapsedInput+ class="touch:rounded-full touch:island"+ draft={value()}+ renderDraft={(draft) => (+ <StaticMarkdown+ markdown={draft()}+ theme={singleLineMarkdownTheme}+ singleLine+ />+ )}+ placeholder={props.input.placeholder}+ pending={isSending()}+ disabled={!value().trim()}+ getFocusTarget={() => {+ // Expand synchronously so iOS can focus within the tap gesture.+ collapsedInput.expand();+ return markdownEditor.lexical.getRootElement();+ }}+ onAttach={collapsedInput.attach}+ onOpen={collapsedInput.expand}+ onSend={() => void commands.send()}+ />+ </Show>+ <ComposerSurface+ class={isCollapsed() ? 'hidden' : 'h-auto'}+ onFocusOut={(event) => {+ const next = event.relatedTarget as Node | null;+ if (next && event.currentTarget.contains(next)) return;+ if (isInternalRefocus) return;+ collapsedInput.collapse();+ }}+ ><Input.Layout><Input.FormatRibbon><FormatButtonsdiff --git a/apps/web/src/lib/core/comments/discussion/index.ts b/apps/web/src/lib/core/comments/discussion/index.tsindex 68f702c00e..fd7eefbbfa 100644--- a/apps/web/src/lib/core/comments/discussion/index.ts+++ b/apps/web/src/lib/core/comments/discussion/index.ts@@ -1,5 +1,9 @@export { DiscussionProvider, useDiscussion } from './context';-export { Discussion, DiscussionThreadView } from './Discussion';+export {+ Discussion,+ DiscussionComposer,+ DiscussionThreadView,+} from './Discussion';export { DiscussionInput } from './DiscussionInput';export {discussionCommentToApiChannelMessage,diff --git a/apps/web/src/lib/core/component/AI/component/ProviderIcon.test.tsx b/apps/web/src/lib/core/component/AI/component/ProviderIcon.test.tsxindex 7075e2e1bb..408cad3901 100644--- a/apps/web/src/lib/core/component/AI/component/ProviderIcon.test.tsx+++ b/apps/web/src/lib/core/component/AI/component/ProviderIcon.test.tsx@@ -11,6 +11,8 @@ describe('AI provider icons', () => {['claude-opus-5', 'anthropic'],['sonnet', 'anthropic'],['openai/gpt-5.6', 'openai'],+ ['openai/gpt-5.5', 'openai'],+ ['gpt-5.5', 'openai'],['gpt-5.6-mini', 'openai'],['o3', 'openai'],['google/gemini-pro', 'google'],diff --git a/apps/web/src/lib/core/component/AI/component/ProviderIcon.tsx b/apps/web/src/lib/core/component/AI/component/ProviderIcon.tsxindex 4c84e6526a..000789cf34 100644--- a/apps/web/src/lib/core/component/AI/component/ProviderIcon.tsx+++ b/apps/web/src/lib/core/component/AI/component/ProviderIcon.tsx@@ -1,7 +1,7 @@+import ClaudeIcon from '@icon/wide-claude.svg';import GoogleIcon from '@phosphor-fill/google-logo-fill.svg';import { type Component, type JSX, Show } from 'solid-js';import { Dynamic } from 'solid-js/web';-import AnthropicIcon from '../assets/anthropic.svg';import OpenAiIcon from '../assets/openai.svg';type Provider = 'anthropic' | 'openai' | 'google';@@ -30,7 +30,7 @@ const icons: Record<Provider,Component<JSX.SvgSVGAttributes<SVGSVGElement>>> = {- anthropic: AnthropicIcon,+ anthropic: ClaudeIcon,openai: OpenAiIcon,google: GoogleIcon,};diff --git a/apps/web/src/lib/core/component/AI/component/input/ChatInput.test.tsx b/apps/web/src/lib/core/component/AI/component/input/ChatInput.test.tsxnew file mode 100644index 0000000000..0af0a8e691--- /dev/null+++ b/apps/web/src/lib/core/component/AI/component/input/ChatInput.test.tsx@@ -0,0 +1,199 @@+import type { EditorConfigBuilder } from '@core/component/LexicalMarkdown/builder/MarkdownConfigBuilder';+import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';+import { type JSX, onCleanup, onMount } from 'solid-js';+import { afterEach, describe, expect, it, vi } from 'vitest';+import { ChatInput } from './ChatInput';++const mocks = vi.hoisted(() => ({+ touch: true,+ emitChange: undefined as ((value: string) => void) | undefined,+ root: undefined as HTMLDivElement | undefined,+ mount: vi.fn(),+ unmount: vi.fn(),+}));++vi.mock('@app/lib/analytics/analytics-context', () => ({+ useAnalytics: () => ({ track: vi.fn() }),+}));+vi.mock('@core/auth/license', () => ({ useHasPaidAccess: () => () => false }));+vi.mock('@core/component/AI/constant', () => ({+ Model: { test: 'test' },+ modelsForPlan: () => ['test'],+ defaultModelForPlan: () => 'test',+}));+vi.mock('@core/component/AI/context', () => ({+ useChatInputContext: () => ({+ model: () => 'test',+ setModel: vi.fn(),+ isGenerating: () => false,+ uploadQueue: { popComplete: () => [], uploading: () => [] },+ attachments: { attached: () => [], setAttached: vi.fn() },+ }),+}));+vi.mock('@core/component/AI/util/attachment', () => ({+ isImageAttachment: () => false,+}));+vi.mock('@core/component/AI/util/chatAttachmentMention', () => ({}));+vi.mock('@core/component/Toast/Toast', () => ({}));+vi.mock('@core/constant/allBlocks', () => ({}));+vi.mock('@core/constant/PaywallState', () => ({+ usePaywallState: () => ({ showPaywall: vi.fn() }),+}));+vi.mock('@core/mobile/isMobile', () => ({ isMobile: () => mocks.touch }));+vi.mock('@core/mobile/isTouchDevice', () => ({+ isTouchDevice: () => mocks.touch,+}));+vi.mock('@core/mobile/isNativeMobilePlatform', () => ({+ isNativeMobilePlatform: () => false,+}));+vi.mock('@core/mobile/useTouchOutsideToDismissKeyboard', () => ({+ useTouchOutsideToDismissKeyboard: () => {},+}));+vi.mock('@core/util/getItemBlockName', () => ({}));+vi.mock('@core/util/upload', () => ({}));+vi.mock('@solid-primitives/resize-observer', () => ({+ createElementSize: () => ({ width: 44, height: 20 }),+}));+vi.mock('./Attachment', () => ({ AttachmentList: () => null }));+vi.mock('./ModelSelector', () => ({ ModelSelector: () => null }));+vi.mock('./ChatAttachMenu', () => ({+ ChatAttachMenu: () => <input aria-label="Search attachments" />,+}));+vi.mock('./useAiDataConsent', () => ({+ useAiDataConsentGate: () => ({ ConsentDialog: () => null }),+}));+vi.mock('@ui', async () => {+ const { cn } = await import('@ui/utils/classname');+ return {+ cn,+ ComposerSurface: (props: JSX.HTMLAttributes<HTMLDivElement>) => (+ <div {...props} />+ ),+ Button: (props: JSX.ButtonHTMLAttributes<HTMLButtonElement>) => (+ <button {...props} />+ ),+ SendButton: (props: JSX.ButtonHTMLAttributes<HTMLButtonElement>) => (+ <button aria-label="Send" {...props} />+ ),+ };+});+vi.mock('@core/component/LexicalMarkdown/builder/MarkdownShell', () => ({+ MarkdownShell: (props: { initialValue?: string }) => {+ mocks.mount();+ onCleanup(mocks.unmount);+ onMount(() => mocks.emitChange?.(props.initialValue ?? ''));+ return (+ <div+ contentEditable+ tabIndex={0}+ role="textbox"+ aria-label="Prompt"+ ref={(element) => {+ mocks.root = element;+ }}+ >+ {props.initialValue}+ </div>+ );+ },+}));++afterEach(() => {+ cleanup();+ mocks.touch = true;+ mocks.root = undefined;+ mocks.emitChange = undefined;+ vi.clearAllMocks();+});++function setup(collapseOnBlur = true) {+ const draft = 'First line\nSecond line of the unsent prompt';+ const onSend = vi.fn();+ const editor = {+ withFilePaste: () => editor,+ onEnter: () => editor,+ onEscape: () => editor,+ onChange: (callback: (value: string) => void) => {+ mocks.emitChange = callback;+ return editor;+ },+ controls: {+ clear: () => {+ if (mocks.root) mocks.root.textContent = '';+ mocks.emitChange?.('');+ },+ },+ } as unknown as EditorConfigBuilder;+ const { container } = render(() => (+ <>+ <ChatInput+ variant="default"+ collapseOnBlur={collapseOnBlur}+ editor={editor}+ initialValue={draft}+ onSend={onSend}+ />+ <input aria-label="Outside" />+ </>+ ));+ const wrapper = container.querySelector<HTMLDivElement>(+ '#chat-input-text-area'+ )!;+ // jsdom has no layout: a clipped element's scrollHeight still includes its+ // full content in browsers. WebKit verification covers the actual geometry.+ Object.defineProperty(wrapper, 'scrollHeight', { get: () => 80 });+ return {+ wrapper,+ draft,+ onSend,+ input: screen.getByRole('textbox', { name: 'Prompt' }),+ };+}++describe('compact mobile chat drafts', () => {+ it('expands on focus and collapses on blur without replacing the editor or draft', () => {+ const { wrapper, input, draft } = setup();+ expect(wrapper.classList.contains('max-h-5')).toBe(true);+ input.focus();+ expect(wrapper.classList.contains('max-h-5')).toBe(false);+ wrapper.scrollTop = 40;+ screen.getByRole('textbox', { name: 'Outside' }).focus();+ expect(wrapper.classList.contains('max-h-5')).toBe(true);+ expect(wrapper.scrollTop).toBe(0);+ expect(input.textContent).toBe(draft);+ input.focus();+ expect(wrapper.classList.contains('max-h-5')).toBe(false);+ expect(screen.getByRole('textbox', { name: 'Prompt' })).toBe(input);+ expect(mocks.mount).toHaveBeenCalledOnce();+ expect(mocks.unmount).not.toHaveBeenCalled();+ });++ it('sends the entire collapsed draft', () => {+ const { draft, onSend } = setup();+ fireEvent.click(screen.getByRole('button', { name: 'Send' }));+ expect(onSend).toHaveBeenCalledWith(+ expect.objectContaining({ content: draft })+ );+ });++ it('keeps the composer expanded when focus moves into its attachment controls', () => {+ const { wrapper, input } = setup();+ input.focus();+ const attach = screen.getByRole('button', { name: 'Attach files' });+ attach.focus();+ fireEvent.click(attach);+ screen.getByRole('textbox', { name: 'Search attachments' }).focus();+ expect(wrapper.classList.contains('max-h-5')).toBe(false);+ });++ it('leaves other chat inputs expanded', () => {+ const { wrapper } = setup(false);+ expect(wrapper.classList.contains('max-h-5')).toBe(false);+ });++ it('leaves desktop drafts expanded', () => {+ mocks.touch = false;+ const { wrapper } = setup();+ expect(wrapper.classList.contains('max-h-5')).toBe(false);+ });+});diff --git a/apps/web/src/lib/core/component/AI/component/input/ChatInput.tsx b/apps/web/src/lib/core/component/AI/component/input/ChatInput.tsxindex 5b73d60712..3d5b9c8f68 100644--- a/apps/web/src/lib/core/component/AI/component/input/ChatInput.tsx+++ b/apps/web/src/lib/core/component/AI/component/input/ChatInput.tsx@@ -24,6 +24,7 @@ import { useTouchOutsideToDismissKeyboard } from '@core/mobile/useTouchOutsideToimport { getItemBlockName } from '@core/util/getItemBlockName';import { handleFileFolderDrop } from '@core/util/upload';import PaperclipIcon from '@phosphor/paperclip.svg';+import PlusIcon from '@phosphor/plus.svg';import { createElementSize } from '@solid-primitives/resize-observer';import { createCallback } from '@solid-primitives/rootless';import { Button, ComposerSurface, cn, SendButton as UiSendButton } from '@ui';@@ -50,6 +51,8 @@ type ChatInputProps = {type ChatInputComponentProps = {variant?: 'default' | 'tall';+ /** Keep an unfocused mobile accessory to one line without unmounting its editor. */+ collapseOnBlur?: boolean;editor: EditorConfigBuilder;initialValue?: string;onChange?: (markdown: string) => void;@@ -128,7 +131,7 @@ export function ChatInput(props: ChatInputComponentProps) {const [attachMenuAnchorRef, setAttachMenuAnchorRef] =createSignal<HTMLDivElement>();const [markdownText, setMarkdownText] = createSignal('');- const [_isFocused, setIsFocused] = createSignal(false);+ const [isFocused, setIsFocused] = createSignal(false);createEffect(() => {const uploaded = uploadQueue.popComplete();@@ -162,6 +165,7 @@ export function ChatInput(props: ChatInputComponentProps) {const LINE_HEIGHT_THRESHOLD = 40;let mdRef: undefined | HTMLDivElement;const isMultiline = () => {+ if (isCollapsed()) return false;// Access markdownText to create reactive dependencyconst text = markdownText();if (text.trim().length === 0) return false;@@ -229,7 +233,9 @@ export function ChatInput(props: ChatInputComponentProps) {aria-label="Attach files"onClick={() => setShowAttachMenu((prev) => !prev)}>- <PaperclipIcon />+ <Show when={isTouchDevice()} fallback={<PaperclipIcon />}>+ <PlusIcon />+ </Show></Button>);@@ -294,8 +300,18 @@ export function ChatInput(props: ChatInputComponentProps) {);const isTallVariant = createMemo(- () => props.variant === 'tall' || isTouchDevice()+ () =>+ props.variant === 'tall' ||+ (isTouchDevice() && props.variant !== 'default'));+ const isCollapsed = () =>+ props.collapseOnBlur &&+ isTouchDevice() &&+ !isTallVariant() &&+ !isFocused() &&+ !isEmptyInput();+ const isCompactMobile = () =>+ isTouchDevice() && !isTallVariant() && !isMultiline();return (<div class="relative">@@ -313,6 +329,7 @@ export function ChatInput(props: ChatInputComponentProps) {const next = e.relatedTarget as Node | null;if (next && containerRef.contains(next)) return;setIsFocused(false);+ if (isCollapsed() && mdRef) mdRef.scrollTop = 0;}}onFocusIn={() => setIsFocused(true)}class="relative flex flex-col"@@ -348,6 +365,8 @@ export function ChatInput(props: ChatInputComponentProps) {ref={setLineEl}class={cn('relative px-2 py-1.5 touch:min-h-12.5 touch:py-[9px]', {'flex flex-col px-2 py-2 touch:p-0': isTallVariant(),+ 'touch:h-(--mobile-chrome-button-size) touch:min-h-0 touch:py-0 touch:flex touch:items-center':+ isCompactMobile(),})}>{/* Invisible reference of the fully-expanded control row laid out@@ -378,10 +397,11 @@ export function ChatInput(props: ChatInputComponentProps) {id={CHAT_INPUT_TEXT_AREA_ID}class={cn('text-sm text-ink touch:px-3 touch:py-2',+ isCompactMobile() && 'w-full touch:py-0',!isTouchDevice() && (isMultiline() || isTallVariant()) && 'pl-2')}classList={{- 'pl-8': !isMultiline() && !isTallVariant(),+ 'pl-8 touch:pl-10': !isMultiline() && !isTallVariant(),'pb-8 touch:pb-10': isMultiline() && !isTallVariant(),'max-h-[calc(32*var(--dvh,1dvh))] overflow-y-auto':isMobile() && isMultiline(),@@ -390,6 +410,10 @@ export function ChatInput(props: ChatInputComponentProps) {// instead of wrapping into the single-line height. Typing clears// it, restoring normal wrapping / grow-to-multiline.'overflow-hidden whitespace-nowrap': isEmptyInput(),+ // Clip the scroll container itself so scrollHeight still reports+ // the full draft when focus restores the expanded layout.+ 'max-h-5 overflow-hidden [&_[contenteditable]>:first-child]:mt-0!':+ isCollapsed(),}}style={!isMultiline() && !isTallVariant()@@ -399,6 +423,7 @@ export function ChatInput(props: ChatInputComponentProps) {ref={mdRef}><MarkdownShell+ class={isCompactMobile() ? 'min-h-5' : undefined}config={props.editor}placeholder={isTouchDevice() ? 'Ask AI…' : 'Ask AI, @mention anything'@@ -427,7 +452,9 @@ export function ChatInput(props: ChatInputComponentProps) {<divclass={cn(!isTallVariant() &&- 'absolute left-2 bottom-2 touch:bottom-[7px]'+ 'absolute left-2 bottom-2 touch:bottom-[7px]',+ isCompactMobile() &&+ 'touch:top-1/2 touch:bottom-auto touch:-translate-y-1/2')}><LeftButton />@@ -436,7 +463,9 @@ export function ChatInput(props: ChatInputComponentProps) {<divclass={cn(!isTallVariant() &&- 'absolute right-2 bottom-2 touch:right-2 touch:bottom-[7px]'+ 'absolute right-2 bottom-2 touch:right-2 touch:bottom-[7px]',+ isCompactMobile() &&+ 'touch:right-[5px] touch:top-1/2 touch:bottom-auto touch:-translate-y-1/2')}><RightControls />diff --git a/apps/web/src/lib/core/component/AI/component/input/ModelSelector.test.tsx b/apps/web/src/lib/core/component/AI/component/input/ModelSelector.test.tsxindex 4fea102ec7..049abb823d 100644--- a/apps/web/src/lib/core/component/AI/component/input/ModelSelector.test.tsx+++ b/apps/web/src/lib/core/component/AI/component/input/ModelSelector.test.tsx@@ -36,7 +36,7 @@ vi.mock('@ui', () => {});// Neutralize SVG imports; tag the lock so we can assert it renders.-vi.mock('@core/component/AI/assets/anthropic.svg', () => ({+vi.mock('@icon/wide-claude.svg', () => ({default: () => null,}));vi.mock('@core/component/AI/assets/openai.svg', () => ({diff --git a/apps/web/src/lib/core/component/AI/component/input/ModelSelector.tsx b/apps/web/src/lib/core/component/AI/component/input/ModelSelector.tsxindex 8d7942331e..6f28051754 100644--- a/apps/web/src/lib/core/component/AI/component/input/ModelSelector.tsx+++ b/apps/web/src/lib/core/component/AI/component/input/ModelSelector.tsx@@ -1,3 +1,4 @@+import { MobileDrawer } from '@components/app/mobile/MobileDrawer';import {DEFAULT_MODEL,MODEL_PRETTYNAME,@@ -5,10 +6,14 @@ import {Model,} from '@core/component/AI/constant';import type { TModel } from '@core/component/AI/types';+import { isMobile } from '@core/mobile/isMobile';+import { virtualKeyboardVisible } from '@core/mobile/virtualKeyboard';+import CheckIcon from '@phosphor/check.svg';+import CloseIcon from '@phosphor/x.svg';import CaretDown from '@phosphor-icons/core/regular/caret-down.svg?component-solid';import LockIcon from '@phosphor-icons/core/regular/lock-simple.svg?component-solid';-import { cn, Dropdown } from '@ui';-import { For, Show } from 'solid-js';+import { Button, cn, Dropdown } from '@ui';+import { createSignal, For, Show } from 'solid-js';import { Dynamic } from 'solid-js/web';/** A model and whether the current user may select it. */@@ -29,7 +34,16 @@ const ALL_AVAILABLE: ModelOption[] = (Object.values(Model) as TModel[]).map((id) => ({ id, available: true }));+const MODEL_DESCRIPTION: Record<TModel, string> = {+ [Model.sonnet5]: 'Everyday writing, coding, and questions',+ [Model.opus5]: 'Complex tasks and deeper analysis',+ [Model.haiku45]: 'Quick answers and lighter tasks',+ [Model.gpt56]: 'Reasoning, writing, and problem solving',+ [Model.gpt56Mini]: 'Fast help with everyday tasks',+};+export function ModelSelector(props: ModelSelectorProps) {+ const [open, setOpen] = createSignal(false);const model = () => props.selectedModel ?? DEFAULT_MODEL;const options = () =>props.models && props.models.length > 0 ? props.models : ALL_AVAILABLE;@@ -43,47 +57,156 @@ export function ModelSelector(props: ModelSelectorProps) {};return (- <Dropdown placement="top-end">- <Dropdown.Trigger- variant="ghost"- size={props.compact ? 'icon-sm' : 'sm'}- class={cn(- 'rounded-lg text-sm text-ink-subtle',- !props.compact && 'gap-1.5'- )}- label={props.compact ? MODEL_PRETTYNAME[model()] : undefined}+ <Show+ when={isMobile()}+ fallback={+ <Dropdown placement="top-end">+ <Dropdown.Trigger+ variant="ghost"+ size={props.compact ? 'icon-sm' : 'sm'}+ class={cn(+ 'rounded-lg text-sm text-ink-subtle',+ !props.compact && 'gap-1.5'+ )}+ label={props.compact ? MODEL_PRETTYNAME[model()] : undefined}+ >+ <Dynamic component={MODEL_PROVIDER_ICON[model()]} />+ <Show when={!props.compact}>+ {MODEL_PRETTYNAME[model()]}+ <CaretDown />+ </Show>+ </Dropdown.Trigger>+ <Dropdown.Content class="w-60 max-w-[calc(100vw-1rem)]">+ <Dropdown.Group>+ <For each={options()}>+ {(option) => (+ // Unavailable items stay clickable (not Kobalte-disabled) so the+ // click can open the paywall; they're just visually dimmed.+ <Dropdown.Item+ class={cn('gap-2', !option.available && 'opacity-50')}+ onSelect={() => handleSelect(option)}+ >+ <Dynamic+ component={MODEL_PROVIDER_ICON[option.id]}+ class="size-4 shrink-0"+ />+ <span class="flex-1 truncate">+ {MODEL_PRETTYNAME[option.id]}+ </span>+ <Show when={!option.available}>+ <LockIcon class="size-3.5 shrink-0 text-ink-extra-muted" />+ </Show>+ </Dropdown.Item>+ )}+ </For>+ </Dropdown.Group>+ </Dropdown.Content>+ </Dropdown>+ }+ >+ <MobileDrawer+ side="bottom"+ open={open()}+ onOpenChange={setOpen}+ preventScroll={false}+ preventScrollbarShift={false}>- <Dynamic component={MODEL_PROVIDER_ICON[model()]} />- <Show when={!props.compact}>- {MODEL_PRETTYNAME[model()]}- <CaretDown />- </Show>- </Dropdown.Trigger>- <Dropdown.Content class="w-60 max-w-[calc(100vw-1rem)]">- <Dropdown.Group>- <For each={options()}>- {(option) => (- // Unavailable items stay clickable (not Kobalte-disabled) so the- // click can open the paywall; they're just visually dimmed.- <Dropdown.Item- class={cn('gap-2', !option.available && 'opacity-50')}- onSelect={() => handleSelect(option)}+ {/* Keep the drawer mounted when opening it dismisses the keyboard. */}+ <MobileDrawer.Trigger+ as={Button}+ variant="ghost"+ size="icon-sm"+ // Prevent compatibility mouse focus from hiding the trigger before+ // click. Leave pointerdown uncancelled so WebKit emits the tap click.+ onMouseDown={(event) => {+ if (event.button === 0) event.preventDefault();+ }}+ aria-label={`Choose model, ${MODEL_PRETTYNAME[model()]}`}+ class={cn(+ 'touch:min-h-11 touch:min-w-11 rounded-full text-sm text-ink-subtle',+ !virtualKeyboardVisible() && 'hidden'+ )}+ >+ <Dynamic component={MODEL_PROVIDER_ICON[model()]} />+ </MobileDrawer.Trigger>+ <MobileDrawer.Portal>+ <MobileDrawer.Overlay />+ <MobileDrawer.Content+ aria-label="Select model"+ class="overflow-hidden"+ >+ <MobileDrawer.Handle class="pb-1" />+ <div class="flex shrink-0 items-center justify-between gap-3 px-6 pb-4">+ <h2 class="text-lg font-semibold text-ink">Select model</h2>+ <MobileDrawer.Close+ as={Button}+ variant="ghost"+ size="icon-sm"+ aria-label="Close model picker"+ class="size-11 shrink-0 rounded-full bg-ink/6">- <Dynamic- component={MODEL_PROVIDER_ICON[option.id]}- class="size-4 shrink-0"- />- <span class="flex-1 truncate">- {MODEL_PRETTYNAME[option.id]}- </span>- <Show when={!option.available}>- <LockIcon class="size-3.5 shrink-0 text-ink-extra-muted" />- </Show>- </Dropdown.Item>- )}- </For>- </Dropdown.Group>- </Dropdown.Content>- </Dropdown>+ <CloseIcon class="size-5" />+ </MobileDrawer.Close>+ </div>+ <MobileDrawer.ScrollBody>+ <MobileDrawer.Section role="group" aria-label="Models">+ <For each={options()}>+ {(option) => (+ <MobileDrawer.Item+ aria-label={`${MODEL_PRETTYNAME[option.id]}${option.available ? '' : ', upgrade required'}`}+ aria-pressed={model() === option.id}+ class={cn(+ 'min-h-19 gap-3 px-4 py-4',+ !option.available && 'opacity-50'+ )}+ onClick={() => {+ if (!option.available) setOpen(false);+ handleSelect(option);+ }}+ >+ <Dynamic+ component={MODEL_PROVIDER_ICON[option.id]}+ class="size-6 shrink-0 text-ink-muted"+ />+ <span class="flex min-w-0 flex-1 flex-col gap-1">+ <span class="text-base font-medium leading-5">+ {MODEL_PRETTYNAME[option.id]}+ </span>+ <span class="text-[13px] leading-[18px] text-ink-muted">+ {MODEL_DESCRIPTION[option.id]}+ </span>+ </span>+ <span class="flex size-5 shrink-0 items-center justify-center">+ <Show+ when={!option.available}+ fallback={+ <Show when={model() === option.id}>+ <CheckIcon class="size-5 text-accent" />+ </Show>+ }+ >+ <LockIcon class="size-4 text-ink-muted" />+ </Show>+ </span>+ </MobileDrawer.Item>+ )}+ </For>+ </MobileDrawer.Section>+ <div class="px-6 pt-5 pb-2">+ <MobileDrawer.Close+ as={Button}+ variant="cta"+ size="xl"+ aria-label="Done"+ class="w-full rounded-full text-base"+ >+ Done+ </MobileDrawer.Close>+ </div>+ </MobileDrawer.ScrollBody>+ </MobileDrawer.Content>+ </MobileDrawer.Portal>+ </MobileDrawer>+ </Show>);}diff --git a/apps/web/src/lib/core/component/AI/constant/model.ts b/apps/web/src/lib/core/component/AI/constant/model.tsindex d584ded111..47ffa27c5d 100644--- a/apps/web/src/lib/core/component/AI/constant/model.ts+++ b/apps/web/src/lib/core/component/AI/constant/model.ts@@ -1,5 +1,5 @@-import AnthropicIcon from '@core/component/AI/assets/anthropic.svg';import OpenAiIcon from '@core/component/AI/assets/openai.svg';+import ClaudeIcon from '@icon/wide-claude.svg';/*** Frontend-owned set of model ids. These are the `provider/model` ids the@@ -34,9 +34,9 @@ export const MODEL_PRETTYNAME: ExhaustiveMap = {} as const;export const MODEL_PROVIDER_ICON: ExhaustiveMap = {- 'anthropic/claude-sonnet-5': AnthropicIcon,- 'anthropic/claude-opus-5': AnthropicIcon,- 'anthropic/claude-haiku-4-5': AnthropicIcon,+ 'anthropic/claude-sonnet-5': ClaudeIcon,+ 'anthropic/claude-opus-5': ClaudeIcon,+ 'anthropic/claude-haiku-4-5': ClaudeIcon,'openai/gpt-5.6': OpenAiIcon,'openai/gpt-5.6-mini': OpenAiIcon,};diff --git a/apps/web/src/lib/core/component/ContextMenu.tsx b/apps/web/src/lib/core/component/ContextMenu.tsxindex 397c496871..9451e64912 100644--- a/apps/web/src/lib/core/component/ContextMenu.tsx+++ b/apps/web/src/lib/core/component/ContextMenu.tsx@@ -26,7 +26,9 @@ import { Dynamic } from 'solid-js/web';* ContextMenu-only abstractions. The DropdownMenu equivalents that used to* live alongside these (in the old `Menu.tsx`) have been retired in favor of* `@ui` `Dropdown`. Right-click menus still use this file because they need- * separate behavior + positioning from the click-triggered Dropdown.+ * separate behavior + positioning from the click-triggered Dropdown. The+ * content wrapper also accepts a click-menu content component when a surface+ * (such as sidebar Search) should match the context menus.*/type BaseMenuItemWrapperProps = {@@ -296,6 +298,8 @@ export const MENU_CONTENT_CLASS = `flex flex-col justify-start items-start bordetype MenuContentProps = ParentProps<{class?: string;+ /** Reuse the surface with click-menu dismissal and focus behavior. */+ contentComponent?: typeof ContextMenu.Content;submenu?: boolean;onOpenAutoFocus?: (event: Event) => void;onCloseAutoFocus?: (event: Event) => void;@@ -400,7 +404,8 @@ export function ContextMenuContent(props: ParentProps<MenuContentProps>) {when={props.submenu}fallback={<Layer depth={2}>- <ContextMenu.Content+ <Dynamic+ component={props.contentComponent ?? ContextMenu.Content}class={cn(MENU_SURFACE_SCOPE,!props.overrideStyling && MENU_CONTENT_CLASS,@@ -415,7 +420,7 @@ export function ContextMenuContent(props: ParentProps<MenuContentProps>) {onCloseAutoFocus={props.onCloseAutoFocus}>{props.children}- </ContextMenu.Content>+ </Dynamic></Layer>}>diff --git a/apps/web/src/lib/core/component/GeneralizedPopup/Popup.tsx b/apps/web/src/lib/core/component/GeneralizedPopup/Popup.tsxindex a198c89cb4..90f006c2d4 100644--- a/apps/web/src/lib/core/component/GeneralizedPopup/Popup.tsx+++ b/apps/web/src/lib/core/component/GeneralizedPopup/Popup.tsx@@ -9,6 +9,8 @@ type GeneralizedPopupProps = ParentProps<{blockType: BlockName;};useBlockBoundary?: boolean;+ /** Forwarded to the positioned container. */+ class?: string;ref?: Ref<HTMLDivElement>;}>;@@ -22,6 +24,7 @@ export function GeneralizedPopup(props: GeneralizedPopupProps) {<PopupPositioneranchor={props.anchor.ref}useBlockBoundary={props.useBlockBoundary}+ class={props.class}><divref={props.ref}diff --git a/apps/web/src/lib/core/component/GeneralizedPopup/PopupPositioner.tsx b/apps/web/src/lib/core/component/GeneralizedPopup/PopupPositioner.tsxindex a7c275a440..267fe48405 100644--- a/apps/web/src/lib/core/component/GeneralizedPopup/PopupPositioner.tsx+++ b/apps/web/src/lib/core/component/GeneralizedPopup/PopupPositioner.tsx@@ -10,7 +10,7 @@ import {shift,} from '@floating-ui/dom';import { mergeRefs } from '@solid-primitives/refs';-import { Layer } from '@ui';+import { cn, Layer } from '@ui';import {createEffect,createSignal,@@ -36,6 +36,8 @@ type PopupPositionerProps = {useBlockBoundary?: boolean;/** Stacking depth for the floating layer. Defaults to 2. */layerDepth?: 0 | 1 | 2 | 3 | 4;+ /** Classes on the positioned container, including its stacking order. */+ class?: string;/** Forwarded to the positioned container element. */ref?: Ref<HTMLDivElement>;};@@ -86,7 +88,7 @@ export function PopupPositioner(props: PopupPositionerProps) {<Layer depth={props.layerDepth ?? 2}><divref={mergeRefs(setPopupRef, props.ref)}- class="absolute"+ class={cn('absolute', props.class)}style={{left: `${position().x}px`,top: `${position().y}px`,diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/PasteNode.tsx b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/PasteNode.tsxindex 17a4490fc8..af8bb4f7fd 100644--- a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/PasteNode.tsx+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/PasteNode.tsx@@ -190,7 +190,7 @@ export function PasteNode(props: PasteNodeDecoratorProps) {><MobileDrawer side="bottom" open={open()} onOpenChange={setOpen}><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Overlay /><MobileDrawer.Content aria-label={originTitle()}><MobileDrawer.Handle /><div class="flex items-center justify-between px-4 pb-2 text-xs text-ink-muted shrink-0">diff --git a/apps/web/src/lib/core/component/TopBar/ShareButton.tsx b/apps/web/src/lib/core/component/TopBar/ShareButton.tsxindex 8943a9223b..d7db3bd5b6 100644--- a/apps/web/src/lib/core/component/TopBar/ShareButton.tsx+++ b/apps/web/src/lib/core/component/TopBar/ShareButton.tsx@@ -462,7 +462,7 @@ function MobileShareDrawer(props: MobileShareDrawerProps) {initialFocusEl={getShareDrawerRecipientInput() ?? undefined}><MobileDrawer.Portal>- <MobileDrawer.Overlay class="fixed inset-0 z-modal-overlay bg-modal-overlay pattern-diagonal-4 pattern-edge-muted" />+ <MobileDrawer.Overlay /><MobileDrawer.Contentaria-label="Share"class="h-[80vh] overflow-y-auto"diff --git a/apps/web/src/lib/core/constant/SettingsState.test.tsx b/apps/web/src/lib/core/constant/SettingsState.test.tsxnew file mode 100644index 0000000000..7f2bd8b0f9--- /dev/null+++ b/apps/web/src/lib/core/constant/SettingsState.test.tsx@@ -0,0 +1,202 @@+import {+ MobileSettingsProvider,+ useMobileSettings,+} from '@app/features/settings/context/mobile-settings';+import {+ setActiveTabId as setSplitActiveTabId,+ activeTabId as splitActiveTabId,+} from '@core/signal/settingsTab';+import { cleanup, render, screen } from '@solidjs/testing-library';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { useSettingsState } from './SettingsState';++const mocks = vi.hoisted(() => ({+ mobile: true,+ hasSettingsSplit: false,+ removeSplit: vi.fn(),+ openWithSplit: vi.fn(),+ replaceAllSplits: vi.fn(),+ navigate: vi.fn(),+}));+vi.mock('@core/mobile/isMobile', () => ({ isMobile: () => mocks.mobile }));+vi.mock('@core/mobile/isTouchDevice', () => ({+ isTouchDevice: () => mocks.mobile,+}));+vi.mock('@app/signal/splitLayout', () => ({+ globalSplitManager: () => ({+ splits: () =>+ mocks.hasSettingsSplit+ ? [+ {+ id: 'settings-split',+ content: { type: 'component', id: 'settings' },+ },+ ]+ : [],+ removeSplit: mocks.removeSplit,+ }),+}));+vi.mock('@components/app/split-layout/layout', () => ({+ useSplitLayout: () => mocks,+}));+vi.mock('@solidjs/router', () => ({+ useNavigate: () => mocks.navigate,+ useLocation: () => ({+ pathname: '/app/component/inbox',+ search: '?keep=1',+ hash: '#position',+ }),+}));+vi.mock('./settingsSplitUrl', () => ({+ stripSettingsSplitFromUrl: (url: string) => url,+ appendSettingsSplitToUrl: (url: string) => url,+}));+vi.mock('./settingsTabsConfig', () => ({+ settingsTabToSlug: (tab: string) => tab.toLowerCase(),+ settingsSlugToTab: () => undefined,+}));++function mountSettings() {+ let state!: ReturnType<typeof useSettingsState>;+ let mobile!: ReturnType<typeof useMobileSettings>;+ function Probe() {+ state = useSettingsState();+ mobile = useMobileSettings();+ return (+ <output aria-label="Active settings page">+ {state.activeTabId() ?? 'index'}+ </output>+ );+ }+ render(() => (+ <MobileSettingsProvider>+ <Probe />+ </MobileSettingsProvider>+ ));+ return { state, mobile };+}++beforeEach(() => {+ vi.clearAllMocks();+ mocks.mobile = true;+ mocks.hasSettingsSplit = false;+ setSplitActiveTabId('Account');+});+afterEach(cleanup);++describe('settings entry points', () => {+ it.each([true, false])(+ 'requires the provider when mobile is %s',+ (mobile) => {+ mocks.mobile = mobile;+ function MissingProvider() {+ useSettingsState();+ return null;+ }+ expect(() => render(() => <MissingProvider />)).toThrow(+ 'useMobileSettings requires MobileSettingsProvider'+ );+ }+ );++ it('opens the mobile index without replacing the page or changing its URL', () => {+ const { state, mobile } = mountSettings();+ state.toggleSettings();+ expect(state.settingsOpen()).toBe(true);+ expect(mobile.page()).toBeUndefined();+ expect(state.activeTabId()).toBeUndefined();+ expect(mocks.openWithSplit).not.toHaveBeenCalled();+ expect(mocks.replaceAllSplits).not.toHaveBeenCalled();+ expect(mocks.navigate).not.toHaveBeenCalled();+ });++ it('opens requested sections, supports back, and resets the next session to the index', () => {+ const { state, mobile } = mountSettings();+ state.openSettings('Billing');+ expect(mobile.page()).toBe('Billing');+ state.selectTab('Appearance');+ expect(mobile.page()).toBe('Appearance');+ mobile.selectPage();+ expect(mobile.page()).toBeUndefined();+ expect(state.settingsOpen()).toBe(true);+ state.closeSettings();+ expect(state.settingsOpen()).toBe(false);+ state.openSettingsInSplit('Connected');+ expect(mobile.page()).toBe('Connected');+ state.toggleSettings();+ state.toggleSettings();+ expect(mobile.page()).toBeUndefined();+ expect(state.settingsOpen()).toBe(true);+ expect(mocks.openWithSplit).not.toHaveBeenCalled();+ });++ it('reads the same mobile page that entry points and sheet navigation select', () => {+ const { state, mobile } = mountSettings();+ const page = screen.getByLabelText('Active settings page');+ state.openSettings('Billing');+ expect(state.activeTabId()).toBe('Billing');+ expect(page.textContent).toBe('Billing');+ state.selectTab('Appearance');+ expect(state.activeTabId()).toBe('Appearance');+ expect(page.textContent).toBe('Appearance');+ mobile.selectPage('Connected');+ expect(state.activeTabId()).toBe('Connected');+ expect(page.textContent).toBe('Connected');+ mobile.selectPage();+ expect(state.activeTabId()).toBeUndefined();+ expect(page.textContent).toBe('index');+ expect(splitActiveTabId()).toBe('Account');+ });++ it('keeps selection in mobile state even when the sheet is closed', () => {+ const { state, mobile } = mountSettings();+ state.selectTab('Billing');+ expect(state.activeTabId()).toBe('Billing');+ expect(mobile.page()).toBe('Billing');+ expect(state.settingsOpen()).toBe(false);+ expect(splitActiveTabId()).toBe('Account');+ state.openSettings();+ expect(state.activeTabId()).toBeUndefined();+ });++ it('ignores a settings split when reading or closing the mobile sheet', () => {+ mocks.hasSettingsSplit = true;+ const { state } = mountSettings();+ expect(state.settingsOpen()).toBe(false);+ state.closeSettings();+ state.openSettings('Billing');+ expect(state.settingsOpen()).toBe(true);+ state.closeSettings();+ expect(state.settingsOpen()).toBe(false);+ expect(mocks.removeSplit).not.toHaveBeenCalled();+ });++ it('ignores retained mobile state when using desktop settings', () => {+ mocks.mobile = false;+ const { state, mobile } = mountSettings();+ mobile.openSettings('Billing');+ expect(state.settingsOpen()).toBe(false);+ expect(state.activeTabId()).toBe('Account');+ state.selectTab('Appearance');+ expect(state.activeTabId()).toBe('Appearance');+ expect(splitActiveTabId()).toBe('Appearance');+ expect(mobile.page()).toBe('Billing');+ });++ it('keeps desktop fullscreen and explicit split entry points', () => {+ mocks.mobile = false;+ const { state, mobile } = mountSettings();+ state.openSettings('Billing');+ expect(mobile.open()).toBe(false);+ expect(state.activeTabId()).toBe('Billing');+ expect(mocks.replaceAllSplits).toHaveBeenCalledWith({+ type: 'component',+ id: 'settings',+ });+ state.openSettingsInSplit('Appearance');+ expect(mocks.openWithSplit).toHaveBeenCalledWith(+ { type: 'component', id: 'settings' },+ expect.objectContaining({ allowDuplicate: false, preferNewSplit: true })+ );+ });+});diff --git a/apps/web/src/lib/core/constant/SettingsState.tsx b/apps/web/src/lib/core/constant/SettingsState.tsxindex c9778cc811..b0750d3288 100644--- a/apps/web/src/lib/core/constant/SettingsState.tsx+++ b/apps/web/src/lib/core/constant/SettingsState.tsx@@ -1,5 +1,6 @@import { DEFAULT_ROUTE } from '@app/constants/defaultRoute';import { toBaseRelative } from '@app/constants/routerBase';+import { useMobileSettings } from '@app/features/settings/context/mobile-settings';import { globalSplitManager } from '@app/signal/splitLayout';import { useSplitLayout } from '@components/app/split-layout/layout';import { isMobile } from '@core/mobile/isMobile';@@ -99,6 +100,7 @@ export const isSoloSettings = () => {};export const useSettingsState = () => {+ const mobileSettings = useMobileSettings();const { openWithSplit, replaceAllSplits } = useSplitLayout();const navigate = useNavigate();const location = useLocation();@@ -142,18 +144,16 @@ export const useSettingsState = () => {replaceAllSplits({ type: 'component', id: 'settings' });};- // Default activation. On mobile, dock settings into the split layout so it- // inherits the split navigation chrome (back button, swipe-back gesture) —- // the solo-settings chrome's exit affordances all live in desktop-only UI.- // On desktop, clobber down to a lone settings split, remembering where we- // came from so "Back to app" can return there. Opening without a specific- // tab always lands on Account rather than the last-viewed page — a fresh- // open shouldn't resume a prior session's tab. Re-invoking while settings- // is already showing (solo or docked alongside other splits) just switches- // the tab rather than re-clobbering the layout.+ // Mobile opens an in-place settings sheet; a fresh open lands on its index.+ // Desktop keeps the solo/split layout and defaults to Account.const openSettings = (tab?: SettingsTab) => {if (isMobile()) {- openSettingsInSplit(tab ?? 'Account');+ setSettingsReturnTo(+ stripSettingsSplitFromUrl(+ `${toBaseRelative(location.pathname)}${location.search}${location.hash}`+ )+ );+ mobileSettings.openSettings(tab);return;}if (splitOpen()) {@@ -163,17 +163,22 @@ export const useSettingsState = () => {collapseToSoloSettings(tab ?? 'Account');};- // Switch the active settings page. The split's URL segment is derived- // reactively from `activeTabId` (see `contentUrlSegments`), so the- // layout's bidirectional URL sync reflects this automatically — no- // explicit navigation needed, whether settings is solo or docked alongside- // other splits.+ // Mobile selection belongs to the sheet, including while it is closed.+ // Desktop selection drives the split's URL through `contentUrlSegments`.const selectTab = (tab: SettingsTab) => {+ if (isMobile()) {+ mobileSettings.selectPage(tab);+ return;+ }setActiveTabId(tab);};// Opt-in: dock settings into the split layout (the pre-route behavior).const openSettingsInSplit = (activeTabId?: SettingsTab) => {+ if (isMobile()) {+ openSettings(activeTabId);+ return;+ }if (activeTabId) setActiveTabId(activeTabId);openWithSplit({ type: 'component', id: 'settings' },@@ -197,6 +202,10 @@ export const useSettingsState = () => {};const closeSettings = () => {+ if (isMobile()) {+ mobileSettings.close();+ return;+ }if (isSoloSettings()) {navigate(settingsReturnTo() ?? DEFAULT_ROUTE, { replace: true });return;@@ -234,6 +243,11 @@ export const useSettingsState = () => {// Focus-aware toggle: bring settings to the user rather than destroying it,// and only close when settings is what they're actually looking at.const toggleSettings = () => {+ if (isMobile()) {+ if (mobileSettings.open()) mobileSettings.close();+ else openSettings();+ return;+ }// Solo takes priority: if it's the only thing showing, leave it.if (isSoloSettings()) {closeSettings();@@ -254,20 +268,20 @@ export const useSettingsState = () => {return;}- // Nothing open → open settings (solo split on desktop, docked on mobile).+ // Nothing open → open settings as a solo split on desktop.openSettings();};return {- settingsOpen: splitOpen,+ settingsOpen: () => (isMobile() ? mobileSettings.open() : splitOpen()),openSettings,openSettingsInSplit,selectTab,closeSettings,moveSettingsToSplit,moveSettingsToSolo,- activeTabId,- setActiveTabId,+ // Undefined represents the mobile settings index.+ activeTabId: () => (isMobile() ? mobileSettings.page() : activeTabId()),toggleSettings,};};diff --git a/apps/web/src/lib/core/mobile/IosPushNotificationModal.tsx b/apps/web/src/lib/core/mobile/IosPushNotificationModal.tsxindex cef5dedbf2..d7e30e1a50 100644--- a/apps/web/src/lib/core/mobile/IosPushNotificationModal.tsx+++ b/apps/web/src/lib/core/mobile/IosPushNotificationModal.tsx@@ -37,9 +37,13 @@ export function IosPushNotificationModal() {Get notified about new messages, mentions, comments, and emails.</Dialog.Description><div class="flex gap-2 w-full justify-end pt-2">- <Dialog.CloseButton class="text-sm text-ink-muted hover:text-ink px-3 py-1.5">+ <button+ type="button"+ class="text-sm text-ink-muted hover:text-ink px-3 py-1.5"+ onClick={() => settings.dismissPrompt()}+ >Later- </Dialog.CloseButton>+ </button><Buttonvariant="accent"size="sm"diff --git a/docs/AGENT_GUIDE/ai-chat.md b/docs/AGENT_GUIDE/ai-chat.mdindex 177ac7046e..0c4a897ce7 100644--- a/docs/AGENT_GUIDE/ai-chat.md+++ b/docs/AGENT_GUIDE/ai-chat.md@@ -8,11 +8,30 @@## Start a standalone chat-On mobile, the Agents list has an AI composer directly above the bottom dock-instead of a floating plus button. Type a prompt, optionally choose a model or+On mobile, every screen has a single-line AI composer directly above the bottom+dock. A labeled glass button beside it opens the current view's create action:+**+ Email**, **+ Task**, **+ Document**, **+ Message**, or **+ Event**. Home’s+**+ New** unfolds Email, Message, Document, Event, Task, and More above the button;+More opens the full create menu in a glass bottom sheet. Other views show+**+ New** for that full menu. The AI input narrows to fit the button, ending+to the left of the navigation pill's right edge below. Agents has no separate+create button; its AI input fills the row.+The composer's compact height is 46px, matching the mobile chrome buttons,+with a plus attachment control and centered text and actions. It expands for+longer prompts while focused. Leaving the AI composer collapses a long draft to+a single-line preview in the accessory row; tapping it expands the same editor+with the full draft intact. Screens with an available composer or reply controls show those+instead; opening mobile search shows scope pills in their place. When neither+is available, the AI composer returns with its draft intact, including in+documents without a comment composer. Type a+prompt, optionally choose a model orattach context, and tap **Send** to create the chat and send its first message.-The composer stays above the software keyboard; the list reserves space for it-so its last row remains reachable.+On touch devices, the accessory hides whenever an editable field outside its+Ask AI composer is focused, including email recipients, subject, and body fields.+It returns with the same draft when focus leaves that field. While typing in+Ask AI itself, the composer stays above the software keyboard; the list reserves+space for it so its last row remains reachable. This also follows focus when a+hardware keyboard is attached.The area behind the composer is transparent, without a bottom gradient overlay.Almost every list surface (Home, Agents, Files, Tasks, Customers, Email) has a bottom@@ -285,20 +304,29 @@ Locally sent user messages in both AI implementations enter with a short upwardslide and fade. History and remounted messages staystill; reduced-motion preferences disable the transition.+On phones, the chat model control appears as a provider icon while the software+keyboard is open. Its accessible name is `Choose model, <model name>`. It opens+a `Select model` sheet with descriptions, a checkmark for the current choice,+and a **Done** button. Selecting an available model updates the selection;+locked models open the upgrade flow. The sheet stays open when the keyboard closes.+The compact model menus use the standard menu text size and a 240px width(capped to the viewport), consistently in production chat and the agent input.Chat title icons follow the selected model's provider, including the agentsystem's live model. Soup rows use the model included in the list data, with asaved local draft selection taking precedence. Icons do not query chat transcripts.-Rows without model data show the standard chat icon. Anthropic, OpenAI, and Google use their+Rows without model data show the standard chat icon. Claude models use the Claude sunburst logo; OpenAI and Google use theirprovider logos; unknown providers in chat titles reserve the icon space.Both AI composers display their model trigger label at the input text size(15px), using the softer secondary text color. This includes the agent modelcatalog trigger and mobile model sheet trigger.-Soup chat icons use the same model resolution as the chat composer: the saved-per-chat selection takes precedence over the server model; retired server model-IDs fall back to the current default. Changing a selection updates mounted list-icons when the draft is saved, without refreshing the list.+Soup and recent-chat icons recognize the provider in the saved model ID even+when that model is no longer selectable. For example, `openai/gpt-5.5` retains+the OpenAI logo; an unknown provider shows the standard chat icon instead of+defaulting to Claude. A recognized per-chat selection takes precedence over the+server model. New sends record that selection before navigation or a background+send, so list icons can update immediately. Restoring a draft without a valid+model lets the composer use the chat's saved model before applying its default.diff --git a/docs/AGENT_GUIDE/documents.md b/docs/AGENT_GUIDE/documents.mdindex e80e821872..cb35788eac 100644--- a/docs/AGENT_GUIDE/documents.md+++ b/docs/AGENT_GUIDE/documents.md@@ -21,6 +21,10 @@ Markdown auto-format works while typing (`#` heading, `[]` checklist, `>` quote)text and inline mention chips (tasks, docs, channels, skills, …) by the titleshown on the chip.+On touch devices, the text-selection menu (Copy, Cut, Comment, Share, and other+available actions) appears above the floating header, comment input, and bottom+dock. It stays anchored to the selection while the document scrolls.+On a touch device, swipe a list item right to indent one level (Apple Notesstyle) or left to outdent. Nested children move with the parent. The firstitem can indent too, even in a single-item list. Vertical scrolling and taps@@ -72,11 +76,27 @@ fetch cascade.## Comments (Discussion)-Below the editor: `Discussion` section with a `Leave a comment...` contenteditable, buttons+On desktop, below the editor: `Discussion` section with a `Leave a comment...` contenteditable, buttons`Attach images`, `Format`, and `Send comment` (disabled until text exists). Click thecomposer, `type_text`, then click `Send comment` (Enter also submits). The comment rendersabove the composer with author + timestamp. `@`-mentions in comments notify the mentioned-user.+user. On mobile, the new-comment composer is docked above the navigation bar,+replacing Ask AI and New when commenting is available in documents and tasks.+When the comment composer is unavailable, the default Ask AI row appears instead.+Tap `Leave a comment...`+to expand the channel-style input; use Send comment to submit (Enter inserts a+newline on mobile). Submitting clears and unfocuses the mobile input, returning+it to its compact state and dismissing the keyboard. The compact input's plus+opens the native photo library in the iOS app, with a file-picker fallback when+unavailable; browsers use the file picker. Cancelling adds no images.+While the main document editor is focused with the virtual keyboard+open, the floating comment input is hidden; dismissing the keyboard or leaving+the document editor restores it with any unsent draft intact. Comments remain in the+Discussion section, and collapsing that section does not hide the docked composer.+On touch devices, the Discussion section is hidden until it contains a comment;+the floating **Leave a comment...** input remains available. If the discussion+becomes empty again, the section disappears. Desktop keeps the empty section+and inline input.Comments anchored to selected text open in a floating margin card on desktop anda `Comments` drawer on touch devices. New comments, replies, and edits use thediff --git a/docs/AGENT_GUIDE/navigation.md b/docs/AGENT_GUIDE/navigation.mdindex 19e5f0aa24..05a9f591bb 100644--- a/docs/AGENT_GUIDE/navigation.md+++ b/docs/AGENT_GUIDE/navigation.md@@ -29,7 +29,13 @@ Splits: the app is a tiling window manager. A second pane appends its own segmen## Sidebar (a11y names are load-bearing)-- Top: buttons `Search` and `Create`.+- Top: buttons `Search` and `Create`. Clicking sidebar `Search` opens a menu+ with `Command Menu` (⌘K on Mac / Ctrl+K elsewhere) and `Search everything`+ (`/`). Choose the first to open commands, or the second to open and focus+ global search. Hold Shift while selecting `Search everything` to open it in a+ new split, including when Search is already active. This left-click menu shares+ its surface and item styling with the sidebar right-click menus, in both the+ compact rail and expanded sidebar.- Nav: `Go to Home`, `Go to Getting Started`, `Go to Notifications`, `Go to Recent`, `Go to Activity`.- Workspace: `Go to Email`, `Go to Channels`, `Go to Calls`, `Go to Files`, `Go to Tasks`,`Go to Calendar`, `Go to Agents`, `Go to Customers`.@@ -62,7 +68,7 @@ changes roll back rather than becoming committed local favorites.## Create menuOn mobile, the bottom dock fits fixed-width buttons in this order: Notifications,-Calendar, Email, Channels, Files, Agents, Tasks, Calls. Calendar appears in the+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.Resizing the screen moves views between the dockand More views, which always includes Settings and lists the overflow views in@@ -71,18 +77,86 @@ their space. Search opens the search input and scope pills.Once every view fits, the navigation island stops growing; Search stays alignedto the right edge.-The separate button one row above Search opens the current page's creation-flow directly: new task on Tasks, email on Email, message on Channels or-Notifications, document on Files, agent session on Agents, and event on-Calendar. It does not open a create menu. It hides during search, while the-keyboard is open, and on entity/detail pages with their own reply or compose-controls. All popover splits open as bottom drawers on touch devices and dialogs+Primary dock navigation buttons, including Search, give haptic feedback on+pointer down and activate on click/release. Holding a button only shows its+pressed state; cancelling the touch does not navigate. More views also opens on+release so holding its trigger cannot drag or dismiss the opening sheet. Mouse,+keyboard, and assistive activation use the normal click behavior.++The dock's More views menu uses the same rounded glass bottom sheet as filters,+with a blurred backdrop, drag handle, and an even 8px outer inset. The home+indicator clearance sits inside the sheet. Tap a row to select; tap outside, swipe down, or press Escape to dismiss.+The ellipsis (**More tabs**) button on non-scrolling pill strips opens the same+drawer on release. Tap a tab to select it and close the drawer; the selected tab+moves into the visible strip. Holding and sliding from the trigger does not select+a row. The **Views** and **Tabs** footer buttons dismiss their respective drawers.+Settings opens its own glass sheet with a grouped main page. Select a settings+section, use **Back to settings** to return, or **Close settings** in the top+right to dismiss without changing the underlying app view.+Opening Settings again starts at the grouped main page. In-app actions that+request a specific section, including Getting Started actions, open that section+directly in the sheet without replacing the current view or changing its URL.+If a requested section is unavailable, the sheet shows an unavailable message+and a **Back to settings** button that returns to the grouped main page.++Fresh mobile CRM visits default to list view, including when+applying a default saved view; explicitly selected saved views and back/forward+navigation retain their layout. The mobile **+ Company** button opens the+company-creation sheet.++The labeled glass button one row above Search opens the current page's creation+flow directly: **+ Task** on Tasks, **+ Email** on Email, **+ Message** on Channels,+**+ Document** on Files, and **+ Event** on Calendar. On Home/Notifications,+**+ New** opens a blurred backdrop and a stack of glass actions: Email, Message,+Document, Event, Task, More. Event follows the calendar UI flag; unavailable+launcher actions are omitted. The plus rotates into an X; tap it or the backdrop,+or press Escape, to dismiss. More opens the full create menu as a glass bottom+sheet on mobile, with broad, screen-scaled corners and an even 8px outer inset;+home-indicator clearance is inside the glass. The mobile full menu is a scrollable+list of available create actions ordered by recent usage, with a Close create menu+button and no search field. Desktop retains search and keyboard controls. Other views+show **+ New** for that full menu. The AI composer narrows beside this+button; on Agents it fills the row with no duplicate create action. The row+hides during search, when a page supplies its own reply or compose controls, or+when an editable field outside Ask AI is focused on a touch device. The AI draft+is preserved when the row returns.+The New button also hides while the software keyboard is open.++Mobile drawers and floating dialogs share this inset glass sheet treatment,+including filters, task/event creation, file/message actions, sharing, and model+pickers. On phones, non-fullscreen dialogs use the shared drawer without an X+button: drag the handle down, tap the backdrop, or press Escape to dismiss.+Explicit actions such as Cancel or Later remain available. Closing returns focus+to the opener unless the flow supplies its own focus destination. With the+keyboard open, the sheet stays 8px above it and its body scrolls to keep inputs+and actions reachable. Fullscreen takeovers retain their fullscreen layout.++Filter sheets have a visible heading and Close filters button. Sort and filter+options use rounded rows with trailing checkmarks; accordion sections retain+their selection counts. Clear all resets selections without dismissing the sheet.+Calendar settings and the month picker use the same translucent groups and+rounded selection highlights. Calendar visibility and Show weekends are checkbox+rows; period, week start, time format, and month choices show trailing checkmarks.++All popover splits open as bottom drawers on touch devices and dialogson desktop, including task, calendar event, skill, and agent session composers.`Create` button (top-left) opens a menu of: Email E, Automation U, Agent A, Skill K,Document D, Task T, Reminder R, Snippet S, Message M, Channel G, Canvas N, Folder F, Code O.Document navigates straight into a new doc; Task and Channel open dialogs.+Mobile glass presses animate the enclosing surface over 300ms. Round buttons+retain roughly 20% growth; wide pills and grouped controls extend their glass+fill and rim by up to 3px per edge, with 8% icon growth around each icon's center.+Labels and layout stay fixed; icons remain visually aligned through release.+Selecting or deselecting a pill updates its fill and text together, including+during release or a rapid second tap. A subtle radial sheen spreads from the tap+location and fades on release. On touch devices, buttons omit the circular+hover/press overlay and native tap highlight; the shimmer supplies feedback.+Release, cancellation, or dragging outside+restores the surface. Disabled controls stay still; reduced motion keeps only+the static highlight.+## Command menu (Ctrl+K)Opens a dialog with a focused `Search...` textbox and category radiosdiff --git a/docs/AGENT_GUIDE/surfaces.md b/docs/AGENT_GUIDE/surfaces.mdindex 1f191dc71b..15452d3e64 100644--- a/docs/AGENT_GUIDE/surfaces.md+++ b/docs/AGENT_GUIDE/surfaces.md@@ -61,6 +61,8 @@ the notification sidebar. With the `enable-inbox-notified-sort` flag on, both tarows and date headers by when you were last notified about the item, so a fresh commenton an old task sits under "Today"; with it off they order by content recency. Keyboard:`j`/`k` move between rows and update the preview; alternate activation opens a new split.+On mobile, the filters float above the full-height scrolling list. On iOS, rows+fade underneath the filters and status bar using the shared top edge gradient.Notifications have three lifecycle states: `unseen`, `seen`, and `done`. Active meansunseen or seen. Viewing must not reopen a done notification; undoing done (`Ctrl+Z`@@ -185,7 +187,7 @@ With the new app views enabled, mobile and tablet Email use a floating, horizontscrolling row of those tabs, with `Open email filters` at the left. The rest of theview is the email list, which scrolls beneath the header and supports pull to refreshand swiping left to mark emails done in Signal and Noise. The filter button opens a-bottom drawer for status, done, attachment, calendar and tag filters, plus an `Inbox`+glass bottom sheet for status, done, attachment, calendar and tag filters, plus an `Inbox`section when the user can pick one: `All inboxes` or a single address, never several.`Clear all` resets those filters and the inbox selection. Desktop keeps its sidebar,search field, filter menu and preview control. The sidebar lists the inboxes above the@@ -197,6 +199,8 @@ still works. The sidebar ends with a collapsible `Tags` section (every personalteam tag, plus a `New tag` button): clicking a tag opens the `All` tab filtered tothreads carrying it, clicking it again clears it, and choosing any tab clears it likethe other filters.+Rows have trailing selection checkmarks; Close filters dismisses the sheet+without resetting its selections.## Search@@ -225,6 +229,11 @@ Calendar event creation and editing open in a bottom sheet on touch devices,with scrollable content above the keyboard. Desktop retains the centered dialog.Dismissing a changed event still asks before discarding the draft.+On phones, event details use inset round action buttons and a transparent RSVP+footer. Answering a recurring invitation opens a rounded glass sheet: choose+`This event` or `All events`, then `Save response`. Cancel or Close returns to+the event details without sending a response.+Week view with `New event`, `Choose calendar view` menu, prev/next week, `Search events`,`Calendar settings`, and a mini month picker in the side panel. Events require connecting aGoogle account (`Connect calendar`). The `Calendar settings` (gear) menu has an `Accounts`@@ -283,6 +292,8 @@ Google's out-of-office event type.Tabs `All` / `Missed` / `Unattended`; `Call` button to start one. Recordings, transcriptionsand summaries appear here; empty state notes "Calls are available to agents."+On phones, recorded call headers omit the **Call Again** action.+## Customers (CRM) — `/app/component/companies`Board/List views, `Company` create button. Requires a team ("Join a team to enable CRM" →@@ -323,8 +334,25 @@ below the floating page title and above the bottom toolbar.Greeting, getting-started checklist, example prompt buttons (`Draft a document`,`Draft an email`, `Search & research`), and the ubiquitous `Ask AI` composer.+On phones, shared confirmations (including Remove Member and Cancel Invitation)+use a glass sheet with a title, description, Close confirmation button, and+side-by-side cancel and confirm actions. Pending actions disable both buttons+and prevent dismissal; canceling leaves the underlying data unchanged.+## Settings — `/app/settings/<section>`+On phones, **More views → Settings** opens an inset glass sheet over the current+page. The main page has a profile shortcut and grouped Account, Preferences,+Workspace, and enabled agent/admin sections. Tap a row to open that settings+page inside the sheet; **Back to settings** returns to the grouped list at its+previous scroll position. **Close settings** at the top right, Escape, an+outside tap, or a downward swipe dismisses the sheet. Opening Settings again+starts at the main page; explicit links (for example Connections) open their+section directly. Existing settings URLs open the requested section in the sheet+and restore the underlying app route. The header stays visible while forms+scroll, including with the keyboard open. Desktop settings retain their panel+and split navigation.+Left nav: General → `Account` (profile, delete account), `API Keys` (create /list / delete personal keys; the secret is shown only once and is sent as`x-macro-user-api-key`), `Notifications`, `Billing`,@@ -372,6 +400,11 @@ Discussion composers on companies, contacts, documents, tasks, and PRs use theshared channel/AI glass surface, 22px desktop corners, 15px desktop text, anda circular neutral Send button. Document comment replies/edits and Edit with AIuse the same composer treatment. Attachment and formatting actions stay available.+On mobile, open documents and tasks put their new-comment composer in the+accessory dock above navigation, using the channel input's compact pill and+expanded surface. Ask AI and New are hidden in these open views only when the+comment composer is available; their list screens keep those controls. Users+without comment permission have no comment composer, so Ask AI remains visible.On touch devices, an email thread's floating action bar has Previous email andNext email arrows beside the larger Mark done checkmark. The arrows follow the@@ -392,3 +425,7 @@ The mobile reply/forward drawer uses matching circular glass buttons fordiscard, attachments, and send, with the dock's button/icon sizing and regularPhosphor icons. Send remains disabled until the draft is valid and shows aspinner while sending.++The mobile new-email composer nests the channel-style Send button inside its+top-right glass toolbar, with an even 5px inset on the top, bottom, and right.+The toolbar is 46px tall; attachment and schedule controls align with Send.diff --git a/docs/AGENT_GUIDE/tasks.md b/docs/AGENT_GUIDE/tasks.mdindex d384ca36df..6786470d99 100644--- a/docs/AGENT_GUIDE/tasks.md+++ b/docs/AGENT_GUIDE/tasks.md@@ -10,7 +10,8 @@ sidebar has a collapsible `Tags` section listing every personal and team tag, wicarrying it (the same selection as the `Tags` group of the `Filter` menu); clicking it againclears it, and switching tabs clears it like any other filter. On mobile, the tabsare pills and the leading sliders button opens one drawer containing Sort, Group, and-Filters (including Tags). Mobile intentionally omits the search and create controls.+Filters (including Tags). The mobile bottom dock has the Ask AI input, a separate **+ Task**+button, and Search.New accounts are seeded with three sample tasks (`Intro to tasks`, `Advanced task features`,`How we use tasks at Macro`).@@ -18,7 +19,9 @@ New accounts are seeded with three sample tasks (`Intro to tasks`, `Advanced tas## Create a taskOn touch devices, task creation opens in a bottom sheet with a drag handle and-scrollable, keyboard-aware content. Desktop uses the centered composer dialog.+scrollable, keyboard-aware content. Its glass pane has broad screen-scaled+corners, an 8px outer inset, and a blurred backdrop, matching the create and+filter sheets. Desktop uses the centered composer dialog.1. Click the `Task` button (or `Create` → `Task T`, or keyboard `c` then `t`).2. A dialog opens with the title contenteditable focused (placeholder `New task`), plus