Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix(mobile): polish (#8390)
Peter Chinman9b0f5d0a51cf
diff --git a/.agents/rules/web/mobile.md b/.agents/rules/web/mobile.mdindex 4ee5b49053..dcff62c2cb 100644--- a/.agents/rules/web/mobile.md+++ b/.agents/rules/web/mobile.md@@ -24,18 +24,23 @@ read their code, and follow that pattern rather than inventing a new one.`mobile:` decide phone layout (touch and under 640px). Hide a desktopcontrol and show its touch replacement with the same one, or tablets getneither. Native checks (`isPlatform` in `@core/util/platform`) are for- native bridges, not layout.+ native bridges and platform-specific visual effects, not layout.- Gate hover and press styles with `not-touch:`; iOS leaves hover stuck.- No action lives only behind hover. `HoverCard` renders nothing on touch,so give it a tap path that opens a sheet, as `UserCardTrigger` does.+- Keep tooltips disabled on touch devices, including focus and controlled-open states.- Keep `@ui` Button's touch sizing (no `noTouchResize` without cause); rowsare 44px on touch (`touch:min-h-[44px]`).-- Long-press goes through the `touchHandler` directive. A touch drag scrolls:- selecting or dragging starts only after a long press, and horizontal- swipes ignore the left edge (iOS back swipe).-- Primary nav fires `hapticImpact('light')` on pointer down and acts on- click, so a held or cancelled touch does nothing. `glass` and `island`- controls get press animation from `installGlassPress`; add none.+- Long-press goes through the `touchHandler` directive. On scrollable rows,+ selecting or dragging starts only after a long press; dedicated reorder+ handles instead drag after a small movement with no hold delay and reserve+ scrolling for the rest of the row. Horizontal swipes ignore the left edge+ (iOS back swipe).+- Keep navigation, filter pills, and create-menu taps silent; keep haptics for+ long press and use `hapticImpact('light')` for valid message/AI sends. Navigation+ acts on click so held or cancelled touches do nothing. `glass` and `island`+ controls and channel inputs get iOS-app-only press animation from+ `installGlassPress`; reuse it and keep Android and web free of the effect.## Sheets, menus, and dialogsdiff --git a/apps/web/AGENTS.md b/apps/web/AGENTS.mdindex 084d0aef23..281721d04c 100644--- a/apps/web/AGENTS.md+++ b/apps/web/AGENTS.md@@ -92,12 +92,14 @@ ownership. Cancel, logout, and the ten-minute timeout retire pending callbacks.shared HttpOnly dev cookies are not visible to JavaScript or localStorage.- Disable GraphQL cache sessions and clear login hints on confirmed auth 401s,even with retained user data; preserve session state on transient failures.+- Mobile dock customization shares the navigation island’s measured capacity; persist ordering per user with `mobile-dock-order.ts`, preserve gated destinations, and keep Search and More fixed. Reorder handles drag without a hold delay; the rest of each row scrolls.+- Share sidebar and mobile dock unread presence through `components/app/use-navigation-unread.ts`; keep badges reactive to read/done changes and avoid fetching extra pages for counts.- Mobile dock search owns transient category/mode state in `features/command/mobile`; reuse the shared entity source and explicit full-text adapter rather than overlaying the dock query on view tabs or saved facets. See `docs/agent-guide/search.md` at the repository root.- Keep mobile search sessions, result order, loaded rows, and scroll state with their Search history entry; preserve order before opening a result so viewedAt updates cannot move it on Back. Refresh row data in place and append later pages. Scope saved rows and scroll measurements to their account and reset result adapters/scrollers on account changes. Query/category changes rerank; a fresh dock search supplies a new session ID in Search's route state, including when reusing a native pane.- Keep Quick Access cache availability reactive to the GraphQL rollout flag; it can arrive after the provider mounts, and email has no legacy source fallback.- Virtualize mobile name results like desktop Command Menu; local Quick Access sources are unbounded, and mounting them all stalls iOS keyboard focus during layout. Load additional search pages near the scroll end instead of reserving a paging bar.- Reconcile mobile full-text rows by entity ID so appending a page preserves DOM rows and scroll position; restore after responsive row measurement and disable browser scroll anchoring so layout changes cannot override the saved history offset.-- Reserve only the safe-area inset above mobile Search and Channels; their hidden split headers must not leave a blank strip or extend the top fade.+- Reserve the safe area plus the category row above mobile Search, and only the safe area above Channels; their hidden split headers must not add another blank strip.- Follow [mobile layout and chrome](../../.agents/rules/web/mobile.md#layout-and-chrome) for full-frame views and record tabs; verify their first controls below the navigation with a nonzero safe area on phones and tablets.- Show only the Recent conversation feed in mobile Channels, without view tabs or a persisted mobile tab selection.- Mount the mobile search input before focusing it inside the dock tap; keep navigation in that handler so focus does not trigger a second navigation or lose iOS keyboard activation.@@ -113,6 +115,7 @@ ownership. Cancel, logout, and the ten-minute timeout retire pending callbacks.and Calendar. Preserve the session ID before disconnecting.- Keep desktop Gmail and Outlook inbox consent in the system browser with a`macro:///inbox-link-callback` return; webview origins are not desktop callbacks.+- Touch email replies and forwards use the full-screen composer with the shared new-email header actions; preserve thread state underneath and flush local edits before closing.- Draft autosaves preserve active email thread messages; evict inactive legacycaches on save and the active cache on thread exit. Revalidate GraphQL threadpages only when a save cannot patch the message list (missing snapshot or adiff --git a/apps/web/src/components/app/Layout.tsx b/apps/web/src/components/app/Layout.tsxindex 6d988465d3..c1c97c9d89 100644--- a/apps/web/src/components/app/Layout.tsx+++ b/apps/web/src/components/app/Layout.tsx@@ -75,7 +75,6 @@ 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';import { SessionExpiredRedirect } from './SessionExpiredRedirect';import { useAppSquishHandlers } from './useAppSquishHandlers';@@ -327,7 +326,12 @@ export function AppChrome(props: ParentProps) {<MobileSettings /></Suspense></Show>- <MobileViewsRow />+ {/* Search owns its filters at the top; suppress background composers. */}+ <FloatRegion+ region="accessory"+ priority={100}+ active={SearchState.isOpen}+ /><FloatRegionregion="dock"active={() => !virtualKeyboardVisible() || SearchState.isOpen()}diff --git a/apps/web/src/components/app/mobile/ConfirmDrawer.tsx b/apps/web/src/components/app/mobile/ConfirmDrawer.tsxindex cb79bf2351..7d6b5978b3 100644--- a/apps/web/src/components/app/mobile/ConfirmDrawer.tsx+++ b/apps/web/src/components/app/mobile/ConfirmDrawer.tsx@@ -19,7 +19,7 @@ export function ConfirmDrawer(props: ConfirmDialogProps) {open={props.open}onOpenChange={(open) => !open && close()}onFinalFocus={props.onCloseAutoFocus}- restoreFocus={!!props.onCloseAutoFocus}+ restoreFocus={!!props.mobileHero || !!props.onCloseAutoFocus}closeOnOutsidePointer={!props.pending}closeOnEscapeKeyDown={!props.pending}>@@ -31,55 +31,104 @@ export function ConfirmDrawer(props: ConfirmDialogProps) {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-[18px] leading-6 font-semibold text-ink"- >- {props.title}- </h2>- <Button- variant="ghost"- size="icon-lg"- aria-label="Close confirmation"- class="bg-ink/6"- disabled={props.pending}- onClick={close}- >- <CloseIcon class="size-5" />- </Button>- </div>- <MobileDrawer.ScrollBody>- <div- id={descriptionId}- class="px-6 pb-6 text-sm leading-5 text-ink-muted"- >- {props.body ?? props.children}+ <Show+ when={props.mobileHero}+ fallback={+ <>+ <div class="flex shrink-0 items-center justify-between gap-3 px-6 pb-4">+ <h2+ id={titleId}+ class="text-[18px] leading-6 font-semibold text-ink"+ >+ {props.title}+ </h2>+ <Button+ variant="ghost"+ size="icon-lg"+ aria-label="Close confirmation"+ class="bg-ink/6"+ disabled={props.pending}+ onClick={close}+ >+ <CloseIcon class="size-5" />+ </Button>+ </div>+ <MobileDrawer.ScrollBody>+ <div+ id={descriptionId}+ class="px-6 pb-6 text-sm leading-5 text-ink-muted"+ >+ {props.body ?? props.children}+ </div>+ </MobileDrawer.ScrollBody>+ <ActionDialogShell.Footer class="gap-3">+ <Button+ variant="ghost"+ size="xl"+ class="min-w-0 flex-1"+ disabled={props.pending}+ onClick={close}+ >+ {props.cancelLabel ?? 'Cancel'}+ </Button>+ <Button+ variant="strong"+ size="xl"+ class="min-w-0 flex-1"+ disabled={props.pending}+ onClick={() => !props.pending && props.onConfirm()}+ >+ <Show when={props.pending}>+ <SpinnerIcon class="size-4 animate-spin" />+ </Show>+ {props.confirmLabel ?? 'Confirm'}+ </Button>+ </ActionDialogShell.Footer>+ </>+ }+ >+ <MobileDrawer.ScrollBody class="pb-0">+ <div class="flex flex-col items-center px-6 pt-6 pb-8 text-center">+ <div+ class="mb-6 flex items-center justify-center gap-3"+ aria-hidden="true"+ >+ {props.mobileHero}+ </div>+ <h2+ id={titleId}+ class="text-xl leading-7 font-semibold text-ink break-words max-w-full"+ >+ {props.title}+ </h2>+ <div+ id={descriptionId}+ class="mt-2 text-base leading-6 text-ink-muted"+ >+ {props.body ?? props.children}+ </div>+ </div>+ </MobileDrawer.ScrollBody>+ <div class="shrink-0 px-4 pb-[max(24px,var(--mobile-sheet-safe-padding))]">+ <Button+ variant="cta"+ size="xl"+ fullWidth+ glass={false}+ class="h-12 rounded-2xl"+ classList={{+ 'bg-success text-surface': props.tone === 'success',+ }}+ 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>- <ActionDialogShell.Footer class="gap-3">- <Button- variant="ghost"- size="xl"- class="min-w-0 flex-1"- disabled={props.pending}- onClick={close}- >- {props.cancelLabel ?? 'Cancel'}- </Button>- <Button- variant="strong"- size="xl"- class="min-w-0 flex-1"- disabled={props.pending}- onClick={() => !props.pending && props.onConfirm()}- >- <Show when={props.pending}>- <SpinnerIcon class="size-4 animate-spin" />- </Show>- {props.confirmLabel ?? 'Confirm'}- </Button>- </ActionDialogShell.Footer>+ </Show></MobileDrawer.Content></MobileDrawer.Portal></MobileDrawer>diff --git a/apps/web/src/components/app/mobile/CustomizeDock.test.tsx b/apps/web/src/components/app/mobile/CustomizeDock.test.tsxnew file mode 100644index 0000000000..4228dde75b--- /dev/null+++ b/apps/web/src/components/app/mobile/CustomizeDock.test.tsx@@ -0,0 +1,169 @@+import { hapticImpact } from '@core/mobile/haptics';+import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';+import { createSignal } from 'solid-js';+import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import { CustomizeDock } from './CustomizeDock';+import { MobileDrawer } from './MobileDrawer';+import type { MobileDockView } from './mobile-dock-views';++vi.mock('@core/mobile/isTouchDevice', () => ({ isTouchDevice: () => true }));+vi.mock('@core/mobile/haptics', () => ({ hapticImpact: vi.fn() }));+vi.mock('@core/mobile/virtualKeyboard', () => ({+ virtualKeyboardVisible: () => false,+}));++beforeEach(() => {+ vi.useFakeTimers();+ vi.clearAllMocks();+ vi.stubGlobal('scrollTo', vi.fn());+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+ vi.spyOn(HTMLElement.prototype, 'getBoundingClientRect').mockImplementation(+ function (this: HTMLElement) {+ const rows = [...document.querySelectorAll('[data-dock-order-item]')];+ const index = rows.indexOf(this);+ return new DOMRect(+ 50,+ 100 + Math.max(index, 0) * 60,+ 300,+ index < 0 ? 400 : 56+ );+ }+ );+});+afterEach(() => {+ cleanup();+ vi.useRealTimers();+ vi.restoreAllMocks();+ vi.unstubAllGlobals();+});++function mount() {+ const [views, setViews] = createSignal<MobileDockView[]>([+ { id: 'home', label: 'Notifications', icon: () => <svg /> },+ { id: 'mail', label: 'Email', icon: () => <svg /> },+ { id: 'tasks', label: 'Tasks', icon: () => <svg /> },+ ]);+ const onMove = vi.fn((from: number, to: number) => {+ setViews((current) => {+ const next = [...current];+ const [item] = next.splice(from, 1);+ next.splice(to, 0, item);+ return next;+ });+ });+ render(() => (+ <MobileDrawer open>+ <MobileDrawer.Content>+ <CustomizeDock+ views={views()}+ visibleCount={1}+ onBack={() => {}}+ onMove={onMove}+ />+ </MobileDrawer.Content>+ </MobileDrawer>+ ));+ return {+ onMove,+ views,+ handle: screen.getByRole('button', { name: 'Reorder Tasks' }),+ };+}+const touch = (y: number) => ({ identifier: 1, clientX: 320, clientY: y });++it('lets touches outside the handle scroll without reordering', () => {+ const { onMove } = mount();+ const handle = screen.getByText('Tasks');+ fireEvent.touchStart(handle, { touches: [touch(248)] });+ expect(fireEvent.touchMove(handle, { touches: [touch(200)] })).toBe(true);+ vi.advanceTimersByTime(350);+ fireEvent.touchEnd(handle, { touches: [], changedTouches: [touch(200)] });+ expect(onMove).not.toHaveBeenCalled();+});++it('drags immediately across the menu/dock boundary without a hold', () => {+ const { handle, onMove, views } = mount();+ fireEvent.touchStart(handle, { touches: [touch(248)] });+ expect(fireEvent.touchMove(handle, { touches: [touch(128)] })).toBe(false);+ fireEvent.touchEnd(handle, { touches: [], changedTouches: [touch(128)] });+ expect(onMove).toHaveBeenCalledExactlyOnceWith(2, 0);+ expect(views()[0].id).toBe('tasks');+ expect(hapticImpact).toHaveBeenCalledExactlyOnceWith('light');+ expect(screen.getByRole('status').textContent).toContain('in dock');+});++it.each(['touchcancel', 'escape', 'blur', 'multitouch'])(+ 'cancels a touch drag on %s without saving',+ (reason) => {+ const { handle, onMove } = mount();+ fireEvent.touchStart(handle, { touches: [touch(248)] });+ fireEvent.touchMove(handle, { touches: [touch(128)] });+ if (reason === 'touchcancel') fireEvent.touchCancel(handle);+ if (reason === 'escape') fireEvent.keyDown(document, { key: 'Escape' });+ if (reason === 'blur') fireEvent.blur(window);+ if (reason === 'multitouch')+ fireEvent.touchStart(document, {+ touches: [touch(128), { ...touch(150), identifier: 2 }],+ });+ fireEvent.touchEnd(handle, { touches: [], changedTouches: [touch(128)] });+ expect(onMove).not.toHaveBeenCalled();+ }+);++it('supports mouse dragging and cancels it with Escape', () => {+ const { handle, onMove } = mount();+ fireEvent.mouseDown(handle, { button: 0, clientX: 320, clientY: 248 });+ fireEvent.mouseMove(document, { clientX: 320, clientY: 128 });+ fireEvent.keyDown(document, { key: 'Escape' });+ fireEvent.mouseUp(document, { clientX: 320, clientY: 128 });+ expect(onMove).not.toHaveBeenCalled();+ fireEvent.mouseDown(handle, { button: 0, clientX: 320, clientY: 248 });+ fireEvent.mouseMove(document, { clientX: 320, clientY: 128 });+ fireEvent.mouseUp(document, { clientX: 320, clientY: 128 });+ expect(onMove).toHaveBeenCalledExactlyOnceWith(2, 0);+});++it('cleans up a pending handle touch when the drawer unmounts', () => {+ const { handle, onMove } = mount();+ fireEvent.touchStart(handle, { touches: [touch(248)] });+ cleanup();+ vi.advanceTimersByTime(500);+ expect(onMove).not.toHaveBeenCalled();+ expect(hapticImpact).not.toHaveBeenCalled();+});++it.each(['touchcancel', 'escape', 'blur', 'multitouch'])(+ 'does not activate a pending drag after %s',+ (reason) => {+ const { handle, onMove } = mount();+ fireEvent.touchStart(handle, { touches: [touch(248)] });+ if (reason === 'touchcancel') fireEvent.touchCancel(handle);+ if (reason === 'escape') fireEvent.keyDown(document, { key: 'Escape' });+ if (reason === 'blur') fireEvent.blur(window);+ if (reason === 'multitouch')+ fireEvent.touchStart(document, {+ touches: [touch(248), { ...touch(150), identifier: 2 }],+ });+ vi.advanceTimersByTime(350);+ expect(hapticImpact).not.toHaveBeenCalled();+ expect(fireEvent.touchMove(handle, { touches: [touch(128)] })).toBe(true);+ fireEvent.touchEnd(handle, { touches: [], changedTouches: [touch(128)] });+ expect(onMove).not.toHaveBeenCalled();+ }+);++it('keeps tap and small finger movements from reordering or firing haptics', () => {+ const { handle, onMove } = mount();+ fireEvent.touchStart(handle, { touches: [touch(248)] });+ fireEvent.touchMove(handle, { touches: [touch(250)] });+ fireEvent.touchEnd(handle, { touches: [], changedTouches: [touch(250)] });+ expect(onMove).not.toHaveBeenCalled();+ expect(hapticImpact).not.toHaveBeenCalled();+});diff --git a/apps/web/src/components/app/mobile/CustomizeDock.tsx b/apps/web/src/components/app/mobile/CustomizeDock.tsxnew file mode 100644index 0000000000..a113f06861--- /dev/null+++ b/apps/web/src/components/app/mobile/CustomizeDock.tsx@@ -0,0 +1,211 @@+import { DragSessionSensors } from '@app/components/drag-drop/drag-session-sensors';+import CaretLeftIcon from '@phosphor/caret-left.svg';+import DotsSixVerticalIcon from '@phosphor/dots-six-vertical.svg';+import {+ closestCenter,+ createSortable,+ DragDropProvider,+ DragOverlay,+ maybeTransformStyle,+ SortableProvider,+ useDragDropContext,+} from '@thisbeyond/solid-dnd';+import { Button, cn } from '@ui';+import { createSignal, For, onMount, Show } from 'solid-js';+import { Dynamic } from 'solid-js/web';+import { createDockTouchSensor } from './create-dock-touch-sensor';+import { MobileDrawer } from './MobileDrawer';+import type { MobileDockView } from './mobile-dock-views';++function DockOrderRow(props: {+ view: MobileDockView;+ index: number;+ count: number;+ attachTouch: (element: HTMLElement, id: string) => void;+ onMove: (from: number, to: number) => void;+}) {+ const sortable = createSortable(props.view.id);+ const [dragState] = useDragDropContext() ?? [];+ return (+ <div+ ref={sortable.ref}+ style={maybeTransformStyle(sortable.transform)}+ data-dock-order-item={props.view.id}+ class={cn(+ 'flex min-h-14 items-center gap-3 rounded-2xl bg-ink/5 pl-4 text-sm',+ !!dragState?.active.draggable &&+ !sortable.isActiveDraggable &&+ 'transition-transform duration-200 ease-out motion-reduce:transition-none',+ sortable.isActiveDraggable && 'opacity-30'+ )}+ >+ <Dynamic+ component={props.view.icon}+ class="size-5 shrink-0 text-ink-muted"+ />+ <span class="flex-1">{props.view.label}</span>+ <Button+ {...sortable.dragActivators}+ ref={(element) => props.attachTouch(element, props.view.id)}+ type="button"+ variant="ghost"+ size="icon-lg"+ aria-label={`Reorder ${props.view.label}`}+ aria-description={`Position ${props.index + 1} of ${props.count}. Drag, or use the up and down arrow keys.`}+ class="flex size-14 shrink-0 cursor-grab touch-none data-[touch-pressed]:bg-ink/10 select-none items-center justify-center rounded-2xl text-ink-muted active:cursor-grabbing focus-visible:outline-2 focus-visible:outline-accent [-webkit-touch-callout:none]"+ onPointerDown={(event) => event.stopPropagation()}+ onContextMenu={(event) => event.preventDefault()}+ onKeyDown={(event) => {+ if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return;+ event.preventDefault();+ props.onMove(+ props.index,+ props.index + (event.key === 'ArrowUp' ? -1 : 1)+ );+ event.currentTarget.focus({ preventScroll: true });+ }}+ >+ <DotsSixVerticalIcon class="size-6" />+ </Button>+ </div>+ );+}++function DockOrderList(props: {+ views: readonly MobileDockView[];+ visibleCount: number;+ onMove: (from: number, to: number) => void;+ onCancel: () => void;+}) {+ let viewport: HTMLDivElement | undefined;+ const attachTouch = createDockTouchSensor(props.onCancel);+ return (+ <>+ <DragSessionSensors+ getViewport={() => viewport}+ axis="both"+ activationDistance={8}+ onCancel={props.onCancel}+ />+ <MobileDrawer.ScrollBody ref={viewport} class="px-4">+ <SortableProvider ids={props.views.map((view) => view.id)}>+ <div class="flex flex-col gap-1">+ <div class="px-2 pb-2 pt-1 text-xs font-medium text-ink-muted">+ In dock · {props.visibleCount}+ </div>+ <For each={props.views}>+ {(view, index) => (+ <>+ <Show when={index() === props.visibleCount}>+ <div class="mt-3 border-t border-edge px-2 pb-2 pt-4 text-xs font-medium text-ink-muted">+ In More · {props.views.length - props.visibleCount}+ </div>+ </Show>+ <DockOrderRow+ view={view}+ index={index()}+ count={props.views.length}+ attachTouch={attachTouch}+ onMove={props.onMove}+ />+ </>+ )}+ </For>+ </div>+ </SortableProvider>+ </MobileDrawer.ScrollBody>+ <DragOverlay class="z-drag pointer-events-none">+ {(draggable) => (+ <Show when={props.views.find((view) => view.id === draggable?.id)}>+ {(view) => (+ <div class="flex min-h-14 items-center gap-3 rounded-2xl bg-menu px-4 text-sm text-ink shadow-lg">+ <Dynamic component={view().icon} class="size-5" />+ <span class="flex-1">{view().label}</span>+ <DotsSixVerticalIcon class="size-6" />+ </div>+ )}+ </Show>+ )}+ </DragOverlay>+ </>+ );+}++export function CustomizeDock(props: {+ views: readonly MobileDockView[];+ visibleCount: number;+ onBack: () => void;+ onMove: (from: number, to: number) => void;+}) {+ let backButton: HTMLButtonElement | undefined;+ onMount(() => backButton?.focus({ preventScroll: true }));+ let cancelled = false;+ const [announcement, setAnnouncement] = createSignal('');+ const move = (from: number, to: number) => {+ if (from === to || to < 0 || to >= props.views.length) return;+ const view = props.views[from];+ if (!view) return;+ props.onMove(from, to);+ setAnnouncement(+ `${view.label} moved to position ${to + 1}, ${to < props.visibleCount ? 'in dock' : 'in More'}.`+ );+ };+ return (+ <>+ <div class="flex items-center gap-2 px-4 pb-2">+ <Button+ type="button"+ ref={backButton}+ aria-label="Back to More views"+ variant="ghost"+ size="icon-lg"+ class="size-11"+ onClick={props.onBack}+ >+ <CaretLeftIcon class="size-5" />+ </Button>+ <MobileDrawer.Title class="flex-1 text-lg font-semibold">+ Customize dock+ </MobileDrawer.Title>+ <MobileDrawer.Close+ as={Button}+ variant="ghost"+ aria-label="Done"+ class="min-h-11 px-3 text-sm font-medium text-accent"+ >+ Done+ </MobileDrawer.Close>+ </div>+ <MobileDrawer.Description class="px-6 pb-4 text-sm text-ink-muted">+ Drag a handle to reorder. {props.visibleCount} app{' '}+ {props.visibleCount === 1 ? 'fits' : 'buttons fit'} in your dock at this+ size. Search and More stay fixed. Changes save automatically.+ </MobileDrawer.Description>+ <span role="status" class="sr-only">+ {announcement()}+ </span>+ <DragDropProvider+ collisionDetector={closestCenter}+ onDragStart={() => {+ cancelled = false;+ }}+ onDragEnd={({ draggable, droppable }) => {+ if (cancelled || !droppable) return;+ move(+ props.views.findIndex((view) => view.id === draggable.id),+ props.views.findIndex((view) => view.id === droppable.id)+ );+ }}+ >+ <DockOrderList+ views={props.views}+ visibleCount={props.visibleCount}+ onMove={move}+ onCancel={() => {+ cancelled = true;+ }}+ />+ </DragDropProvider>+ </>+ );+}diff --git a/apps/web/src/components/app/mobile/MobileCreateMenu.tsx b/apps/web/src/components/app/mobile/MobileCreateMenu.tsxindex eb51f70cd2..115b257966 100644--- a/apps/web/src/components/app/mobile/MobileCreateMenu.tsx+++ b/apps/web/src/components/app/mobile/MobileCreateMenu.tsx@@ -1,5 +1,4 @@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';@@ -67,7 +66,6 @@ export function MobileCreateMenu(props: {const select = (item: MobileCreateMenuItem) => {selectedAction = item.onSelect;- hapticImpact('light');setOpen(false);};@@ -77,7 +75,6 @@ export function MobileCreateMenu(props: {<Dialog.Triggerref={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-base font-medium whitespace-nowrap"><PlusIcon class="size-5.5 shrink-0" />@@ -138,7 +135,6 @@ export function MobileCreateMenu(props: {<Dialog.CloseButtonaria-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-base font-medium outline-none focus-visible:ring-2 focus-visible:ring-accent"><PlusIcon class="mobile-create-menu-plus size-5.5 shrink-0" />diff --git a/apps/web/src/components/app/mobile/MobileDockButton.test.tsx b/apps/web/src/components/app/mobile/MobileDockButton.test.tsxindex 9d9dd59c9e..6933c5acb6 100644--- a/apps/web/src/components/app/mobile/MobileDockButton.test.tsx+++ b/apps/web/src/components/app/mobile/MobileDockButton.test.tsx@@ -62,17 +62,17 @@ function setup() {}describe('mobile dock activation', () => {it.each(['touch', 'pen', 'mouse'])(- 'gives haptic feedback on %s down and activates on click',+ 'stays silent on %s down and activates on click',(pointerType) => {const { activate, button, press } = setup();expect(press(pointerType).defaultPrevented).toBe(false);- expect(hapticImpact).toHaveBeenCalledExactlyOnceWith('light');+ expect(hapticImpact).not.toHaveBeenCalled();expect(activate).not.toHaveBeenCalled();fireEvent.pointerUp(button);expect(activate).not.toHaveBeenCalled();fireEvent.click(button, { detail: 1 });expect(activate).toHaveBeenCalledTimes(1);- expect(hapticImpact).toHaveBeenCalledTimes(1);+ expect(hapticImpact).not.toHaveBeenCalled();press(pointerType);expect(activate).toHaveBeenCalledTimes(1);}diff --git a/apps/web/src/components/app/mobile/MobileDockButton.tsx b/apps/web/src/components/app/mobile/MobileDockButton.tsxindex 1656599712..751bd8021e 100644--- a/apps/web/src/components/app/mobile/MobileDockButton.tsx+++ b/apps/web/src/components/app/mobile/MobileDockButton.tsx@@ -1,6 +1,11 @@-import { hapticImpact } from '@core/mobile/haptics';+import { UnreadIndicator } from '@entity/components/UnreadIndicator';import { cn } from '@ui';-import { type Component, type ComponentProps, splitProps } from 'solid-js';+import {+ type Component,+ type ComponentProps,+ Show,+ splitProps,+} from 'solid-js';import { Dynamic } from 'solid-js/web';export type MobileDockIcon = Component<{ class?: string }>;@@ -10,6 +15,7 @@ type MobileDockButtonProps = Omit<ComponentProps<'button'>, 'children'> & {/** Accessible name for the icon-only button. */ariaLabel: string;active?: boolean;+ unread?: boolean;iconClass?: string;};@@ -22,6 +28,7 @@ export function MobileDockButton(props: MobileDockButtonProps) {'icon','ariaLabel','active',+ 'unread','class','iconClass',]);@@ -30,7 +37,8 @@ export function MobileDockButton(props: MobileDockButtonProps) {<buttontype="button"aria-label={local.ariaLabel}- onPointerDown={() => hapticImpact('light')}+ aria-description={local.unread ? 'Unread items' : undefined}+ data-unread={local.unread ? '' : undefined}class={cn('relative flex size-(--mobile-chrome-button-size) shrink-0 items-center justify-center rounded-full',local.active && 'text-accent',@@ -40,11 +48,19 @@ export function MobileDockButton(props: MobileDockButtonProps) {><divclass={cn(- 'size-(--mobile-chrome-icon-size) shrink-0 [&_svg]:size-(--mobile-chrome-icon-size)',+ 'relative size-(--mobile-chrome-icon-size) shrink-0 [&_svg]:size-(--mobile-chrome-icon-size)',local.iconClass)}><Dynamic component={local.icon} />+ <Show when={local.unread}>+ <span+ aria-hidden="true"+ class="pointer-events-none absolute -right-1 -top-1 rounded-full ring-2 ring-chrome"+ >+ <UnreadIndicator active class="size-1.5" />+ </span>+ </Show></div></button>);diff --git a/apps/web/src/components/app/mobile/MobileDockRow.test.tsx b/apps/web/src/components/app/mobile/MobileDockRow.test.tsxindex bb31e46d59..13c5c877d6 100644--- a/apps/web/src/components/app/mobile/MobileDockRow.test.tsx+++ b/apps/web/src/components/app/mobile/MobileDockRow.test.tsx@@ -1,5 +1,4 @@import { SearchState } from '@app/features/command/mobile/mobileSearchState';-import { enableCalendarScheduling } from '@core/constant/featureFlags';import {cleanup,fireEvent,@@ -8,22 +7,28 @@ import {waitFor,within,} from '@solidjs/testing-library';-import type { ParentProps } from 'solid-js';+import { createSignal, type ParentProps } from 'solid-js';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';import { MobileDockRow } from './MobileDockRow';import { isMobileNavViewId } from './mobile-nav-views';-const { navigate, toggleSettings, reviewsFlag, schedulingFlag, foreground } =- vi.hoisted(() => ({- navigate: vi.fn(),- toggleSettings: vi.fn(),- reviewsFlag: { enabled: false },- schedulingFlag: { enabled: false },- foreground: { id: 'tasks' },- }));-vi.mock('@app/lib/analytics/posthog', () => ({- useFeatureFlag: (flag: unknown) => () =>- flag === enableCalendarScheduling ? schedulingFlag : reviewsFlag,+const {+ navigate,+ toggleSettings,+ reviewsFlag,+ schedulingFlag,+ foreground,+ unreadViews,+} = vi.hoisted(() => ({+ navigate: vi.fn(),+ toggleSettings: vi.fn(),+ reviewsFlag: { enabled: false },+ schedulingFlag: { enabled: false },+ foreground: { id: 'tasks' },+ unreadViews: { enabled: false },+}));+vi.mock('@core/context/user', () => ({+ useUserId: () => () => 'dock-test-user',}));vi.mock('@core/constant/SettingsState', () => ({useSettingsState: () => ({ settingsOpen: () => false, toggleSettings }),@@ -35,24 +40,64 @@ vi.mock('@core/mobile/haptics', () => ({ hapticImpact: vi.fn() }));vi.mock('@core/mobile/virtualKeyboard', () => ({virtualKeyboardVisible: () => false,}));-vi.mock('@ui', () => ({+vi.mock('@ui', async () => ({+ Button: (await import('@ui/components/Button')).Button,cn: (...values: unknown[]) => values.filter(Boolean).join(' '),Layer: (props: ParentProps) => props.children,}));+const [unreadIds, setUnreadIds] = createSignal<string[]>([]);+vi.mock('../use-navigation-unread', () => ({+ useNavigationUnread: () => (id: string) => unreadIds().includes(id),+}));+const [islandWidth, setIslandWidth] = createSignal(80);vi.mock('@solid-primitives/resize-observer', () => ({- createElementSize: () => ({ width: 80, height: 40 }),+ createElementSize: () => ({+ get width() {+ return islandWidth();+ },+ height: 40,+ }),}));vi.mock('./use-mobile-nav', () => ({useForegroundMobileView: () => () => foreground.id,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 /> },- ],+ MOBILE_DOCK_VIEWS: [+ 'home',+ 'mail',+ 'channels',+ 'calendar',+ 'documents',+ 'tasks',+ 'calls',+ 'reviews',+ 'booking-links',+ ].map((id) => ({ id })),+ useMobileDockViews: () => {+ if (unreadViews.enabled) {+ const views = [+ { id: 'home', label: 'Notifications', icon: () => <svg /> },+ { id: 'mail', label: 'Email', icon: () => <svg /> },+ { id: 'channels', label: 'Channels', icon: () => <svg /> },+ { id: 'documents', label: 'Files', icon: () => <svg /> },+ ];+ return () => views;+ }+ const views = [+ { id: 'calendar', label: 'Calendar', icon: () => <svg /> },+ { id: 'documents', label: 'Files', icon: () => <svg /> },+ { id: 'tasks', label: 'Tasks', icon: () => <svg /> },+ { id: 'calls', label: 'Calls', icon: () => <svg /> },+ ...(reviewsFlag.enabled+ ? [{ id: 'reviews', label: 'Reviews', icon: () => <svg /> }]+ : []),+ ...(schedulingFlag.enabled+ ? [{ id: 'booking-links', label: 'Scheduling', icon: () => <svg /> }]+ : []),+ ];+ return () => views;+ },}));let drawerStyles: HTMLStyleElement;@@ -61,6 +106,10 @@ beforeEach(() => {reviewsFlag.enabled = false;schedulingFlag.enabled = false;foreground.id = 'tasks';+ unreadViews.enabled = false;+ setUnreadIds([]);+ localStorage.clear();+ setIslandWidth(80);drawerStyles = document.createElement('style');drawerStyles.textContent ='[data-corvu-drawer-content], [data-corvu-drawer-overlay] { transition-duration: 0s; animation-name: none; }';@@ -91,7 +140,7 @@ it('mounts and focuses search during the tap before navigating once', () => {});describe('dock overflow drawer', () => {- it('keeps Settings first, reverses overflow views, and closes after navigation', async () => {+ it('keeps Settings first, shows overflow in saved order, and closes after navigation', async () => {render(() => <MobileDockRow />);const trigger = screen.getByRole('button', { name: 'More views' });fireEvent.pointerDown(trigger);@@ -101,7 +150,14 @@ describe('dock overflow drawer', () => {const drawer = within(screen.getByRole('dialog', { name: 'More views' }));expect(drawer.getAllByRole('button').map((button) => button.textContent)- ).toEqual(['Settings', 'Calls', 'Tasks', 'Files', 'Views']);+ ).toEqual([+ 'Settings',+ 'Customize dock',+ 'Files',+ 'Tasks',+ 'Calls',+ 'Views',+ ]);expect(drawer.getByRole('button', { name: 'Tasks' }).getAttribute('aria-current')).toBe('page');@@ -154,3 +210,139 @@ describe('dock overflow drawer', () => {expect(navigate).not.toHaveBeenCalled();});});++it('opens customization, updates the measured boundary, and persists keyboard reorders', async () => {+ const mounted = render(() => <MobileDockRow />);+ fireEvent.click(screen.getByRole('button', { name: 'More views' }));+ fireEvent.click(screen.getByRole('button', { name: 'Customize dock' }));+ await screen.findByRole('button', { name: 'Reorder Tasks' });+ const drawer = within(screen.getByRole('dialog', { name: 'Customize dock' }));+ expect(drawer.getByText('In dock · 1')).toBeTruthy();+ expect(drawer.getByText('In More · 3')).toBeTruthy();+ setIslandWidth(120);+ expect(drawer.getByText('In dock · 2')).toBeTruthy();+ expect(drawer.getByText('In More · 2')).toBeTruthy();+ const handle = drawer.getByRole('button', { name: 'Reorder Tasks' });+ handle.focus();+ fireEvent.keyDown(handle, { key: 'ArrowUp' });+ fireEvent.keyDown(handle, { key: 'ArrowUp' });+ expect(document.activeElement).toBe(handle);+ expect(drawer.getByRole('status').textContent).toContain(+ 'Tasks moved to position 1, in dock'+ );+ fireEvent.click(drawer.getByRole('button', { name: 'Done' }));+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ expect(screen.getByRole('button', { name: 'Tasks' })).toBeTruthy();+ mounted.unmount();+ render(() => <MobileDockRow />);+ expect(screen.getByRole('button', { name: 'Tasks' })).toBeTruthy();+ fireEvent.click(screen.getByRole('button', { name: 'More views' }));+ expect(+ within(screen.getByRole('dialog'))+ .getAllByRole('button')+ .map((button) => button.textContent)+ ).toEqual(['Settings', 'Customize dock', 'Files', 'Calls', 'Views']);+});++it('returns from customization to More without navigating', async () => {+ render(() => <MobileDockRow />);+ fireEvent.click(screen.getByRole('button', { name: 'More views' }));+ fireEvent.click(screen.getByRole('button', { name: 'Customize dock' }));+ fireEvent.click(+ await screen.findByRole('button', { name: 'Back to More views' })+ );+ expect(screen.getByRole('dialog', { name: 'More views' })).toBeTruthy();+ expect(navigate).not.toHaveBeenCalled();+ expect(document.activeElement).toBe(+ screen.getByRole('button', { name: 'Customize dock' })+ );+});++describe('dock unread indicators', () => {+ it('reacts to the shared unread source without clearing indicators just for navigation', () => {+ unreadViews.enabled = true;+ setIslandWidth(160);+ render(() => <MobileDockRow />);+ const notifications = screen.getByRole('button', { name: 'Notifications' });+ const email = screen.getByRole('button', { name: 'Email' });+ const channels = screen.getByRole('button', { name: 'Channels' });+ expect(email.getAttribute('aria-description')).toBeNull();+ setUnreadIds(['home', 'mail', 'channels']);+ for (const button of [notifications, email, channels]) {+ expect(button.getAttribute('aria-description')).toBe('Unread items');+ expect(button.querySelector('[aria-hidden="true"]')).not.toBeNull();+ }+ fireEvent.click(email);+ expect(navigate).toHaveBeenCalledExactlyOnceWith('mail');+ expect(email.getAttribute('aria-description')).toBe('Unread items');+ setUnreadIds(['channels']);+ expect(email.getAttribute('aria-description')).toBeNull();+ expect(notifications.getAttribute('aria-description')).toBeNull();+ expect(channels.getAttribute('aria-description')).toBe('Unread items');+ expect(screen.getByRole('button', { name: 'Email' })).toBe(email);+ expect(+ screen+ .getByRole('button', { name: 'Search' })+ .getAttribute('aria-description')+ ).toBeNull();+ expect(+ screen+ .getByRole('button', { name: 'More views' })+ .getAttribute('aria-description')+ ).toBeNull();+ });++ it('moves unread indicators between the dock and More as capacity and ordering change', async () => {+ unreadViews.enabled = true;+ setUnreadIds(['channels']);+ setIslandWidth(80);+ render(() => <MobileDockRow />);+ const more = screen.getByRole('button', { name: 'More views' });+ expect(more.getAttribute('aria-description')).toBe('Unread items');+ fireEvent.click(more);+ const drawer = within(screen.getByRole('dialog', { name: 'More views' }));+ expect(+ drawer+ .getByRole('button', { name: 'Channels' })+ .getAttribute('aria-description')+ ).toBe('Unread items');+ expect(+ drawer+ .getByRole('button', { name: 'Email' })+ .getAttribute('aria-description')+ ).toBeNull();+ setUnreadIds([]);+ expect(more.getAttribute('aria-description')).toBeNull();+ expect(+ drawer+ .getByRole('button', { name: 'Channels' })+ .getAttribute('aria-description')+ ).toBeNull();+ setUnreadIds(['channels']);+ fireEvent.click(drawer.getByRole('button', { name: 'Views' }));+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ setIslandWidth(160);+ expect(+ screen+ .getByRole('button', { name: 'Channels' })+ .getAttribute('aria-description')+ ).toBe('Unread items');+ expect(more.getAttribute('aria-description')).toBeNull();+ setIslandWidth(80);+ fireEvent.click(more);+ fireEvent.click(screen.getByRole('button', { name: 'Customize dock' }));+ const handle = await screen.findByRole('button', {+ name: 'Reorder Channels',+ });+ fireEvent.keyDown(handle, { key: 'ArrowUp' });+ fireEvent.keyDown(handle, { key: 'ArrowUp' });+ fireEvent.click(screen.getByRole('button', { name: 'Done' }));+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ expect(+ screen+ .getByRole('button', { name: 'Channels' })+ .getAttribute('aria-description')+ ).toBe('Unread items');+ expect(more.getAttribute('aria-description')).toBeNull();+ });+});diff --git a/apps/web/src/components/app/mobile/MobileDockRow.tsx b/apps/web/src/components/app/mobile/MobileDockRow.tsxindex 00fdb1fc46..0c94e1e263 100644--- a/apps/web/src/components/app/mobile/MobileDockRow.tsx+++ b/apps/web/src/components/app/mobile/MobileDockRow.tsx@@ -1,45 +1,63 @@+import { ContentLoading } from '@app/components/app/ContentLoading';import { MobileSearchInput } from '@app/features/command/mobile/MobileSearchInput';import { SearchState } from '@app/features/command/mobile/mobileSearchState';-import { useFeatureFlag } from '@app/lib/analytics/posthog';-import {- enableCalendarScheduling,- enableTasksReviews,-} from '@core/constant/featureFlags';import { useSettingsState } from '@core/constant/SettingsState';+import { useUserId } from '@core/context/user';import { triggerFocusInput } from '@core/directive/focusInput';import { hapticImpact } from '@core/mobile/haptics';-import CalendarCheckIcon from '@phosphor/calendar-check.svg';+import { lazyNamed } from '@core/util/lazyNamed';+import { UnreadIndicator } from '@entity/components/UnreadIndicator';+import { Telemetry } from '@macro-inc/observability';import CaretUpIcon from '@phosphor/caret-up.svg';+import DotsSixVerticalIcon from '@phosphor/dots-six-vertical.svg';import IconGear from '@phosphor/gear.svg';-import GitPullRequestIcon from '@phosphor/git-pull-request.svg';import SearchIcon from '@phosphor/magnifying-glass.svg';import { createElementSize } from '@solid-primitives/resize-observer';import { cn } from '@ui';-import { createSignal, For, Show } from 'solid-js';+import { createMemo, createSignal, For, Show, Suspense } from 'solid-js';import { Dynamic } from 'solid-js/web';+import { useNavigationUnread } from '../use-navigation-unread';+import { MobileDockButton } from './MobileDockButton';import { MobileDockIsland } from './MobileDockIsland';import { MobileDrawer } from './MobileDrawer';import { MobileBottomEdgeFade } from './MobileEdgeFade';-import { type MobileDockView, useMobileDockViews } from './mobile-dock-views';+import { createMobileDockOrder, dockVisibleCount } from './mobile-dock-order';+import {+ MOBILE_DOCK_VIEWS,+ type MobileDockView,+ useMobileDockViews,+} from './mobile-dock-views';import {type MobileDockNavId,useForegroundMobileView,useMobileNavNavigate,} from './use-mobile-nav';+const CustomizeDock = lazyNamed(+ () => import('./CustomizeDock'),+ 'CustomizeDock'+);+function MoreViewsDrawer(props: {views: readonly MobileDockView[];+ visibleCount: number;+ onMove: (from: number, to: number) => void;isActive: (id: MobileDockNavId) => boolean;+ hasUnread: (id: MobileDockNavId) => boolean;onNavigate: (id: MobileDockNavId) => void;}) {const { settingsOpen, toggleSettings } = useSettingsState();- const reviewsFlag = useFeatureFlag(enableTasksReviews);- const schedulingFlag = useFeatureFlag(enableCalendarScheduling);+ const [customizing, setCustomizing] = createSignal(false);+ let customizeButton: HTMLButtonElement | undefined;return (<MobileDrawerside="bottom"+ restoreFocus+ onOpenChange={(open) => {+ if (open) setCustomizing(false);+ }}preventScroll={false}preventScrollbarShift={false}closeOnOutsidePointerStrategy="pointerdown"@@ -48,95 +66,99 @@ function MoreViewsDrawer(props: {as={MobileDockButton}ariaLabel="More views"icon={CaretUpIcon}+ unread={props.views+ .slice(props.visibleCount)+ .some((view) => props.hasUnread(view.id))}/><MobileDrawer.Portal><MobileDrawer.Overlay />- <MobileDrawer.Content aria-label="More views">+ <MobileDrawer.Content+ aria-label={customizing() ? 'Customize dock' : 'More views'}+ targetHeight={customizing() ? 85 : undefined}+ ><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 ||- reviewsFlag().enabled ||- schedulingFlag().enabled- }- >- <div class="-mx-1 h-px shrink-0 bg-edge" />- </Show>- <For each={props.views.toReversed()}>- {(view) => (+ <Show+ when={customizing()}+ fallback={+ <MobileDrawer.ScrollBody>+ <div class="mx-3 flex flex-col gap-1 px-1"><MobileDrawer.Closeas={MobileDrawer.Item}- aria-label={view.label}- class={props.isActive(view.id) ? 'text-accent' : undefined}- aria-current={props.isActive(view.id) ? 'page' : undefined}+ aria-label="Settings"+ class={settingsOpen() ? 'text-accent' : undefined}onClick={() => {- hapticImpact('light');- props.onNavigate(view.id);+ toggleSettings();}}>- <Dynamic component={view.icon} class="size-4 shrink-0" />- <span>{view.label}</span>+ <IconGear class="size-4 shrink-0" />+ <span>Settings</span></MobileDrawer.Close>- )}- </For>- <Show when={reviewsFlag().enabled}>- <MobileDrawer.Close- as={MobileDrawer.Item}- aria-label="Reviews"- class={props.isActive('reviews') ? 'text-accent' : undefined}- aria-current={props.isActive('reviews') ? 'page' : undefined}- onClick={() => {- hapticImpact('light');- props.onNavigate('reviews');- }}- >- <GitPullRequestIcon class="size-4 shrink-0" />- <span>Reviews</span>- </MobileDrawer.Close>- </Show>- <Show when={schedulingFlag().enabled}>- <MobileDrawer.Close- as={MobileDrawer.Item}- aria-label="Scheduling"- class={- props.isActive('booking-links') ? 'text-accent' : undefined- }- aria-current={- props.isActive('booking-links') ? 'page' : undefined- }- onClick={() => {- hapticImpact('light');- props.onNavigate('booking-links');- }}- >- <CalendarCheckIcon class="size-4 shrink-0" />- <span>Scheduling</span>- </MobileDrawer.Close>- </Show>- <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.Item+ ref={customizeButton}+ aria-label="Customize dock"+ onClick={() => setCustomizing(true)}+ >+ <DotsSixVerticalIcon class="size-4 shrink-0" />+ <span>Customize dock</span>+ </MobileDrawer.Item>+ <Show when={props.views.length > props.visibleCount}>+ <div class="-mx-1 h-px shrink-0 bg-edge" />+ </Show>+ <For each={props.views.slice(props.visibleCount)}>+ {(view) => (+ <MobileDrawer.Close+ as={MobileDrawer.Item}+ aria-label={view.label}+ aria-description={+ props.hasUnread(view.id) ? 'Unread items' : undefined+ }+ data-unread={props.hasUnread(view.id) ? '' : undefined}+ class={+ props.isActive(view.id) ? 'text-accent' : undefined+ }+ aria-current={+ props.isActive(view.id) ? 'page' : undefined+ }+ onClick={() => {+ props.onNavigate(view.id);+ }}+ >+ <Dynamic+ component={view.icon}+ class="size-4 shrink-0"+ />+ <span>{view.label}</span>+ <Show when={props.hasUnread(view.id)}>+ <span aria-hidden="true" class="ml-auto">+ <UnreadIndicator active class="size-1.5" />+ </span>+ </Show>+ </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"+ >+ Views+ </MobileDrawer.Close>+ </div>+ </MobileDrawer.ScrollBody>+ }+ >+ <Suspense fallback={<ContentLoading />}>+ <CustomizeDock+ views={props.views}+ visibleCount={props.visibleCount}+ onMove={props.onMove}+ onBack={() => {+ setCustomizing(false);+ customizeButton?.focus({ preventScroll: true });+ }}+ />+ </Suspense>+ </Show></MobileDrawer.Content></MobileDrawer.Portal></MobileDrawer>@@ -152,15 +174,42 @@ function MoreViewsDrawer(props: {function MobileNavigationDockRow() {const navigate = useMobileNavNavigate();const foregroundView = useForegroundMobileView();- const dockViews = useMobileDockViews();+ const availableViews = useMobileDockViews();+ const hasUnread = useNavigationUnread();+ const userId = useUserId();+ const preferences = createMemo(() =>+ createMobileDockOrder(+ userId(),+ MOBILE_DOCK_VIEWS.map((view) => view.id)+ )+ );+ const dockViews = createMemo(() => {+ const order = preferences().order();+ return [...availableViews()].sort(+ (a, b) => order.indexOf(a.id) - order.indexOf(b.id)+ );+ });const [navRef, setNavRef] = createSignal<HTMLDivElement>();const navSize = createElementSize(navRef);- const visibleCount = () => {- // The island height and square buttons share the same CSS size. Its width- // already excludes Search and the gutters; reserve one button for More.- if (!navSize.height) return 0;- return Math.max(0, Math.floor(navSize.width / navSize.height) - 1);+ // The measured island already excludes Search and gutters; reserve More.+ const visibleCount = () =>+ dockVisibleCount(navSize.width, navSize.height, dockViews().length);+ const move = (from: number, to: number) => {+ const span = Telemetry.span('mobile.dock.reorder');+ try {+ span.setAttr('dock.from', from);+ span.setAttr('dock.to', to);+ span.setAttr('dock.visible_count', visibleCount());+ preferences().move(+ from,+ to,+ dockViews().map((view) => view.id)+ );+ hapticImpact('light');+ } finally {+ span.end();+ }};return (@@ -182,13 +231,17 @@ function MobileNavigationDockRow() {}ariaLabel={button.label}active={foregroundView() === button.id}+ unread={hasUnread(button.id)}onClick={() => navigate(button.id)}/>)}</For><MoreViewsDrawer- views={dockViews().slice(visibleCount())}+ views={dockViews()}+ visibleCount={visibleCount()}+ onMove={move}isActive={(id) => foregroundView() === id}+ hasUnread={hasUnread}onNavigate={navigate}/></MobileDockIsland>@@ -219,8 +272,8 @@ type MobileDockRowProps = {/*** The bottom-most chrome row. By default it is the navigation dock (see* MobileNavigationDockRow); pressing its Search button opens a search session,- * which swaps in the search bar and category pills in the accessory slot- * above (see MobileViewsRow). Pressing the+ * which swaps in the search bar; category pills sit at the top of the+ * results (see MobileViewsRow). Pressing the* input's X ends the session and restores the navigation dock.*/export function MobileDockRow(props: MobileDockRowProps) {diff --git a/apps/web/src/components/app/mobile/MobilePageActionRow.test.tsx b/apps/web/src/components/app/mobile/MobilePageActionRow.test.tsxindex 356b9ca892..25cd6dbf2c 100644--- a/apps/web/src/components/app/mobile/MobilePageActionRow.test.tsx+++ b/apps/web/src/components/app/mobile/MobilePageActionRow.test.tsx@@ -68,9 +68,6 @@ vi.mock('@components/app/mobile/use-mobile-nav', () => ({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>@@ -98,7 +95,6 @@ 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';@@ -225,7 +221,11 @@ describe('Mobile page action row', () => {// Mount the fallback last to ensure priority, rather than mount order, wins.render(() => (<>- <MobileViewsRow />+ <FloatRegion+ region="accessory"+ priority={100}+ active={SearchState.isOpen}+ /><FloatRegion region="accessory" active={canComment}><button>Leave a comment</button></FloatRegion>@@ -238,7 +238,7 @@ describe('Mobile page action row', () => {expect(screen.queryByRole('button', { name: 'Send' })).toBeNull();SearchState.open();- expect(screen.getByRole('tablist', { name: 'Search scopes' })).toBeTruthy();+ expect(mount.textContent).toBe('');expect(screen.queryByRole('button', { name: 'Leave a comment' })).toBeNull();@@ -254,7 +254,7 @@ describe('Mobile page action row', () => {expect(screen.getByRole('button', { name: 'New email' })).toBeTruthy();SearchState.open();- expect(screen.getByRole('tablist', { name: 'Search scopes' })).toBeTruthy();+ expect(mount.textContent).toBe('');expect(screen.queryByRole('button', { name: 'Send' })).toBeNull();SearchState.close();expect(screen.queryByRole('button', { name: 'Send' })).toBeNull();diff --git a/apps/web/src/components/app/mobile/MobilePageActionRow.tsx b/apps/web/src/components/app/mobile/MobilePageActionRow.tsxindex 3269d7b99d..1303fdf481 100644--- a/apps/web/src/components/app/mobile/MobilePageActionRow.tsx+++ b/apps/web/src/components/app/mobile/MobilePageActionRow.tsx@@ -31,7 +31,7 @@ export function MobilePageActionRow() {};return (- // Screen composers (0) and search scopes (100) take precedence.+ // Screen composers (0) and search (100) take precedence.<FloatRegion region="accessory" priority={-1} active={isAvailable}><div class="group/mobile-composer flex items-end justify-end gap-(--mobile-chrome-gutter) px-(--mobile-chrome-gutter)">{composer}diff --git a/apps/web/src/components/app/mobile/MobilePageCreateButton.tsx b/apps/web/src/components/app/mobile/MobilePageCreateButton.tsxindex f0226de0c0..1e4a5933bd 100644--- a/apps/web/src/components/app/mobile/MobilePageCreateButton.tsx+++ b/apps/web/src/components/app/mobile/MobilePageCreateButton.tsx@@ -5,7 +5,6 @@ import {useCreateMenuBlocks,} from '@app/features/command/Launcher';import { openCreateCompanyModal } from '@app/features/crm/creation-adapter';-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';@@ -107,7 +106,6 @@ export function MobilePageCreateButton() {? '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-base font-medium whitespace-nowrap">diff --git a/apps/web/src/components/app/mobile/MobileViewsRow.tsx b/apps/web/src/components/app/mobile/MobileViewsRow.tsxindex 2acf6b02dd..9655ad4b77 100644--- a/apps/web/src/components/app/mobile/MobileViewsRow.tsx+++ b/apps/web/src/components/app/mobile/MobileViewsRow.tsx@@ -1,9 +1,8 @@-import { SearchState } from '@app/features/command/mobile/mobileSearchState';+import type { MobileSearchSession } from '@app/features/command/mobile/mobileSearchState';import { useMobileSearchCategory } from '@app/features/command/mobile/use-mobile-search-category';import type { EntitySearchCategory } from '@app/features/command/queries/entity-search';import { useFeatureFlag } from '@app/lib/analytics/posthog';import { enableProjects } from '@core/constant/featureFlags';-import { FloatRegion } from './float-regions/FloatRegion';import { type PillTabItem, PillTabs } from './PillTabs';const CATEGORIES: PillTabItem<EntitySearchCategory>[] = [@@ -18,11 +17,14 @@ const CATEGORIES: PillTabItem<EntitySearchCategory>[] = [];/** Search categories filter entities directly without navigating between views. */-export function MobileViewsRow() {+export function MobileViewsRow(props: { session: MobileSearchSession }) {const projects = useFeatureFlag(enableProjects);- const category = useMobileSearchCategory();+ const category = useMobileSearchCategory(() => props.session.category());return (- <FloatRegion region="accessory" priority={100} active={SearchState.isOpen}>+ <header+ aria-label="Search filters"+ class="pointer-events-none absolute inset-x-0 top-0 z-split-panel-chrome flex pt-[calc(var(--safe-top,0px)+0.5rem)]"+ ><PillTabsscrollablecontentClass="px-(--mobile-chrome-gutter)"@@ -30,8 +32,8 @@ export function MobileViewsRow() {(item) => item.value !== 'projects' || projects().enabled)}value={category()}- onChange={SearchState.setCategory}+ onChange={(value) => props.session.setCategory(value)}/>- </FloatRegion>+ </header>);}diff --git a/apps/web/src/components/app/mobile/PillTabs.test.tsx b/apps/web/src/components/app/mobile/PillTabs.test.tsxindex eb0b36540b..59324b2fa0 100644--- a/apps/web/src/components/app/mobile/PillTabs.test.tsx+++ b/apps/web/src/components/app/mobile/PillTabs.test.tsx@@ -1,3 +1,4 @@+import { hapticImpact } from '@core/mobile/haptics';import {cleanup,fireEvent,@@ -24,6 +25,7 @@ vi.mock('@solid-primitives/resize-observer', () => ({let drawerStyles: HTMLStyleElement;beforeEach(() => {+ vi.clearAllMocks();// Supply browser motion defaults missing in jsdom for Corvu's presence tracking.drawerStyles = document.createElement('style');drawerStyles.textContent =@@ -101,6 +103,7 @@ describe('pill overflow drawer', () => {fireEvent.click(within(drawer).getByRole('button', { name }));expect(onChange).toHaveBeenCalledExactlyOnceWith(selectedValue);expect(value()).toBe(selectedValue);+ expect(hapticImpact).not.toHaveBeenCalled();await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());expect(screen.getByRole('button', { name, pressed: true })).toBeTruthy();fireEvent.click(trigger, { detail: 0 });diff --git a/apps/web/src/components/app/mobile/PillTabs.tsx b/apps/web/src/components/app/mobile/PillTabs.tsxindex a9f5c44096..f052268250 100644--- a/apps/web/src/components/app/mobile/PillTabs.tsx+++ b/apps/web/src/components/app/mobile/PillTabs.tsx@@ -1,4 +1,3 @@-import { hapticImpact } from '@core/mobile/haptics';import DotsThreeIcon from '@phosphor/dots-three.svg';import { createElementSize } from '@solid-primitives/resize-observer';import { cn } from '@ui';@@ -127,11 +126,7 @@ function PillButton<T extends string>(props: {onPointerDown={(e) => {e.preventDefault();}}- // Haptic on activation, not on touch-down: a pan that starts on a pill- // never activates it (the pan handler suppresses the click), so it must- // not buzz either.onClick={() => {- hapticImpact('light');props.onSelect();}}>@@ -491,7 +486,6 @@ function MenuOverflowPillTabs<T extends string>(props: PillTabsProps<T>) {: undefined}onClick={() => {- hapticImpact('light');props.onChange(item.value);}}>@@ -503,7 +497,6 @@ function MenuOverflowPillTabs<T extends string>(props: PillTabsProps<T>) {<MobileDrawer.Closearia-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>diff --git a/apps/web/src/components/app/mobile/create-dock-touch-sensor.ts b/apps/web/src/components/app/mobile/create-dock-touch-sensor.tsnew file mode 100644index 0000000000..aa745c20bb--- /dev/null+++ b/apps/web/src/components/app/mobile/create-dock-touch-sensor.ts@@ -0,0 +1,111 @@+import { hapticImpact } from '@core/mobile/haptics';+import { useDragDropContext } from '@thisbeyond/solid-dnd';+import { onCleanup, onMount } from 'solid-js';++/** Dedicated handles drag after a small movement; the rest of each row scrolls. */+export function createDockTouchSensor(onCancel: () => void) {+ const context = useDragDropContext();+ if (!context) throw new Error('Dock touch sensor requires DragDropProvider');+ const [state, actions] = context;+ const id = 'dock-touch';+ let gesture:+ | {+ element: HTMLElement;+ draggableId: string;+ touchId: number;+ x: number;+ y: number;+ }+ | undefined;+ const active = () => state.active.sensorId === id;++ const finish = (cancelled: boolean) => {+ gesture?.element.removeAttribute('data-touch-pressed');+ gesture = undefined;+ if (!active()) return;+ if (cancelled) onCancel();+ if (state.active.draggable) actions.dragEnd();+ actions.sensorEnd();+ };+ const cancel = () => finish(true);+ const move = (event: TouchEvent) => {+ if (!gesture) return;+ if (event.touches.length !== 1) return cancel();+ const touch = Array.from(event.touches).find(+ (touch) => touch.identifier === gesture?.touchId+ );+ if (!touch) return cancel();+ // Reserve handle gestures for dragging, including movement below threshold.+ event.preventDefault();+ if (!active()) {+ if (Math.hypot(touch.clientX - gesture.x, touch.clientY - gesture.y) < 8)+ return;+ if (state.active.sensor) return cancel();+ actions.sensorStart(id, { x: gesture.x, y: gesture.y });+ actions.dragStart(gesture.draggableId);+ hapticImpact('light');+ }+ actions.sensorMove({ x: touch.clientX, y: touch.clientY });+ };+ const end = (event: TouchEvent) => {+ if (!gesture) return;+ event.preventDefault();+ finish(false);+ };+ const cancelOnEscape = (event: KeyboardEvent) => {+ if (event.key !== 'Escape' || !gesture) return;+ event.preventDefault();+ event.stopImmediatePropagation();+ cancel();+ };+ const start = (event: TouchEvent) => {+ if (event.touches.length > 1) cancel();+ };+ onMount(() => {+ actions.addSensor({ id, activators: {} });+ document.addEventListener('touchmove', move, {+ capture: true,+ passive: false,+ });+ document.addEventListener('touchend', end, {+ capture: true,+ passive: false,+ });+ document.addEventListener('touchcancel', cancel, true);+ document.addEventListener('touchstart', start, true);+ document.addEventListener('keydown', cancelOnEscape, true);+ window.addEventListener('blur', cancel);+ });+ onCleanup(() => {+ cancel();+ actions.removeSensor(id);+ document.removeEventListener('touchmove', move, true);+ document.removeEventListener('touchend', end, true);+ document.removeEventListener('touchcancel', cancel, true);+ document.removeEventListener('touchstart', start, true);+ document.removeEventListener('keydown', cancelOnEscape, true);+ window.removeEventListener('blur', cancel);+ });++ return (element: HTMLElement, draggableId: string) => {+ const begin = (event: TouchEvent) => {+ if (event.touches.length !== 1 || state.active.sensor) return;+ event.stopPropagation();+ event.preventDefault();+ const touch = event.touches[0];+ gesture = {+ element,+ draggableId,+ touchId: touch.identifier,+ x: touch.clientX,+ y: touch.clientY,+ };+ element.setAttribute('data-touch-pressed', '');+ };+ element.addEventListener('touchstart', begin, { passive: false });+ onCleanup(() => {+ if (gesture?.element === element) cancel();+ element.removeEventListener('touchstart', begin);+ });+ };+}diff --git a/apps/web/src/components/app/mobile/glassPress.test.ts b/apps/web/src/components/app/mobile/glassPress.test.tsindex fe4388c017..876eb144f8 100644--- a/apps/web/src/components/app/mobile/glassPress.test.ts+++ b/apps/web/src/components/app/mobile/glassPress.test.ts@@ -1,6 +1,12 @@import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';-vi.mock('@core/mobile/isTouchDevice', () => ({ isTouchDevice: () => true }));+const device = vi.hoisted(() => ({ platform: 'ios', touch: true }));+vi.mock('@core/mobile/isTouchDevice', () => ({+ isTouchDevice: () => device.touch,+}));+vi.mock('@core/util/platform', () => ({+ isPlatform: (platform: string) => device.platform === platform,+}));import { glassPressGeometry, installGlassPress } from './glassPress';@@ -8,6 +14,7 @@ let dispose: () => void;function pointer(element: Element, type: string, x = 20, y = 20) {const event = new MouseEvent(type, {bubbles: true,+ cancelable: true,button: 0,clientX: x,clientY: y,@@ -18,6 +25,7 @@ function pointer(element: Element, type: string, x = 20, y = 20) {pointerType: { value: 'touch' },});element.dispatchEvent(event);+ return event;}function surface(width = 300, height = 46) {const group = document.createElement('div');@@ -33,6 +41,8 @@ function surface(width = 300, height = 46) {return group;}beforeEach(() => {+ device.platform = 'ios';+ device.touch = true;vi.useFakeTimers();dispose = installGlassPress();});@@ -44,12 +54,64 @@ afterEach(() => {});describe('mobile glass surface press', () => {- it('keeps round growth at 20% and caps wide displacement independently of width', () => {+ it('grows round controls by 28% 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);+ expect(glassPressGeometry(46, 46).scale).toBeCloseTo(1.28);+ expect(glassPressGeometry(300, 46).outset).toBe(6);+ expect(glassPressGeometry(600, 46).outset).toBe(6);+ expect(glassPressGeometry(600, 80).outset).toBe(6);+ });+ it.each(['android', 'web', 'desktop'])(+ 'leaves %s controls without the iOS press effect',+ (platform) => {+ device.platform = platform;+ const group = surface();+ const event = pointer(group.querySelector('button')!, 'pointerdown');+ expect(group.hasAttribute('data-glass-press')).toBe(false);+ expect(group.style.getPropertyValue('--press-x')).toBe('');+ expect(event.defaultPrevented).toBe(false);+ }+ );+ it('leaves non-touch input unchanged', () => {+ device.touch = false;+ const group = surface();+ pointer(group.querySelector('button')!, 'pointerdown');+ expect(group.hasAttribute('data-glass-press')).toBe(false);+ });+ it.each([140, 480])(+ 'lights a %ipx-tall channel editor without scaling its text or disturbing its draft',+ (height) => {+ const group = surface(360, height);+ group.removeAttribute('data-mobile-dock-island');+ group.dataset.glassInput = '';+ group.innerHTML =+ '<div contenteditable="true" role="textbox">Unsent draft</div><button>Add</button>';+ const editor = group.querySelector<HTMLElement>('[contenteditable]')!;+ editor.focus();+ const event = pointer(editor, 'pointerdown', 160, 40);+ expect(group.dataset.glassPress).toBe('wide');+ expect(group.style.getPropertyValue('--press-x')).toBe('160px');+ expect(group.style.getPropertyValue('--press-y')).toBe('40px');+ expect(event.defaultPrevented).toBe(false);+ expect(document.activeElement).toBe(editor);+ expect(editor.textContent).toBe('Unsent draft');+ pointer(editor, 'pointercancel');+ expect(group.hasAttribute('data-glass-press')).toBe(false);+ expect(document.activeElement).toBe(editor);+ }+ );+ it('lights the collapsed channel input when its preview is pressed', () => {+ const root = document.createElement('div');+ root.dataset.input = '';+ document.body.append(root);+ const group = surface();+ group.removeAttribute('data-mobile-dock-island');+ group.dataset.composerCollapsed = '';+ root.append(group);+ pointer(group.querySelector('button')!, 'pointerdown');+ expect(group.dataset.glassPress).toBe('wide');+ pointer(group, 'pointerup');+ expect(group.hasAttribute('data-glass-press')).toBe(false);});it('owns the press and tap-centered highlight on the outer dock', () => {const group = surface();@@ -102,6 +164,57 @@ describe('mobile glass surface press', () => {pointer(button, 'pointerdown');expect(group.hasAttribute('data-glass-press')).toBe(false);});+ it('follows the latest touch once per frame without reading layout on each move', () => {+ const group = surface();+ const button = group.querySelector('button')!;+ const bounds = vi.spyOn(group, 'getBoundingClientRect');+ pointer(button, 'pointerdown');+ bounds.mockClear();++ pointer(button, 'pointermove', 80, 25);+ pointer(button, 'pointermove', 180, 30);+ expect(group.style.getPropertyValue('--press-x')).toBe('20px');+ expect(bounds).not.toHaveBeenCalled();+ expect(vi.getTimerCount()).toBe(1);++ vi.advanceTimersToNextFrame();+ expect(group.style.getPropertyValue('--press-x')).toBe('180px');+ expect(group.style.getPropertyValue('--press-y')).toBe('30px');+ expect(bounds).toHaveBeenCalledTimes(1);+ expect(vi.getTimerCount()).toBe(0);+ expect(group.children).toHaveLength(2);+ });+ it('tracks local coordinates as a round surface expands', () => {+ const group = surface(46, 46);+ const button = group.querySelector('button')!;+ pointer(button, 'pointerdown', 23, 23);+ group.getBoundingClientRect = () => new DOMRect(-6.44, -6.44, 58.88, 58.88);+ pointer(button, 'pointermove', 35, 30);+ vi.advanceTimersToNextFrame();+ expect(parseFloat(group.style.getPropertyValue('--press-x'))).toBeCloseTo(+ 32.375+ );+ expect(parseFloat(group.style.getPropertyValue('--press-y'))).toBeCloseTo(+ 28.46875+ );+ });+ it.each(['pointerup', 'pointercancel', 'outside', 'blur', 'dispose'])(+ 'cancels a queued spotlight update on %s',+ (end) => {+ const group = surface();+ const button = group.querySelector('button')!;+ pointer(button, 'pointerdown');+ pointer(button, 'pointermove', 180);+ if (end === 'dispose') dispose();+ else if (end === 'blur') window.dispatchEvent(new Event('blur'));+ else if (end === 'outside') pointer(button, 'pointermove', 400);+ else pointer(button, end);+ expect(vi.getTimerCount()).toBe(0);+ vi.advanceTimersToNextFrame();+ expect(group.hasAttribute('data-glass-press')).toBe(false);+ expect(group.style.getPropertyValue('--press-x')).toBe('20px');+ }+ );it.each(['pointerup', 'pointercancel', 'pointermove'])('releases on %s without scheduling cleanup',(event) => {diff --git a/apps/web/src/components/app/mobile/glassPress.ts b/apps/web/src/components/app/mobile/glassPress.tsindex 9b8a6c3471..ce514ce183 100644--- a/apps/web/src/components/app/mobile/glassPress.ts+++ b/apps/web/src/components/app/mobile/glassPress.ts@@ -1,31 +1,56 @@import { isTouchDevice } from '@core/mobile/isTouchDevice';+import { isPlatform } from '@core/util/platform';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 INPUT = '[data-glass-input], [data-input] [data-composer-collapsed]';const DISABLED = ':disabled, [data-disabled], [aria-disabled="true"]';-/** Round controls retain their 20% press; wide surfaces grow at most 3px per edge. */+/** Round controls grow 28%; wide surfaces expand their paint by up to 6px per edge. */export function glassPressGeometry(width: number, height: number) {- const outset = Math.min(3, width * 0.15, height * 0.15);+ const outset = Math.min(6, width * 0.15, height * 0.15);return {outset,round: width <= height * 1.15,- scale: 1.2,+ scale: 1.28,};}/**- * Automatically animate glass/island controls and their enclosing groups,+ * Animate native iOS glass/island controls, channel inputs and 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 }+ | {+ element: HTMLElement;+ pointerId: number;+ bounds: DOMRect;+ width: number;+ height: number;+ x: number;+ y: number;+ }| undefined;+ let frame: number | undefined;+ const positionHighlight = (bounds: DOMRect) => {+ if (!pressed || !bounds.width || !bounds.height) return;+ const { element, width, height, x, y } = pressed;+ element.style.setProperty(+ '--press-x',+ `${Math.max(0, Math.min(width, ((x - bounds.left) * width) / bounds.width))}px`+ );+ element.style.setProperty(+ '--press-y',+ `${Math.max(0, Math.min(height, ((y - bounds.top) * height) / bounds.height))}px`+ );+ };const release = () => {+ if (frame !== undefined) cancelAnimationFrame(frame);+ frame = undefined;if (!pressed) return;pressed.element.removeAttribute('data-glass-press');// Keep the last tap geometry for the fading shimmer. These values belong@@ -33,39 +58,55 @@ export function installGlassPress() {pressed = undefined;};const down = (event: PointerEvent) => {- if (!isTouchDevice() || !event.isPrimary || event.button !== 0) return;+ if (+ !isPlatform('ios') ||+ !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;+ if (event.target.closest(DISABLED)) return;+ const input = event.target.closest<HTMLElement>(INPUT);+ const element =+ input ??+ control?.closest<HTMLElement>(GROUP) ??+ (control?.matches('.glass, .island, [class~="touch:island"]')+ ? control+ : undefined);+ if (!element) 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;+ pressed = {+ element,+ pointerId: event.pointerId,+ bounds,+ width,+ height,+ x: event.clientX,+ y: event.clientY,+ };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`- );+ positionHighlight(bounds);element.style.setProperty('--press-shimmer-size',- `${Math.max(100, Math.min(260, height * 3))}px`+ `${Math.max(140, Math.min(320, height * 4))}px`+ );+ // Editors keep their text and caret still, even when a long draft is taller+ // than the input is wide. Only the enclosing paint should expand.+ element.setAttribute(+ 'data-glass-press',+ !input && geometry.round ? 'round' : 'wide');- 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();@@ -78,8 +119,19 @@ export function installGlassPress() {event.clientX > bounds.right ||event.clientY < bounds.top ||event.clientY > bounds.bottom- )+ ) {release();+ return;+ }+ pressed.x = event.clientX;+ pressed.y = event.clientY;+ if (frame !== undefined) return;+ // Coalesce moves into one paint per frame. Read the current bounds once+ // so the spotlight stays under the finger while round controls scale.+ frame = requestAnimationFrame(() => {+ frame = undefined;+ if (pressed) positionHighlight(pressed.element.getBoundingClientRect());+ });};document.addEventListener('pointerdown', down, true);document.addEventListener('pointerup', up, true);diff --git a/apps/web/src/components/app/mobile/mobile-dock-order.test.ts b/apps/web/src/components/app/mobile/mobile-dock-order.test.tsnew file mode 100644index 0000000000..0358d021c4--- /dev/null+++ b/apps/web/src/components/app/mobile/mobile-dock-order.test.ts@@ -0,0 +1,66 @@+import { beforeEach, describe, expect, it, vi } from 'vitest';+import {+ createMobileDockOrder,+ dockVisibleCount,+ normalizeDockOrder,+} from './mobile-dock-order';++const defaults = ['home', 'calendar', 'mail', 'tasks', 'reviews'];+beforeEach(() => localStorage.clear());++describe('mobile dock preferences', () => {+ it('deduplicates saved entries, ignores unknown ids, and appends new views', () => {+ expect(+ normalizeDockOrder(['tasks', 'tasks', 'old-view', 'home'], defaults)+ ).toEqual(['tasks', 'home', 'calendar', 'mail', 'reviews']);+ });+ it('preserves gated positions while reordering enabled destinations', () => {+ const prefs = createMobileDockOrder('alice', defaults);+ prefs.move(2, 0, ['home', 'mail', 'tasks']);+ expect(prefs.order()).toEqual([+ 'tasks',+ 'calendar',+ 'home',+ 'mail',+ 'reviews',+ ]);+ expect(createMobileDockOrder('alice', defaults).order()).toEqual(+ prefs.order()+ );+ expect(createMobileDockOrder('bob', defaults).order()).toEqual(defaults);+ expect(createMobileDockOrder(undefined, defaults).order()).toEqual(+ defaults+ );+ });+ it.each(['not json', '{}', '[1,2]'])(+ 'recovers from malformed storage: %s',+ (stored) => {+ localStorage.setItem('macro:mobile:dock-order:alice', stored);+ expect(createMobileDockOrder('alice', defaults).order()).toEqual(+ defaults+ );+ }+ );+ it('keeps the in-memory order when storage fails and ignores invalid moves', () => {+ const prefs = createMobileDockOrder('alice', defaults);+ const write = vi+ .spyOn(Storage.prototype, 'setItem')+ .mockImplementation(() => {+ throw new Error('blocked');+ });+ prefs.move(0, -1, defaults);+ prefs.move(0, defaults.length, defaults);+ expect(prefs.order()).toEqual(defaults);+ prefs.move(3, 0, defaults);+ expect(prefs.order()[0]).toBe('tasks');+ write.mockRestore();+ });+});++it('reserves More, clamps to enabled items, and handles unmeasured or narrow docks', () => {+ expect(dockVisibleCount(null, null, 10)).toBe(0);+ expect(dockVisibleCount(30, 44, 10)).toBe(0);+ expect(dockVisibleCount(220, 44, 10)).toBe(4);+ expect(dockVisibleCount(219, 44, 10)).toBe(3);+ expect(dockVisibleCount(440, 44, 3)).toBe(3);+});diff --git a/apps/web/src/components/app/mobile/mobile-dock-order.ts b/apps/web/src/components/app/mobile/mobile-dock-order.tsnew file mode 100644index 0000000000..a4be5a1e66--- /dev/null+++ b/apps/web/src/components/app/mobile/mobile-dock-order.ts@@ -0,0 +1,67 @@+import { makePersistedState } from '@app/lib/persistence';+import { createUserScopedStorage } from '@core/util/userScopedStorage';+import { createSignal } from 'solid-js';+import { z } from 'zod';++const orderSchema = z.array(z.string());+const storage = createUserScopedStorage('macro:mobile:dock-order');++/** Keep gated destinations in the saved order and append newly added views. */+export function normalizeDockOrder(+ saved: readonly string[],+ defaults: readonly string[]+) {+ const known = new Set(defaults);+ return [...new Set([...saved.filter((id) => known.has(id)), ...defaults])];+}++export function createMobileDockOrder(+ userId: string | undefined,+ defaults: readonly string[]+) {+ const [order, setOrder] = makePersistedState(createSignal([...defaults]), {+ storages: {+ restore: () => {+ if (!userId) return;+ const raw = storage.read(userId);+ if (!raw) return;+ const parsed = orderSchema.safeParse(JSON.parse(raw));+ if (parsed.success) return normalizeDockOrder(parsed.data, defaults);+ },+ write: (value) => {+ if (userId) storage.write(userId, JSON.stringify(value));+ },+ },+ });++ function move(from: number, to: number, visibleIds: readonly string[]) {+ if (+ from === to ||+ from < 0 ||+ to < 0 ||+ from >= visibleIds.length ||+ to >= visibleIds.length+ )+ return;+ const next = [...visibleIds];+ const [moved] = next.splice(from, 1);+ next.splice(to, 0, moved);+ const visible = new Set(visibleIds);+ let index = 0;+ // Replace only enabled slots, preserving preferences for gated views.+ setOrder((current) =>+ current.map((id) => (visible.has(id) ? next[index++] : id))+ );+ }++ return { order, move };+}++export function dockVisibleCount(+ width: number | null,+ height: number | null,+ count: number+) {+ if (!height || !width) return 0;+ return Math.min(count, Math.max(0, Math.floor(width / height) - 1));+}diff --git a/apps/web/src/components/app/mobile/mobile-dock-views.ts b/apps/web/src/components/app/mobile/mobile-dock-views.tsindex 0ffb10f48e..10987c9532 100644--- a/apps/web/src/components/app/mobile/mobile-dock-views.ts+++ b/apps/web/src/components/app/mobile/mobile-dock-views.ts@@ -1,9 +1,15 @@import { useCalendarUiFlag } from '@app/features/calendar/hooks/use-calendar-ui-flag';import { useFeatureFlag } from '@app/lib/analytics/posthog';import { getIconConfig } from '@core/component/EntityIcon';-import { enableCrm } from '@core/constant/featureFlags';+import {+ enableCalendarScheduling,+ enableCrm,+ enableTasksReviews,+} from '@core/constant/featureFlags';import BellIcon from '@phosphor/bell.svg';+import CalendarCheckIcon from '@phosphor/calendar-check.svg';import ChatsCircleIcon from '@phosphor/chats-circle.svg';+import GitPullRequestIcon from '@phosphor/git-pull-request.svg';import BellFillIcon from '@phosphor-fill/bell-fill.svg';import CalendarFillIcon from '@phosphor-fill/calendar-fill.svg';import ChatsCircleFillIcon from '@phosphor-fill/chats-circle-fill.svg';@@ -25,7 +31,7 @@ export type MobileDockView = {* Dock navigation order. Views that do not fit go in More; Settings is* added by its own surface.*/-const MOBILE_DOCK_VIEWS: readonly MobileDockView[] = [+export const MOBILE_DOCK_VIEWS: readonly MobileDockView[] = [{id: 'home',label: 'Notifications',@@ -60,14 +66,21 @@ const MOBILE_DOCK_VIEWS: readonly MobileDockView[] = [{ id: 'tasks', label: 'Tasks', icon: getIconConfig('task').icon },{ id: 'calls', label: 'Calls', icon: getIconConfig('call').icon },{ id: 'companies', label: 'CRM', icon: getIconConfig('company').icon },+ { id: 'reviews', label: 'Reviews', icon: GitPullRequestIcon },+ { id: 'booking-links', label: 'Scheduling', icon: CalendarCheckIcon },];export function useMobileDockViews() {const calendarEnabled = useCalendarUiFlag();const crm = useFeatureFlag(enableCrm);+ const reviews = useFeatureFlag(enableTasksReviews);+ const scheduling = useFeatureFlag(enableCalendarScheduling);return createMemo(() =>MOBILE_DOCK_VIEWS.filter((view) => view.id !== 'calendar' || calendarEnabled()- ).filter((view) => view.id !== 'companies' || crm().enabled)+ )+ .filter((view) => view.id !== 'companies' || crm().enabled)+ .filter((view) => view.id !== 'reviews' || reviews().enabled)+ .filter((view) => view.id !== 'booking-links' || scheduling().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 cde145eecd..a4b33f36c3 100644--- a/apps/web/src/components/app/mobile/mobile-nav-views.ts+++ b/apps/web/src/components/app/mobile/mobile-nav-views.ts@@ -2,8 +2,7 @@* Views reachable from mobile navigation, in display order.* `search` is the "All" pill, first in the scope pill row;* `settings` navigates through the settings state (not `openWithSplit`), and- * `calendar`, `reviews`, and `booking-links` are feature-gated; the latter two- * are drawer-only shortcuts.+ * `calendar`, `reviews`, and `booking-links` are feature-gated.*/export const MOBILE_NAV_VIEW_IDS = ['search',diff --git a/apps/web/src/components/app/sidebar-next/sidebar-rail.tsx b/apps/web/src/components/app/sidebar-next/sidebar-rail.tsxindex 63083b07d7..dcab66ef4d 100644--- a/apps/web/src/components/app/sidebar-next/sidebar-rail.tsx+++ b/apps/web/src/components/app/sidebar-next/sidebar-rail.tsx@@ -7,13 +7,13 @@ import { hotkeyScopeNeutralAttribute } from '@core/dom-selectors';import { isPlatform } from '@core/util/platform';import { cn } from '@ui';import { For, Match, Suspense, Switch } from 'solid-js';+import { useNavigationUnread } from '../use-navigation-unread';import { SidebarRailCreateButton } from './create-button';import { FooterActions } from './footer-actions';import { ListNav, type ListNavProps } from './list-nav';import { MoreMenu } from './more-menu';import { visibleNavItems } from './nav-items';import { useNextMeetingBadge } from './queries/use-next-meeting-badge';-import { useSidebarUnread } from './queries/use-sidebar-unread';import { SearchRailButton } from './search-bar-button';import { useNavItemGates } from './use-nav-item-gates';import { SidebarPrefsProvider } from './use-sidebar-prefs';@@ -48,7 +48,7 @@ const SidebarRailContent = () => {const gates = useNavItemGates();const analytics = useAnalytics();const layout = useSplitLayout();- const hasUnread = useSidebarUnread();+ const hasUnread = useNavigationUnread();const _openHome = (event: MouseEvent) => {if (event.button !== 0) return;diff --git a/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.test.ts b/apps/web/src/components/app/use-navigation-unread.test.tssimilarity index 98%rename from apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.test.tsrename to apps/web/src/components/app/use-navigation-unread.test.tsindex 5ebdebac7c..1f9835f0c1 100644--- a/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.test.ts+++ b/apps/web/src/components/app/use-navigation-unread.test.ts@@ -3,7 +3,7 @@ import type { UnifiedNotification } from '@notifications/types';import type { NotificationState } from '@service-storage/graphql/generated/graphql';import { createRoot, createSignal } from 'solid-js';import { afterEach, describe, expect, it, vi } from 'vitest';-import { useSidebarUnread } from './use-sidebar-unread';+import { useNavigationUnread } from './use-navigation-unread';const mocks = vi.hoisted(() => ({home: vi.fn(),@@ -130,7 +130,7 @@ function setup(graphql = false) {mocks.email.mockReturnValue(query);mocks.notifications.mockImplementation(notifications);return {- unread: useSidebarUnread(),+ unread: useNavigationUnread(),setLoading,setEmails,setNotifications,@@ -141,7 +141,7 @@ function setup(graphql = false) {});}-describe('sidebar unread presence', () => {+describe('navigation unread presence', () => {it('does not read pending resources or badge unrelated navigation', () => {const { unread } = setup();for (const id of ['home', 'mail', 'channels', 'documents', 'agents']) {diff --git a/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.ts b/apps/web/src/components/app/use-navigation-unread.tssimilarity index 98%rename from apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.tsrename to apps/web/src/components/app/use-navigation-unread.tsindex f9760964f5..833851ec60 100644--- a/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.ts+++ b/apps/web/src/components/app/use-navigation-unread.ts@@ -26,7 +26,7 @@ const signalInsertFilter: SoupApiItemFilter = (item) =>soupItemMatchesHomeTab(item, 'signal');/** Presence in the loaded unread page, never a total or a pagination loop. */-export function useSidebarUnread() {+export function useNavigationUnread() {const notificationSource = useGlobalNotificationSource();const graphqlFlag = useFeatureFlag(enableGraphqlSoup);const channels = createChannelUnreadQuery(diff --git a/apps/web/src/components/ui/components/Button.docs.tsx b/apps/web/src/components/ui/components/Button.docs.tsxindex f2a406d3fc..8699f87d17 100644--- a/apps/web/src/components/ui/components/Button.docs.tsx+++ b/apps/web/src/components/ui/components/Button.docs.tsx@@ -232,7 +232,7 @@ export default defineDoc({id: 'tooltip',title: 'Tooltips and shortcuts',description:- '`label` doubles as the tooltip; `tooltip` overrides it when the accessible name and the hint should differ. `hotkey` renders a registered shortcut, `shortcut` a raw string.',+ '`label` doubles as the tooltip; `tooltip` overrides it when the accessible name and the hint should differ. `hotkey` renders a registered shortcut, `shortcut` a raw string. Tooltips are disabled on touch devices, including when an action receives focus.',render: TooltipDemo,},],diff --git a/apps/web/src/components/ui/components/ConfirmDialog.test.tsx b/apps/web/src/components/ui/components/ConfirmDialog.test.tsxindex 64860a001a..04ff6763d1 100644--- a/apps/web/src/components/ui/components/ConfirmDialog.test.tsx+++ b/apps/web/src/components/ui/components/ConfirmDialog.test.tsx@@ -90,6 +90,43 @@ describe('controlled confirmation', () => {});describe('imperative confirmation', () => {+ it.each(['confirm', 'escape'] as const)(+ 'resolves a hero confirmation only after %s',+ async (action) => {+ render(() => <ImperativeDialogHost />);+ const result = confirmDialog({+ title: 'Start a call with Jacob',+ body: 'They’ll receive a notification to join.',+ mobileHero: <span>Avatars</span>,+ confirmLabel: 'Start call',+ tone: 'success',+ });+ const resolved = vi.fn();+ const resolution = (async () => resolved(await result))();+ expect(resolved).not.toHaveBeenCalled();+ expect(screen.queryByRole('button', { name: 'Cancel' })).toBeNull();+ expect(+ screen.queryByRole('button', { name: 'Close confirmation' })+ ).toBeNull();+ expect(+ screen+ .getByRole('dialog', { name: 'Start a call with Jacob' })+ .getAttribute('aria-describedby')+ ).toBeTruthy();++ if (action === 'confirm') {+ fireEvent.click(screen.getByRole('button', { name: 'Start call' }));+ } else {+ fireEvent.keyDown(document, { key: 'Escape' });+ }+ await vi.advanceTimersByTimeAsync(249);+ expect(resolved).not.toHaveBeenCalled();+ await vi.advanceTimersByTimeAsync(1);+ await resolution;+ expect(resolved).toHaveBeenCalledExactlyOnceWith(action === 'confirm');+ }+ );+it.each([['Confirm', true],['Cancel', false],diff --git a/apps/web/src/components/ui/components/ConfirmDialog.tsx b/apps/web/src/components/ui/components/ConfirmDialog.tsxindex 5d1ba1b4c9..3372471b6b 100644--- a/apps/web/src/components/ui/components/ConfirmDialog.tsx+++ b/apps/web/src/components/ui/components/ConfirmDialog.tsx@@ -18,6 +18,10 @@ export type ConfirmDialogDisplayProps = {/** Dialog copy. `children` is used when `body` is omitted. */body?: JSX.Element;children?: JSX.Element;+ /** Phone-only artwork above centered copy and a single full-width action.+ * Dismiss with the handle, backdrop, or Escape instead of a cancel button.+ */+ mobileHero?: JSX.Element;confirmLabel?: JSX.Element;cancelLabel?: JSX.Element;tone?: 'default' | 'danger' | 'success';diff --git a/apps/web/src/components/ui/components/Dialog.tsx b/apps/web/src/components/ui/components/Dialog.tsxindex 1ddbcb7997..ffde3c5610 100644--- a/apps/web/src/components/ui/components/Dialog.tsx+++ b/apps/web/src/components/ui/components/Dialog.tsx@@ -152,14 +152,13 @@ function DesktopDialog(props: DialogProps) {<divclass={cn('fixed top-0 bottom-(--virtual-keyboard-height,0) inset-x-0 z-modal flex',- props.fullscreen- ? 'inset-0'- : cn(- 'justify-center px-2',- props.position === 'center'- ? 'items-center'- : 'items-start pt-[10vh]'- )+ !props.fullscreen &&+ cn(+ 'justify-center px-2',+ props.position === 'center'+ ? 'items-center'+ : 'items-start pt-[10vh]'+ ))}><KobalteDialog.Contentdiff --git a/apps/web/src/components/ui/components/Tooltip.test.tsx b/apps/web/src/components/ui/components/Tooltip.test.tsxnew file mode 100644index 0000000000..9e1e21f5a7--- /dev/null+++ b/apps/web/src/components/ui/components/Tooltip.test.tsx@@ -0,0 +1,80 @@+import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';+import { createSignal } from 'solid-js';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { setTooltipsEnabled } from '../signals/signals';+import { Tooltip } from './Tooltip';++const device = vi.hoisted(() => ({ isTouch: (): boolean => true }));+vi.mock('@core/mobile/isTouchDevice', () => ({+ isTouchDevice: () => device.isTouch(),+}));++beforeEach(() => {+ vi.stubEnv('MODE', 'development');+ device.isTouch = () => true;+ setTooltipsEnabled(true);+ const rects = [new DOMRect(0, 0, 40, 40)];+ vi.spyOn(HTMLElement.prototype, 'getClientRects').mockReturnValue(+ Object.assign(rects, { item: (index: number) => rects[index] ?? null })+ );+});+afterEach(() => {+ cleanup();+ vi.restoreAllMocks();+ vi.unstubAllEnvs();+});++describe('Tooltip touch behavior', () => {+ it('keeps the focused back action available without showing its tooltip on touch', () => {+ const back = vi.fn();+ render(() => (+ <Tooltip label="Back to thread" tabIndex={0}>+ <button onClick={back}>Back</button>+ </Tooltip>+ ));+ const button = screen.getByRole('button', { name: 'Back' });+ button.parentElement?.focus();+ expect(document.activeElement).toBe(button.parentElement);+ expect(screen.queryByRole('tooltip')).toBeNull();+ fireEvent.click(button);+ expect(back).toHaveBeenCalledOnce();+ });++ it('suppresses explicitly opened tooltips on touch', () => {+ render(() => (+ <Tooltip label="Back to thread" open>+ <button>Back</button>+ </Tooltip>+ ));+ expect(screen.queryByRole('tooltip')).toBeNull();+ });++ it('closes when touch detection changes without replacing the focused control', () => {+ const [touch, setTouch] = createSignal(false);+ device.isTouch = touch;+ render(() => (+ <Tooltip label="Back to thread" open>+ <button>Back</button>+ </Tooltip>+ ));+ const button = screen.getByRole('button', { name: 'Back' });+ button.focus();+ expect(screen.getByRole('tooltip').textContent).toContain('Back to thread');+ setTouch(true);+ expect(screen.queryByRole('tooltip')).toBeNull();+ expect(screen.getByRole('button', { name: 'Back' })).toBe(button);+ expect(document.activeElement).toBe(button);+ });++ it('still opens on keyboard focus on desktop', () => {+ device.isTouch = () => false;+ render(() => (+ <Tooltip label="Back to thread" tabIndex={0}>+ <button>Back</button>+ </Tooltip>+ ));+ const button = screen.getByRole('button', { name: 'Back' });+ button.parentElement?.focus();+ expect(screen.getByRole('tooltip').textContent).toContain('Back to thread');+ });+});diff --git a/apps/web/src/components/ui/components/Tooltip.tsx b/apps/web/src/components/ui/components/Tooltip.tsxindex 837a1b16bc..15ac87ce1b 100644--- a/apps/web/src/components/ui/components/Tooltip.tsx+++ b/apps/web/src/components/ui/components/Tooltip.tsx@@ -1,4 +1,5 @@import type { HotkeyToken } from '@core/hotkey/tokens';+import { isTouchDevice } from '@core/mobile/isTouchDevice';import type { Placement } from '@floating-ui/dom';import { Tooltip as KobalteTooltip } from '@kobalte/core/tooltip';import type { ParentProps } from 'solid-js';@@ -109,13 +110,15 @@ export function Tooltip(props: TooltipProps) {);onCleanup(() => setOpen(false));- const visible = () => isOpen() && !props.disabled && tooltipsEnabled();+ const enabled = () =>+ !isTouchDevice() && !props.disabled && tooltipsEnabled();+ const visible = () => isOpen() && enabled();return (<KobalteTooltipopen={visible()}onOpenChange={(isOpen) => {- setOpen(isOpen && !props.disabled && tooltipsEnabled());+ setOpen(isOpen && enabled());}}placement={props.placement ?? 'bottom'}ignoreSafeArea={true}@@ -125,7 +128,7 @@ export function Tooltip(props: TooltipProps) {closeDelay={0}flip={true}gutter={4}- disabled={props.disabled || !tooltipsEnabled()}+ disabled={!enabled()}><KobalteTooltip.Triggerref={(ref) => {diff --git a/apps/web/src/components/view-shell/MobileFilterDrawer.tsx b/apps/web/src/components/view-shell/MobileFilterDrawer.tsxindex a5af9d5931..ba3185b091 100644--- a/apps/web/src/components/view-shell/MobileFilterDrawer.tsx+++ b/apps/web/src/components/view-shell/MobileFilterDrawer.tsx@@ -188,7 +188,10 @@ function Option(props: {<MobileDrawer.Itemrole={props.selectionMode === 'single' ? 'radio' : 'checkbox'}aria-checked={props.checked}- class={props.class}+ class={cn(+ '[&[role=checkbox][aria-checked=true]:has(+[role=checkbox][aria-checked=true])]:rounded-b-none [&[role=checkbox][aria-checked=true]+[role=checkbox][aria-checked=true]]:rounded-t-none',+ props.class+ )}onClick={() => props.onChange(!props.checked)}><Show when={props.icon}>diff --git a/apps/web/src/features/agents-view/components/ChatComposer.test.tsx b/apps/web/src/features/agents-view/components/ChatComposer.test.tsxindex 06c847132c..41e80b9432 100644--- a/apps/web/src/features/agents-view/components/ChatComposer.test.tsx+++ b/apps/web/src/features/agents-view/components/ChatComposer.test.tsx@@ -1,6 +1,7 @@import { createSessionComposerDraft } from '@app/features/block-agent/primitives/session-composer-draft';import type { InputAttachmentData } from '@channel/Input/types';import { preloadAgentFold } from '@core/agent-fold/client';+import { hapticImpact } from '@core/mobile/haptics';import { isTouchDevice } from '@core/mobile/isTouchDevice';import { $createQuoteNode, QuoteNode } from '@lexical/rich-text';import { fireEvent, render, screen } from '@solidjs/testing-library';@@ -17,6 +18,8 @@ import { beforeEach, describe, expect, it, vi } from 'vitest';import { RepositoryPicker } from '../views/RepositoryPicker';import { ChatComposer, ChatSessionInput } from './ChatComposer';+vi.mock('@core/mobile/haptics', () => ({ hapticImpact: vi.fn() }));+vi.mock('@service-connection/websocket', () => ({ws: { addEventListener: vi.fn(), send: vi.fn() },state: () => 'closed',@@ -302,9 +305,11 @@ describe('Chat session input', () => {// Not captured, so the editor inserts a newline instead of sending.expect(editor.enter?.(undefined, editor.text)).toBe(false);expect(send).not.toHaveBeenCalled();+ expect(hapticImpact).not.toHaveBeenCalled();expect(editor.clear).not.toHaveBeenCalled();fireEvent.click(screen.getByRole('button', { name: 'Send' }));expect(send).toHaveBeenCalledWith('first line', []);+ expect(hapticImpact).toHaveBeenCalledExactlyOnceWith('light');});it('does not advance the queue from Enter either', () => {@@ -337,6 +342,7 @@ describe('Chat session input', () => {));expect(editor.enter?.(undefined, 'Describe this')).toBe(false);expect(send).not.toHaveBeenCalled();+ expect(hapticImpact).not.toHaveBeenCalled();});});diff --git a/apps/web/src/features/agents-view/components/ChatComposer.tsx b/apps/web/src/features/agents-view/components/ChatComposer.tsxindex 3c67543e93..8f1ffede7c 100644--- a/apps/web/src/features/agents-view/components/ChatComposer.tsx+++ b/apps/web/src/features/agents-view/components/ChatComposer.tsx@@ -15,6 +15,7 @@ import { buildConfig } from '@core/component/LexicalMarkdown/builder/MarkdownConimport { MarkdownShell } from '@core/component/LexicalMarkdown/builder/MarkdownShell';import { createComposerLayout } from '@core/component/LexicalMarkdown/utils/create-composer-layout';import { toast } from '@core/component/Toast/Toast';+import { hapticImpact } from '@core/mobile/haptics';import { isTouchDevice } from '@core/mobile/isTouchDevice';import { useTouchOutsideToDismissKeyboard } from '@core/mobile/useTouchOutsideToDismissKeyboard';import { fireAndForget } from '@core/util/fireAndForget';@@ -209,6 +210,7 @@ export function ChatComposer(props: {const attached = attachments();editor.controls.clear();props.onDraftChange('');+ hapticImpact('light');props.onSend(prompt, attached);};diff --git a/apps/web/src/features/channel/Call/CallParticipantAvatars.test.tsx b/apps/web/src/features/channel/Call/CallParticipantAvatars.test.tsxnew file mode 100644index 0000000000..88bc652225--- /dev/null+++ b/apps/web/src/features/channel/Call/CallParticipantAvatars.test.tsx@@ -0,0 +1,29 @@+import { cleanup, render, screen } from '@solidjs/testing-library';+import { createSignal } from 'solid-js';+import { afterEach, expect, it, vi } from 'vitest';+import { CallParticipantAvatars } from './CallParticipantAvatars';++vi.mock('@core/component/UserIcon', () => ({+ UserIcon: (props: { id: string }) => <img alt={props.id} />,+}));+afterEach(cleanup);++it('shows all four people when they fit, and counts everyone after the first three when overflowing', () => {+ const [ids, setIds] = createSignal(['self', 'alice', 'bob', 'carol']);+ render(() => <CallParticipantAvatars ids={ids()} />);+ expect(screen.getAllByRole('img')).toHaveLength(4);+ expect(screen.queryByText(/^\+/)).toBeNull();++ setIds(['self', 'alice', 'bob', 'carol', 'dan']);+ expect(screen.getAllByRole('img')).toHaveLength(4);+ expect(+ screen.getByText('+2').parentElement?.contains(screen.getByAltText('carol'))+ ).toBe(true);+ expect(screen.queryByAltText('dan')).toBeNull();++ setIds(['self', 'alice', 'bob', 'carol', 'dan', 'erin', 'frank']);+ expect(screen.getByText('+4')).toBeTruthy();+ setIds(['self', 'alice']);+ expect(screen.getAllByRole('img')).toHaveLength(2);+ expect(screen.queryByText(/^\+/)).toBeNull();+});diff --git a/apps/web/src/features/channel/Call/CallParticipantAvatars.tsx b/apps/web/src/features/channel/Call/CallParticipantAvatars.tsxnew file mode 100644index 0000000000..e1cbc54202--- /dev/null+++ b/apps/web/src/features/channel/Call/CallParticipantAvatars.tsx@@ -0,0 +1,26 @@+import { UserIcon } from '@core/component/UserIcon';+import { For, Show } from 'solid-js';++/** Keep four avatar slots; the overflow slot represents everyone after the first three. */+export function CallParticipantAvatars(props: { ids: readonly string[] }) {+ return (+ <For each={props.ids.slice(0, 4)}>+ {(id, index) => (+ <div class="relative size-14 shrink-0">+ <UserIcon+ id={id}+ size="lg"+ class="size-14"+ suppressClick+ showTooltip={false}+ />+ <Show when={index() === 3 && props.ids.length > 4}>+ <span class="absolute inset-0 flex items-center justify-center rounded-full bg-surface/85 text-lg font-semibold text-ink backdrop-blur-xs">+ +{props.ids.length - 3}+ </span>+ </Show>+ </div>+ )}+ </For>+ );+}diff --git a/apps/web/src/features/channel/Call/use-start-channel-call.tsx b/apps/web/src/features/channel/Call/use-start-channel-call.tsxindex 9674fda03f..d1a15c2b81 100644--- a/apps/web/src/features/channel/Call/use-start-channel-call.tsx+++ b/apps/web/src/features/channel/Call/use-start-channel-call.tsx@@ -1,12 +1,18 @@import { analytics } from '@app/lib/analytics';import { useChannelTab } from '@channel/Channel/ChannelTabContext';-import { useChannelName, useChannelType } from '@core/context/channels';+import {+ useChannel,+ useChannelName,+ useChannelType,+} from '@core/context/channels';+import { useUserId } from '@core/context/user';import { isMobile } from '@core/mobile/isMobile';import PhoneIcon from '@phosphor/phone-call.svg';import { useActiveCallQuery } from '@queries/call/call';import { ChannelTypeEnum } from '@service-storage/client';import { confirmDialog } from '@ui';-import { getOwner } from 'solid-js';+import { createMemo, getOwner } from 'solid-js';+import { CallParticipantAvatars } from './CallParticipantAvatars';import { getCallJoinTab, getCallLeaveTab } from './call-tabs';import { useCall } from './use-call';@@ -23,6 +29,17 @@ export function useStartChannelCall(channelId: () => string) {const activeCallQuery = useActiveCallQuery(channelId);const isCallInProgress = () => !!activeCallQuery.data;+ const channel = useChannel(channelId());+ const userId = useUserId();+ const participantIds = createMemo(() => {+ const currentUser = userId();+ return [+ ...(currentUser ? [currentUser] : []),+ ...(channel()?.participants ?? [])+ .filter((participant) => participant.user_id !== currentUser)+ .map((participant) => participant.user_id),+ ];+ });const channelName = useChannelName(channelId());const channelType = useChannelType(channelId());const isDm = () => channelType() === ChannelTypeEnum.DirectMessage;@@ -34,13 +51,13 @@ export function useStartChannelCall(channelId: () => string) {const confirmTitle = () => {const name = channelName();if (!name) return 'Start a call?';- return isDm() ? `Call ${name}?` : `Start a call in ${name}?`;+ return isDm() ? `Start a call with ${name}` : `Start a call in ${name}`;};- // A DM title ("Call Jane?") already says who rings; the group-channel case- // is the one where the blast radius needs spelling out.const confirmBody = () =>- isDm() ? undefined : 'Everyone in the channel will be notified.';+ isDm()+ ? 'They’ll receive a notification to join.'+ : 'Everyone in the channel will be notified.';const joinCall = async () => {if (call.isJoining()) return;@@ -77,6 +94,7 @@ export function useStartChannelCall(channelId: () => string) {title: confirmTitle(),body: confirmBody(),tone: 'success' as const,+ mobileHero: <CallParticipantAvatars ids={participantIds()} />,confirmLabel: (<><PhoneIcon class="size-5" />diff --git a/apps/web/src/features/channel/Input/ChannelInput.tsx b/apps/web/src/features/channel/Input/ChannelInput.tsxindex 6dc414977b..741f60176f 100644--- a/apps/web/src/features/channel/Input/ChannelInput.tsx+++ b/apps/web/src/features/channel/Input/ChannelInput.tsx@@ -799,6 +799,7 @@ export function ChannelInput(props: ChannelInputProps) {</Show><Dynamiccomponent={props.flat ? 'div' : ComposerSurface}+ data-glass-input={props.flat ? undefined : ''}onFocusOut={(e: FocusEvent & { currentTarget: HTMLElement }) => {const next = e.relatedTarget as Node | null;if (next && e.currentTarget.contains(next)) return;diff --git a/apps/web/src/features/channel/Input/SendAction.tsx b/apps/web/src/features/channel/Input/SendAction.tsxindex a21578917c..763accda9c 100644--- a/apps/web/src/features/channel/Input/SendAction.tsx+++ b/apps/web/src/features/channel/Input/SendAction.tsx@@ -38,10 +38,9 @@ export function SendAction(props: SendActionProps) {hidden={isMobile() && isBlockedByEmptyInput()}// Full-frame mobile/tablet: pill rounding to match the dock/accessory islands.class={cn('touch:rounded-full', local.class)}- onPointerDown={(event) => {- event.preventDefault();- fireAndForget(commands.send(), 'channel-input');- }}+ onPointerDown={(event) => event.preventDefault()}+ onMouseDown={(event) => event.preventDefault()}+ onClick={() => fireAndForget(commands.send(), 'channel-input')}{...rest}/>);diff --git a/apps/web/src/features/channel/Input/create-input-commands.ts b/apps/web/src/features/channel/Input/create-input-commands.tsindex b6c6a61217..b0e459c438 100644--- a/apps/web/src/features/channel/Input/create-input-commands.ts+++ b/apps/web/src/features/channel/Input/create-input-commands.ts@@ -1,3 +1,4 @@+import { hapticImpact } from '@core/mobile/haptics';import { fireAndForget } from '@core/util/fireAndForget';import { Telemetry } from '@macro-inc/observability';import type { Accessor } from 'solid-js';@@ -44,6 +45,7 @@ export function createInputCommands(const current = deps.snapshot();if (!hasSendableInputContent(current)) return false;+ hapticImpact('light');deps.setIsSending(true);try {await deps.callbacks.onSend(current);diff --git a/apps/web/src/features/channel/Input/tests/create-input-commands.test.ts b/apps/web/src/features/channel/Input/tests/create-input-commands.test.tsindex ba6b0a6370..688e17e374 100644--- a/apps/web/src/features/channel/Input/tests/create-input-commands.test.ts+++ b/apps/web/src/features/channel/Input/tests/create-input-commands.test.ts@@ -1,7 +1,11 @@-import { describe, expect, it, vi } from 'vitest';+import { hapticImpact } from '@core/mobile/haptics';+import { beforeEach, describe, expect, it, vi } from 'vitest';import { createInputCommands } from '../create-input-commands';import type { InputSnapshot } from '../types';+vi.mock('@core/mobile/haptics', () => ({ hapticImpact: vi.fn() }));+beforeEach(() => vi.clearAllMocks());+describe('createInputCommands', () => {it('does not send an empty message', async () => {const onSend = vi.fn();@@ -27,6 +31,7 @@ describe('createInputCommands', () => {await expect(commands.send()).resolves.toBe(false);expect(onSend).not.toHaveBeenCalled();+ expect(hapticImpact).not.toHaveBeenCalled();});it('allows attachment-only messages', async () => {@@ -63,6 +68,7 @@ describe('createInputCommands', () => {await expect(commands.send()).resolves.toBe(true);expect(onSend).toHaveBeenCalledWith(snapshot);+ expect(hapticImpact).toHaveBeenCalledExactlyOnceWith('light');expect(reset).toHaveBeenCalledOnce();expect(clearComposer).toHaveBeenCalledOnce();});diff --git a/apps/web/src/features/channel/Input/tests/input-slots.test.tsx b/apps/web/src/features/channel/Input/tests/input-slots.test.tsxindex b62697a114..43c3fcb8b0 100644--- a/apps/web/src/features/channel/Input/tests/input-slots.test.tsx+++ b/apps/web/src/features/channel/Input/tests/input-slots.test.tsx@@ -4,7 +4,11 @@import { isMobile } from '@core/mobile/isMobile';import type { IUser } from '@core/user/types';-import { render as renderBare, screen } from '@solidjs/testing-library';+import {+ fireEvent,+ render as renderBare,+ screen,+} from '@solidjs/testing-library';import { QueryClient, QueryClientProvider } from '@tanstack/solid-query';import userEvent from '@testing-library/user-event';import { createSignal, type JSX, onMount } from 'solid-js';@@ -638,6 +642,40 @@ describe('Input slots', () => {expect(editorMocks.focus).not.toHaveBeenCalled();});+ it('waits for touch release before sending a channel message', async () => {+ vi.mocked(isMobile).mockReturnValue(true);+ const user = userEvent.setup();+ const onSend = vi.fn();+ render(() => (+ <ChannelInput+ input={{ ...baseInput, value: 'Send on release' }}+ onSend={onSend}+ />+ ));+ const button = screen.getByRole('button', { name: 'Send message' });+ await user.pointer({ target: button, keys: '[TouchA>]' });+ expect(onSend).not.toHaveBeenCalled();+ await user.pointer({ keys: '[/TouchA]' });+ expect(onSend).toHaveBeenCalledOnce();+ expect(onSend.mock.calls[0]?.[0]?.value).toBe('Send on release');+ });++ it('does not send a cancelled press and still accepts an assistive click', () => {+ const onSend = vi.fn();+ render(() => (+ <ChannelInput+ input={{ ...baseInput, value: 'Keep this draft' }}+ onSend={onSend}+ />+ ));+ const button = screen.getByRole('button', { name: 'Send message' });+ fireEvent.pointerDown(button, { pointerType: 'touch' });+ fireEvent.pointerCancel(button, { pointerType: 'touch' });+ expect(onSend).not.toHaveBeenCalled();+ fireEvent.click(button, { detail: 0 });+ expect(onSend).toHaveBeenCalledOnce();+ });+it('renders the default action composition and wires handlers through context', async () => {const user = userEvent.setup();const onSend = vi.fn();diff --git a/apps/web/src/features/channels-view/components/ChannelsMobileView.test.tsx b/apps/web/src/features/channels-view/components/ChannelsMobileView.test.tsxindex 5c97604c5b..ef8808ef9b 100644--- a/apps/web/src/features/channels-view/components/ChannelsMobileView.test.tsx+++ b/apps/web/src/features/channels-view/components/ChannelsMobileView.test.tsx@@ -35,7 +35,12 @@ vi.mock('@app/features/next-soup/actions', () => ({vi.mock('@app/features/next-soup/utils', () => ({openEntityInSplitFromUnifiedList: mocks.openSplit,}));-vi.mock('@app/features/soup', () => ({ SoupEntityContextMenu: mocks.pass }));+vi.mock('@app/features/soup', () => ({+ SoupEntityContextMenu: (props: { children?: JSX.Element }) => (+ <div>{props.children}</div>+ ),+}));+vi.mock('@core/mobile/isTouchDevice', () => ({ isTouchDevice: () => true }));vi.mock('@app/lib/debugSettings', () => ({DEBUG_SETTING_KEYS: {},useDebugSetting: () => () => false,@@ -81,7 +86,7 @@ vi.mock('./rail/ChannelRailItems', () => ({CONVERSATION_CARD_HEIGHT: 80,ConversationCard: (props: {channel: ChannelEntity;- onActivate: () => void;+ onActivate: (event: MouseEvent) => void;}) => <button onClick={props.onActivate}>{props.channel.name}</button>,}));vi.mock('./rail/hooks/useChannelCalls', () => ({@@ -123,7 +128,10 @@ beforeEach(() => {vi.clearAllMocks();HTMLElement.prototype.scrollTo = vi.fn();});-afterEach(cleanup);+afterEach(() => {+ cleanup();+ vi.useRealTimers();+});describe('mobile channel activation', () => {it('opens recent conversations immediately at latest with top-level read marking', async () => {@@ -183,3 +191,54 @@ describe('mobile channel activation', () => {}});});++describe('mobile channel press feedback', () => {+ it('highlights a held row and cancels when the finger scrolls or the touch is cancelled', () => {+ vi.useFakeTimers();+ render(() => (+ <ChannelsMobileView+ source={source}+ searchQuery=""+ onClearSearch={() => {}}+ />+ ));+ const button = screen.getByRole('button', { name: 'One' });+ const row = button.closest('[data-soup-entity]')!;+ fireEvent.touchStart(button, { touches: [{ clientX: 20, clientY: 20 }] });+ vi.advanceTimersByTime(20);+ expect(row.classList.contains('touch-highlight')).toBe(true);+ vi.advanceTimersByTime(500);+ expect(row.classList.contains('touch-highlight')).toBe(true);+ expect(mocks.openSplit).not.toHaveBeenCalled();+ fireEvent.touchMove(button, { touches: [{ clientX: 20, clientY: 40 }] });+ expect(row.classList.contains('touch-highlight')).toBe(false);+ fireEvent.touchStart(button, { touches: [{ clientX: 20, clientY: 20 }] });+ vi.advanceTimersByTime(20);+ expect(row.classList.contains('touch-highlight')).toBe(true);+ fireEvent.touchCancel(button);+ expect(row.classList.contains('touch-highlight')).toBe(false);+ });++ it('keeps the tapped row highlighted while navigation is pending and clears after it finishes', async () => {+ vi.useFakeTimers();+ const opened = Promise.withResolvers<void>();+ mocks.openSplit.mockReturnValueOnce(opened.promise);+ render(() => (+ <ChannelsMobileView+ source={source}+ searchQuery=""+ onClearSearch={() => {}}+ />+ ));+ const button = screen.getByRole('button', { name: 'One' });+ const row = button.closest('[data-soup-entity]')!;+ fireEvent.click(button);+ expect(row.classList.contains('touch-highlight')).toBe(true);+ vi.advanceTimersByTime(600);+ expect(row.classList.contains('touch-highlight')).toBe(true);+ opened.resolve();+ await opened.promise;+ await vi.runAllTimersAsync();+ expect(row.classList.contains('touch-highlight')).toBe(false);+ });+});diff --git a/apps/web/src/features/channels-view/components/ChannelsMobileView.tsx b/apps/web/src/features/channels-view/components/ChannelsMobileView.tsxindex 3a28df46fd..e385e0356a 100644--- a/apps/web/src/features/channels-view/components/ChannelsMobileView.tsx+++ b/apps/web/src/features/channels-view/components/ChannelsMobileView.tsx@@ -1,5 +1,9 @@import { createListController } from '@app/components/list';import { toEntityActionListState } from '@app/features/next-soup/actions';+import {+ persistSoupNavigationTouchHighlight,+ soupNavigationTouchHighlight,+} from '@app/features/next-soup/soup-view/soup-navigation-touch-highlight';import { openEntityInSplitFromUnifiedList } from '@app/features/next-soup/utils';import { SoupEntityContextMenu } from '@app/features/soup';import { DEBUG_SETTING_KEYS, useDebugSetting } from '@app/lib/debugSettings';@@ -107,8 +111,9 @@ export function ChannelsMobileView(props: {onCleanup(() => {opening += 1;});- const openChannel = async (channel: ChannelEntity) => {+ const openChannel = async (channel: ChannelEntity, event: MouseEvent) => {const request = ++opening;+ const finishTouchHighlight = persistSoupNavigationTouchHighlight(event);try {await openEntityInSplitFromUnifiedList(channel, {splitHandle: panel.handle,@@ -121,6 +126,8 @@ export function ChannelsMobileView(props: {if (request !== opening) return;console.error('Failed to open conversation', error);toast.failure('Unable to open conversation. Please try again.');+ } finally {+ finishTouchHighlight?.();}};@@ -136,7 +143,10 @@ export function ChannelsMobileView(props: {onRefresh={props.source.refresh}/><div- ref={setViewport}+ ref={(element) => {+ setViewport(element);+ soupNavigationTouchHighlight(element);+ }}class="scrollbar-hidden size-full min-h-0 overflow-y-auto overscroll-none"><div@@ -224,29 +234,40 @@ export function ChannelsMobileView(props: {});}}>- <ConversationCard- id={`${listId}-channel:${channel.id}`}- class="border-b border-edge-muted/50 px-(--mobile-chrome-gutter) touch:pl-6"- channel={channel}- showLatestMessage- senderId={channel.latestRootMessage?.senderId}- mentionedCurrentUser={channelMentionsUser(- channel,- currentUserId()- )}- unread={channelActivity.unreadChannelIds().has(channel.id)}- muted={isMutedItem(notificationSource.mutedEntities(), {- item_id: channel.id,- item_type: 'channel',- })}- callStatus={channelActivity.callStatuses().get(channel.id)}- incomingCallId={channelActivity- .incomingCallIds()- .get(channel.id)}- selected={false}- focused={false}- onActivate={() => openChannel(channel)}- />+ <div data-soup-entity>+ <ConversationCard+ id={`${listId}-channel:${channel.id}`}+ class="border-b border-edge-muted/50 px-(--mobile-chrome-gutter) touch:pl-6"+ channel={channel}+ showLatestMessage+ senderId={channel.latestRootMessage?.senderId}+ mentionedCurrentUser={channelMentionsUser(+ channel,+ currentUserId()+ )}+ unread={channelActivity+ .unreadChannelIds()+ .has(channel.id)}+ muted={isMutedItem(notificationSource.mutedEntities(), {+ item_id: channel.id,+ item_type: 'channel',+ })}+ callStatus={channelActivity+ .callStatuses()+ .get(channel.id)}+ incomingCallId={channelActivity+ .incomingCallIds()+ .get(channel.id)}+ selected={false}+ focused={false}+ onActivate={(event) =>+ fireAndForget(+ openChannel(channel, event),+ 'channels-view'+ )+ }+ />+ </div></SoupEntityContextMenu>)}</Virtualizer>diff --git a/apps/web/src/features/channels-view/components/rail/ChannelRailItems.tsx b/apps/web/src/features/channels-view/components/rail/ChannelRailItems.tsxindex 319e3f2c77..a94cc01c59 100644--- a/apps/web/src/features/channels-view/components/rail/ChannelRailItems.tsx+++ b/apps/web/src/features/channels-view/components/rail/ChannelRailItems.tsx@@ -271,6 +271,7 @@ export function ConversationCard(props: ConversationCardProps) {return (<divid={props.id}+ data-channel-conversationrole="treeitem"tabIndex={-1}class={cn(diff --git a/apps/web/src/features/command/CommandItem.tsx b/apps/web/src/features/command/CommandItem.tsxindex abeece805c..c1e162015e 100644--- a/apps/web/src/features/command/CommandItem.tsx+++ b/apps/web/src/features/command/CommandItem.tsx@@ -111,7 +111,7 @@ function CommandDisplay(props: { item: CommandMenuItem }) {return (<div class="flex items-center gap-2 flex-1 min-w-0">- <div class="size-5 flex items-center justify-center text-ink-muted shrink-0">+ <div class="size-5 mobile:scale-150 flex items-center justify-center text-ink-muted shrink-0"><Showwhen={command()?.commandPaletteIcon}fallback={@@ -145,7 +145,7 @@ function EntityDisplay(props: { entity: EntityData }) {return (<div class="flex items-center gap-2 flex-1 min-w-0">- <div class="size-5 p-0.5 flex items-center justify-center text-ink-muted shrink-0">+ <div class="size-5 mobile:scale-150 p-0.5 flex items-center justify-center text-ink-muted shrink-0"><Entity.Icon entity={props.entity} /></div><Entity.Title entity={props.entity} />@@ -159,7 +159,7 @@ function ContactDisplay(props: { contact: CrmContactEntity }) {return (<div class="flex items-center gap-2 flex-1 min-w-0">- <div class="size-5 p-0.5 flex items-center justify-center text-ink-muted shrink-0">+ <div class="size-5 mobile:scale-150 p-0.5 flex items-center justify-center text-ink-muted shrink-0"><Entity.Icon entity={props.contact} /></div><span class="truncate">@@ -179,7 +179,7 @@ function UserDisplay(props: { item: UserItem }) {return (<div class="flex items-center gap-2 flex-1 min-w-0">- <div class="size-5 flex items-center justify-center shrink-0">+ <div class="size-5 mobile:scale-150 flex items-center justify-center shrink-0"><UserIcon id={props.item.id} size="sm" isDeleted={false} /></div><span class="truncate">@@ -195,7 +195,7 @@ function UserDisplay(props: { item: UserItem }) {function SearchDisplay(props: { item: SearchItem }) {return (<div class="flex items-center gap-2 flex-1 min-w-0">- <div class="size-5 flex items-center justify-center text-ink-muted shrink-0">+ <div class="size-5 mobile:scale-150 flex items-center justify-center text-ink-muted shrink-0"><SearchIcon class="size-4" /></div><span class="truncate text-ink">@@ -208,7 +208,7 @@ function SearchDisplay(props: { item: SearchItem }) {function AskAiDisplay(props: { item: AskAiItem }) {return (<div class="flex items-center gap-2 flex-1 min-w-0">- <div class="size-5 flex items-center justify-center text-ink-muted shrink-0">+ <div class="size-5 mobile:scale-150 flex items-center justify-center text-ink-muted shrink-0"><WideStar class="size-4" /></div><span class="truncate text-ink">@@ -224,7 +224,7 @@ export function ItemDisplay(props: { item: CommandMenuItem }) {<Match when={props.item.kind === 'initiative' && props.item}>{(item) => (<div class="flex items-center gap-2 flex-1 min-w-0">- <ProjectIcon class="size-4 text-ink-muted shrink-0" />+ <ProjectIcon class="size-4 mobile:scale-150 text-ink-muted shrink-0" /><span class="truncate">{item().name}</span><span class="ml-auto text-xs text-ink-muted">Project</span></div>@@ -232,7 +232,7 @@ export function ItemDisplay(props: { item: CommandMenuItem }) {</Match><Match when={props.item.kind === 'new-project'}><div class="flex items-center gap-2 flex-1 min-w-0">- <PlusIcon class="size-4 text-ink-muted" />+ <PlusIcon class="size-4 mobile:scale-150 text-ink-muted" /><span>New project</span></div></Match>diff --git a/apps/web/src/features/command/mobile/MobileSearchInput.tsx b/apps/web/src/features/command/mobile/MobileSearchInput.tsxindex e6f7ce944d..61c33806ad 100644--- a/apps/web/src/features/command/mobile/MobileSearchInput.tsx+++ b/apps/web/src/features/command/mobile/MobileSearchInput.tsx@@ -2,7 +2,6 @@ import {useForegroundMobileView,useMobileNavNavigate,} from '@components/app/mobile/use-mobile-nav';-import { hapticImpact } from '@core/mobile/haptics';import { usePreserveFocusOnButtonTaps } from '@core/mobile/usePreserveFocusOnButtonTaps';import XIcon from '@phosphor/x.svg';import { SearchState } from './mobileSearchState';@@ -63,7 +62,6 @@ export function MobileSearchInput() {aria-label="Close search"onPointerDown={(e) => {e.preventDefault();- hapticImpact('light');}}onClick={handleClear}>diff --git a/apps/web/src/features/command/mobile/MobileSearchResults.test.tsx b/apps/web/src/features/command/mobile/MobileSearchResults.test.tsxindex 167242a520..0904b6ab5f 100644--- a/apps/web/src/features/command/mobile/MobileSearchResults.test.tsx+++ b/apps/web/src/features/command/mobile/MobileSearchResults.test.tsx@@ -599,7 +599,11 @@ it('restores loaded name pages and scroll before refresh resolves, without a loafireEvent.scroll(screen.getByRole('region', { name: 'Search results' }), {target: { scrollTop: 800 },});- fireEvent.click(screen.getAllByRole('button')[0]);+ fireEvent.click(+ within(screen.getByRole('region', { name: 'Search results' })).getAllByRole(+ 'button'+ )[0]+ );view.unmount();setLoading(true);@@ -867,9 +871,17 @@ it('keeps a covered native search entry independent of a new dock session', () =SearchState.open();SearchState.setQuery('new search');SearchState.setCategory('tasks');+ expect(+ screen.getByRole('button', { name: 'Email' }).getAttribute('aria-pressed')+ ).toBe('true');+ expect(+ screen.getByRole('button', { name: 'Tasks' }).getAttribute('aria-pressed')+ ).toBe('false');+ fireEvent.click(screen.getByRole('button', { name: 'Files' }));+ expect(SearchState.category()).toBe('tasks');mocks.setActive(true);expect(SearchState.query()).toBe('original');- expect(SearchState.category()).toBe('email');+ expect(SearchState.category()).toBe('documents');});it('loads another name page near the end without a persistent paging bar', async () => {diff --git a/apps/web/src/features/command/mobile/MobileSearchResults.tsx b/apps/web/src/features/command/mobile/MobileSearchResults.tsxindex 9c18f40add..e08ee0e555 100644--- a/apps/web/src/features/command/mobile/MobileSearchResults.tsx+++ b/apps/web/src/features/command/mobile/MobileSearchResults.tsx@@ -2,6 +2,8 @@ import { useCrmContactDiscovery } from '@app/features/crm/record-adapter';import { openEntityInSplitFromUnifiedList } from '@app/features/next-soup/utils';import { projectRouteId } from '@app/features/projects/core/route';import { createSoupRowStore } from '@app/features/soup/collection/row-store';+import { MobileTopEdgeFade } from '@components/app/mobile/MobileEdgeFade';+import { MobileViewsRow } from '@components/app/mobile/MobileViewsRow';import { useEntryState } from '@components/app/split-layout/entry-state';import { useSplitLayout } from '@components/app/split-layout/layout';import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';@@ -176,7 +178,7 @@ function MobileNameResults(props: {return (<divref={setContainer}- class="flex h-full min-h-0 flex-col px-3 mobile:pt-(--mobile-content-inset-top) mobile:pb-(--mobile-content-inset-bottom)"+ class="flex h-full min-h-0 flex-col px-3 touch:pt-(--mobile-content-inset-top) touch:pb-(--mobile-content-inset-bottom)"><Show when={state.query().trim() && category() !== 'projects'}><div@@ -333,7 +335,7 @@ function MobileFullTextResults(props: {});loadMoreNearEnd();}}- class="soup-list h-full overflow-y-auto overscroll-none [overflow-anchor:none] mobile:pt-(--mobile-content-inset-top) mobile:pb-(--mobile-content-inset-bottom)"+ class="soup-list h-full overflow-y-auto overscroll-none [overflow-anchor:none] touch:pt-(--mobile-content-inset-top) touch:pb-(--mobile-content-inset-bottom)"><ListEntityMetadataQueryProvider><ListLayoutProvider@@ -392,17 +394,35 @@ export function MobileSearchResults() {const accountId = useUserId();const authenticated = useIsAuthenticated();return (- <Show when={authenticated() === true ? accountId() : undefined} keyed>- {(id) => (- <Suspense fallback={<p role="status">Loading…</p>}>- <Show- when={session.mode() === 'full-text'}- fallback={<MobileNameResults session={session} accountId={id} />}+ <div+ class="relative size-full min-h-0 min-w-0"+ style={{+ '--mobile-content-inset-top': 'calc(var(--safe-top, 0px) + 3.75rem)',+ }}+ >+ <MobileViewsRow session={session} />+ <Show when={authenticated() === true ? accountId() : undefined} keyed>+ {(id) => (+ <Suspense+ fallback={+ <p+ role="status"+ class="px-3 touch:pt-(--mobile-content-inset-top)"+ >+ Loading…+ </p>+ }>- <MobileFullTextResults session={session} accountId={id} />- </Show>- </Suspense>- )}- </Show>+ <Show+ when={session.mode() === 'full-text'}+ fallback={<MobileNameResults session={session} accountId={id} />}+ >+ <MobileFullTextResults session={session} accountId={id} />+ </Show>+ </Suspense>+ )}+ </Show>+ <MobileTopEdgeFade />+ </div>);}diff --git a/apps/web/src/features/email-compose/components/draft-back-menu.tsx b/apps/web/src/features/email-compose/components/draft-back-menu.tsxnew file mode 100644index 0000000000..8c861e0335--- /dev/null+++ b/apps/web/src/features/email-compose/components/draft-back-menu.tsx@@ -0,0 +1,46 @@+import { MobileDrawer } from '@components/app/mobile/MobileDrawer';++/** Shared leave-composer choices; callers keep the editor open if saving fails. */+export function DraftBackMenu(props: {+ open: boolean;+ /** Nested full-screen composers keep this sheet within their modal layer. */+ mount?: HTMLElement;+ onOpenChange: (open: boolean) => void;+ onDelete: () => Promise<void>;+ onSave: () => Promise<void>;+}) {+ return (+ <MobileDrawer+ side="bottom"+ open={props.open}+ onOpenChange={props.onOpenChange}+ onEscapeKeyDown={(event) => {+ event.preventDefault();+ props.onOpenChange(false);+ }}+ preventScroll={false}+ preventScrollbarShift={false}+ >+ <MobileDrawer.Portal mount={props.mount}>+ <MobileDrawer.Overlay />+ <MobileDrawer.Content aria-label="Draft options">+ <MobileDrawer.Handle />+ <MobileDrawer.Section class="mb-3">+ <MobileDrawer.Item+ class="justify-center font-medium text-failure"+ onClick={props.onDelete}+ >+ Delete Draft+ </MobileDrawer.Item>+ <MobileDrawer.Item+ class="justify-center font-medium"+ onClick={props.onSave}+ >+ Save Draft+ </MobileDrawer.Item>+ </MobileDrawer.Section>+ </MobileDrawer.Content>+ </MobileDrawer.Portal>+ </MobileDrawer>+ );+}diff --git a/apps/web/src/features/email-compose/components/email-date-selector.tsx b/apps/web/src/features/email-compose/components/email-date-selector.tsxindex d384320cbb..46baa66930 100644--- a/apps/web/src/features/email-compose/components/email-date-selector.tsx+++ b/apps/web/src/features/email-compose/components/email-date-selector.tsx@@ -100,7 +100,7 @@ export const EmailDateSelector: VoidComponent<EmailDateSelectorProps> = (</Show>}triggerClass={cn(- buttonClasses({ size: 'icon-composer' }),+ buttonClasses({ size: props.mobile ? 'icon-sm' : 'icon-composer' }),props.selectedTime &&!isCompact() &&'min-w-0 max-w-full shrink gap-1 aspect-auto! bg-accent/20 text-accent hover:bg-accent/15! hover:text-accent! not-touch:min-w-[33.75px] not-touch:w-auto! not-touch:px-2'@@ -121,7 +121,12 @@ export const EmailDateSelector: VoidComponent<EmailDateSelectorProps> = (return (<div class="flex min-w-0 items-center gap-1">- <ClockIcon class={props.selectedTime ? 'text-accent' : ''} />+ <ClockIcon+ class={cn(+ 'touch:size-6',+ props.selectedTime && 'text-accent'+ )}+ /><Show when={showExpanded()}><span class="min-w-0 truncate text-sm">{selectedLabel()}diff --git a/apps/web/src/features/email-compose/components/mobile-compose-actions.tsx b/apps/web/src/features/email-compose/components/mobile-compose-actions.tsxnew file mode 100644index 0000000000..bdc4722b6a--- /dev/null+++ b/apps/web/src/features/email-compose/components/mobile-compose-actions.tsx@@ -0,0 +1,41 @@+import { HeaderIsland } from '@components/app/split-layout/components/HeaderIsland';+import Paperclip from '@phosphor/paperclip.svg';+import { Button, SendButton } from '@ui';+import { type JSX, Show } from 'solid-js';++/** Shared header actions for new emails, replies, and forwards. */+export function MobileComposeActions(props: {+ status?: JSX.Element;+ attachRef?: (element: HTMLButtonElement) => void;+ editingDisabled: boolean;+ scheduleControl?: JSX.Element;+ sendLabel: string;+ sendTooltip?: string;+ sendDisabled: boolean;+ sending: boolean;+ onSend: () => void;+}) {+ return (+ <HeaderIsland class="h-(--mobile-chrome-button-size) p-[5px]">+ {props.status}+ <Show when={props.attachRef}>+ <Button+ ref={props.attachRef}+ label="Attach"+ size="icon-sm"+ disabled={props.editingDisabled}+ >+ <Paperclip />+ </Button>+ </Show>+ {props.scheduleControl}+ <SendButton+ tooltip={props.sendTooltip ?? props.sendLabel}+ aria-label={props.sendLabel}+ disabled={props.sendDisabled}+ pending={props.sending}+ onClick={props.onSend}+ />+ </HeaderIsland>+ );+}diff --git a/apps/web/src/features/email-compose/components/mobile-reply-toolbar.tsx b/apps/web/src/features/email-compose/components/mobile-reply-toolbar.tsxindex fda94eefe1..6f01efdb08 100644--- a/apps/web/src/features/email-compose/components/mobile-reply-toolbar.tsx+++ b/apps/web/src/features/email-compose/components/mobile-reply-toolbar.tsx@@ -1,27 +1,12 @@-import ArrowUp from '@phosphor/arrow-up.svg';-import Paperclip from '@phosphor/paperclip.svg';-import Spinner from '@phosphor/spinner-gap.svg';-import Trash from '@phosphor/trash.svg';-import { Button, type ButtonProps } from '@ui';-import { type JSX, Show } from 'solid-js';+import { HeaderIsland } from '@components/app/split-layout/components/HeaderIsland';+import CaretLeft from '@phosphor/caret-left.svg';+import { Button } from '@ui';+import type { JSX } from 'solid-js';+import { MobileComposeActions } from './mobile-compose-actions';-function ToolbarButton(props: ButtonProps) {- return (- <Button- {...props}- depth={3}- variant="ghost"- size="icon-md"- noTouchResize- class="island size-(--mobile-chrome-button-size) border-0 bg-chrome p-0 text-ink"- />- );-}--/** Reply and forward share the same circular glass controls as the mobile dock. */+/** Same header controls as new email, with Back returning to the thread. */export function MobileReplyToolbar(props: {- discardLabel: string;- onDiscard: () => void;+ onBack: () => void;attachRef: (element: HTMLButtonElement) => void;onSend: () => void;sendLabel: string;@@ -33,45 +18,16 @@ export function MobileReplyToolbar(props: {status?: JSX.Element;}) {return (- <div- data-corvu-no-drag=""- class="sticky top-0 inset-x-0 z-10 flex shrink-0 flex-wrap items-center justify-between gap-y-2 bg-surface p-3 pt-0"- >- <div class="flex items-center">- {props.status}- <ToolbarButton- label={props.discardLabel}- onClick={props.onDiscard}- disabled={props.editingDisabled}- >- <Trash class="size-(--mobile-chrome-icon-size)" />- </ToolbarButton>+ <div class="sticky top-0 z-10 flex shrink-0 flex-wrap items-center justify-between gap-2 bg-surface px-(--mobile-chrome-gutter) pb-3 pt-[calc(var(--safe-top,0px)+12px)]">+ <HeaderIsland class="size-(--mobile-chrome-button-size) justify-center p-0">+ <Button label="Go Back" size="icon-sm" onClick={props.onBack}>+ <CaretLeft />+ </Button>+ </HeaderIsland>+ <div class="ml-auto">+ <MobileComposeActions {...props} /></div>{props.scheduleSummary}- <div class="ml-auto flex items-center gap-2">- {props.scheduleControl}- <ToolbarButton- label="Attach"- ref={props.attachRef}- disabled={props.editingDisabled}- >- <Paperclip class="size-(--mobile-chrome-icon-size)" />- </ToolbarButton>- <ToolbarButton- label={props.sendLabel}- disabled={props.sendDisabled}- onClick={props.onSend}- >- <Show- when={!props.sending}- fallback={- <Spinner class="size-(--mobile-chrome-icon-size) animate-spin" />- }- >- <ArrowUp class="size-(--mobile-chrome-icon-size)" />- </Show>- </ToolbarButton>- </div></div>);}diff --git a/apps/web/src/features/email-compose/primitives/reply-composer-focus.ts b/apps/web/src/features/email-compose/primitives/reply-composer-focus.tsindex 68056246df..f61144d386 100644--- a/apps/web/src/features/email-compose/primitives/reply-composer-focus.ts+++ b/apps/web/src/features/email-compose/primitives/reply-composer-focus.ts@@ -14,7 +14,7 @@ export function takesFocusOnMount(mount: {requested: boolean;/** Restores a send the user just undid. */restoredSend: boolean;- /** Touch replies open in a drawer the user just asked for. */+ /** Touch replies open in a full-screen composer the user just asked for. */desktop: boolean;}): boolean {return (diff --git a/apps/web/src/features/email-compose/views/compose-toolbar.tsx b/apps/web/src/features/email-compose/views/compose-toolbar.tsxindex f8921d0cfd..3a88c7e25e 100644--- a/apps/web/src/features/email-compose/views/compose-toolbar.tsx+++ b/apps/web/src/features/email-compose/views/compose-toolbar.tsx@@ -18,6 +18,7 @@ import { FORMAT_TEXT_COMMAND, type LexicalEditor } from 'lexical';import { createSignal, type JSX, Show } from 'solid-js';import { EmailDateSelector } from '../components/email-date-selector';import { EmailScheduleSummary } from '../components/email-schedule-summary';+import { MobileComposeActions } from '../components/mobile-compose-actions';import { useCompose } from '../context/compose-context';export function EmailComposeToolbar(props: {@@ -136,47 +137,38 @@ function MobileToolbar(props: { status?: JSX.Element }) {</Show></SplitHeaderLeft><SplitHeaderRight>- <HeaderIsland class="h-(--mobile-chrome-button-size) p-[5px]">- {props.status}- <Show when={!ctx.hideAttachments}>- <div class="relative">- <Button- ref={(el) =>+ <MobileComposeActions+ status={props.status}+ attachRef={+ ctx.hideAttachments+ ? undefined+ : (el) =>fileSelector(el, () => ({multiple: true,onSelect: ctx.onAddAttachments,}))- }- size="icon-sm"- disabled={ctx.disabled()}- >- <PaperclipIcon />- </Button>- </div>- </Show>-- <Show when={ctx.scheduleEnabled}>- <EmailDateSelector- mobile={ctx.isMobile()}- state={ctx.schedule.state()}- selectedTime={ctx.schedule.selectedTime()}- onSelectTime={ctx.schedule.onSelect}- onCancelSchedule={ctx.schedule.onCancel}- operation={ctx.schedule.operation()}- disabled={ctx.schedule.pickerDisabled()}- compact- />- </Show>- <SendButton- tooltip={- ctx.sendUnavailableReason?.() ?? ctx.schedule.actionLabel()- }- aria-label={ctx.schedule.actionLabel()}- disabled={ctx.isSavingDraft?.() || ctx.primaryActionDisabled()}- pending={ctx.isSending()}- onClick={() => ctx.onSend()}- />- </HeaderIsland>+ }+ editingDisabled={ctx.disabled()}+ scheduleControl={+ <Show when={ctx.scheduleEnabled}>+ <EmailDateSelector+ mobile={ctx.isMobile()}+ state={ctx.schedule.state()}+ selectedTime={ctx.schedule.selectedTime()}+ onSelectTime={ctx.schedule.onSelect}+ onCancelSchedule={ctx.schedule.onCancel}+ operation={ctx.schedule.operation()}+ disabled={ctx.schedule.pickerDisabled()}+ compact+ />+ </Show>+ }+ sendLabel={ctx.schedule.actionLabel()}+ sendTooltip={ctx.sendUnavailableReason?.()}+ sendDisabled={!!ctx.isSavingDraft?.() || ctx.primaryActionDisabled()}+ sending={ctx.isSending()}+ onSend={() => ctx.onSend()}+ /></SplitHeaderRight></>);diff --git a/apps/web/src/features/email-compose/views/email-compose.test.tsx b/apps/web/src/features/email-compose/views/email-compose.test.tsxindex 209d759c9e..e8233514d2 100644--- a/apps/web/src/features/email-compose/views/email-compose.test.tsx+++ b/apps/web/src/features/email-compose/views/email-compose.test.tsx@@ -5,7 +5,7 @@ import {screen,waitFor,} from '@solidjs/testing-library';-import { type ParentProps, Show } from 'solid-js';+import { type ComponentProps, type ParentProps, Show } from 'solid-js';import { afterEach, expect, it, vi } from 'vitest';import type { EmailDraftStorage } from '../context/compose-capabilities';import { useCompose } from '../context/compose-context';@@ -52,6 +52,7 @@ vi.mock('@components/app/mobile/MobileDrawer', () => {Content: passthrough,Handle: () => null,Section: passthrough,+ Item: (props: ComponentProps<'button'>) => <button {...props} />,}),};diff --git a/apps/web/src/features/email-compose/views/email-compose.tsx b/apps/web/src/features/email-compose/views/email-compose.tsxindex 4718682203..d8d963448f 100644--- a/apps/web/src/features/email-compose/views/email-compose.tsx+++ b/apps/web/src/features/email-compose/views/email-compose.tsx@@ -1,4 +1,3 @@-import { MobileDrawer } from '@components/app/mobile/MobileDrawer';import { SplitHeaderLeft } from '@components/app/split-layout/components/SplitHeader';import {SplitHeaderBadge,@@ -10,6 +9,7 @@ import { fireAndForget } from '@core/util/fireAndForget';import { ComposerSurface } from '@ui';import { createResource, createSignal, Show } from 'solid-js';import { MessageOperationRecovery } from '../../email-message/views/message-operation-recovery';+import { DraftBackMenu } from '../components/draft-back-menu';import { DraftSyncStatus } from '../components/draft-sync-status';import { EmailScheduleBar } from '../components/email-schedule-summary';import { SignaturePreview } from '../components/signature-preview';@@ -303,46 +303,20 @@ function LoadedEmailComposeView(</div></div><Show when={composeContext.presentation.isMobile()}>- <MobileDrawer- side="bottom"+ <DraftBackMenuopen={draftBackMenuOpen()}onOpenChange={setDraftBackMenuOpen}- preventScroll={false}- preventScrollbarShift={false}- >- <MobileDrawer.Portal>- <MobileDrawer.Overlay />- <MobileDrawer.Content aria-label="Draft options">- <MobileDrawer.Handle />- <MobileDrawer.Section class="mb-3">- <button- type="button"- class="w-full bg-surface px-3 py-3.5 text-sm font-medium text-failure text-center not-last:mb-px"- onClick={async () => {- // Navigate only once the deletion landed; the mutation- // toasts on failure and the composer stays put.- try {- if (!(await deleteDraftAndReset())) return;- } catch {- setDraftBackMenuOpen(false);- return;- }- setDraftBackMenuOpen(false);- }}- >- Delete Draft- </button>- <button- type="button"- class="w-full bg-surface px-3 py-3.5 text-sm font-medium text-center"- onClick={leaveCompose}- >- Save Draft- </button>- </MobileDrawer.Section>- </MobileDrawer.Content>- </MobileDrawer.Portal>- </MobileDrawer>+ onSave={leaveCompose}+ onDelete={async () => {+ try {+ if (!(await deleteDraftAndReset())) return;+ } catch {+ setDraftBackMenuOpen(false);+ return;+ }+ setDraftBackMenuOpen(false);+ }}+ /></Show></ComposeProvider>);diff --git a/apps/web/src/features/email-compose/views/reply-input-close.test.tsx b/apps/web/src/features/email-compose/views/reply-input-close.test.tsxnew file mode 100644index 0000000000..ec954fc0b0--- /dev/null+++ b/apps/web/src/features/email-compose/views/reply-input-close.test.tsx@@ -0,0 +1,189 @@+import { registerHotkey } from '@core/hotkey/hotkeys';+import {+ cleanup,+ fireEvent,+ render,+ screen,+ waitFor,+} from '@solidjs/testing-library';+import { type ComponentProps, type JSX, Show } from 'solid-js';+import { afterEach, expect, it, vi } from 'vitest';+import { message } from '../../email-message/tests/messages';+import type { DraftBackMenu } from '../components/draft-back-menu';+import type { MobileReplyToolbar } from '../components/mobile-reply-toolbar';+import { EmailFormContextProvider } from '../context/email-form-context';+import { createComposeContext } from '../tests/capabilities';+import { createEmailEditor } from '../tests/editor';+import { ReplyInputView } from './reply-input';++const fixture = vi.hoisted(() => ({ text: '' }));++// Keep the real view, form, draft controller and deletion lifecycle. Stub only+// app-owned editor plugins and presentation unrelated to closing the reply.+vi.mock('@core/hotkey/hotkeys', () => ({+ registerHotkey: vi.fn(),+ useHotkeyDOMScope: () => [() => {}, 'reply'],+}));+vi.mock(+ '@core/component/LexicalMarkdown/builder/MarkdownConfigBuilder',+ () => ({+ buildConfig: () => {+ const config = {+ withAppLinkResolver: () => config,+ namespace: () => config,+ withMentions: () => config,+ withEmojis: () => config,+ withLinks: () => config,+ withHistory: () => config,+ withMedia: () => config,+ withCode: () => config,+ withCheckboxToTask: () => config,+ withRestoreFocus: () => config,+ withSelectionData: () => config,+ withFloatingFormatMenu: () => config,+ use: () => config,+ onChange: () => config,+ withFilePaste: () => config,+ buildHandle: () => ({ lexical: createEmailEditor(fixture.text) }),+ };+ return config;+ },+ })+);+vi.mock('@core/component/LexicalMarkdown/builder/MarkdownShell', () => ({+ MarkdownShell: () => null,+}));+vi.mock('@components/app/split-layout/split-router/mention-links', () => ({+ useMacroMentionLinkResolver: () => undefined,+}));+vi.mock('@ui', () => ({+ cn: (...classes: unknown[]) => classes.filter(Boolean).join(' '),+ Surface: (props: JSX.HTMLAttributes<HTMLDivElement>) => (+ <div ref={props.ref}>{props.children}</div>+ ),+ Tooltip: (props: { children: JSX.Element }) => props.children,+ Button: (props: JSX.ButtonHTMLAttributes<HTMLButtonElement>) => (+ <button {...props} />+ ),+}));+vi.mock('../components/mobile-reply-toolbar', () => ({+ MobileReplyToolbar: (props: ComponentProps<typeof MobileReplyToolbar>) => (+ <button onClick={props.onBack}>Go Back</button>+ ),+}));+vi.mock('../components/draft-back-menu', () => ({+ DraftBackMenu: (props: ComponentProps<typeof DraftBackMenu>) => (+ <Show when={props.open}>+ <button onClick={props.onSave}>Save Draft</button>+ <button onClick={props.onDelete}>Delete Draft</button>+ </Show>+ ),+}));+vi.mock('../components/attachment-viewer', () => ({+ createAttachmentViewer: () => ({}),+}));+vi.mock('../components/draft-sync-status', () => ({+ DraftSyncStatus: () => null,+}));+vi.mock('../components/email-schedule-summary', () => ({+ EmailScheduleSummary: () => null,+}));+vi.mock('./reply-envelope', () => ({ ReplyEnvelope: () => null }));+vi.mock('@core/component/FileDropOverlay', () => ({+ FileDropOverlay: () => null,+}));+vi.mock('@core/directive/fileFolderDrop', () => ({ fileFolderDrop: () => {} }));+vi.mock('@core/mobile/useTouchOutsideToDismissKeyboard', () => ({+ useTouchOutsideToDismissKeyboard: () => {},+}));++afterEach(() => {+ cleanup();+ vi.clearAllMocks();+});++function mount(draftId?: string, text = '') {+ fixture.text = text;+ const context = createComposeContext();+ context.presentation.isTouch = () => true;+ context.presentation.scheduleEnabled = false;+ const draft = draftId+ ? message(draftId, { is_draft: true, body_text: text, subject: '' })+ : undefined;+ const parent = message('parent', { subject: '' });+ const onClose = vi.fn();+ const onDraftRemoved = vi.fn();+ const exitToThread = vi.fn(() => true);+ const setShowReply = vi.fn();+ render(() => (+ <EmailFormContextProvider+ context={{+ viewerEmail: context.viewerEmail,+ inboxes: context.accounts.inboxes,+ }}+ formOptions={{+ getMessageById: () => parent,+ getDraftForMessageReply: () => draft,+ }}+ >+ <ReplyInputView+ context={context}+ draft={draft}+ sourceEntityId="thread"+ replyingTo={() => parent}+ setShowReply={setShowReply}+ session={{+ thread: () => ({+ db_id: 'thread',+ link_id: 'inbox',+ inbox_visible: true,+ }),+ recipientOptions: () => [],+ isPersonalReply: () => false,+ onDraftRemoved,+ exitToThread,+ replyRequest: { replyType: () => undefined, clear() {} },+ }}+ mobileCompose={{+ portalMount: () => undefined,+ onClose,+ registerClose() {},+ }}+ />+ </EmailFormContextProvider>+ ));+ return { context, onClose, onDraftRemoved, exitToThread, setShowReply };+}++it('routes the composer Escape hotkey through the mobile draft choices', () => {+ const state = mount('draft', 'Unsent reply');+ const shortcut = vi+ .mocked(registerHotkey)+ .mock.calls.find(([options]) => options.hotkey === 'escape')?.[0];+ expect(shortcut).toBeDefined();+ shortcut?.keyDownHandler?.(new KeyboardEvent('keydown', { key: 'Escape' }));+ expect(screen.getByRole('button', { name: 'Save Draft' })).toBeTruthy();+ expect(state.exitToThread).not.toHaveBeenCalled();+ expect(state.onClose).not.toHaveBeenCalled();+ shortcut?.keyDownHandler?.(new KeyboardEvent('keydown', { key: 'Escape' }));+ expect(screen.queryByRole('button', { name: 'Save Draft' })).toBeNull();+ expect(state.onClose).not.toHaveBeenCalled();+});++it.each([undefined, 'saved-draft'])(+ 'discards an empty reply and clears the preview (identity: %s)',+ async (draftId) => {+ const state = mount(draftId);+ fireEvent.click(screen.getByRole('button', { name: 'Go Back' }));+ await waitFor(() => expect(state.onDraftRemoved).toHaveBeenCalledOnce());+ expect(state.setShowReply).toHaveBeenCalledWith(false);+ expect(state.onClose).not.toHaveBeenCalled();+ if (draftId) {+ expect(state.context.drafts.deleteDraft).toHaveBeenCalledWith(+ expect.objectContaining({ draftId })+ );+ } else {+ expect(state.context.drafts.deleteDraft).not.toHaveBeenCalled();+ }+ }+);diff --git a/apps/web/src/features/email-compose/views/reply-input.tsx b/apps/web/src/features/email-compose/views/reply-input.tsxindex ab00713c29..03e4bc3185 100644--- a/apps/web/src/features/email-compose/views/reply-input.tsx+++ b/apps/web/src/features/email-compose/views/reply-input.tsx@@ -18,9 +18,17 @@ import { isIOS } from '@solid-primitives/platform';import { Button, cn, SendButton, Surface, Tooltip } from '@ui';import type { LexicalEditor } from 'lexical';import { $getRoot } from 'lexical';-import { createResource, createSignal, For, onMount, Show } from 'solid-js';+import {+ type Accessor,+ createResource,+ createSignal,+ For,+ onMount,+ Show,+} from 'solid-js';import { MessageOperationRecovery } from '../../email-message/views/message-operation-recovery';import { createAttachmentViewer } from '../components/attachment-viewer';+import { DraftBackMenu } from '../components/draft-back-menu';import { DraftSyncStatus } from '../components/draft-sync-status';import { EmailDateSelector } from '../components/email-date-selector';import {@@ -67,7 +75,11 @@ type ReplyInputViewProps = Omit<onReloadDraft?: () => void;markdownDomRef?: (ref: HTMLDivElement) => void | HTMLDivElement;unframed?: boolean;- mobileDrawer?: { onClose: () => void };+ mobileCompose?: {+ portalMount: Accessor<HTMLDivElement | undefined>;+ onClose: () => void;+ registerClose: (handler: () => void) => void;+ };};export function ReplyInputView(props: ReplyInputViewProps) {const initialId = props.draft?.db_id;@@ -201,13 +213,34 @@ function LoadedReplyInputView(props: ReplyInputViewProps) {composeContext.presentation.signaturesEnabled()? state.signatureHtml(): undefined;- const isMobileDrawer = () => props.mobileDrawer !== undefined;+ const [draftBackMenuOpen, setDraftBackMenuOpen] = createSignal(false);+ const requestClose = () => {+ // The full-screen dialog owns Escape; dismiss the nested draft choices first.+ if (draftBackMenuOpen()) {+ setDraftBackMenuOpen(false);+ return;+ }+ if (collectDraft()) setDraftBackMenuOpen(true);+ else fireAndForget(deleteDraftAndReset(), 'email-compose');+ };+ const saveAndClose = async () => {+ try {+ await state.flushLocal();+ } catch (error) {+ composeContext.notices.reportError(error);+ return;+ }+ setDraftBackMenuOpen(false);+ props.mobileCompose?.onClose();+ };+ onMount(() => props.mobileCompose?.registerClose(requestClose));+ const isMobileCompose = () => props.mobileCompose !== undefined;const composePortalScope = () =>- isMobileDrawer() ? ('local' as const) : undefined;+ isMobileCompose() ? ('local' as const) : undefined;const scrollAreaSignatureHtml = () =>- isMobileDrawer() ? signatureHtml() : undefined;+ isMobileCompose() ? signatureHtml() : undefined;const footerSignatureHtml = () =>- isMobileDrawer() ? undefined : signatureHtml();+ isMobileCompose() ? undefined : signatureHtml();// File sharing and editor plugin wiring belong to this view. The controller only// needs to know when editor content has changed and requires another save.const editorConfig = buildConfig('markdown')@@ -335,6 +368,10 @@ function LoadedReplyInputView(props: ReplyInputViewProps) {scopeId: composeHotkeyScope,description: 'Close reply',keyDownHandler: () => {+ if (isMobileCompose()) {+ requestClose();+ return true;+ }const draft = collectDraft();const isEmpty = draft === null;@@ -430,8 +467,13 @@ function LoadedReplyInputView(props: ReplyInputViewProps) {<Surfaceclass={cn('relative flex flex-col flex-1 max-w-full min-h-0',- isMobileDrawer() && 'min-h-full overflow-y-scroll overscroll-y-none',- props.unframed ? 'rounded-lg' : 'rounded-xl bg-menu-glass glass-input'+ isMobileCompose() &&+ 'h-full overflow-y-auto overscroll-y-none pb-[max(16px,var(--safe-bottom,0px))]',+ isMobileCompose()+ ? 'rounded-none'+ : props.unframed+ ? 'rounded-lg'+ : 'rounded-xl bg-menu-glass glass-input')}style={props.unframed ? { 'background-color': 'transparent' } : undefined@@ -439,8 +481,9 @@ function LoadedReplyInputView(props: ReplyInputViewProps) {hideBorder={props.unframed}ref={(el) => {composeContainerRef = el;+ if (isMobileCompose()) setScrollContainer(el);}}- depth={2}+ depth={isMobileCompose() ? 0 : 2}solid><Show when={state.operationSource}>@@ -478,11 +521,10 @@ function LoadedReplyInputView(props: ReplyInputViewProps) {</a></p></Show>- <Show when={isMobileDrawer()}>+ <Show when={isMobileCompose()}><MobileReplyToolbarstatus={<SyncStatus />}- discardLabel={savedDraftId() ? 'Delete draft' : 'Discard draft'}- onDiscard={deleteDraftAndReset}+ onBack={requestClose}attachRef={(element) =>fileSelector(element, () => ({multiple: true,@@ -532,25 +574,27 @@ function LoadedReplyInputView(props: ReplyInputViewProps) {scheduleDraftSave();}}showSubject={!!props.isEditingExisting}- mobile={isMobileDrawer}+ mobile={isMobileCompose}portalScope={composePortalScope}replyType={state.replyType}disabled={editingDisabled}/><divclass={cn(- isMobileDrawer()+ isMobileCompose()? 'relative flex-1 flex flex-col': 'size-full flex flex-col min-h-0',state.recipients.showExpandedRecipients() && 'mt-4')}><div- ref={setScrollContainer}+ ref={(el) => {+ if (!isMobileCompose()) setScrollContainer(el);+ }}class={cn('relative min-h-8 w-full flex flex-col placeholder:text-ink-placeholder placeholder:opacity-50 px-0 py-1',- isMobileDrawer()- ? 'max-h-none flex-1 overflow-visible px-5 pt-6 pb-4'+ isMobileCompose()+ ? 'max-h-none flex-1 overflow-visible px-4 pt-6 pb-4': cn('overflow-y-auto mobile:max-h-[calc(32*var(--dvh,1dvh))]',composerExpanded()@@ -614,11 +658,11 @@ function LoadedReplyInputView(props: ReplyInputViewProps) {)}disabled={editingDisabled()}placeholder={- isMobileDrawer()+ isMobileCompose()? 'Use `@` to reference files': 'Reply — @mention to share or cc people'}- portalScope={isMobileDrawer() ? 'local' : 'split'}+ portalScope={isMobileCompose() ? 'local' : 'split'}refFn={(el) => props.markdownDomRef?.(el)}onConnect={handleEditorConnect}/>@@ -633,7 +677,7 @@ function LoadedReplyInputView(props: ReplyInputViewProps) {/></div></Show>- <Show when={isMobileDrawer()}>+ <Show when={isMobileCompose()}><AttachmentsRow /></Show><Show when={scrollAreaSignatureHtml()}>@@ -706,7 +750,7 @@ function LoadedReplyInputView(props: ReplyInputViewProps) {</Tooltip></div></Show>- <Show when={!isMobileDrawer()}>+ <Show when={!isMobileCompose()}>{/* Below the scroll area so quoted email content can never overlap it */}<AttachmentsRow class="px-4" /><Show when={footerSignatureHtml()}>@@ -776,7 +820,22 @@ function LoadedReplyInputView(props: ReplyInputViewProps) {</Show></div></Surface>- <Show when={!isMobileDrawer()}>+ <Show when={isMobileCompose()}>+ <DraftBackMenu+ mount={props.mobileCompose?.portalMount()}+ open={draftBackMenuOpen()}+ onOpenChange={setDraftBackMenuOpen}+ onSave={saveAndClose}+ onDelete={async () => {+ try {+ await deleteDraftAndReset();+ } catch {+ setDraftBackMenuOpen(false);+ }+ }}+ />+ </Show>+ <Show when={!isMobileCompose()}>{/* The desktop reply sits in its message card; the bar spans the card'spadding so it reads as the card's footer, like the standalonecomposer's drawer. */}diff --git a/apps/web/src/features/email-thread/primitives/reply-actions.test.ts b/apps/web/src/features/email-thread/primitives/reply-actions.test.tsindex a3e06a2696..be1176130f 100644--- a/apps/web/src/features/email-thread/primitives/reply-actions.test.ts+++ b/apps/web/src/features/email-thread/primitives/reply-actions.test.ts@@ -19,8 +19,8 @@ function setup() {describe('openEmailReplyComposerForMessage', () => {// Tablets are touch at desktop widths. The inline reply input never renders- // on touch, so replying there must open the compose drawer.- it('opens the compose drawer on touch', () => {+ // on touch, so replying there must open the full-screen composer.+ it('opens the full-screen composer on touch', () => {const { ctx, state } = setup();openEmailReplyComposerForMessage({diff --git a/apps/web/src/features/email-thread/primitives/reply-actions.ts b/apps/web/src/features/email-thread/primitives/reply-actions.tsindex 095257a9d8..040c96bf18 100644--- a/apps/web/src/features/email-thread/primitives/reply-actions.ts+++ b/apps/web/src/features/email-thread/primitives/reply-actions.ts@@ -6,7 +6,7 @@ import type { EmailThreadState } from './email-thread-state';export function openEmailReplyComposerForMessage(args: {ctx: EmailThreadState;- /** Touch layouts reply in the compose drawer; the inline reply input only+ /** Touch layouts reply in the full-screen composer; the inline reply input only* renders for non-touch. Phone width alone is not the gate: tablets are* touch at desktop widths. */isTouch: boolean;diff --git a/apps/web/src/features/email-thread/primitives/thread-reply-area.ts b/apps/web/src/features/email-thread/primitives/thread-reply-area.tsindex f5b3612f47..ea06ed535a 100644--- a/apps/web/src/features/email-thread/primitives/thread-reply-area.ts+++ b/apps/web/src/features/email-thread/primitives/thread-reply-area.ts@@ -1,7 +1,7 @@import { type Accessor, createEffect, createMemo } from 'solid-js';import type { EmailMessage } from '../../email-message/core/email-message';-/** Owns bottom/drawer reply placement independently of thread navigation. */+/** Owns bottom/full-screen reply placement independently of thread navigation. */export function createThreadReplyArea(options: {threadId: Accessor<string>;isTouch: Accessor<boolean>;diff --git a/apps/web/src/features/email-thread/views/bottom-reply-buttons.tsx b/apps/web/src/features/email-thread/views/bottom-reply-buttons.tsxindex 7d207a0de6..b4d95d8e20 100644--- a/apps/web/src/features/email-thread/views/bottom-reply-buttons.tsx+++ b/apps/web/src/features/email-thread/views/bottom-reply-buttons.tsx@@ -28,17 +28,15 @@ function ReplyActionButton(props: {const viewContext = useEmailThreadViewContext();return (<Button- // Button wraps itself in Layer depth={0} by default; in the floating- // accessory region, match the chrome's depth so the island surface- // matches the dock buttons. (The region host's Layer can't help —- // Button's own Layer would reset it.)+ // Button owns its Layer; floating actions use the dock's chrome depth.depth={viewContext.thread.isTouch() ? 3 : undefined}variant="outline"+ glass={false}aria-label={props.ariaLabel}disabled={props.disabled}class={cn(// Island pills when floating in the mobile/tablet accessory region.- 'touch:island touch:h-8 touch:border-0',+ 'touch:island touch:bg-chrome touch:text-ink touch:h-8 touch:border-0',!props.label && 'touch:w-9 touch:p-0')}onClick={props.onClick}diff --git a/apps/web/src/features/email-thread/views/email-thread.tsx b/apps/web/src/features/email-thread/views/email-thread.tsxindex c25032d33c..6d46c99af5 100644--- a/apps/web/src/features/email-thread/views/email-thread.tsx+++ b/apps/web/src/features/email-thread/views/email-thread.tsx@@ -10,7 +10,7 @@ import { createThreadNavigation } from '../primitives/thread-navigation';import { createThreadReplyArea } from '../primitives/thread-reply-area';import { BottomReplyButtons } from './bottom-reply-buttons';import { MessageList } from './message-list';-import { MobileEmailComposeDrawer } from './mobile-email-compose-drawer';+import { MobileEmailCompose } from './mobile-email-compose';export type EmailThreadViewProps = {title: string;threadId: Accessor<string>;@@ -139,7 +139,7 @@ export function EmailThreadView(props: EmailThreadViewProps) {)}</Show><Show when={isTouchDevice()}>- <MobileEmailComposeDrawer+ <MobileEmailComposemarkdownDomRef={(el) => {navigation.setMarkdownDomRef(el);}}diff --git a/apps/web/src/features/email-thread/views/message-container.tsx b/apps/web/src/features/email-thread/views/message-container.tsxindex 8d45047b64..0b411fd4d2 100644--- a/apps/web/src/features/email-thread/views/message-container.tsx+++ b/apps/web/src/features/email-thread/views/message-container.tsx@@ -57,7 +57,7 @@ export function MessageContainer(props: MessageContainerProps) {context.drafts.initialDraftsSettled());- // Touch replies live in a drawer, so a saved one would otherwise be invisible.+ // Touch replies open full screen, so a saved one would otherwise be invisible.const touchDraft = () =>isTouchDevice() && context.permissions().isOwner ? draftChild() : undefined;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.tsxdeleted file mode 100644index 80ee7449f8..0000000000--- a/apps/web/src/features/email-thread/views/mobile-email-compose-drawer.tsx+++ /dev/null@@ -1,95 +0,0 @@-import {- MobileDrawer,- scrollToFocusedInput,-} from '@components/app/mobile/MobileDrawer';-import { FloatingInputLoader } from '@core/component/FloatingInputLoader';-import { createMemo, Show } from 'solid-js';-import { useEmailThreadState } from '../context/email-thread-state-context';-import { ThreadReplyInput } from './thread-reply-input';--export function MobileEmailComposeDrawer(props: {- markdownDomRef?: (ref: HTMLDivElement) => void | HTMLDivElement;-}) {- const context = useEmailThreadState();-- const replyInfo = createMemo(() => {- const messageId = context.mobileReplyComposer.messageId();- if (!messageId || !context.permissions().isOwner) return;-- const replyingTo = context.messages- .unfiltered()- .find((message) => message.db_id === messageId);- if (!replyingTo) return;-- return {- replyingTo,- draft: context.drafts.getDraftForMessage(messageId),- };- });-- const setDrawerOpen = (open: boolean) => {- if (open) {- context.mobileReplyComposer.setOpen(true);- return;- }-- context.mobileReplyComposer.close();- context.messages.setBottomReplyOpen(false);- };-- return (- <Show when={replyInfo()}>- {(info) => (- <MobileDrawer- side="bottom"- open={context.mobileReplyComposer.open()}- onOpenChange={setDrawerOpen}- closeOnOutsidePointerStrategy="pointerdown"- preventScroll={false}- preventScrollbarShift={false}- breakPoints={[0.85]}- >- <MobileDrawer.Portal>- <MobileDrawer.Overlay />- <MobileDrawer.Content- aria-label="Reply composer"- maxHeight={90}- targetHeight={90}- >- <MobileDrawer.Handle class="pb-1" />-- <div class="relative flex-1 min-h-0">- <FloatingInputLoader- isLoading={context.query.isFetching}- loadingText="Loading messages"- />- <div- class="overflow-y-auto scrollbar-hidden h-full pb-1"- onFocusIn={(e) => scrollToFocusedInput(e)}- >- <ThreadReplyInput- replyingTo={() => info().replyingTo}- draft={info().draft}- setShowReply={(value) => {- const next =- typeof value === 'function'- ? value(context.mobileReplyComposer.open())- : value;- setDrawerOpen(next);- return next;- }}- markdownDomRef={props.markdownDomRef}- unframed- mobileDrawer={{- onClose: () => setDrawerOpen(false),- }}- />- </div>- </div>- </MobileDrawer.Content>- </MobileDrawer.Portal>- </MobileDrawer>- )}- </Show>- );-}diff --git a/apps/web/src/features/email-thread/views/mobile-email-compose.test.tsx b/apps/web/src/features/email-thread/views/mobile-email-compose.test.tsxnew file mode 100644index 0000000000..4f5b0dac13--- /dev/null+++ b/apps/web/src/features/email-thread/views/mobile-email-compose.test.tsx@@ -0,0 +1,178 @@+import {+ cleanup,+ fireEvent,+ render,+ screen,+ waitFor,+} from '@solidjs/testing-library';+import { type ComponentProps, createSignal, onMount } from 'solid-js';+import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import { DraftBackMenu } from '../../email-compose/components/draft-back-menu';+import { MobileReplyToolbar } from '../../email-compose/components/mobile-reply-toolbar';+import { message } from '../tests/fixtures';+import { MobileEmailCompose } from './mobile-email-compose';+import type { ThreadReplyInput } from './thread-reply-input';++vi.mock('@core/mobile/isMobile', () => ({ isMobile: () => true }));+vi.mock('@core/mobile/isTouchDevice', () => ({ isTouchDevice: () => true }));+vi.mock('@core/mobile/haptics', () => ({ hapticImpact: vi.fn() }));+vi.mock('@core/component/FloatingInputLoader', () => ({+ FloatingInputLoader: () => null,+}));+vi.mock('../context/email-thread-state-context', () => ({+ useEmailThreadState: () => state,+}));++const [open, setOpen] = createSignal(false);+const [messageId, setMessageId] = createSignal<string>();+const [savedText, setSavedText] = createSignal('Saved reply');+const [fetching, setFetching] = createSignal(false);+const parent = message('parent');+const state = {+ mobileReplyComposer: {+ open,+ setOpen,+ messageId,+ close: () => {+ setOpen(false);+ setMessageId(undefined);+ },+ },+ permissions: () => ({ isOwner: true }),+ messages: { unfiltered: () => [parent], setBottomReplyOpen: vi.fn() },+ drafts: {+ getDraftForMessage: () =>+ message('draft', { is_draft: true, body_text: savedText() }),+ },+ query: {+ get isFetching() {+ return fetching();+ },+ },+};++// The shell owns full-screen presentation and close routing. The real draft+// controller/editor lifetime is covered by thread-reply-input and compose tests.+vi.mock('./thread-reply-input', () => ({+ ThreadReplyInput: (props: ComponentProps<typeof ThreadReplyInput>) => {+ const seed = props.draft?.body_text ?? '';+ const [menuOpen, setMenuOpen] = createSignal(false);+ const close = () => setMenuOpen(!menuOpen());+ onMount(() => props.mobileCompose?.registerClose(close));+ return (+ <>+ <MobileReplyToolbar+ onBack={close}+ attachRef={() => {}}+ onSend={() => props.setShowReply?.(false)}+ sendLabel="Send email"+ sendDisabled={false}+ sending={false}+ editingDisabled={false}+ />+ <label>+ Message+ <textarea+ value={seed}+ onInput={(event) => setSavedText(event.currentTarget.value)}+ />+ </label>+ <DraftBackMenu+ mount={props.mobileCompose?.portalMount()}+ open={menuOpen()}+ onOpenChange={setMenuOpen}+ onSave={async () => props.mobileCompose?.onClose()}+ onDelete={async () => {+ setSavedText('');+ props.mobileCompose?.onClose();+ }}+ />+ </>+ );+ },+}));++let motionStyles: HTMLStyleElement;+beforeEach(() => {+ motionStyles = document.createElement('style');+ motionStyles.textContent =+ '[data-corvu-drawer-content], [data-corvu-drawer-overlay] { transition-duration: 0s; animation-name: none; }';+ document.head.append(motionStyles);+ setOpen(false);+ setMessageId(undefined);+ setSavedText('Saved reply');+ setFetching(false);+ vi.stubGlobal('scrollTo', vi.fn());+ vi.stubGlobal(+ 'ResizeObserver',+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ }+ );+});+afterEach(() => {+ cleanup();+ motionStyles.remove();+ vi.unstubAllGlobals();+});++function mount() {+ render(() => (+ <>+ <button+ onClick={() => {+ setMessageId('parent');+ setOpen(true);+ }}+ >+ Reply+ </button>+ <MobileEmailCompose />+ </>+ ));+}++it('opens at full screen, keeps the editor during refresh, and returns to the same draft', async () => {+ mount();+ fireEvent.click(screen.getByRole('button', { name: 'Reply' }));+ const composer = screen.getByRole('dialog', { name: 'Reply composer' });+ expect(composer.closest('[data-corvu-drawer-content]')).toBeNull();+ const input = screen.getByRole('textbox', { name: 'Message' });+ fireEvent.input(input, { target: { value: 'Reply in progress' } });+ setFetching(true);+ setFetching(false);+ expect(screen.getByRole('textbox', { name: 'Message' })).toBe(input);+ fireEvent.click(screen.getByRole('button', { name: 'Go Back' }));+ fireEvent.click(await screen.findByRole('button', { name: 'Save Draft' }));+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+ expect(state.messages.setBottomReplyOpen).toHaveBeenCalledWith(false);+ fireEvent.click(screen.getByRole('button', { name: 'Reply' }));+ expect(+ (screen.getByRole('textbox', { name: 'Message' }) as HTMLTextAreaElement)+ .value+ ).toBe('Reply in progress');+ fireEvent.click(screen.getByRole('button', { name: 'Send email' }));+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+});++it('routes Escape to draft choices and dismisses those before the composer', async () => {+ mount();+ fireEvent.click(screen.getByRole('button', { name: 'Reply' }));+ fireEvent.keyDown(document, { key: 'Escape' });+ const save = await screen.findByRole('button', { name: 'Save Draft' });+ await waitFor(() =>+ expect(document.activeElement).toBe(+ screen.getByRole('button', { name: 'Delete Draft' })+ )+ );+ fireEvent.keyDown(save, { key: 'Escape' });+ await waitFor(() =>+ expect(screen.queryByRole('button', { name: 'Save Draft' })).toBeNull()+ );+ expect(screen.getByRole('dialog', { name: 'Reply composer' })).toBeTruthy();+ fireEvent.keyDown(document, { key: 'Escape' });+ fireEvent.click(await screen.findByRole('button', { name: 'Save Draft' }));+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull());+});diff --git a/apps/web/src/features/email-thread/views/mobile-email-compose.tsx b/apps/web/src/features/email-thread/views/mobile-email-compose.tsxnew file mode 100644index 0000000000..8e93a6346e--- /dev/null+++ b/apps/web/src/features/email-thread/views/mobile-email-compose.tsx@@ -0,0 +1,92 @@+import { FloatingInputLoader } from '@core/component/FloatingInputLoader';+import { Dialog } from '@ui';+import { createMemo, createSignal, onCleanup, Show } from 'solid-js';+import { useEmailThreadState } from '../context/email-thread-state-context';+import { ThreadReplyInput } from './thread-reply-input';++export function MobileEmailCompose(props: {+ markdownDomRef?: (ref: HTMLDivElement) => void | HTMLDivElement;+}) {+ const context = useEmailThreadState();+ const [contentRef, setContentRef] = createSignal<HTMLDivElement>();++ const replyInfo = createMemo(() => {+ const messageId = context.mobileReplyComposer.messageId();+ if (!messageId || !context.permissions().isOwner) return;++ const replyingTo = context.messages+ .unfiltered()+ .find((message) => message.db_id === messageId);+ if (!replyingTo) return;++ return {+ replyingTo,+ draft: context.drafts.getDraftForMessage(messageId),+ };+ });++ const setComposerOpen = (open: boolean) => {+ if (open) {+ context.mobileReplyComposer.setOpen(true);+ return;+ }++ context.mobileReplyComposer.close();+ context.messages.setBottomReplyOpen(false);+ };++ let requestClose = () => setComposerOpen(false);++ return (+ <Show when={replyInfo()}>+ {(info) => (+ <Dialog+ fullscreen+ contentRef={setContentRef}+ open={context.mobileReplyComposer.open()}+ onOpenChange={(open) =>+ open ? setComposerOpen(true) : requestClose()+ }+ onEscapeKeyDown={(event) => {+ if (event.defaultPrevented) return;+ event.preventDefault();+ requestClose();+ }}+ class="flex flex-col overflow-hidden bg-surface text-ink"+ >+ <Dialog.Title class="sr-only">Reply composer</Dialog.Title>+ <div class="relative flex min-h-0 flex-1 flex-col">+ <FloatingInputLoader+ isLoading={context.query.isFetching}+ loadingText="Loading messages"+ />+ <ThreadReplyInput+ replyingTo={() => info().replyingTo}+ draft={info().draft}+ setShowReply={(value) => {+ const next =+ typeof value === 'function'+ ? value(context.mobileReplyComposer.open())+ : value;+ setComposerOpen(next);+ return next;+ }}+ markdownDomRef={props.markdownDomRef}+ unframed+ mobileCompose={{+ portalMount: contentRef,+ onClose: () => setComposerOpen(false),+ registerClose: (handler) => {+ requestClose = handler;+ onCleanup(() => {+ requestClose = () => setComposerOpen(false);+ });+ },+ }}+ />+ </div>+ </Dialog>+ )}+ </Show>+ );+}diff --git a/apps/web/src/features/email-thread/views/standalone-draft-navigation.test.tsx b/apps/web/src/features/email-thread/views/standalone-draft-navigation.test.tsxindex d7f4c1b310..cbe5fe47d4 100644--- a/apps/web/src/features/email-thread/views/standalone-draft-navigation.test.tsx+++ b/apps/web/src/features/email-thread/views/standalone-draft-navigation.test.tsx@@ -30,8 +30,8 @@ vi.mock('@core/component/CustomScrollbar', () => ({}));vi.mock('./message-list', () => ({ MessageList: () => null }));vi.mock('./bottom-reply-buttons', () => ({ BottomReplyButtons: () => null }));-vi.mock('./mobile-email-compose-drawer', () => ({- MobileEmailComposeDrawer: () => null,+vi.mock('./mobile-email-compose', () => ({+ MobileEmailCompose: () => null,}));it.each(['accepted', 'rejected'] as const)(diff --git a/apps/web/src/features/email-thread/views/thread-reply-input.tsx b/apps/web/src/features/email-thread/views/thread-reply-input.tsxindex 01cc5a2de8..7863b7bf1f 100644--- a/apps/web/src/features/email-thread/views/thread-reply-input.tsx+++ b/apps/web/src/features/email-thread/views/thread-reply-input.tsx@@ -22,8 +22,10 @@ interface ThreadReplyInputProps {setShowReply?: Setter<boolean>;markdownDomRef?: (ref: HTMLDivElement) => void | HTMLDivElement;unframed?: boolean;- mobileDrawer?: {+ mobileCompose?: {+ portalMount: Accessor<HTMLDivElement | undefined>;onClose: () => void;+ registerClose: (handler: () => void) => void;};}@@ -99,7 +101,7 @@ function ThreadReplyInputSession(props: ThreadReplyInputProps) {<Show when={ctx.drafts.initialDraftsSettled()}><Show when={seedKey()} keyed>{(seed) => (- <Layer depth={props.mobileDrawer ? 0 : 2}>+ <Layer depth={props.mobileCompose ? 0 : 2}><ReplyInputViewcontext={viewContext.compose}onReloadDraft={() => {@@ -161,7 +163,7 @@ function ThreadReplyInputSession(props: ThreadReplyInputProps) {setShowReply={props.setShowReply}markdownDomRef={props.markdownDomRef}unframed={props.unframed}- mobileDrawer={props.mobileDrawer}+ mobileCompose={props.mobileCompose}isEditingExisting={props.replyingTo() == null && props.draft != null}diff --git a/apps/web/src/index.css b/apps/web/src/index.cssindex 5da71fcb75..1c57c5c70f 100644--- a/apps/web/src/index.css+++ b/apps/web/src/index.css@@ -72,7 +72,8 @@/* Glass chrome, ported from the marketing site's hero CTA ring(solid-site `.home-hero-cta-bar`). The look is four things layered on atranslucent surface: a backdrop blur, a bright inner top edge, a dark- inner bottom edge, and a 135deg specular rim.+ inner bottom edge, and a diagonal specular rim. Touch surfaces use only+ the diagonal reflections with short, dimmer opposing corners.Split in two so the size scale and the theme stay independent:@@ -86,6 +87,7 @@inherited light-mode value, so they must never name a color or astrength directly — palette lives here, and only here. */--glass-tint: var(--color-content-1);+ --glass-press-tint: var(--color-content-1);--glass-shade-color: var(--color-surface-0);--glass-shadow-alpha: 0.55;--glass-highlight-base: 6%;@@ -93,10 +95,10 @@--glass-rim-strong-base: 13.5%;--glass-rim-soft-base: 9%;--glass-rim-shade-base: 0%;- /* Mobile chrome has a continuous rim with two diagonal reflections. */+ --glass-rim-gap-ratio: 0;+ /* Mobile chrome has two diagonal reflections with quiet opposing corners. */--island-rim-strong: 28%;--island-rim-soft: 12%;- --island-rim-faint: 4%;/* Depth-0 defaults for content rendered outside a Layer marker. */--layer-surface: var(--color-surface-0);@@ -115,6 +117,7 @@shared, so every size scales the same way in both themes. */html[data-theme-light='true'] {--glass-tint: white;+ --glass-press-tint: white;--glass-shade-color: var(--color-content-0);--glass-shadow-alpha: 0.28;--glass-highlight-base: 55%;@@ -123,9 +126,10 @@ html[data-theme-light='true'] {--glass-rim-soft-base: 30%;/* A faint ink rim keeps white reflections legible on pale surfaces. */--glass-rim-shade-base: 7%;+ /* Keep quiet corners close to the highlight instead of exposing a dark rim. */+ --glass-rim-gap-ratio: 0.85;--island-rim-strong: 75%;--island-rim-soft: 40%;- --island-rim-faint: 16%;}html[data-platform='ios'],@@ -740,8 +744,8 @@ html[data-theme-light='false'] {utility so it composes with variants — `mobile:island` — instead ofhand-prefixing each part. */@utility island {- /* Dark mode uses glass; light mode keeps its ring and cast shadow. */- @apply min-h-[40px] min-w-[40px] bg-chrome text-ink dark-mode:glass light-mode:ring light-mode:ring-edge/70 light-mode:shadow-[0_4px_20px_8px_oklch(0.15_0_0/0.07)];+ /* Both themes share the diagonal rim; light mode keeps a soft cast shadow. */+ @apply min-h-[40px] min-w-[40px] bg-chrome text-ink glass light-mode:shadow-[0_4px_20px_8px_oklch(0.15_0_0/0.07)];--glass-blur: 18px;--glass-saturate: 1.5;@@ -752,16 +756,15 @@ html[data-theme-light='false'] {var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);}- /* A quiet continuous edge, with broad reflections at the upper-left and- lower-right. Unlike desktop glass, the rim never disappears entirely- between the highlights. Glass owns the rim's geometry and mask. */+ /* Keep a bright rim around most of the shape, with short soft gaps at the+ top-right and bottom-left, including wide pills. Glass owns the mask. */--glass-rim-background: linear-gradient(- 135deg,+ to bottom right,color-mix(in oklch, var(--glass-tint) var(--island-rim-strong), transparent) 0%,- color-mix(in oklch, var(--glass-tint) var(--island-rim-soft), transparent) 18%,- color-mix(in oklch, var(--glass-tint) var(--island-rim-faint), transparent) 42%,- color-mix(in oklch, var(--glass-tint) var(--island-rim-faint), transparent) 58%,- color-mix(in oklch, var(--glass-tint) var(--island-rim-soft), transparent) 82%,+ color-mix(in oklch, var(--glass-tint) var(--island-rim-soft), transparent) 42%,+ color-mix(in oklch, var(--glass-tint) calc(var(--island-rim-soft) * var(--glass-rim-gap-ratio)), transparent) 49%,+ color-mix(in oklch, var(--glass-tint) calc(var(--island-rim-soft) * var(--glass-rim-gap-ratio)), transparent) 51%,+ color-mix(in oklch, var(--glass-tint) var(--island-rim-soft), transparent) 58%,color-mix(in oklch, var(--glass-tint) var(--island-rim-strong), transparent) 100%);}@@ -771,15 +774,17 @@ html[data-theme-light='false'] {length). Shape and background come from the consumer, so this composes withany radius — the rim inherits it — and with variants (`mobile:glass`).- Desktop glass uses the marketing site's hero-ring geometry. Consumers can+ Glass shares a corner-relative diagonal rim. Consumers canoverride --glass-rim-background to customize the rim without owning itspseudo-element. The palette stays in :root; the gradient reads those tokens. */@utility glass {--glass-rim-background: linear-gradient(- 135deg,+ to bottom right,color-mix(in oklch, var(--glass-tint) calc(var(--glass-rim-strong-base) * var(--glass-scale)), transparent) 0%,- transparent 24%,- transparent 76%,+ color-mix(in oklch, var(--glass-tint) calc(var(--glass-rim-soft-base) * var(--glass-scale)), transparent) 42%,+ color-mix(in oklch, var(--glass-tint) calc(var(--glass-rim-soft-base) * var(--glass-scale) * var(--glass-rim-gap-ratio)), transparent) 49%,+ color-mix(in oklch, var(--glass-tint) calc(var(--glass-rim-soft-base) * var(--glass-scale) * var(--glass-rim-gap-ratio)), transparent) 51%,+ color-mix(in oklch, var(--glass-tint) calc(var(--glass-rim-soft-base) * var(--glass-scale)), transparent) 58%,color-mix(in oklch, var(--glass-tint) calc(var(--glass-rim-soft-base) * var(--glass-scale)), transparent) 100%);position: relative;@@ -801,6 +806,11 @@ html[data-theme-light='false'] {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))));+ @variant touch {+ --glass-shadow:+ 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);@@ -908,7 +918,7 @@ html[data-theme-light='false'] {}/* Shared menu appearance: an opaque menu fill with the glass rim, inset- top/bottom highlights, and cast shadow, so menus read as raised in both+ diagonal highlights, and cast shadow, so menus read as raised in boththemes. */@utility menu-surface {@apply glass relative min-h-0 rounded-xl bg-menu text-ink;@@ -988,11 +998,13 @@ html[data-theme-light='true'] :is(.glass-input, .elevated-surface) {initial-value: 0px;}-/* Persistent paint layers belong to the material, including native controls.+/* Native iOS press paint layers belong to the material, including channel inputs.::before paints the live fill, shadow and tap-centered sheen; ::after keepsthe 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(+html[data-platform='ios'][data-touch-device='true'] :is(+ [data-glass-input],+ [data-input] [data-composer-collapsed],[data-mobile-dock-island],[data-header-island],[data-slot='button-group'].glass,@@ -1021,12 +1033,12 @@ html[data-touch-device='true'] :is(position: absolute;z-index: -1;pointer-events: none;- background-color: var(--glass-fill);+ background-color: color-mix(in oklch, var(--glass-press-tint) calc(8% * var(--press-light)), 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%,+ color-mix(in oklch, var(--glass-press-tint) calc(28% * var(--press-light)), transparent),+ color-mix(in oklch, var(--glass-press-tint) calc(12% * var(--press-light)), transparent) 45%,transparent 100%);backdrop-filter: var(--glass-backdrop, none);@@ -1059,7 +1071,7 @@ html[data-touch-device='true'] :is(--press-expansion: var(--press-outset);& svg {- scale: 1.08;+ scale: 1.18;}}&[data-glass-press]::before {@@ -1718,6 +1730,7 @@ html:not([data-touch-device="true"]) [data-message][data-targeted]:hover{/* Immediate touch feedback for mobile soup entity rows */[data-soup-entity].touch-highlight [data-swipe-content],+[data-soup-entity].touch-highlight [data-channel-conversation],[data-soup-entity].touch-highlight .soup-list-entity {background-color: var(--color-hover);transition: none;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.tsxindex 9df37dad80..d86ef9ddb6 100644--- 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.tsx@@ -1,4 +1,5 @@import type { EditorConfigBuilder } from '@core/component/LexicalMarkdown/builder/MarkdownConfigBuilder';+import { hapticImpact } from '@core/mobile/haptics';import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';import { createSignal, type JSX, onCleanup, onMount } from 'solid-js';import { afterEach, describe, expect, it, vi } from 'vitest';@@ -16,6 +17,8 @@ const mocks = vi.hoisted(() => ({stopDictation: () => {},}));+vi.mock('@core/mobile/haptics', () => ({ hapticImpact: vi.fn() }));+vi.mock('@app/features/dictation/composer-dictation', () => ({createComposerDictation: () => {const [active, setActive] = createSignal(false);@@ -262,7 +265,9 @@ describe('Enter', () => {// Not captured, so the editor inserts a newline instead of sending.expect(mocks.enter?.()).toBe(false);expect(onSend).not.toHaveBeenCalled();+ expect(hapticImpact).not.toHaveBeenCalled();fireEvent.click(screen.getByRole('button', { name: 'Send' }));+ expect(hapticImpact).toHaveBeenCalledExactlyOnceWith('light');expect(onSend).toHaveBeenCalledWith(expect.objectContaining({ content: draft }));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 6250f460ed..b93d7f2bbc 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@@ -26,6 +26,7 @@ import { toast } from '@core/component/Toast/Toast';import { fileTypeToBlockName } from '@core/constant/allBlocks';import { PaywallKey, usePaywallState } from '@core/constant/PaywallState';import { TOKENS } from '@core/hotkey/tokens';+import { hapticImpact } from '@core/mobile/haptics';import { isMobile } from '@core/mobile/isMobile';import { isNativeMobilePlatform } from '@core/mobile/isNativeMobilePlatform';import { isTouchDevice } from '@core/mobile/isTouchDevice';@@ -211,6 +212,7 @@ export function ChatInput(props: ChatInputComponentProps) {};props.editor.controls.clear();attachments.setAttached([]);+ hapticImpact('light');props.onSend(sendInput);});diff --git a/apps/web/src/lib/core/directive/touchHandler.ts b/apps/web/src/lib/core/directive/touchHandler.tsindex 89c6794e0e..bb6ba9d504 100644--- a/apps/web/src/lib/core/directive/touchHandler.ts+++ b/apps/web/src/lib/core/directive/touchHandler.ts@@ -217,6 +217,8 @@ export function touchHandler(element.addEventListener('touchcancel', handleTouchCancel, { passive: true });onCleanup(() => {+ clearState();+ cancelTouchClassExit();cancelTouchClassEnter();endTouchClass();element.removeEventListener('touchstart', handleTouchStart);@@ -224,4 +226,7 @@ export function touchHandler(element.removeEventListener('touchend', handleTouchEnd);element.removeEventListener('touchcancel', handleTouchCancel);});++ // Drag sensors can abort a pending hold when the window or gesture changes.+ return handleTouchCancel;}diff --git a/apps/web/src/lib/core/util/message-send-motion.test.tsx b/apps/web/src/lib/core/util/message-send-motion.test.tsxindex 693d921ef3..ca64413f8a 100644--- a/apps/web/src/lib/core/util/message-send-motion.test.tsx+++ b/apps/web/src/lib/core/util/message-send-motion.test.tsx@@ -1,8 +1,14 @@+import { isTouchDevice } from '@core/mobile/isTouchDevice';import { cleanup, render } from '@solidjs/testing-library';import { createSignal } from 'solid-js';-import { afterEach, describe, expect, it, vi } from 'vitest';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';import { markMessageSent, messageSendMotion } from './message-send-motion';+vi.mock('@core/mobile/isTouchDevice', () => ({+ isTouchDevice: vi.fn(() => false),+}));+beforeEach(() => vi.mocked(isTouchDevice).mockReturnValue(false));+function Message(props: { id: string | undefined }) {return <div ref={(el) => messageSendMotion(el, () => props.id)}>Message</div>;}@@ -38,7 +44,8 @@ afterEach(() => {vi.useRealTimers();});-describe('local send motion', () => {+describe.each([false, true])('local send motion (touch: %s)', (touch) => {+ beforeEach(() => vi.mocked(isTouchDevice).mockReturnValue(touch));it('leaves history still and animates a send once, including after a remount', () => {const { animate } = setup();const history = render(() => <Message id="history" />);@@ -103,6 +110,7 @@ describe('local send motion', () => {});it('slides without scaling and cancels on unmount', () => {+ vi.mocked(isTouchDevice).mockReturnValue(false);const { animate, cancel } = setup();markMessageSent('channel');const view = render(() => <Message id="channel" />);diff --git a/apps/web/src/lib/core/util/message-send-motion.ts b/apps/web/src/lib/core/util/message-send-motion.tsindex e6ebbba25b..f18e48c309 100644--- a/apps/web/src/lib/core/util/message-send-motion.ts+++ b/apps/web/src/lib/core/util/message-send-motion.ts@@ -1,3 +1,4 @@+import { isTouchDevice } from '@core/mobile/isTouchDevice';import { ReactiveMap } from '@solid-primitives/map';import { type Accessor, createEffect, on, onCleanup, untrack } from 'solid-js';@@ -50,16 +51,43 @@ export function messageSendMotion(return;animation?.cancel();- animation = element.animate(- [- { opacity: 0, transform: 'translateY(10px)' },- { opacity: 1, transform: 'translateY(0)' },- ],- {- duration: 300,- easing: 'cubic-bezier(0.22, 1, 0.36, 1)',- }- );+ // Keep the text at its final size and the virtual row at its final+ // height. Touch sends lift into place, then settle by just one pixel.+ animation = isTouchDevice()+ ? element.animate(+ [+ {+ opacity: 0,+ transform: 'translateY(24px)',+ offset: 0,+ easing: 'cubic-bezier(0.16, 0.8, 0.3, 1)',+ },+ {+ opacity: 1,+ transform: 'translateY(4px)',+ offset: 0.4,+ easing: 'cubic-bezier(0.2, 0.7, 0.3, 1)',+ },+ {+ opacity: 1,+ transform: 'translateY(-1px)',+ offset: 0.75,+ easing: 'ease-in-out',+ },+ { opacity: 1, transform: 'translateY(0)', offset: 1 },+ ],+ { duration: 360, easing: 'linear' }+ )+ : element.animate(+ [+ { opacity: 0, transform: 'translateY(10px)' },+ { opacity: 1, transform: 'translateY(0)' },+ ],+ {+ duration: 300,+ easing: 'cubic-bezier(0.22, 1, 0.36, 1)',+ }+ );}));diff --git a/docs/agent-guide/ai-chat.md b/docs/agent-guide/ai-chat.mdindex f62d1adb98..38bd6f34a9 100644--- a/docs/agent-guide/ai-chat.md+++ b/docs/agent-guide/ai-chat.md@@ -615,7 +615,8 @@ draft or widening the pane restores the compact layout when the text fitsbeside its controls. Leaving the AI composer collapses a long draft toa single-line preview in the accessory row; tapping it expands the same editorwith the full draft intact. Screens with an available composer or reply controls show those-instead; opening mobile search shows category pills in their place. On Agents,+instead; opening mobile search hides those controls, puts category pills above+the results, and keeps the query input in the dock. On Agents,the AI composer returns with its draft intact when higher-priority controls close.Other views have no floating AI fallback. Type aprompt, optionally choose a model or@@ -1653,8 +1654,9 @@ must stay hidden; subsequent live messages must still appear.permission policy selector. The backend enforces these policies.Locally sent user messages in both AI implementations enter with a short upward-slide and fade. History and remounted messages stay-still; reduced-motion preferences disable the transition.+slide and fade. On touch devices, messages lift into place with a gentle settle;+the text reaches full opacity early and keeps its final size. History and+remounted messages stay still; reduced-motion preferences disable the transition.On phones, the chat model control appears as a provider icon while the softwarekeyboard is open. Its accessible name is `Choose model, <model name>`. It opensdiff --git a/docs/agent-guide/channels.md b/docs/agent-guide/channels.mdindex 1062bbe6c6..116b10bdd8 100644--- a/docs/agent-guide/channels.md+++ b/docs/agent-guide/channels.md@@ -255,6 +255,10 @@ toolbar, consistent at narrow and wide composer widths.The new-message compose screen and channel message/reply inputs use the sameattachment and send controls on mobile and desktop, with no format toggle.iOS uses the native media attachment picker.+In the iOS app, both collapsed and expanded channel inputs use the shared+[glass press spotlight](navigation.md#mobile-glass-feedback). Tap the editor and its+enabled actions to check the highlight; the caret, draft, keyboard, and action+timing should remain unchanged. Flat embedded inputs keep their host's surface.Short top-level drafts place attachment, message text, and send on one row onboth mobile and desktop. Text that wraps onto a second line, explicit linebreaks, non-paragraph blocks (lists, blockquotes, headings, etc.), and attachments@@ -270,7 +274,15 @@ opens a menu on desktop and a bottom drawer on mobile: `Mention` (opens the `@`picker; the iOS media picker on iOS), then under `Create` the same actions as`/task`, `/poll`, `/form` and `/document` (poll and form only with forms on),then `Ask Macro` (inserts an `@Macro` mention) and, in a channel, `Start a call`-(`Join call` while one is live).+(`Join call` while one is live). On phones, starting a new call opens a+confirmation sheet with centered participant avatars, notification copy, and a+full-width green **Start call** button, without a divider or close/cancel buttons.+Show up to four avatars including yourself. With more than four participants,+show three unobscured avatars and overlay **+N** on the fourth; N includes everyone+after the first three (five participants shows **+2**).+Drag the handle, tap the backdrop, or press Escape to dismiss without starting a+call. Only confirming notifies participants; joining a live call skips the sheet.+Check both DMs and channels, including long names, in light and dark themes.Input action and formatting buttons show the app tooltip without a secondnative browser tooltip.On desktop, select draft text to open the floating formatting toolbar. Its@@ -314,6 +326,11 @@ avatars and status; previews refresh periodically while the browser tab is activto update titles and access.Placeholder `Type @ to share with #<name>`. Click it, `type_text`, press Enter to send.+On touch devices, Send activates on release, not when pressed down. Holding or+cancelling a press does not send; releasing outside the button keeps the draft.+The composer keeps keyboard focus when sending. New local messages lift into place+with a gentle settle on touch devices; history stays still and Reduce Motion+disables the entrance animation.The message renders immediately with avatar, email, timestamp. Composer extras: `Attachfiles` and the `Send message` button. Replies also include a close-reply control.@@ -941,6 +958,9 @@ On touch layouts, Channels shows only the Recent conversation feed, with channeland DM message previews. There are no view tabs or reserved tab-header space;older saved tab selections and mobile-tab links cannot change the list. It loadsmore as the list approaches the end and supports pull to refresh.+Rows use the same touch highlight as Home and Email: taps retain feedback while+opening, holds stay highlighted for the action menu, and scrolling or cancelling+a touch clears the press highlight.The mobile dock Search button opens the independent Search route. Its Channelsand People categories search cached channel names and people directly; theconversation list does not constrain results. Full-text search is explicit,diff --git a/docs/agent-guide/email.md b/docs/agent-guide/email.mdindex 60278265d0..c7994ae631 100644--- a/docs/agent-guide/email.md+++ b/docs/agent-guide/email.md@@ -358,7 +358,18 @@ separators and 16px side gutters; collapsed previews show one line. Desktopkeeps rounded cards matching the chat composer: soft shadows in light mode,the same subtle 3D rim in dark mode, and a faint hover tint. Desktop selectiondoes not add an accent-colored ring; keyboard focus has a neutral outline.-Replies appear inline on desktop and in a composer drawer on touch devices.+On touch, the floating Reply, Forward, previous/next email, and done controls+use the mobile dock's chrome fill and icon color in both themes.+Replies appear inline on desktop and in a full-screen composer on touch devices,+including tablets. Reply, Reply all, and Forward use the same grouped header+actions as new email: attach, schedule, and send. The schedule clock matches+Attach's touch icon size. The Back control returns to the thread; when a reply+has content, choose Save Draft or Delete Draft. Escape+and Android Back follow the same close flow, including Escape with a header+button focused. Closing an empty reply discards its local/server draft and+removes its Draft preview from the thread. Saving must finish before leaving;+a failed local save keeps the composer and draft options open. The message list+stays mounted underneath so closing a reply preserves its scroll position.On touch, a saved reply shows as a **Draft** row with its opening words under themessage it answers (which stays expanded); tapping it reopens the draft.On desktop, a saved reply that reappears with its thread (opening it, steppingdiff --git a/docs/agent-guide/navigation.md b/docs/agent-guide/navigation.mdindex fca3b7b71d..7642316af0 100644--- a/docs/agent-guide/navigation.md+++ b/docs/agent-guide/navigation.md@@ -547,22 +547,39 @@ search mode, and shortcuts; Left/Right also navigates its cards outside search.The inline `/app/debug/create-menu-demo` keeps all three layouts for comparisonwithout creating data. Mobile continues to use its create sheet.-On mobile, the bottom dock fits fixed-width buttons in this order: Notifications,-Calendar, Email, Channels, Agents, Files, Tasks, Calls, and CRM (when enabled). Calendar appears in the-dock only when the calendar UI flag is enabled. Search has its own entity categories.-Resizing the screen moves views between the dock-and More views, which always includes Settings and lists the overflow views in-reverse order. More and the separate bottom-right Search button always retain-their space. Search opens the persistent Search… input and entity category pills (see [Search](search.md)).-Once every view fits, the navigation island stops growing; Search stays aligned-to the right edge.-Scheduling is a drawer-only destination in **More views** when the-calendar-scheduling feature flag is enabled; it does not add a search-scope pill or-a fixed dock button. It opens `/app/scheduling`, highlights while Scheduling is-active, and uses header islands for its section and Personal/team owner drawers.--Primary dock navigation buttons, including Search, give haptic feedback on-pointer down and activate on click/release. Holding a button only shows its+On mobile, the bottom dock defaults to Notifications, Calendar, Email, Channels,+Agents, Files, Tasks, Calls, CRM, Reviews, and Scheduling. Feature-gated views+appear only when enabled. The navigation island measures its width and fits as+many fixed-size app buttons as possible, reserving room for More. Search stays+in its own island at the right edge and opens the persistent Search… input and+entity category pills (see [Search](search.md)). Once every view fits, the+navigation island stops growing.++Notifications, Email, and Channels use the same reactive unread-presence checks+as the desktop sidebar, via `useNavigationUnread`. Their accent dots clear when+the represented items are read or completed, not merely when opening a view.+Overflow destinations keep their dots in More; More itself has a dot when any+hidden destination is unread. Resizing or reordering moves the indicator with+its destination. These remain presence indicators, with no extra pagination.++Open **More views → Customize dock** to change the order. Drag a row's handle immediately,+without holding first, and move it across the **In dock** / **In More** boundary. The counts use the+same live measurement as the dock and update on resize or rotation. Swiping+elsewhere on a row scrolls normally; dragging a handle scrolls at the list's+edges. Neighboring rows slide into their new positions during a drag, with+reduced motion respected. A tap or small finger movement leaves the order unchanged.+Keyboard users can focus a handle and press Up/Down; Escape during a drag+cancels it. Changes save immediately per user on this device and survive reload.+Search and More stay fixed. Settings and Customize dock stay in More, followed+by overflow destinations in their saved order. **Back to More views** returns to+the menu; **Done** closes the drawer.++Reviews and Scheduling can be moved into the dock when enabled. Scheduling+opens `/app/scheduling`, highlights while active, and uses header islands for its+section and Personal/team owner drawers; it does not add a search-scope pill.++Dock navigation, Search, filter pills, and create-menu taps do not trigger+haptics. Buttons activate on click/release. Holding a button only shows itspressed state; cancelling the touch does not navigate. More views also opens onrelease so holding its trigger cannot drag or dismiss the opening sheet. Mouse,keyboard, and assistive activation use the normal click behavior.@@ -641,17 +658,22 @@ When calls are enabled, `C C` (Create → Call) opens `/app/meet/new`. The callcreated only after `Start call`; Escape closes the Create menu.Project opens the native project composer; Folder remains the Files folder action.-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.+## Mobile glass feedback++In the native iOS app, glass presses animate the enclosing surface over 300ms.+Round buttons grow by 28%; wide pills and grouped controls extend their glass+fill and rim by up to 6px per edge, with 18% 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.+during release or a rapid second tap. The fill changes with a radial spotlight+centered on the touch, brightening the surface in both light and dark themes.+The spotlight follows the finger while it moves within the surface, updating+at most once per animation frame.+These iOS surfaces omit the native tap highlight; the spotlight supplies feedback.+Release, cancellation, dragging outside, or losing window focus restores the+surface. Disabled controls stay still; reduced motion keeps only the static+color feedback. Android and web keep normal tap feedback without this expansion+or spotlight.## Routinesdiff --git a/docs/agent-guide/pull-requests.md b/docs/agent-guide/pull-requests.mdindex ebdef24bc8..50d2f68602 100644--- a/docs/agent-guide/pull-requests.md+++ b/docs/agent-guide/pull-requests.md@@ -2,7 +2,7 @@## Pull requests — `/app/reviews/pr/<foreignEntityId>`-Opening **Reviews** from the mobile dock's **More** drawer starts on **Pull+Opening **Reviews** from the mobile dock or its **More** drawer starts on **Pullrequests** (the **All** scope). Explicit review-tab links keep their selectedscope; desktop's default scope remains **Involves me**.diff --git a/docs/agent-guide/search.md b/docs/agent-guide/search.mdindex b459e52018..4eb575da77 100644--- a/docs/agent-guide/search.md+++ b/docs/agent-guide/search.md@@ -9,9 +9,14 @@ usually faster for jump-to-entity; `/` opens workspace search when no editor isOn touch devices, the dock's **Search** button opens a persistent **Search…**input in `/app/search`. It starts in **All** with Command Menu-style Quick Accessname search. Categories are **All, Email, Agents, Files, Tasks, Projects, Channels,-People**; Projects respects its feature flag. Categories filter entities directly,+People** in a horizontal pill row at the top, below the status-bar safe area;+the query input stays in the bottom dock. Each filter row reads and updates its+own Search history entry, including while another entry is in front. Projects respects its feature flag.+Categories filter entities directly,independently of view tabs, mailbox selections, and saved facets. Commands andcreation shortcuts are excluded. Empty queries show recent entities.+On phones, name-result icons and avatars are scaled to 150% (16px artwork+becomes 24px), preserving row height and text alignment.For a nonempty query, **Search full text for “…”** appears above name results,including when there are no matches. It retains the query and category and stays@@ -85,9 +90,9 @@ retention; select Projects from full-text mode and confirm it shows name resultsRepeat opening with a large recent list: results are virtualized, so transferringkeyboard focus should not mount every cached row. Scroll through later resultsto the end to verify additional pages load automatically without a fixed Load more bar.-Search starts below the status-bar safe area without reserving space for the-hidden view/filter header; check both name and full-text results with the keyboard-open and dismissed. Same-query full-text refreshes keep the current rows visible+Search results start below the floating category row, with the same clearance on+phones and tablets. Check both name and full-text results with the keyboard open+and dismissed; categories stay at the top while the input stays above the keyboard. Same-query full-text refreshes keep the current rows visibleso paging does not collapse the list and reset its scroll position. Appending apage preserves existing row elements, including when the service rematerializestheir data; scroll through multiple pages to check that the position stays put.diff --git a/docs/agent-guide/tasks.md b/docs/agent-guide/tasks.mdindex 731fa0e121..e83b51db42 100644--- a/docs/agent-guide/tasks.md+++ b/docs/agent-guide/tasks.md@@ -336,7 +336,7 @@ those older results must not hide a failure for the new, uncached query.With `enable-tasks-reviews` enabled (on by default in development),`Reviews` is available in desktop navigation and the mobile bottom dock's-`More views` drawer, not the mobile Tasks tabs.+`More views` drawer (or directly in the dock after Customize dock), not the mobile Tasks tabs.It opens a separate `/app/reviews` shell whose sidebar lists `Pull requests`,`Authored by me`, `Assigned to me`, `Involves me`, and `Review requests`;`Involves me` is selected by default. The selected tab is stored in the URL anddiff --git a/docs/agent-guide/ui-conventions.md b/docs/agent-guide/ui-conventions.mdindex fd49f828c8..d8df5df81f 100644--- a/docs/agent-guide/ui-conventions.md+++ b/docs/agent-guide/ui-conventions.md@@ -26,6 +26,18 @@ to enable glass on all devices, or `glass={false}` to disable it everywhere.Embedded and low-emphasis actions use `ghost`; inline calendar-invitation textactions remove the transparent border to keep their text alignment.+Glass rims stay highlighted around most of the perimeter, with short soft gaps+at the top-right and bottom-left corners. Light themes keep a soft highlight+through those corners so they are only slightly dimmer. The iOS app also uses shared+[glass press feedback](navigation.md#mobile-glass-feedback).++## Mobile filters++Adjacent checked options in a filter section share one continuous selection+surface, rounded only at the top and bottom of each run. Unchecking a middle+option splits the surface into separate rounded groups; isolated selections and+single-select rows keep their rounded shape.+## Dialog actionsCancel uses a ghost button. Confirm, save, and create actions use strong: the