Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(ios): edge to edge (#4146)

Peter Chinman19dbcb290a6e
diff --git a/js/app/packages/app/component/Layout.tsx b/js/app/packages/app/component/Layout.tsx
index 8f5ece27b4..f31e8bcf63 100644
--- a/js/app/packages/app/component/Layout.tsx
+++ b/js/app/packages/app/component/Layout.tsx
@@ -16,7 +16,7 @@ import { virtualKeyboardVisible } from '@core/mobile/virtualKeyboard';
import { updateCookie } from '@core/util/cookies';
import { makePersisted } from '@solid-primitives/storage';
import { type RouteSectionProps, useLocation } from '@solidjs/router';
-import { cn, Layer } from '@ui';
+import { cn } from '@ui';
import { ScreencastHotkeys } from '@ui/components/ScreencastHotkeys';
import { attachGlobalDOMScope } from 'core/hotkey/hotkeys';
import {
@@ -40,7 +40,10 @@ import { ItemDndProvider } from './ItemDragAndDrop';
import { IosShareSheet } from './ios-share-sheet/IosShareSheet';
import { createMenuOpen, Launcher, setCreateMenuOpen } from './Launcher';
import { MacroMcpSetupModal } from './macro-mcp-setup-modal/MacroMcpSetupModal';
+import { FloatRegion } from './mobile/float-regions/FloatRegion';
+import { FloatRegionHost } from './mobile/float-regions/FloatRegionHost';
import { MobileDock } from './mobile/MobileDock';
+import { MobileBottomEdgeFade } from './mobile/MobileEdgeFade';
import { MobileSearchOuter } from './mobile/MobileSearch';
import { SwipeDownDismissKeyboard } from './mobile/SwipeDownDismissKeyboard';
import { Paywall } from './paywall/Paywall';
@@ -87,12 +90,7 @@ function LayoutInner(props: RouteSectionProps) {
const isAuthenticated = useIsAuthenticated();
const { paywallOpen, showPaywall } = usePaywallState();
const location = useLocation();
- const shouldUsePanelSafeAreaBackground = createMemo(
- () =>
- isMobile() &&
- isAuthenticated() === true &&
- !AUTH_URLS.includes(location.pathname)
- );
+
useAppSquishHandlers();
// save last_path to cookie
@@ -125,17 +123,9 @@ function LayoutInner(props: RouteSectionProps) {
return (
<div
class={cn(
- 'relative flex flex-col justify-between w-dvw h-[calc(var(--dvh,1dvh)*100)] pt-(--safe-top) pl-(--safe-left) pr-(--safe-right)',
- {
- 'pb-(--safe-bottom)': !virtualKeyboardVisible(),
- }
+ 'relative flex flex-col justify-between w-dvw h-[calc(var(--dvh,1dvh)*100)] pl-(--safe-left) pr-(--safe-right)'
)}
>
- <Show when={shouldUsePanelSafeAreaBackground()}>
- <Layer depth={1}>
- <div class="pointer-events-none absolute inset-x-0 top-0 h-(--safe-top) bg-surface" />
- </Layer>
- </Show>
<BundleUpdateProgressBar />
<Suspense>
<Show when={isAuthenticated()}>
@@ -198,12 +188,15 @@ function LayoutInner(props: RouteSectionProps) {
<Show
when={
isMobile() &&
- !virtualKeyboardVisible() &&
isAuthenticated() &&
!AUTH_URLS.includes(location.pathname)
}
>
- <MobileDock />
+ <FloatRegionHost />
+ <FloatRegion region="dock" active={() => !virtualKeyboardVisible()}>
+ <MobileBottomEdgeFade />
+ <MobileDock />
+ </FloatRegion>
</Show>
<Show when={isMobile()}>
<MobileSearchOuter />
diff --git a/js/app/packages/app/component/ResponsiveBlockToolbar.tsx b/js/app/packages/app/component/ResponsiveBlockToolbar.tsx
index 1b6006a310..62f7f6273c 100644
--- a/js/app/packages/app/component/ResponsiveBlockToolbar.tsx
+++ b/js/app/packages/app/component/ResponsiveBlockToolbar.tsx
@@ -4,6 +4,7 @@ import type { ItemType } from '@service-storage/client';
import { Button, cn } from '@ui';
import { type Component, For, type JSX, Show } from 'solid-js';
import { Dynamic } from 'solid-js/web';
+import { HeaderIsland } from './split-layout/components/HeaderIsland';
import {
type FileOperation,
SplitFileMenu,
@@ -66,7 +67,9 @@ export function ResponsivePermissionsBadge() {
}
>
<SplitHeaderLeft>
- <SplitPermissionsBadge />
+ <HeaderIsland>
+ <SplitPermissionsBadge />
+ </HeaderIsland>
</SplitHeaderLeft>
</Show>
);
@@ -119,15 +122,17 @@ export function ResponsiveBlockToolbar(props: BlockToolbarProps) {
}
>
<SplitHeaderRight>
- <SplitFileMenu
- id={props.id}
- itemType={props.itemType}
- name={props.name}
- formattedName={props.formattedName}
- ops={props.ops}
- tools={props.tools}
- buttonClass="order-last"
- />
+ <HeaderIsland>
+ <SplitFileMenu
+ id={props.id}
+ itemType={props.itemType}
+ name={props.name}
+ formattedName={props.formattedName}
+ ops={props.ops}
+ tools={props.tools}
+ buttonClass="order-last"
+ />
+ </HeaderIsland>
</SplitHeaderRight>
</Show>
);
diff --git a/js/app/packages/app/component/home/home.tsx b/js/app/packages/app/component/home/home.tsx
index 3f4dcf2787..d3dbfed489 100644
--- a/js/app/packages/app/component/home/home.tsx
+++ b/js/app/packages/app/component/home/home.tsx
@@ -120,7 +120,7 @@ function HomeContent() {
`
}</style>
- <div class="@container/home size-full sm:pb-10 p-2 md:p-4">
+ <div class="@container/home size-full p-2 mobile:pb-[calc(var(--mobile-content-inset-bottom)+1rem)] sm:pb-10 md:p-4">
<HomeSectionBoundary title="hero">
<section class="relative flex flex-col size-full">
<div class="home-hero-stagger mx-auto flex flex-col items-center gap-8 justify-end sm:justify-center sm:-mt-15 max-w-2xl size-full">
diff --git a/js/app/packages/app/component/mobile/MobileDock.css b/js/app/packages/app/component/mobile/MobileDock.css
new file mode 100644
index 0000000000..cf43889845
--- /dev/null
+++ b/js/app/packages/app/component/mobile/MobileDock.css
@@ -0,0 +1,34 @@
+@keyframes more-popover-show {
+ from {
+ width: 10rem;
+ height: 5rem;
+ }
+ to {
+ width: var(
+ --more-popover-width,
+ calc(100vw - 2 * var(--mobile-chrome-gutter, 0.75rem))
+ );
+ height: var(--more-popover-height, 23.5rem);
+ }
+}
+@keyframes more-popover-hide {
+ from {
+ width: var(
+ --more-popover-width,
+ calc(100vw - 2 * var(--mobile-chrome-gutter, 0.75rem))
+ );
+ height: var(--more-popover-height, 23.5rem);
+ opacity: 1;
+ }
+ to {
+ width: 0rem;
+ height: 0rem;
+ opacity: 0;
+ }
+}
+.more-popover-content {
+ animation: more-popover-hide 120ms ease-in forwards;
+}
+.more-popover-content[data-expanded] {
+ animation: more-popover-show 150ms cubic-bezier(0.2, 1.05, 1, 1.1);
+}
diff --git a/js/app/packages/app/component/mobile/MobileDock.tsx b/js/app/packages/app/component/mobile/MobileDock.tsx
index 8c19a5fc61..b8413441e1 100644
--- a/js/app/packages/app/component/mobile/MobileDock.tsx
+++ b/js/app/packages/app/component/mobile/MobileDock.tsx
@@ -1,31 +1,60 @@
-import type { ListView } from '@app/constants/list-views';
+import './MobileDock.css';
+import { isListViewID, type ListView } from '@app/constants/list-views';
import { globalSplitManager } from '@app/signal/splitLayout';
+import { useSettingsState } from '@core/constant/SettingsState';
+import { triggerFocusInput } from '@core/directive/focusInput';
import { hapticImpact } from '@core/mobile/haptics';
+import { isNativeMobilePlatform } from '@core/mobile/isNativeMobilePlatform';
import { ICON_ANIMATION_DURATION_MS } from '@icon/animation';
+import IconGear from '@icon/macro-gear.svg';
import { AnimatedCallIcon } from '@icon/wide-call';
import { AnimatedChannelIcon } from '@icon/wide-channel';
import { AnimatedEmailIcon } from '@icon/wide-email';
import { AnimatedFileMdIcon } from '@icon/wide-fileMd';
+import { AnimatedFolderIcon } from '@icon/wide-folder';
import { AnimatedInboxIcon } from '@icon/wide-inbox';
+import { AnimatedSearchIcon } from '@icon/wide-search';
import { AnimatedStarIcon } from '@icon/wide-star';
import { AnimatedTaskIcon } from '@icon/wide-task';
+import CaretUpIcon from '@phosphor/caret-up.svg';
+import HomeIcon from '@phosphor/house.svg';
+import PlusIcon from '@phosphor/plus.svg';
+import { createElementSize } from '@solid-primitives/resize-observer';
import { useLocation } from '@solidjs/router';
import { cn, Layer } from '@ui';
-import { type Component, createSignal, type JSX, Show } from 'solid-js';
-import { Dynamic } from 'solid-js/web';
+import { type Component, createSignal, For, type JSX, Show } from 'solid-js';
+import { Dynamic, Portal } from 'solid-js/web';
+import { setCreateMenuOpen } from '../Launcher';
import { useSplitLayout } from '../split-layout/layout';
+import { SearchState } from './mobileSearchState';
+import { pressPulse } from './pressPulse';
+
+// Keeps the directive import from being tree-shaken / lint-flagged.
+false && pressPulse;
+
+type DockId = ListView | 'home';
+
+type IconComponent = Component<
+ JSX.SvgSVGAttributes<SVGSVGElement> | { triggerAnimation?: boolean }
+>;
type MobileDockButtonProps = {
- icon: Component<
- JSX.SvgSVGAttributes<SVGSVGElement> | { triggerAnimation?: boolean }
- >;
+ icon: IconComponent;
label?: string;
+ /** Accessible name for icon-only buttons (falls back to `label`). */
+ ariaLabel?: string;
onClick: () => void;
active?: boolean;
ref?: HTMLButtonElement | ((el: HTMLButtonElement) => void);
onTouchMove?: (e: TouchEvent) => void;
onTouchEnd?: (e: TouchEvent) => void;
iconClass?: string;
+ class?: string;
+ /** Plain svg icons (Home, Caret) don't accept `triggerAnimation`. */
+ animateIcon?: boolean;
+ /** Fire on pointer-down instead of release. (More menu: opening on press
+ * enables the hold-and-drag row selection gesture.) */
+ fireOnPress?: boolean;
};
function MobileDockButton(props: MobileDockButtonProps) {
@@ -35,34 +64,275 @@ function MobileDockButton(props: MobileDockButtonProps) {
<button
type="button"
ref={props.ref}
+ aria-label={props.ariaLabel ?? props.label}
+ use:pressPulse
onPointerDown={() => {
hapticImpact('light');
- setAnimating(true);
- setTimeout(() => setAnimating(false), ICON_ANIMATION_DURATION_MS);
- props.onClick();
+ if (props.animateIcon !== false) {
+ setAnimating(true);
+ setTimeout(() => setAnimating(false), ICON_ANIMATION_DURATION_MS);
+ }
+ if (props.fireOnPress) props.onClick();
+ }}
+ // Default: fires on release — the press pulse holds the on-state while
+ // touched. (Not on fireOnPress buttons, which already fired above.)
+ onClick={() => {
+ if (!props.fireOnPress) props.onClick();
}}
onTouchMove={props.onTouchMove}
onTouchEnd={props.onTouchEnd}
class={cn(
- 'flex flex-col items-center justify-center flex-1 pt-3 pb-2 bg-surface border-t border-edge-muted',
- props.active && 'text-accent'
+ 'island pointer-events-auto flex items-center justify-center',
+ props.active && 'text-accent',
+ props.class
)}
>
<div class={cn('size-6 [&_svg]:size-6', props.iconClass)}>
- <Dynamic component={props.icon} triggerAnimation={animating()} />
+ {props.animateIcon === false ? (
+ <Dynamic component={props.icon} />
+ ) : (
+ <Dynamic component={props.icon} triggerAnimation={animating()} />
+ )}
</div>
<Show when={props.label}>
- <span class="text-xs">{props.label}</span>
+ <span class="text-sm font-medium">{props.label}</span>
</Show>
</button>
);
}
+const MORE_VIEWS: { id: ListView; label: string; icon: IconComponent }[] = [
+ { id: 'agents', label: 'Agents', icon: AnimatedStarIcon },
+ { id: 'mail', label: 'Email', icon: AnimatedEmailIcon },
+ { id: 'documents', label: 'Documents', icon: AnimatedFileMdIcon },
+ { id: 'tasks', label: 'Tasks', icon: AnimatedTaskIcon },
+ { id: 'channels', label: 'Channels', icon: AnimatedChannelIcon },
+ { id: 'calls', label: 'Calls', icon: AnimatedCallIcon },
+ { id: 'folders', label: 'Folders', icon: AnimatedFolderIcon },
+];
+
+// The More button opens the menu on pointer-down (see fireOnPress), which also
+// arms the hold-and-drag-to-select gesture. The opening touch lifts after the
+// overlay is up, and its trailing synthesized click would land on whatever is
+// now under the finger: a freshly-mounted menu item (accidental selection) or,
+// once a drag-release dismisses the menu, the adjacent Create button. Swallow
+// that one click (capture phase, one-shot) so the opening touch can't leak
+// through. The timeout clears the listener if no ghost click arrives.
+function suppressNextClick() {
+ const onClick = (e: MouseEvent) => {
+ e.stopPropagation();
+ e.preventDefault();
+ cleanup();
+ };
+ const cleanup = () => {
+ document.removeEventListener('click', onClick, true);
+ clearTimeout(timer);
+ };
+ const timer = setTimeout(cleanup, 400);
+ document.addEventListener('click', onClick, true);
+}
+
+function MorePopover(props: {
+ isActive: (id: DockId) => boolean;
+ onNavigate: (id: DockId) => void;
+}) {
+ const { settingsOpen, toggleSettings } = useSettingsState();
+ // `open` drives the show/hide animation (via data-expanded); `mounted`
+ // keeps the overlay in the DOM until the hide animation finishes.
+ const [open, setOpen] = createSignal(false);
+ const [mounted, setMounted] = createSignal(false);
+ const [hoveredId, setHoveredId] = createSignal<string | null>(null);
+ // The menu's natural size, fed to the open/close animation as CSS vars —
+ // the container animates its real width/height between the dock button's
+ // size and these (see MobileDock.css).
+ const [menuRef, setMenuRef] = createSignal<HTMLDivElement>();
+ const menuSize = createElementSize(menuRef);
+
+ const openMenu = () => {
+ setMounted(true);
+ setOpen(true);
+ // Block the opening touch's trailing click (see suppressNextClick).
+ suppressNextClick();
+ };
+
+ const closeMenu = () => {
+ setOpen(false);
+ setHoveredId(null);
+ };
+
+ // Row selection: unmount instantly, no hide animation. The size animation
+ // is layout-bound and would drop frames while navigation mounts the
+ // destination view; the animated close is kept for plain dismissals
+ // (backdrop, caret, More button), where the main thread is idle.
+ const dismissMenu = () => {
+ setOpen(false);
+ setMounted(false);
+ setHoveredId(null);
+ };
+
+ const handleTouchMove = (e: TouchEvent) => {
+ if (!open()) return;
+ const touch = e.touches[0];
+ const el = document.elementFromPoint(touch.clientX, touch.clientY);
+ const button = el?.closest('[data-more-item]') as HTMLElement | null;
+ const id = button?.dataset.moreItem ?? null;
+ if (id !== hoveredId()) {
+ setHoveredId(id);
+ if (id) hapticImpact('light');
+ }
+ };
+
+ // Acts on a row by id. 'settings' toggles the settings panel; list-view ids
+ // navigate. Shared by tap (onClick) and the hold-and-drag-release gesture.
+ const select = (id: string | null) => {
+ if (id === 'settings') {
+ toggleSettings();
+ } else if (isListViewID(id)) {
+ props.onNavigate(id);
+ } else {
+ return;
+ }
+ dismissMenu();
+ };
+
+ const handleTouchEnd = () => {
+ const id = hoveredId();
+ setHoveredId(null);
+ select(id);
+ };
+
+ return (
+ <>
+ <MobileDockButton
+ icon={CaretUpIcon}
+ ariaLabel="More views"
+ animateIcon={false}
+ fireOnPress
+ onClick={() => (open() ? closeMenu() : openMenu())}
+ onTouchMove={handleTouchMove}
+ onTouchEnd={handleTouchEnd}
+ class="size-10 rounded-full"
+ />
+ <Show when={mounted()}>
+ <Portal>
+ {/* Portaled to <body>, outside FloatRegionHost's Layer — re-apply
+ depth 3 so the menu's surface matches the rest of the dock. */}
+ <Layer depth={3}>
+ {/* Backdrop: any tap outside the menu closes it. The bottom
+ padding mirrors FloatRegionHost's, so the menu's bottom edge
+ aligns with the bottom of the dock. */}
+ <div
+ class={cn(
+ 'fixed inset-0 z-modal flex items-end justify-center pb-3',
+ isNativeMobilePlatform() && 'pb-7'
+ )}
+ onPointerDown={(e) => {
+ if (e.target === e.currentTarget) closeMenu();
+ }}
+ >
+ {/* The container is what the open/close animation sizes; it
+ expands upward from the dock line. The inner menu keeps its
+ full size, pinned to the container's left edge (so it rides
+ leftward as the box widens from center) and to its bottom
+ edge (so it stays put vertically and is unmasked top-down as
+ the box grows upward). */}
+ <div
+ class="more-popover-content flex items-end justify-start overflow-hidden rounded-2xl bg-surface ring ring-edge"
+ data-expanded={open() ? '' : undefined}
+ style={{
+ '--more-popover-width': menuSize.width
+ ? `${menuSize.width}px`
+ : undefined,
+ '--more-popover-height': menuSize.height
+ ? `${menuSize.height}px`
+ : undefined,
+ }}
+ onAnimationEnd={(e) => {
+ // Icon animations bubble animationend; only unmount when the
+ // container's own hide animation completes.
+ if (e.target === e.currentTarget && !open())
+ setMounted(false);
+ }}
+ >
+ {/* Width matches the dock: full screen minus its gutters. */}
+ <div
+ class="flex w-[calc(100vw-2*var(--mobile-chrome-gutter))] shrink-0 flex-col gap-1 p-1"
+ ref={setMenuRef}
+ >
+ <button
+ type="button"
+ data-more-item="settings"
+ class={cn(
+ 'flex h-11 items-center gap-2 rounded-lg px-3 text-sm',
+ settingsOpen() ? 'text-accent' : 'text-ink',
+ hoveredId() === 'settings' ? 'bg-hover' : 'hover:bg-hover'
+ )}
+ onClick={() => {
+ hapticImpact('light');
+ select('settings');
+ }}
+ >
+ <div class="size-4 shrink-0 [&_svg]:size-4">
+ <IconGear />
+ </div>
+ <span>Settings</span>
+ </button>
+ <For each={MORE_VIEWS}>
+ {(item) => (
+ <button
+ type="button"
+ data-more-item={item.id}
+ class={cn(
+ 'flex h-11 items-center gap-2 rounded-lg px-3 text-sm',
+ props.isActive(item.id) ? 'text-accent' : 'text-ink',
+ hoveredId() === item.id
+ ? 'bg-hover'
+ : 'hover:bg-hover'
+ )}
+ onClick={() => {
+ hapticImpact('light');
+ select(item.id);
+ }}
+ >
+ <div class="size-4 shrink-0 [&_svg]:size-4">
+ <Dynamic
+ component={item.icon}
+ triggerAnimation={hoveredId() === item.id}
+ />
+ </div>
+ <span>{item.label}</span>
+ </button>
+ )}
+ </For>
+ {/* Full-bleed divider between the list and the Views row. */}
+ <div class="-mx-1 h-px shrink-0 bg-edge" />
+ <button
+ type="button"
+ class="flex h-9 shrink-0 items-center justify-between px-3 text-sm font-medium text-ink-muted"
+ onClick={() => {
+ hapticImpact('light');
+ closeMenu();
+ }}
+ >
+ <span>Views</span>
+ {/* Center the caret over the dock's More trigger (this menu's opener) so it lines up with that button's caret. */}
+ <CaretUpIcon class="mr-11 size-6 rotate-180 text-ink" />
+ </button>
+ </div>
+ </div>
+ </div>
+ </Layer>
+ </Portal>
+ </Show>
+ </>
+ );
+}
+
export function MobileDock() {
const { openWithSplit } = useSplitLayout();
const location = useLocation();
- const isActive = (id: ListView) => {
+ const isActive = (id: DockId) => {
const activeContent = globalSplitManager()?.activeSplit()?.content();
if (!activeContent) {
const segments = location.pathname.split('/').filter(Boolean);
@@ -71,7 +341,7 @@ export function MobileDock() {
return activeContent.id === id;
};
- const navigate = (id: ListView) => {
+ const navigate = (id: DockId) => {
// If we're already on a soup/component view, replace in-place (mergeHistory)
// so the tab switch doesn't push a new entry into the swipe-back BG slot.
// From any other view (document, task, etc.) treat it as forward navigation
@@ -82,49 +352,46 @@ export function MobileDock() {
};
return (
- <Layer depth={1}>
- <div class="relative z-mobile-nav-bar flex flex-row justify-between">
- <div class="-z-1 absolute inset-x-0 top-0 w-screen h-40 bg-surface" />
- <MobileDockButton
- icon={AnimatedInboxIcon}
- active={isActive('inbox')}
- onClick={() => {
- navigate('inbox');
- }}
- />
- <MobileDockButton
- icon={AnimatedEmailIcon}
- active={isActive('mail')}
- onClick={() => navigate('mail')}
- />
- <MobileDockButton
- icon={AnimatedChannelIcon}
- active={isActive('channels')}
- onClick={() => {
- navigate('channels');
- }}
- />
- <MobileDockButton
- icon={AnimatedTaskIcon}
- active={isActive('tasks')}
- onClick={() => navigate('tasks')}
- />
- <MobileDockButton
- icon={AnimatedFileMdIcon}
- active={isActive('documents')}
- onClick={() => navigate('documents')}
- />
- <MobileDockButton
- icon={AnimatedStarIcon}
- active={isActive('agents')}
- onClick={() => navigate('agents')}
- />
- <MobileDockButton
- icon={AnimatedCallIcon}
- active={isActive('calls')}
- onClick={() => navigate('calls')}
- />
- </div>
- </Layer>
+ <div class="flex items-center gap-3 px-(--mobile-chrome-gutter)">
+ <MobileDockButton
+ icon={HomeIcon}
+ ariaLabel="Home"
+ animateIcon={false}
+ class="size-10 rounded-full"
+ active={isActive('home')}
+ onClick={() => navigate('home')}
+ />
+ <MobileDockButton
+ icon={AnimatedInboxIcon}
+ ariaLabel="Inbox"
+ class="size-10 rounded-full"
+ active={isActive('inbox')}
+ onClick={() => navigate('inbox')}
+ />
+ <MobileDockButton
+ icon={AnimatedSearchIcon}
+ label="Search"
+ class="h-10 flex-1 gap-1 rounded-full px-3"
+ onClick={() => {
+ SearchState.maybeResetState();
+ // Arm the focus before opening: iOS only raises the keyboard for a
+ // synchronous focus inside the gesture, so triggerFocusInput grabs a
+ // temp input now and transfers to the real search input once the
+ // dock region portals it in.
+ triggerFocusInput(() =>
+ document.getElementById('mobile-search-input')
+ );
+ SearchState.open();
+ }}
+ />
+ <MorePopover isActive={isActive} onNavigate={navigate} />
+ <MobileDockButton
+ icon={PlusIcon}
+ animateIcon={false}
+ ariaLabel="Create"
+ class="size-10 rounded-full"
+ onClick={() => setCreateMenuOpen(true)}
+ />
+ </div>
);
}
diff --git a/js/app/packages/app/component/mobile/MobileEdgeFade.tsx b/js/app/packages/app/component/mobile/MobileEdgeFade.tsx
new file mode 100644
index 0000000000..bb275c4d9b
--- /dev/null
+++ b/js/app/packages/app/component/mobile/MobileEdgeFade.tsx
@@ -0,0 +1,45 @@
+import { isPlatform } from '@core/util/platform';
+import { Layer } from '@ui';
+import { Show } from 'solid-js';
+
+/**
+ * Edge scrims for full-frame mobile: content dissolves into the page surface
+ * as it scrolls beneath the floating chrome at the top and bottom
+ */
+
+/** Extra distance the gradients bleed past the chrome they cover. */
+const TOP_FALLOFF = '0rem';
+const BOTTOM_FALLOFF = '2rem';
+
+export function MobileTopEdgeFade() {
+ return (
+ <Show when={isPlatform('ios')}>
+ <Layer depth={0}>
+ <div
+ class="pointer-events-none absolute inset-x-0 top-0"
+ style={{
+ height: `calc(var(--mobile-content-inset-top, 0px) + ${TOP_FALLOFF})`,
+ background:
+ 'linear-gradient(to bottom, var(--color-surface) 10%, 70%, transparent)',
+ }}
+ />
+ </Layer>
+ </Show>
+ );
+}
+
+/** Spans the bottom-chrome host plus a falloff above it. */
+export function MobileBottomEdgeFade() {
+ return (
+ <Layer depth={0}>
+ <div
+ class="pointer-events-none absolute inset-x-0 bottom-0 -z-10"
+ style={{
+ top: `calc(${BOTTOM_FALLOFF} * -1)`,
+ background:
+ 'linear-gradient(to top, var(--color-surface), 60%, transparent)',
+ }}
+ />
+ </Layer>
+ );
+}
diff --git a/js/app/packages/app/component/mobile/MobileSearch.tsx b/js/app/packages/app/component/mobile/MobileSearch.tsx
index 349399dd32..28ebd7c665 100644
--- a/js/app/packages/app/component/mobile/MobileSearch.tsx
+++ b/js/app/packages/app/component/mobile/MobileSearch.tsx
@@ -2,12 +2,10 @@
import { openChatWithMessage } from '@app/component/ChatWithAgentButton';
import { openEntityInSplitFromUnifiedList } from '@app/component/next-soup/utils';
-import { Tabs } from '@core/component/Tabs';
import { TailSpinner } from '@core/component/TailSpinner';
import { itemToBlockName } from '@core/constant/allBlocks';
import { getActiveCommandsFromScope } from '@core/hotkey/getCommands';
import { runCommand } from '@core/hotkey/utils';
-import { virtualKeyboardVisible } from '@core/mobile/virtualKeyboard';
import { debouncedDependent } from '@core/util/debounce';
import { windowSearchMatch } from '@core/util/searchHighlight';
import { openExternalUrl } from '@core/util/url';
@@ -18,11 +16,10 @@ import {
type WithSearch,
} from '@entity';
import { SearchContent } from '@entity/extractors-search/search-content';
-import { Dialog } from '@kobalte/core/dialog';
import ArrowLeft from '@phosphor/arrow-left.svg';
import SearchIcon from '@phosphor-icons/core/regular/magnifying-glass.svg?component-solid';
import { useFullTextSearch } from '@queries/soup/useFullTextSearch';
-import { cn, Layer } from '@ui';
+import { Layer } from '@ui';
import {
createSignal,
Match,
@@ -42,37 +39,26 @@ import {
useCommandItems,
} from '../command/useCommandItems';
import { useSplitLayout } from '../split-layout/layout';
+import { FloatRegion } from './float-regions/FloatRegion';
import { SearchState } from './mobileSearchState';
+import { type PillTabItem, PillTabs } from './PillTabs';
-const CATEGORIES: { id: CategoryFilter; label: string }[] = [
- { id: 'all', label: 'All' },
- { id: 'channels', label: 'Channels' },
- { id: 'dms', label: 'DMs' },
- { id: 'documents', label: 'Documents' },
- { id: 'tasks', label: 'Tasks' },
- { id: 'chats', label: 'Chats' },
- { id: 'projects', label: 'Folders' },
- { id: 'commands', label: 'Commands' },
+const CATEGORIES: PillTabItem<CategoryFilter>[] = [
+ { value: 'all', label: 'All' },
+ { value: 'channels', label: 'Channels' },
+ { value: 'dms', label: 'DMs' },
+ { value: 'documents', label: 'Documents' },
+ { value: 'tasks', label: 'Tasks' },
+ { value: 'chats', label: 'Chats' },
+ { value: 'projects', label: 'Folders' },
+ { value: 'commands', label: 'Commands' },
];
export function MobileSearchOuter() {
return (
- <Dialog open={SearchState.isOpen()} onOpenChange={SearchState.setIsOpen}>
- <Dialog.Portal>
- <Layer depth={2}>
- <Dialog.Content
- class={cn(
- 'fixed inset-0 z-modal flex flex-col h-[calc(var(--dvh,1dvh)*100)] pt-(--safe-top) pl-(--safe-left) pr-(--safe-right)',
- {
- 'pb-(--safe-bottom)': !virtualKeyboardVisible(),
- }
- )}
- >
- <MobileSearchInner />
- </Dialog.Content>
- </Layer>
- </Dialog.Portal>
- </Dialog>
+ <Show when={SearchState.isOpen()}>
+ <MobileSearchInner />
+ </Show>
);
}
@@ -171,38 +157,76 @@ function MobileSearchInner() {
}
};
+ const showTabs = () =>
+ !SearchState.isInCommandScope() && !SearchState.isFullTextMode();
+
return (
- <div class="flex flex-col h-full bg-surface">
- <ResultsContainer
- nameMatchItems={filteredItems()}
- fullTextItems={fullTextResults()}
- onSelectNameMatch={(item, openInNewSplit) =>
- handleItemAction(item, openInNewSplit)
- }
- onSelectFullText={(entity) => handleFullTextItemAction(entity)}
- isLoading={() => SearchState.isFullTextMode() && isFullTextLoading()}
- onFullTextSearch={() => SearchState.enableFullTextMode()}
- query={SearchState.query}
- />
- <Show
- when={!SearchState.isInCommandScope() && !SearchState.isFullTextMode()}
- >
- <CategoryFilterTabs />
+ <>
+ {/* Full-frame results surface. Sits below the float host (see
+ zMobileSearch) so the input (dock region) and tabs (accessory
+ region) float over it; bottom padding clears that floating chrome. */}
+ <Layer depth={0}>
+ <div class="fixed inset-0 z-mobile-search flex flex-col bg-surface pt-(--safe-top) pr-(--safe-right) pb-[calc(var(--virtual-keyboard-height)+var(--mobile-content-inset-bottom))] pl-(--safe-left)">
+ <ResultsContainer
+ nameMatchItems={filteredItems()}
+ fullTextItems={fullTextResults()}
+ onSelectNameMatch={(item, openInNewSplit) =>
+ handleItemAction(item, openInNewSplit)
+ }
+ onSelectFullText={(entity) => handleFullTextItemAction(entity)}
+ isLoading={() =>
+ SearchState.isFullTextMode() && isFullTextLoading()
+ }
+ onFullTextSearch={() => SearchState.enableFullTextMode()}
+ query={SearchState.query}
+ />
+ </div>
+ </Layer>
+
+ {/* Category filter tabs → accessory region (above the input). */}
+ <Show when={showTabs()}>
+ <FloatRegion
+ region="accessory"
+ priority={20}
+ active={() => SearchState.isOpen()}
+ >
+ <CategoryFilterTabs />
+ </FloatRegion>
</Show>
- {/* Search Input */}
- <div class="flex items-center gap-2 bg-surface px-2 border-t border-edge-muted">
+
+ {/* Search input → dock region. High priority so it wins over the dock
+ while search is open, regardless of keyboard visibility. */}
+ <FloatRegion
+ region="dock"
+ priority={20}
+ active={() => SearchState.isOpen()}
+ >
+ <SearchInputBar onBack={handleBack} />
+ </FloatRegion>
+ </>
+ );
+}
+
+function SearchInputBar(props: { onBack: () => void }) {
+ // Focus (and the iOS keyboard) is driven by triggerFocusInput from the dock
+ // Search button, which targets this input by id once it mounts here.
+ return (
+ <div class="pointer-events-auto px-(--mobile-chrome-gutter)">
+ <div class="island flex h-11 items-center gap-1 rounded-full pr-3 pl-1">
<button
- class="text-ink-muted flex flex-col items-center justify-center pl-2 pt-3 pb-2"
- onClick={handleBack}
+ type="button"
+ class="flex size-9 shrink-0 items-center justify-center rounded-full text-ink-muted"
+ onClick={props.onBack}
+ aria-label="Back"
title="Back (Esc)"
>
- <ArrowLeft class="size-6" />
+ <ArrowLeft class="size-5" />
</button>
<input
id="mobile-search-input"
type="text"
- class="pt-3 pb-2 flex-1 bg-transparent border-0 outline-none focus:outline-none ring-0 focus:ring-0 text-ink-muted placeholder:text-ink-placeholder"
- placeholder={'Search...'}
+ class="h-full min-w-0 flex-1 border-0 bg-transparent text-ink outline-none ring-0 placeholder:text-ink-placeholder focus:outline-none focus:ring-0"
+ placeholder="Search..."
value={SearchState.query()}
onInput={(e) => SearchState.setQuery(e.currentTarget.value)}
/>
@@ -405,15 +429,12 @@ function FullTextResultItem(props: {
function CategoryFilterTabs() {
return (
- <div class="bg-surface border-t border-edge-muted h-11 px-1 overflow-x-auto scrollbar-hidden">
- <Tabs
- list={CATEGORIES.map((c) => ({ value: c.id, label: c.label }))}
+ <div class="flex items-center px-(--mobile-chrome-gutter)">
+ <PillTabs
+ items={CATEGORIES}
value={SearchState.categoryFilter()}
- onChange={(value) => {
- if (value) SearchState.setCategoryFilter(value as CategoryFilter);
- }}
- indicatorPosition="top"
- class="w-max **:data-indicator:h-0.75"
+ onChange={(value) => SearchState.setCategoryFilter(value)}
+ preserveFocus
/>
</div>
);
diff --git a/js/app/packages/app/component/mobile/PillTabs.tsx b/js/app/packages/app/component/mobile/PillTabs.tsx
new file mode 100644
index 0000000000..44295063c2
--- /dev/null
+++ b/js/app/packages/app/component/mobile/PillTabs.tsx
@@ -0,0 +1,104 @@
+import { hapticImpact } from '@core/mobile/haptics';
+import { cn } from '@ui';
+import { createEffect, For, type JSXElement, on } from 'solid-js';
+import { pressPulse } from './pressPulse';
+
+// Keeps the directive import from being tree-shaken / lint-flagged.
+false && pressPulse;
+
+export type PillTabItem<T extends string = string> = {
+ value: T;
+ label: JSXElement;
+};
+
+/**
+ * Horizontal strip of pill tabs — the shared mobile-chrome tab style used by
+ * the dock's floating regions (soup-view tabs, search category filters) and
+ * the settings bottom bar. Each option is its own island-styled pill.
+ *
+ * Presentational only: the caller owns selection state via `value`/`onChange`
+ * and wraps this with its own layout (gutters, sibling controls, region
+ * chrome). The active pill is kept scrolled into view automatically.
+ */
+export function PillTabs<T extends string>(props: {
+ items: readonly PillTabItem<T>[];
+ value: T | undefined;
+ onChange: (value: T) => void;
+ /**
+ * Keep the active element focused when a pill is tapped (e.g. so an open
+ * keyboard stays up in search) by preventing the pointer-down default.
+ */
+ preserveFocus?: boolean;
+ /** Extra classes on the scroll strip. */
+ class?: string;
+}) {
+ let stripRef: HTMLDivElement | undefined;
+
+ // Keep the active pill scrolled into view within the horizontal strip.
+ // Re-runs on selection change or when the list of items changes.
+ createEffect(
+ on(
+ () => [props.value, props.items] as const,
+ () => {
+ const strip = stripRef;
+ if (!strip) return;
+ queueMicrotask(() => {
+ const active = strip.querySelector<HTMLElement>('[data-checked]');
+ if (!active) return;
+ const stripRect = strip.getBoundingClientRect();
+ const activeRect = active.getBoundingClientRect();
+ if (activeRect.left < stripRect.left) {
+ strip.scrollBy({
+ left: activeRect.left - stripRect.left - 8,
+ behavior: 'smooth',
+ });
+ } else if (activeRect.right > stripRect.right) {
+ strip.scrollBy({
+ left: activeRect.right - stripRect.right + 8,
+ behavior: 'smooth',
+ });
+ }
+ });
+ }
+ )
+ );
+
+ return (
+ <div
+ ref={stripRef}
+ class={cn(
+ // overflow-x:auto forces overflow-y to auto, which clips the pills'
+ // shadow. The padding gives the shadow room inside the (clipping)
+ // padding box; the matching negative margin cancels its layout impact.
+ 'pointer-events-auto -my-3 flex min-w-0 items-center gap-2 overflow-x-auto py-3 pr-2 scrollbar-hidden',
+ props.class
+ )}
+ >
+ <For each={props.items}>
+ {(item) => {
+ const active = () => props.value === item.value;
+ return (
+ <button
+ type="button"
+ use:pressPulse
+ data-checked={active() ? '' : undefined}
+ class={cn(
+ 'h-10 shrink-0 whitespace-nowrap rounded-full border px-3.5 text-sm font-medium shadow-md',
+ active()
+ ? 'bg-accent text-surface border-accent'
+ : 'bg-surface text-ink-extra-muted border-edge'
+ )}
+ onPointerDown={(e) => {
+ if (props.preserveFocus) e.preventDefault();
+ hapticImpact('light');
+ }}
+ onClick={() => props.onChange(item.value)}
+ >
+ {item.label}
+ </button>
+ );
+ }}
+ </For>
+ </div>
+ );
+}
diff --git a/js/app/packages/app/component/mobile/SwipeDownDismissKeyboard.tsx b/js/app/packages/app/component/mobile/SwipeDownDismissKeyboard.tsx
index 7542b0424c..79b330c767 100644
--- a/js/app/packages/app/component/mobile/SwipeDownDismissKeyboard.tsx
+++ b/js/app/packages/app/component/mobile/SwipeDownDismissKeyboard.tsx
@@ -12,8 +12,7 @@ const ZONE_HEIGHT = 20; // px above keyboard that activates blur
// docked to the keyboard, and taps commonly drift past the swipe threshold —
// treat gestures starting on interactive elements as taps, not dismissal
// swipes.
-const INTERACTIVE_SELECTOR =
- 'button, [role="button"], a[href], input, textarea, select, [contenteditable="true"]';
+const INTERACTIVE_SELECTOR = 'button, [role="button"], a[href], select';
function isInteractiveTarget(target: EventTarget | null): boolean {
return (
diff --git a/js/app/packages/app/component/mobile/float-regions/FloatRegion.tsx b/js/app/packages/app/component/mobile/float-regions/FloatRegion.tsx
new file mode 100644
index 0000000000..a7ea855475
--- /dev/null
+++ b/js/app/packages/app/component/mobile/float-regions/FloatRegion.tsx
@@ -0,0 +1,59 @@
+import { useSplitPanel } from '@app/component/split-layout/layoutUtils';
+import { isMobile } from '@core/mobile/isMobile';
+import { onCleanup, type ParentProps, Show } from 'solid-js';
+import { Portal } from 'solid-js/web';
+import { type FloatRegionName, FloatRegions } from './float-region-state';
+
+export type FloatRegionProps = ParentProps<{
+ region: FloatRegionName;
+ /** Higher wins; ties go to the most recently mounted contributor. Default 0. */
+ priority?: number;
+ /** Extra reactive gate, e.g. `() => !virtualKeyboardVisible()`. */
+ active?: () => boolean;
+}>;
+
+/**
+ * Contributes children to a floating bottom-chrome region (see
+ * FloatRegionHost). Children render through a Portal, so they keep this
+ * component's owner context (providers, signals, etc.).
+ *
+ * Inside a SplitPanel, contributions from inactive (background swipe) panels
+ * are ignored automatically. Among active contributors to the same region the
+ * highest priority wins; ties go to the most recently mounted.
+ *
+ * Contributions own their horizontal padding (`px-(--mobile-chrome-gutter)`
+ * to align with the dock) and must re-enable `pointer-events-auto` on
+ * interactive content — the host is pointer-transparent.
+ */
+export function FloatRegion(props: FloatRegionProps) {
+ const panel = useSplitPanel();
+
+ const registration = FloatRegions.register({
+ region: props.region,
+ priority: props.priority ?? 0,
+ isActive: () =>
+ isMobile() &&
+ (panel?.isPanelActive() ?? true) &&
+ (props.active?.() ?? true),
+ });
+ onCleanup(registration.unregister);
+
+ return (
+ <Show when={registration.isWinner() && FloatRegions.mount(props.region)}>
+ {(mountEl) => <Portal mount={mountEl()}>{props.children}</Portal>}
+ </Show>
+ );
+}
+
+/**
+ * Renders children in normal flow on desktop and floats them into `region`
+ * on mobile. Note: crossing the mobile breakpoint remounts children (e.g.
+ * editors lose selection; drafts must persist on their own).
+ */
+export function FloatRegionOrInline(props: FloatRegionProps) {
+ return (
+ <Show when={isMobile()} fallback={props.children}>
+ <FloatRegion {...props} />
+ </Show>
+ );
+}
diff --git a/js/app/packages/app/component/mobile/float-regions/FloatRegionHost.tsx b/js/app/packages/app/component/mobile/float-regions/FloatRegionHost.tsx
new file mode 100644
index 0000000000..8eeb40efe7
--- /dev/null
+++ b/js/app/packages/app/component/mobile/float-regions/FloatRegionHost.tsx
@@ -0,0 +1,59 @@
+import { isNativeMobilePlatform } from '@core/mobile/isNativeMobilePlatform';
+import { virtualKeyboardVisible } from '@core/mobile/virtualKeyboard';
+import { createElementSize } from '@solid-primitives/resize-observer';
+import { cn, Layer } from '@ui';
+import { createEffect, createSignal, For, onCleanup } from 'solid-js';
+import { FLOAT_REGIONS, FloatRegions } from './float-region-state';
+
+/**
+ * The mobile bottom-chrome host: an ordered stack of floating regions
+ * (`accessory` above `dock`) anchored to the bottom of the layout root.
+ * Positioned `absolute` (not `fixed`) so the --dvh squish from
+ * useAppSquishHandlers lifts the whole stack above the virtual keyboard.
+ *
+ * Publishes its height as `--mobile-content-inset-bottom` on <html> for content that
+ * needs bottom clearance. Empty regions collapse (`empty:hidden`), so the
+ * variable tracks what is actually visible.
+ */
+export function FloatRegionHost() {
+ const [hostRef, setHostRef] = createSignal<HTMLDivElement>();
+ const size = createElementSize(hostRef);
+
+ createEffect(() => {
+ const height = size.height ?? 0;
+ FloatRegions.setHostHeight(height);
+ document.documentElement.style.setProperty(
+ '--mobile-content-inset-bottom',
+ `${height}px`
+ );
+ });
+ onCleanup(() => {
+ FloatRegions.setHostHeight(0);
+ document.documentElement.style.removeProperty(
+ '--mobile-content-inset-bottom'
+ );
+ });
+
+ return (
+ <Layer depth={3}>
+ <div
+ ref={setHostRef}
+ class={cn(
+ 'pointer-events-none absolute inset-x-0 bottom-0 z-mobile-nav-bar flex flex-col gap-3 pb-3',
+ isNativeMobilePlatform() && 'pb-7',
+ virtualKeyboardVisible() && 'pb-3'
+ )}
+ >
+ <For each={FLOAT_REGIONS}>
+ {(region) => (
+ <div
+ data-float-region={region}
+ ref={(el) => FloatRegions.setMount(region, el)}
+ class="flex w-full flex-col empty:hidden"
+ />
+ )}
+ </For>
+ </div>
+ </Layer>
+ );
+}
diff --git a/js/app/packages/app/component/mobile/float-regions/float-region-state.ts b/js/app/packages/app/component/mobile/float-regions/float-region-state.ts
new file mode 100644
index 0000000000..ff8edaea7a
--- /dev/null
+++ b/js/app/packages/app/component/mobile/float-regions/float-region-state.ts
@@ -0,0 +1,91 @@
+import { type Accessor, createSignal } from 'solid-js';
+import { createStore } from 'solid-js/store';
+
+/** Region render order in the host, top to bottom. Add new regions here. */
+export const FLOAT_REGIONS = ['accessory', 'dock'] as const;
+
+export type FloatRegionName = (typeof FLOAT_REGIONS)[number];
+
+type FloatRegionRegistration = {
+ /** Unique identity; comparisons use this rather than object reference. */
+ id: symbol;
+ /** Higher wins; ties go to the most recently mounted contributor. */
+ priority: number;
+ /** Reactive gate: panel activity, keyboard visibility, etc. */
+ isActive: Accessor<boolean>;
+ /** Mount order, used to break priority ties. */
+ seq: number;
+};
+
+export type FloatRegionRegistrationHandle = {
+ /** Reactive: whether this contribution currently wins its region. */
+ isWinner: () => boolean;
+ unregister: () => void;
+};
+
+function createFloatRegionsState() {
+ // Regions are independent silos — keyed by region so winner recomputation
+ // in one region never tracks changes in another.
+ const [registrations, setRegistrations] = createStore(
+ Object.fromEntries(
+ FLOAT_REGIONS.map((region) => [region, [] as FloatRegionRegistration[]])
+ ) as Record<FloatRegionName, FloatRegionRegistration[]>
+ );
+ const [mounts, setMounts] = createStore<
+ Partial<Record<FloatRegionName, HTMLElement>>
+ >({});
+ const [hostHeight, setHostHeight] = createSignal(0);
+ let nextSeq = 0;
+
+ function register(
+ input: Omit<FloatRegionRegistration, 'id' | 'seq'> & {
+ region: FloatRegionName;
+ }
+ ): FloatRegionRegistrationHandle {
+ const { region, ...rest } = input;
+ const entry: FloatRegionRegistration = {
+ ...rest,
+ id: Symbol('float-region-registration'),
+ seq: nextSeq++,
+ };
+ setRegistrations(region, (prev) => [...prev, entry]);
+ return {
+ isWinner: () => winnerOf(region)?.id === entry.id,
+ unregister: () =>
+ setRegistrations(region, (prev) =>
+ prev.filter((r) => r.id !== entry.id)
+ ),
+ };
+ }
+
+ function winnerOf(
+ region: FloatRegionName
+ ): FloatRegionRegistration | undefined {
+ let winner: FloatRegionRegistration | undefined;
+ for (const r of registrations[region]) {
+ if (!r.isActive()) continue;
+ if (
+ !winner ||
+ r.priority > winner.priority ||
+ (r.priority === winner.priority && r.seq > winner.seq)
+ ) {
+ winner = r;
+ }
+ }
+ return winner;
+ }
+
+ return {
+ register,
+ setMount: (region: FloatRegionName, el: HTMLElement) =>
+ setMounts(region, el),
+ mount: (region: FloatRegionName) => mounts[region],
+ /** Measured height of the visible bottom-chrome stack, in px.
+ * Same value as the `--mobile-content-inset-bottom` CSS variable. */
+ hostHeight,
+ setHostHeight,
+ };
+}
+
+/** Global mobile bottom-chrome registry — one host per app (see FloatRegionHost). */
+export const FloatRegions = createFloatRegionsState();
diff --git a/js/app/packages/app/component/mobile/pressPulse.ts b/js/app/packages/app/component/mobile/pressPulse.ts
new file mode 100644
index 0000000000..e7bbf51339
--- /dev/null
+++ b/js/app/packages/app/component/mobile/pressPulse.ts
@@ -0,0 +1,24 @@
+declare module 'solid-js' {
+ namespace JSX {
+ interface Directives {
+ pressPulse: true;
+ }
+ }
+}
+
+/**
+ * Press feedback for floating mobile chrome buttons (`[data-press-pulse]`
+ * in index.css): pointer-down eases the button to its on-state and holds
+ * it; release bounces it back. Marks the element and manages
+ * `data-pressed`. Fire the button's action from `onClick` (release), not
+ * pointer-down.
+ */
+export function pressPulse(el: HTMLElement) {
+ el.setAttribute('data-press-pulse', '');
+ const press = () => el.setAttribute('data-pressed', '');
+ const release = () => el.removeAttribute('data-pressed');
+ el.addEventListener('pointerdown', press);
+ el.addEventListener('pointerup', release);
+ el.addEventListener('pointercancel', release);
+ el.addEventListener('pointerleave', release);
+}
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/mobile-filter-drawer.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/mobile-filter-drawer.tsx
index ebd9896eca..3ca418a773 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/mobile-filter-drawer.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/mobile-filter-drawer.tsx
@@ -3,6 +3,7 @@ import {
MobileDrawer,
scrollToFocusedInput,
} from '@app/component/mobile/MobileDrawer';
+import { pressPulse } from '@app/component/mobile/pressPulse';
import {
type FilterContext,
NO_ASSIGNEE,
@@ -264,7 +265,9 @@ export const MobileFilterDrawer = () => {
aria-label="Open filters"
variant="ghost"
size="sm"
- class="rounded-xs [&_svg]:size-6 relative h-full"
+ depth={3}
+ class="island pointer-events-auto relative size-10 shrink-0 rounded-full bg-surface [&_svg]:size-5"
+ ref={pressPulse}
>
<SlidersHorizontalIcon />
<Show when={activeCount() > 0}>
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view-mobile-create-button.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view-mobile-create-button.tsx
index 873432bc92..b6358ac75b 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view-mobile-create-button.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view-mobile-create-button.tsx
@@ -98,12 +98,12 @@ export function SoupViewMobileCreateButton(props: {
const isVisible = () => (props.visible?.() ?? true) && !!createAction();
return (
- <Layer depth={4}>
+ <Layer depth={3}>
<button
type="button"
class={cn(
'absolute bottom-4 right-4 z-10 h-11 pl-3.5 pr-4.5 rounded-full',
- 'bg-surface text-accent flex items-center justify-center gap-2 shadow-md ring ring-edge',
+ 'island flex items-center justify-center gap-2',
MOBILE_FLOATING_BUTTON_TRANSITION,
isVisible()
? MOBILE_FLOATING_BUTTON_VISIBLE
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view-mobile-search.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view-mobile-search.tsx
deleted file mode 100644
index 9fc1358920..0000000000
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view-mobile-search.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-import { useSoupView } from '@app/component/next-soup/soup-view/soup-view-context';
-import { focusInput } from '@core/directive/focusInput';
-import { hapticImpact } from '@core/mobile/haptics';
-import SearchIcon from '@icon/macro-magnifying-glass.svg';
-import XIcon from '@phosphor/x.svg';
-import { cn, Layer } from '@ui';
-import { type Accessor, createEffect, Show } from 'solid-js';
-import {
- MOBILE_FLOATING_BUTTON_TRANSITION,
- MOBILE_FLOATING_BUTTON_VISIBLE,
-} from './soup-view-mobile-floating-motion';
-
-false && focusInput;
-
-export function SoupViewMobileSearchButton(props: {
- open: Accessor<boolean>;
- visible?: Accessor<boolean>;
- onOpen: () => void;
-}) {
- const isVisible = () => !props.open();
- const isExpanded = () => props.visible?.() ?? true;
-
- return (
- <Layer depth={4}>
- <button
- type="button"
- use:focusInput={{
- getTarget: () => document.getElementById('soup-mobile-search-input'),
- }}
- class={cn(
- 'absolute bottom-4 right-4 z-10 size-11 rounded-full',
- 'bg-surface flex items-center justify-center shadow-md ring ring-edge',
- MOBILE_FLOATING_BUTTON_TRANSITION,
- !isVisible()
- ? 'pointer-events-none translate-y-2'
- : isExpanded()
- ? 'opacity-100 -translate-x-[calc(100%+5.25rem)] scale-100'
- : MOBILE_FLOATING_BUTTON_VISIBLE
- )}
- disabled={!isVisible()}
- aria-hidden={!isVisible()}
- aria-label="Search"
- onClick={() => {
- hapticImpact('light');
- props.onOpen();
- }}
- >
- <SearchIcon class="size-5" />
- </button>
- </Layer>
- );
-}
-
-export function SoupViewMobileSearchBar(props: {
- open: Accessor<boolean>;
- onClose: () => void;
-}) {
- const { searchText, setSearchText, setSearchPaused } = useSoupView();
- let inputRef: HTMLInputElement | undefined;
-
- createEffect(() => {
- if (!props.open()) return;
- setSearchPaused(false);
- setTimeout(() => inputRef?.focus());
- });
-
- return (
- <Show when={props.open()}>
- <Layer depth={4}>
- <div
- class="absolute inset-x-0 bottom-0 z-20 flex items-center gap-2 bg-surface px-2 border-t border-edge-muted"
- data-no-focus-restore
- >
- <button
- type="button"
- class="text-ink-muted flex flex-col items-center justify-center pl-2 pt-3 pb-2"
- onClick={() => {
- setSearchText('');
- props.onClose();
- }}
- title="Close Search"
- >
- <XIcon class="size-6" />
- </button>
- <input
- ref={inputRef}
- id="soup-mobile-search-input"
- type="text"
- class="pt-3 pb-2 flex-1 min-w-0 bg-transparent border-0 outline-none focus:outline-none ring-0 focus:ring-0 text-ink-muted placeholder:text-ink-placeholder"
- placeholder="Search..."
- value={searchText()}
- onInput={(e) => setSearchText(e.currentTarget.value)}
- onKeyDown={(e) => {
- if (e.key !== 'Escape') return;
- e.currentTarget.blur();
- props.onClose();
- }}
- />
- </div>
- </Layer>
- </Show>
- );
-}
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view-mobile-settings-button.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view-mobile-settings-button.tsx
deleted file mode 100644
index 9d09e5d706..0000000000
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view-mobile-settings-button.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import { useSettingsState } from '@core/constant/SettingsState';
-import { hapticImpact } from '@core/mobile/haptics';
-import IconGear from '@icon/macro-gear.svg';
-import { cn, Layer } from '@ui';
-import type { Accessor } from 'solid-js';
-import { Show } from 'solid-js';
-import { useSplitLayout } from '../../split-layout/layout';
-import {
- MOBILE_FLOATING_BUTTON_OFFSCREEN_RIGHT,
- MOBILE_FLOATING_BUTTON_TRANSITION,
- MOBILE_FLOATING_BUTTON_VISIBLE,
-} from './soup-view-mobile-floating-motion';
-
-export function SoupViewMobileSettingsButton(props: {
- visible: Accessor<boolean>;
-}) {
- const { settingsOpen, toggleSettings } = useSettingsState();
- const { getSplitCount } = useSplitLayout();
-
- const isSingleSplit = () => getSplitCount() <= 1;
-
- return (
- <Show when={isSingleSplit()}>
- <Layer depth={4}>
- <button
- type="button"
- class={cn(
- 'absolute bottom-[4.5rem] right-4 z-10 size-11 rounded-full',
- 'bg-surface text-ink flex items-center justify-center shadow-md',
- MOBILE_FLOATING_BUTTON_TRANSITION,
- 'ring ring-edge hover:text-accent hover:bg-hover',
- settingsOpen() && 'bg-accent/20 text-accent ring-accent/20',
- props.visible()
- ? MOBILE_FLOATING_BUTTON_VISIBLE
- : MOBILE_FLOATING_BUTTON_OFFSCREEN_RIGHT
- )}
- aria-label={settingsOpen() ? 'Close Settings' : 'Open Settings'}
- aria-hidden={!props.visible()}
- onClick={() => {
- hapticImpact('light');
- toggleSettings();
- }}
- >
- <IconGear class="size-5" />
- </button>
- </Layer>
- </Show>
- );
-}
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx
index 3bdc263b33..8c00cbd1b6 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx
@@ -3,6 +3,7 @@ import {
type PresetContext,
VIEW_TAB_PRESETS,
} from '@app/component/app-sidebar/soup-filter-presets';
+import { PillTabs } from '@app/component/mobile/PillTabs';
import type { FilterID } from '@app/component/next-soup/filters';
import type { FilterContext } from '@app/component/next-soup/filters/configs';
import {
@@ -15,7 +16,6 @@ import { MobileFilterDrawer } from '@app/component/next-soup/soup-view/filters-b
import { useSoupView } from '@app/component/next-soup/soup-view/soup-view-context';
import { useSplitPanelOrThrow } from '@app/component/split-layout/layoutUtils';
import { isListViewID, type ListView } from '@app/constants/list-views';
-import { MobileTabs } from '@core/component/MobileTabs';
import type { TabItem } from '@core/component/Tabs';
import { TabsInset } from '@core/component/TabsInset';
import { TabsInsetDropdown } from '@core/component/TabsInsetDropdown';
@@ -283,23 +283,19 @@ export const MobileSoupViewTabs = () => {
const listView = useCurrentListView();
return (
- <div class="bg-surface border-t border-edge-muted h-11 px-1 flex gap-1">
+ <div class="flex items-center px-(--mobile-chrome-gutter)">
<MobileFilterDrawer />
- <div class="flex-1 min-w-0 h-full">
- <Switch>
- <For
- each={
- Object.keys(VIEW_TAB_LISTS) as (keyof typeof VIEW_TAB_LISTS)[]
- }
- >
- {(v) => (
- <Match when={listView() === v}>
- <MobileViewTabs view={v} />
- </Match>
- )}
- </For>
- </Switch>
- </div>
+ <Switch>
+ <For
+ each={Object.keys(VIEW_TAB_LISTS) as (keyof typeof VIEW_TAB_LISTS)[]}
+ >
+ {(v) => (
+ <Match when={listView() === v}>
+ <MobileViewTabs view={v} />
+ </Match>
+ )}
+ </For>
+ </Switch>
</div>
);
};
@@ -310,12 +306,13 @@ const MobileViewTabs = (props: { view: TabbedListView }) => {
const isTeamAdmin = useIsTeamAdmin();
const list = () =>
filterTabsForUser(props.view, VIEW_TAB_LISTS[props.view], isTeamAdmin());
+ const activeValue = () => activeTab() ?? VIEW_TAB_PRESETS[props.view].default;
return (
- <MobileTabs
- list={list()}
- value={activeTab()}
- defaultValue={VIEW_TAB_PRESETS[props.view].default}
+ <PillTabs
+ class="pl-2"
+ items={list()}
+ value={activeValue()}
onChange={(value) => applyTabPreset(props.view, value)}
/>
);
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
index 7b52a4a425..323da1d2a6 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
@@ -4,6 +4,7 @@ import {
useGlobalNotificationSource,
} from '@app/component/GlobalAppState';
import { EntityRowProvider } from '@app/component/mobile/EntityRow';
+import { FloatRegion } from '@app/component/mobile/float-regions/FloatRegion';
import {
makeMarkDoneAction,
useEntityActionHotkeys,
@@ -32,12 +33,6 @@ import {
import { useSoupView } from '@app/component/next-soup/soup-view/soup-view-context';
import { SoupViewCreateButton } from '@app/component/next-soup/soup-view/soup-view-create-button';
import { SoupViewFileDropzone } from '@app/component/next-soup/soup-view/soup-view-file-dropzone';
-import { SoupViewMobileCreateButton } from '@app/component/next-soup/soup-view/soup-view-mobile-create-button';
-import {
- SoupViewMobileSearchBar,
- SoupViewMobileSearchButton,
-} from '@app/component/next-soup/soup-view/soup-view-mobile-search';
-import { SoupViewMobileSettingsButton } from '@app/component/next-soup/soup-view/soup-view-mobile-settings-button';
import {
CollapsedSoupViewTabs,
MobileSoupViewTabs,
@@ -61,7 +56,10 @@ import {
SplitHeaderRight,
} from '@app/component/split-layout/components/SplitHeader';
import { SplitPanelContext } from '@app/component/split-layout/context';
-import { useSplitPanelOrThrow } from '@app/component/split-layout/layoutUtils';
+import {
+ useSplitPanel,
+ useSplitPanelOrThrow,
+} from '@app/component/split-layout/layoutUtils';
import { LIST_VIEW_DOCS_URL } from '@app/constants/docs-links';
import { isListViewID, type ListView } from '@app/constants/list-views';
import { DEBUG_SETTING_KEYS, useDebugSetting } from '@app/lib/debugSettings';
@@ -127,7 +125,7 @@ import {
Switch,
} from 'solid-js';
import { Dynamic } from 'solid-js/web';
-import { type VirtualizerHandle, VList } from 'virtua/solid';
+import { Virtualizer, type VirtualizerHandle } from 'virtua/solid';
import type { CacheSnapshot } from 'virtua/unstable_core';
import { SoupEntitySelectionToolbar } from './soup-entity-selection-toolbar';
import { useSoupNavigationHotkeys } from './use-soup-navigation-hotkeys';
@@ -287,7 +285,7 @@ const DefaultGroupHeader = (
* the new soup query is still in flight.
*/
const MobileTabLoadingBar = () => (
- <div class="pointer-events-none absolute inset-x-0 top-0 z-10 h-0.5 overflow-hidden bg-accent/10">
+ <div class="pointer-events-none absolute inset-x-0 top-(--safe-top) z-10 h-0.5 overflow-hidden bg-accent/10">
<div class="h-full w-2/5 rounded-full bg-accent animate-indeterminate-bar" />
</div>
);
@@ -530,35 +528,6 @@ export const SoupView = (props: SoupViewProps) => {
const [narrowSearchExpanded, setNarrowSearchExpanded] = createSignal(false);
const [mobileSearchOpen, setMobileSearchOpen] = createSignal(false);
const [searchIsCollapsed, setSearchIsCollapsed] = createSignal(false);
- const [floatingButtonsVisible, setFloatingButtonsVisible] =
- createSignal(true);
- let lastSoupScrollOffset = 0;
- let upwardSoupScrollDistance = 0;
-
- const resetFloatingButtonScrollTracking = (offset = 0) => {
- lastSoupScrollOffset = Math.max(0, offset);
- upwardSoupScrollDistance = 0;
- setFloatingButtonsVisible(true);
- };
-
- const handleSoupScrollOffsetChange = (offset: number) => {
- const nextOffset = Math.max(0, offset);
- const delta = nextOffset - lastSoupScrollOffset;
- lastSoupScrollOffset = nextOffset;
-
- if (delta > 0) {
- upwardSoupScrollDistance = 0;
- setFloatingButtonsVisible(false);
- return;
- }
-
- if (delta < 0) {
- upwardSoupScrollDistance += Math.abs(delta);
- if (upwardSoupScrollDistance > FLOATING_BUTTON_SCROLL_UP_THRESHOLD) {
- setFloatingButtonsVisible(true);
- }
- }
- };
registerHotkey({
hotkey: 'cmd+f',
@@ -713,37 +682,20 @@ export const SoupView = (props: SoupViewProps) => {
</Show>
</SplitHeaderRight>
</Show>
- <SoupFiltersBar />
</div>
+ <SoupFiltersBar />
<div class="relative grow min-h-1 flex max-sm:flex-col flex-row size-full">
<Suspense>
<SoupViewFileDropzone>
- <SoupViewList
- onScrollOffsetBaseline={resetFloatingButtonScrollTracking}
- onScrollOffsetChange={handleSoupScrollOffsetChange}
- />
+ <SoupViewList />
</SoupViewFileDropzone>
</Suspense>
<Show when={isMobile()}>
- <SoupViewMobileSettingsButton visible={floatingButtonsVisible} />
- <SoupViewMobileSearchButton
- open={mobileSearchOpen}
- visible={floatingButtonsVisible}
- onOpen={() => setMobileSearchOpen(true)}
- />
- <SoupViewMobileCreateButton
- activeView={activeListView}
- visible={floatingButtonsVisible}
- />
- <SoupViewMobileSearchBar
- open={mobileSearchOpen}
- onClose={() => setMobileSearchOpen(false)}
- />
+ <FloatRegion region="accessory">
+ <MobileSoupViewTabs />
+ </FloatRegion>
</Show>
</div>
- <Show when={isMobile()}>
- <MobileSoupViewTabs />
- </Show>
</div>
<Suspense>
<Show when={ENABLE_UNIFIED_LIST_AI_INPUT && !isMobile()}>
@@ -757,8 +709,6 @@ export const SoupView = (props: SoupViewProps) => {
interface SoupViewListProps {
customScrollbarHidden?: boolean;
scopeId?: string;
- onScrollOffsetBaseline?: (offset: number) => void;
- onScrollOffsetChange?: (offset: number) => void;
}
export const SoupViewList = (props: SoupViewListProps) => {
@@ -1041,10 +991,6 @@ export const SoupViewList = (props: SoupViewListProps) => {
HTMLDivElement | undefined
>();
- createEffect(() => {
- if (rows().length === 0) props.onScrollOffsetBaseline?.(0);
- });
-
const entityById = createMemo(
() => {
const list = rows() ?? [];
@@ -1121,12 +1067,10 @@ export const SoupViewList = (props: SoupViewListProps) => {
setSearchText(cached.searchText);
soup.focus.set(cached.focus);
virtualizerHandle()?.scrollTo(cached.scrollOffset ?? 0);
- props.onScrollOffsetBaseline?.(cached.scrollOffset ?? 0);
registerFocusEffects(false);
return;
}
- props.onScrollOffsetBaseline?.(0);
registerFocusEffects();
};
@@ -1193,7 +1137,12 @@ export const SoupViewList = (props: SoupViewListProps) => {
<StaticMarkdownContext>
<Switch>
<Match when={source.isFetching() && !rows().length}>
- <LoadingBlock />
+ {/* Non-list states pad the chrome top themselves — the
+ panel leaves list views unpadded so rows can
+ under-scroll the status bar. */}
+ <div class="flex-1 min-h-0 flex flex-col mobile:pt-(--mobile-content-inset-top) mobile:pb-(--mobile-content-inset-bottom)">
+ <LoadingBlock />
+ </div>
</Match>
<Match
when={
@@ -1201,7 +1150,7 @@ export const SoupViewList = (props: SoupViewListProps) => {
!rows().length
}
>
- <div class="flex items-center gap-2 p-3 text-xs text-text-muted">
+ <div class="flex items-center gap-2 p-3 text-xs text-text-muted mobile:mt-(--mobile-content-inset-top) mobile:mb-(--mobile-content-inset-bottom)">
<Spinner class="size-3 animate-spin" />
Searching...
</div>
@@ -1212,13 +1161,15 @@ export const SoupViewList = (props: SoupViewListProps) => {
forceEmptyState()
}
>
- <EmptyState
- listView={currentView()}
- search={!!searchText()}
- hasRefinementsFromBase={hasActiveRefinements()}
- hasHiddenItems={hasHiddenItems()}
- onClearFilters={resetToTabDefaults}
- />
+ <div class="flex-1 min-h-0 flex flex-col mobile:pt-(--mobile-content-inset-top) mobile:pb-(--mobile-content-inset-bottom)">
+ <EmptyState
+ listView={currentView()}
+ search={!!searchText()}
+ hasRefinementsFromBase={hasActiveRefinements()}
+ hasHiddenItems={hasHiddenItems()}
+ onClearFilters={resetToTabDefaults}
+ />
+ </div>
</Match>
<Match when={rows().length}>
<ListLayoutProvider ref={localEntityListRef}>
@@ -1263,7 +1214,6 @@ export const SoupViewList = (props: SoupViewListProps) => {
)}
class="overflow-hidden flex min-w-0"
virtualizerRef={registerVirtualizerHandler}
- onScrollOffsetChange={props.onScrollOffsetChange}
onScrollBottom={debouncedFetchMore}
scrollBottomOffset={300}
rows={rows()}
@@ -1479,7 +1429,9 @@ export const SoupViewList = (props: SoupViewListProps) => {
</div>
</Show>
<Show when={i() === rows().length - 1}>
- <div class="h-15" />
+ {/* Desktop-only: mobile clearance comes
+ from the in-scroll trailing spacer. */}
+ <div class="h-15 mobile:hidden" />
</Show>
</>
);
@@ -1537,7 +1489,6 @@ export const SoupViewList = (props: SoupViewListProps) => {
const DEFAULT_ITEM_SIZE = 10;
const DEFAULT_OVERSCAN = 5;
-const FLOATING_BUTTON_SCROLL_UP_THRESHOLD = 5;
interface SoupListProps {
ref?: (el: HTMLDivElement) => void;
@@ -1557,10 +1508,16 @@ interface SoupListProps {
const SoupList = (props: SoupListProps) => {
const [virtualizerHandle, setVirtualizerHandle] =
createSignal<VirtualizerHandle>();
+ const splitPanel = useSplitPanel();
const itemSize = createMemo(() => props.itemSize ?? DEFAULT_ITEM_SIZE);
const overscan = createMemo(() => props.overscan ?? DEFAULT_OVERSCAN);
+ // Full-frame mobile: rows under-scroll the status bar; this in-scroll
+ // spacer is their resting inset (safe-top — list views have no header).
+ const topInset = () =>
+ isMobile() ? (splitPanel?.contentOffsetTop() ?? 0) : 0;
+
const handleScroll = (offset: number) => {
const handle = virtualizerHandle();
@@ -1592,18 +1549,37 @@ const SoupList = (props: SoupListProps) => {
props.class
)}
>
- <VList
- cache={props.cache}
- ref={registerVirtualizerHandler}
+ {/* Hand-rolled VList (scroller + Virtualizer) so the full-frame mobile
+ insets can live inside the scroller: rows rest clear of the chrome
+ but still slide beneath it. `startMargin` keeps virtua's scroll
+ math correct for the leading spacer. */}
+ <div
class={cn('overscroll-none', props.virtualizerClass)}
- data={props.rows}
- itemSize={itemSize()}
- bufferSize={overscan() * itemSize()}
- onScroll={handleScroll}
+ style={{
+ display: 'block',
+ 'overflow-y': 'auto',
+ contain: 'strict',
+ width: '100%',
+ height: '100%',
+ }}
{...soupListContainerAttribute}
>
- {(row, i) => props.children(row, i)}
- </VList>
+ <div aria-hidden style={{ height: `${topInset()}px` }} />
+ <Virtualizer
+ cache={props.cache}
+ ref={registerVirtualizerHandler}
+ startMargin={topInset()}
+ data={props.rows}
+ itemSize={itemSize()}
+ bufferSize={overscan() * itemSize()}
+ onScroll={handleScroll}
+ >
+ {(row, i) => props.children(row, i)}
+ </Virtualizer>
+ <Show when={isMobile()}>
+ <div aria-hidden class="h-(--mobile-content-inset-bottom)" />
+ </Show>
+ </div>
</div>
);
};
diff --git a/js/app/packages/app/component/settings/Settings.tsx b/js/app/packages/app/component/settings/Settings.tsx
index 4c5c9f830b..0b02f0837f 100644
--- a/js/app/packages/app/component/settings/Settings.tsx
+++ b/js/app/packages/app/component/settings/Settings.tsx
@@ -6,7 +6,6 @@ import { MobileApp } from './MobileApp';
import { Agent } from './Agent';
import { Admin } from './Admin';
import { Appearance } from './Appearance';
-import { MobileTabs } from '@core/component/MobileTabs';
import { Account } from './Account';
import { Email } from './Email';
import { GitHub } from './GitHub';
@@ -14,6 +13,9 @@ import { Shortcuts } from './Shortcuts';
import { Team } from './Team';
import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';
import type { ValidHotkey } from '@core/hotkey/types';
+import { FloatRegion } from '../mobile/float-regions/FloatRegion';
+import { PillTabs } from '../mobile/PillTabs';
+import { HeaderIsland } from '../split-layout/components/HeaderIsland';
import { Button, SideNav } from '@ui';
import ColumnsPlusRight from '@phosphor/columns-plus-right.svg';
import ArrowsOut from '@phosphor/arrows-out.svg';
@@ -22,21 +24,13 @@ import {
SplitHeaderLeft,
SplitHeaderRight,
} from '../split-layout/components/SplitHeader';
-import { SettingsButton } from './SettingsButton';
/** Where the settings panel is mounted, which determines its header chrome. */
export type SettingsVariant = 'split' | 'modal';
export function SettingsPanelComponentWrapper() {
return (
- <>
- <Show when={isMobile()}>
- <SplitHeaderRight>
- <SettingsButton />
- </SplitHeaderRight>
- </Show>
<SettingsPanel />
- </>
)
}
@@ -158,16 +152,15 @@ export function SettingsPanel(props: SettingsPanelProps) {
function BottomTabs() {
return (
- <div class="bg-surface border-t border-edge-muted h-11 shrink-0 px-1 flex">
- <div class="flex-1 min-w-0 h-full">
- <MobileTabs
- list={flatTabs().map((tab) => ({ value: tab.tab, label: tab.label }))}
+ <FloatRegion region="accessory">
+ <div class="flex items-center px-(--mobile-chrome-gutter)">
+ <PillTabs
+ items={flatTabs().map((tab) => ({ value: tab.tab, label: tab.label }))}
value={activeTabId()}
- defaultValue="Account"
onChange={handleTabChange}
/>
</div>
- </div>
+ </FloatRegion>
);
}
@@ -181,11 +174,13 @@ export function SettingsPanel(props: SettingsPanelProps) {
>
<Show when={variant() === 'split'}>
<SplitHeaderLeft>
- <div class="h-full flex gap-3 items-center">
- <h1 class="font-semibold text-ink select-none text-sm shrink-0">
- Settings
- </h1>
- </div>
+ <HeaderIsland>
+ <div class="h-full flex gap-3 items-center">
+ <h1 class="font-semibold text-ink select-none text-sm shrink-0">
+ Settings
+ </h1>
+ </div>
+ </HeaderIsland>
</SplitHeaderLeft>
{/* Pop the split back out into the modal (desktop only). */}
<Show when={!isMobile()}>
@@ -249,7 +244,7 @@ export function SettingsPanel(props: SettingsPanelProps) {
</SideNav>
</Show>
- <div class="relative grow min-h-1 min-w-0 overflow-auto">
+ <div class="relative grow min-h-1 min-w-0 overflow-auto mobile:pt-(--mobile-content-inset-top) mobile:pb-(--mobile-content-inset-bottom)">
<Show when={isCurrentTab('Account')}>
<Suspense>
<Account />
@@ -288,9 +283,7 @@ export function SettingsPanel(props: SettingsPanelProps) {
</div>
</div>
- <Show when={isMobile()}>
- <BottomTabs />
- </Show>
+ <BottomTabs />
</div>
);
}
diff --git a/js/app/packages/app/component/side-panel/SidePanel.tsx b/js/app/packages/app/component/side-panel/SidePanel.tsx
index 0f4c08397f..854448be3e 100644
--- a/js/app/packages/app/component/side-panel/SidePanel.tsx
+++ b/js/app/packages/app/component/side-panel/SidePanel.tsx
@@ -168,7 +168,9 @@ function SidePanelLayoutInner(
<Show when={showOverlay()}>
<div class="absolute inset-0 z-10 flex flex-col bg-surface">
<Scroll>
- <div class="w-full max-w-2xl mx-auto min-w-0">
+ {/* Full-frame mobile: the overlay spans the whole panel, so the
+ content must clear the floating header islands + status bar. */}
+ <div class="w-full max-w-2xl mx-auto min-w-0 mobile:pt-(--mobile-content-inset-top)">
<SidePanelOutlet
sections={props.sections}
openIds={props.openIds}
@@ -285,6 +287,9 @@ function useSidePanel() {
* Pill-style tabs that switch between the main content and the side panel
* overlay in narrow mode. Renders nothing when the layout is wide or when no
* sections are registered, so it's safe to mount unconditionally.
+ *
+ * Hidden on mobile, where the header title island doubles as the
+ * Content/Info switcher instead (see BlockItemSplitLabel).
*/
function NarrowTabs(props: { contentLabel?: string; infoLabel?: string }) {
const ctx = useContext(SidePanelContext);
@@ -293,7 +298,7 @@ function NarrowTabs(props: { contentLabel?: string; infoLabel?: string }) {
const value = () => (ctx.isOpen() ? 'info' : 'content');
return (
- <Show when={ctx.isNarrow() && ctx.hasSections()}>
+ <Show when={ctx.isNarrow() && ctx.hasSections() && !isMobile()}>
<TabsInset
list={[
{ value: 'content', label: props.contentLabel ?? 'Content' },
diff --git a/js/app/packages/app/component/split-layout/components/HeaderIsland.tsx b/js/app/packages/app/component/split-layout/components/HeaderIsland.tsx
new file mode 100644
index 0000000000..f2785e02c2
--- /dev/null
+++ b/js/app/packages/app/component/split-layout/components/HeaderIsland.tsx
@@ -0,0 +1,34 @@
+import { isMobile } from '@core/mobile/isMobile';
+import { cn, Layer } from '@ui';
+import { type ParentProps, Show } from 'solid-js';
+
+/**
+ * Marks an island boundary inside a SplitHeader contribution. Every header
+ * slot contribution must wrap its content in one of these (directly or via
+ * SplitLabel / ResponsiveBlockToolbar) — there is no fallback styling for
+ * bare slot content on mobile.
+ *
+ * Desktop: renders children directly — zero layout impact, so header content
+ * needs no mobile fork. Mobile: renders a floating pill wrapped in the same
+ * Layer depth as the rest of the floating chrome (dock, accessories), so
+ * `island` surface colors match across the chrome.
+ *
+ * Note: crossing the mobile breakpoint remounts children.
+ */
+export function HeaderIsland(props: ParentProps<{ class?: string }>) {
+ return (
+ <Show when={isMobile()} fallback={props.children}>
+ <Layer depth={3}>
+ <div
+ data-header-island
+ class={cn(
+ 'island pointer-events-auto flex h-10 min-w-0 shrink-0 items-center gap-1 rounded-full px-3 empty:hidden',
+ props.class
+ )}
+ >
+ {props.children}
+ </div>
+ </Layer>
+ </Show>
+ );
+}
diff --git a/js/app/packages/app/component/split-layout/components/HeaderTitleMenu.tsx b/js/app/packages/app/component/split-layout/components/HeaderTitleMenu.tsx
new file mode 100644
index 0000000000..fb419f2ff8
--- /dev/null
+++ b/js/app/packages/app/component/split-layout/components/HeaderTitleMenu.tsx
@@ -0,0 +1,69 @@
+import { hapticImpact } from '@core/mobile/haptics';
+import CaretDownIcon from '@phosphor/caret-down.svg';
+import CheckIcon from '@phosphor/check.svg';
+import { Dropdown } from '@ui';
+import {
+ type Component,
+ For,
+ type JSX,
+ type ParentProps,
+ Show,
+} from 'solid-js';
+import { Dynamic } from 'solid-js/web';
+
+export type HeaderTitleMenuItem = {
+ value: string;
+ label: JSX.Element | string;
+ icon?: Component<JSX.SvgSVGAttributes<SVGSVGElement>>;
+};
+
+/**
+ * Mobile header pattern: the title island doubles as a view switcher.
+ * Children render as the dropdown trigger (icon + title) followed by a
+ * caret; the menu lists the block's views with a check on the active one.
+ * Used in place of header/toolbar tabs, which are hidden on mobile.
+ */
+export function HeaderTitleMenu(
+ props: ParentProps<{
+ items: readonly HeaderTitleMenuItem[];
+ active?: string;
+ onSelect: (value: string) => void;
+ }>
+) {
+ return (
+ <Dropdown placement="bottom-start">
+ <Dropdown.Trigger class="ph-no-capture h-8 max-w-full min-w-0 gap-1.5 border-none bg-transparent px-1 text-ink mobile:active:bg-transparent">
+ {props.children}
+ <CaretDownIcon class="size-3 shrink-0 text-ink-muted" />
+ </Dropdown.Trigger>
+ <Dropdown.Content depth={3} class="shadow-md">
+ <Dropdown.Group>
+ <For each={[...props.items]}>
+ {(item) => (
+ <Dropdown.Item
+ class="h-10 min-w-44 text-sm"
+ onSelect={() => {
+ hapticImpact('light');
+ props.onSelect(item.value);
+ }}
+ >
+ <Show when={item.icon}>
+ {(icon) => (
+ <Dynamic
+ component={icon()}
+ class="size-4 shrink-0 text-ink-muted"
+ />
+ )}
+ </Show>
+ <span>{item.label}</span>
+ <Show when={props.active === item.value}>
+ <CheckIcon class="ml-auto size-3.5 shrink-0 text-accent" />
+ </Show>
+ </Dropdown.Item>
+ )}
+ </For>
+ </Dropdown.Group>
+ </Dropdown.Content>
+ </Dropdown>
+ );
+}
diff --git a/js/app/packages/app/component/split-layout/components/SplitHeader.tsx b/js/app/packages/app/component/split-layout/components/SplitHeader.tsx
index 7339a7d105..f1d21ef59d 100644
--- a/js/app/packages/app/component/split-layout/components/SplitHeader.tsx
+++ b/js/app/packages/app/component/split-layout/components/SplitHeader.tsx
@@ -5,6 +5,7 @@ import type { BlockName } from '@core/block';
import { fileTypeToBlockName } from '@core/constant/allBlocks';
import { TOKENS } from '@core/hotkey/tokens';
import { isMobile } from '@core/mobile/isMobile';
+import { isNativeMobilePlatform } from '@core/mobile/isNativeMobilePlatform';
import type { EntityDragEvent } from '@entity';
import CollapseIcon from '@phosphor/arrows-in.svg';
import ExpandIcon from '@phosphor/arrows-out.svg';
@@ -28,6 +29,7 @@ import { splitBackInterceptor } from '../back-interceptor';
import { SplitLayoutContext, SplitPanelContext } from '../context';
import type { SplitContent } from '../layoutManager';
import { canSpotlight } from '../utils/canSpotlight';
+import { HeaderIsland } from './HeaderIsland';
function getEntitySplitContent(data: EntityDragEvent['draggable']['data']):
| {
@@ -62,7 +64,7 @@ function SplitBackButton() {
if (!context) return null;
return (
<Button
- class="p-1 rounded-lg"
+ class="p-1 rounded-lg mobile:active:bg-transparent"
label="Go Back"
hotkey={TOKENS.split.go.back}
disabled={!context.handle.canGoBack()}
@@ -85,10 +87,7 @@ function SplitForwardButton() {
hotkey={TOKENS.split.go.forward}
disabled={!context.handle.canGoForward()}
onClick={context.handle.goForward}
- class={cn(
- 'p-1 rounded-lg',
- isMobile() && !context.handle.canGoForward() && 'hidden'
- )}
+ class={cn('p-1 rounded-lg')}
>
<CaretRight class="h-4" />
</Button>
@@ -262,7 +261,13 @@ export function SplitHeader(props: { ref: Setter<HTMLDivElement | null> }) {
<div
class={cn(
'isolate relative w-full h-full overflow-clip text-ink',
+ // On mobile the header overlays the panel body as a transparent strip
+ // of floating islands
+ 'mobile:absolute mobile:inset-x-0 mobile:z-mobile-nav-bar mobile:h-11.25 mobile:overflow-visible mobile:pointer-events-none',
isMobile() && isListViewID(panel.handle.content().id) && 'hidden',
+ isMobile() &&
+ !isNativeMobilePlatform() &&
+ 'mobile:top-[calc(var(--safe-top)+6px)]',
isEntityDraggingOver() && 'bg-active/50'
)}
data-split-header
@@ -286,19 +291,32 @@ export function SplitHeader(props: { ref: Setter<HTMLDivElement | null> }) {
</Portal>
)}
</Show>
- <div class="absolute inset-0 flex justify-start items-center">
- <div class="relative flex items-center pl-2 mobile:pl-0 h-full">
- <div class="mobile:hidden">
- <SplitCloseButton />
- </div>
- <Show when={!(isMobile() && isListViewID(panel.handle.content().id))}>
- <SplitBackButton />
- <SplitForwardButton />
- </Show>
- </div>
+ <div class="absolute inset-0 flex justify-start items-center mobile:px-(--mobile-chrome-gutter) mobile:gap-2">
+ <Show
+ when={isMobile()}
+ fallback={
+ <div class="relative flex items-center pl-2 h-full">
+ <SplitCloseButton />
+ <SplitBackButton />
+ <SplitForwardButton />
+ </div>
+ }
+ >
+ {/* Back/forward island. */}
+ <HeaderIsland
+ class={cn(
+ 'relative gap-0 px-1',
+ !panel.handle.canGoBack() && 'hidden'
+ )}
+ >
+ <Show when={!isListViewID(panel.handle.content().id)}>
+ <SplitBackButton />
+ </Show>
+ </HeaderIsland>
+ </Show>
<div
- class="relative min-w-0 h-full shrink pl-2 flex items-center gap-0.5"
+ class="relative min-w-0 h-full shrink pl-2 flex items-center gap-0.5 mobile:pl-0 mobile:gap-2"
ref={(ref) => {
panel.layoutRefs.headerLeft = ref;
}}
@@ -314,7 +332,7 @@ export function SplitHeader(props: { ref: Setter<HTMLDivElement | null> }) {
</div>
</Show>*/}
- <div class="min-w-4 h-full grow shrink flex items-center justify-end gap-0.5 px-2">
+ <div class="h-full grow shrink flex items-center justify-end gap-0.5 px-2 mobile:px-0 mobile:gap-2">
<div
class="contents"
ref={(ref) => {
diff --git a/js/app/packages/app/component/split-layout/components/SplitLabel.tsx b/js/app/packages/app/component/split-layout/components/SplitLabel.tsx
index b6cb6fe0de..4321b018f7 100644
--- a/js/app/packages/app/component/split-layout/components/SplitLabel.tsx
+++ b/js/app/packages/app/component/split-layout/components/SplitLabel.tsx
@@ -1,4 +1,5 @@
import { openBulkEditModal } from '@app/component/bulk-edit-entity/BulkEditEntityModal';
+import { useSidePanel } from '@app/component/side-panel/SidePanel';
import { isInBlock, useBlockAliasedName, useBlockId } from '@core/block';
import {
EntityIcon,
@@ -6,6 +7,7 @@ import {
isArchiveType,
} from '@core/component/EntityIcon';
import { toast } from '@core/component/Toast/Toast';
+import { isMobile } from '@core/mobile/isMobile';
import { blockMetadataSignal } from '@core/signal/load';
import {
useCanComment,
@@ -15,9 +17,13 @@ import {
} from '@core/signal/permissions';
import { useBlockDocumentName } from '@core/util/currentBlockDocumentName';
import { type BuildEntityDataArgs, buildEntityData } from '@entity';
+import ArticleIcon from '@phosphor/article.svg';
+import InfoIcon from '@phosphor/info.svg';
import { cn, Tooltip } from '@ui';
import { type Accessor, createEffect, type JSX, Show } from 'solid-js';
import { useSplitPanelOrThrow } from '../layoutUtils';
+import { HeaderIsland } from './HeaderIsland';
+import { HeaderTitleMenu, type HeaderTitleMenuItem } from './HeaderTitleMenu';
export function StaticSplitLabel(props: {
label: string;
@@ -32,26 +38,28 @@ export function StaticSplitLabel(props: {
panel.handle.setDisplayName(props.label);
});
return (
- <div
- class={cn(
- 'z-page-overlay relative flex items-center gap-2 max-w-full h-full shrink',
- props.class
- )}
- >
- <Show when={props.iconType}>
- <EntityIcon
- class="shrink-0"
- targetType={props.iconType}
- size="xs"
- theme={props.colorIcon ? undefined : 'monochrome'}
- />
- </Show>
- <Show when={props.icon}>
- <div class="shrink-0">{props.icon}</div>
- </Show>
- <Show when={props.badges}>{props.badges}</Show>
- <span class="inline-block text-sm truncate">{props.label}</span>
- </div>
+ <HeaderIsland class="shrink">
+ <div
+ class={cn(
+ 'z-page-overlay relative flex items-center gap-2 max-w-full h-full shrink',
+ props.class
+ )}
+ >
+ <Show when={props.iconType}>
+ <EntityIcon
+ class="shrink-0"
+ targetType={props.iconType}
+ size="xs"
+ theme={props.colorIcon ? undefined : 'monochrome'}
+ />
+ </Show>
+ <Show when={props.icon}>
+ <div class="shrink-0">{props.icon}</div>
+ </Show>
+ <Show when={props.badges}>{props.badges}</Show>
+ <span class="inline-block text-sm truncate">{props.label}</span>
+ </div>
+ </HeaderIsland>
);
}
@@ -173,14 +181,43 @@ export function BlockItemSplitLabel(props: {
panel.handle.setDisplayName(displayName());
});
+ const sidePanel = useSidePanel();
+
return (
- <div class="ph-no-capture z-page-overlay relative flex items-center gap-2 min-w-0 max-w-full h-full shrink">
- <EntityIcon class="shrink-0" targetType={targetType()} size="xs" />
- <Show when={props.badges}>{props.badges}</Show>
- <SplitLabel
- label={displayName() ?? ''}
- lockRename={!isOwner() || props.lockRename}
- />
- </div>
+ <HeaderIsland class="shrink">
+ <Show
+ when={isMobile() && sidePanel?.hasSections()}
+ fallback={
+ <div class="ph-no-capture z-page-overlay relative flex items-center gap-2 min-w-0 max-w-full h-full shrink">
+ <EntityIcon class="shrink-0" targetType={targetType()} size="xs" />
+ <Show when={props.badges}>{props.badges}</Show>
+ <SplitLabel
+ label={displayName() ?? ''}
+ lockRename={!isOwner() || props.lockRename}
+ />
+ </div>
+ }
+ >
+ {/* Mobile: the side-panel tabs hide behind the title — tapping it
+ opens a menu switching between Content and Info. */}
+ <HeaderTitleMenu
+ items={SIDE_PANEL_VIEWS}
+ active={sidePanel?.isOpen() ? 'info' : 'content'}
+ onSelect={(value) => sidePanel?.setIsOpen(value === 'info')}
+ >
+ <EntityIcon class="shrink-0" targetType={targetType()} size="xs" />
+ <Show when={props.badges}>{props.badges}</Show>
+ <SplitLabel
+ label={displayName() ?? ''}
+ lockRename={!isOwner() || props.lockRename}
+ />
+ </HeaderTitleMenu>
+ </Show>
+ </HeaderIsland>
);
}
+
+const SIDE_PANEL_VIEWS: HeaderTitleMenuItem[] = [
+ { value: 'content', label: 'Content', icon: ArticleIcon },
+ { value: 'info', label: 'Info', icon: InfoIcon },
+];
diff --git a/js/app/packages/app/component/split-layout/components/SplitPanel.tsx b/js/app/packages/app/component/split-layout/components/SplitPanel.tsx
index d7e82eec3d..87a20de7eb 100644
--- a/js/app/packages/app/component/split-layout/components/SplitPanel.tsx
+++ b/js/app/packages/app/component/split-layout/components/SplitPanel.tsx
@@ -1,3 +1,4 @@
+import { MobileTopEdgeFade } from '@app/component/mobile/MobileEdgeFade';
import { createSoupState } from '@app/component/next-soup/create-soup-state';
import { SoupContextProvider } from '@app/component/next-soup/soup-context';
import { SoupViewContextProvider } from '@app/component/next-soup/soup-view/soup-view-context';
@@ -5,6 +6,7 @@ import { isListViewID, LIST_VIEW_ID } from '@app/constants/list-views';
import { globalSplitManager } from '@app/signal/splitLayout';
import { splitContainerAttribute } from '@core/dom-selectors';
import { isMobile } from '@core/mobile/isMobile';
+import { getSafeAreaInset } from '@core/mobile/safeAreaInsets';
import CloseIcon from '@phosphor/x.svg';
import { createElementSize } from '@solid-primitives/resize-observer';
import { Button, cn, Panel } from '@ui';
@@ -120,7 +122,12 @@ export function SplitPanel(props: SplitPanelProps) {
});
const offsetTop = createMemo(() => {
- const offset = (headerSize.height ?? 0) + (toolbarSize.height ?? 0);
+ // Full-frame mobile: panels start at the screen edge, so anything that
+ // offsets from the panel top (drawers, content insets) must clear the
+ // status bar as well as the header.
+ const safeTop = isMobile() ? getSafeAreaInset('top') : 0;
+ const offset =
+ safeTop + (headerSize.height ?? 0) + (toolbarSize.height ?? 0);
setContentOffsetTop(offset);
return offset;
});
@@ -175,6 +182,15 @@ export function SplitPanel(props: SplitPanelProps) {
'opacity-100': props.active || props.handle.isSpotLight(),
'relative size-full': !props.handle.isSpotLight(),
}}
+ style={{
+ '--split-header-height': `${
+ shouldHideSplitHeader() ? 0 : (headerSize.height ?? 0)
+ }px`,
+ // The hard spacer for top-anchored content on full-frame
+ // mobile: status bar + floating header strip.
+ '--mobile-content-inset-top':
+ 'calc(var(--safe-top, 0px) + var(--split-header-height, 0px))',
+ }}
ref={(ref) => {
setPanelRef(ref);
props.setPanelRef(ref);
@@ -192,12 +208,15 @@ export function SplitPanel(props: SplitPanelProps) {
multipleSplits() &&
!props.handle.isSpotLight()
}
- class="rounded-xl mobile:rounded-none mobile:after:hidden mobile:!border-0"
+ class="rounded-xl mobile:rounded-none mobile:after:hidden mobile:border-0!"
depth={1}
>
<Panel.Header
class={cn(
'block min-h-10.25 touch:min-h-11.25 p-0 overflow-visible',
+ // On mobile the header collapses to a zero-height grid row;
+ // SplitHeader overlays the body as floating islands.
+ 'mobile:min-h-0 mobile:border-b-0',
shouldHideSplitHeader() && 'hidden'
)}
>
@@ -208,6 +227,7 @@ export function SplitPanel(props: SplitPanelProps) {
class={cn(
'items-start py-2 overflow-visible',
!hasToolbarContent() && 'hidden',
+ isMobile() && 'hidden',
(!previewState() ||
isListViewID(props.handle.content().id)) &&
'border-b-0' /* List views draw the preview border below their filter bar instead (see SoupView). */
@@ -253,6 +273,7 @@ export function SplitPanel(props: SplitPanelProps) {
)}
</Show>
</div>
+ <MobileTopEdgeFade />
</Panel.Body>
</Panel>
</div>
diff --git a/js/app/packages/app/index.css b/js/app/packages/app/index.css
index 416fc4abbc..104fe04be4 100644
--- a/js/app/packages/app/index.css
+++ b/js/app/packages/app/index.css
@@ -61,6 +61,11 @@
--safe-left: max(env(safe-area-inset-left, 0px), var(--tauri-inset-left, 0px));
--safe-top: max(env(safe-area-inset-top, 0px), var(--tauri-inset-top, 0px));
+ /* Horizontal gutter shared by the full-frame mobile chrome: the dock row,
+ header island strip, and accessory-region contributions all pad with
+ this so their edges line up. Use `px-(--mobile-chrome-gutter)`. */
+ --mobile-chrome-gutter: 0.75rem;
+
/* chat vars */
--left-of-connector: calc(var(--message-padding-x) + var(--user-icon-width) * 0.5);
--left-of-user-icon: calc(var(--left-of-connector) - var(--user-icon-width) * 0.5);
@@ -215,6 +220,23 @@
}
}
+/* Floating "island" chrome shared by the mobile dock buttons, header islands,
+ and other floating mobile controls. Consumers add their own shape classes
+ (e.g. `size-10 rounded-full` or `h-10 rounded-full px-3`). Defined as a
+ utility so it composes with variants — `mobile:island` — instead of
+ hand-prefixing each part. */
+@utility island {
+ @apply bg-surface text-ink ring ring-edge shadow-md;
+}
+
+[data-press-pulse] {
+ transition: transform 100ms cubic-bezier(0.34, 1.56, 0.64, 1);
+}
+[data-press-pulse][data-pressed] {
+ transform: scale(1.08);
+ transition: transform 100ms ease-out;
+}
+
@layer base {
html {
font: -apple-system-body;
@@ -443,6 +465,19 @@ a {
}
}
+/* Mobile bottom chrome: accessory contributions animate in when they mount
+ or swap (enter-only; losers unmount immediately). The Portal wrapper div
+ is the region slot's direct child. */
+[data-float-region='accessory'] > * {
+ animation: float-region-in 150ms ease-out;
+}
+@keyframes float-region-in {
+ from {
+ opacity: 0;
+ transform: translateY(0.5rem);
+ }
+}
+
@media (pointer: coarse) {
.md-table-cell-resizer {
background-color: #adf;
diff --git a/js/app/packages/block-automation/component/Automation.tsx b/js/app/packages/block-automation/component/Automation.tsx
index a2c103feb2..565c4df74d 100644
--- a/js/app/packages/block-automation/component/Automation.tsx
+++ b/js/app/packages/block-automation/component/Automation.tsx
@@ -1,3 +1,4 @@
+import { HeaderIsland } from '@app/component/split-layout/components/HeaderIsland';
import { SplitHeaderLeft } from '@app/component/split-layout/components/SplitHeader';
import { useSplitLayout } from '@app/component/split-layout/layout';
import { useSplitPanelOrThrow } from '@app/component/split-layout/layoutUtils';
@@ -234,19 +235,25 @@ export function Automation() {
{(d) => (
<>
<SplitHeaderLeft>
- <div class="z-page-overlay relative flex h-full w-screen max-w-full shrink items-center gap-2">
- <EntityIcon class="shrink-0" targetType="automation" size="xs" />
- <span
- class="inline-block min-w-0 flex-1 truncate text-sm"
- onDblClick={() => setRenameOpen(true)}
- onContextMenu={(e) => {
- e.preventDefault();
- setRenameOpen(true);
- }}
- >
- {d().name || blockNameToDefaultFile('automation')}
- </span>
- </div>
+ <HeaderIsland class="shrink">
+ <div class="z-page-overlay relative flex h-full w-screen max-w-full shrink items-center gap-2">
+ <EntityIcon
+ class="shrink-0"
+ targetType="automation"
+ size="xs"
+ />
+ <span
+ class="inline-block min-w-0 flex-1 truncate text-sm"
+ onDblClick={() => setRenameOpen(true)}
+ onContextMenu={(e) => {
+ e.preventDefault();
+ setRenameOpen(true);
+ }}
+ >
+ {d().name || blockNameToDefaultFile('automation')}
+ </span>
+ </div>
+ </HeaderIsland>
</SplitHeaderLeft>
<AutomationRenameModal
isOpen={renameOpen}
diff --git a/js/app/packages/block-canvas/component/FloatingMenu.tsx b/js/app/packages/block-canvas/component/FloatingMenu.tsx
index 8dbc39fc54..7a04dec8e0 100644
--- a/js/app/packages/block-canvas/component/FloatingMenu.tsx
+++ b/js/app/packages/block-canvas/component/FloatingMenu.tsx
@@ -480,6 +480,8 @@ export function FloatingMenu() {
<div
class={cn(
'absolute flex flex-row top-4 z-5 cursor-auto',
+ // Full-frame mobile: clear the floating split chrome at the top.
+ 'mobile:top-[calc(var(--mobile-content-inset-top,0)+0.5rem)]',
!isMobileWidth() && 'right-4'
)}
>
diff --git a/js/app/packages/block-canvas/component/ToolBar.tsx b/js/app/packages/block-canvas/component/ToolBar.tsx
index f1143645ce..f2548dfe9a 100644
--- a/js/app/packages/block-canvas/component/ToolBar.tsx
+++ b/js/app/packages/block-canvas/component/ToolBar.tsx
@@ -181,7 +181,8 @@ export function ToolBar() {
return (
<ScopedPortal scope="block">
- <div class="absolute left-1/2 bottom-2 flex flex-row p-1 bg-surface border border-edge -translate-x-1/2">
+ {/* Full-frame mobile: rest above the floating bottom chrome. */}
+ <div class="absolute left-1/2 bottom-2 mobile:bottom-[calc(var(--mobile-content-inset-bottom,0)+0.5rem)] flex flex-row p-1 bg-surface border border-edge -translate-x-1/2">
<div
class={cn(
'flex flex-row items-center space-x-2',
diff --git a/js/app/packages/block-canvas/component/TopBar.tsx b/js/app/packages/block-canvas/component/TopBar.tsx
index fdc0fc1341..3d5847a1f3 100644
--- a/js/app/packages/block-canvas/component/TopBar.tsx
+++ b/js/app/packages/block-canvas/component/TopBar.tsx
@@ -146,7 +146,8 @@ export function TopBar() {
<BlockItemSplitLabel />
</SplitHeaderLeft>
<SplitHeaderRight>
- <div class="-order-1">
+ {/* Hidden on mobile: no floating-island treatment for live avatars yet. */}
+ <div class="-order-1 mobile:hidden">
<BlockLiveIndicators />
</div>
</SplitHeaderRight>
diff --git a/js/app/packages/block-channel/component/Compose.tsx b/js/app/packages/block-channel/component/Compose.tsx
index 2dbe2ceca1..815f0ef020 100644
--- a/js/app/packages/block-channel/component/Compose.tsx
+++ b/js/app/packages/block-channel/component/Compose.tsx
@@ -1,3 +1,4 @@
+import { FloatRegionOrInline } from '@app/component/mobile/float-regions/FloatRegion';
import { SplitHeaderLeft } from '@app/component/split-layout/components/SplitHeader';
import {
SplitHeaderBadge,
@@ -218,14 +219,14 @@ export function ChannelCompose() {
<div class="h-full items-center flex" p-1></div>
</SplitToolbarLeft>
<div class="relative flex flex-col size-full panel">
- <div class="pt-2 size-full grow overflow-y-auto @min-[40rem]:px-4">
+ <div class="pt-2 mobile:pt-[calc(var(--mobile-content-inset-top)+.5rem)] size-full grow overflow-y-auto @min-[40rem]:px-4">
<div class="macro-message-width macro-message-padding mx-auto pb-1 h-full">
<input
type="text"
value={channelName()}
disabled={selectedRecipients().length < 2}
placeholder={previewName()}
- class="text-xl font-medium mb-6 mt-12 bg-transparent border-none outline-none w-full resize-none appearance-none focus:ring-0"
+ class="text-xl font-medium mb-6 mt-12 mobile:mt-0 bg-transparent border-none outline-none w-full resize-none appearance-none focus:ring-0"
style="box-shadow: none;"
onInput={(e) => {
if (selectedRecipients().length >= 2) {
@@ -252,83 +253,89 @@ export function ChannelCompose() {
</div>
</div>
</div>
- <Show when={error()}>
- <div class="shrink-0 w-full @min-[40rem]:px-4">
- <div class="mx-auto w-full macro-message-width macro-message-padding">
- <div class="text-sm font-mono text-failure-ink">{error()}</div>
+ {/* Full-frame mobile: error + composer float in the bottom accessory
+ region above the dock; desktop renders them inline as before. */}
+ <FloatRegionOrInline region="accessory">
+ <Show when={error()}>
+ <div class="shrink-0 w-full @min-[40rem]:px-4 mobile:px-(--mobile-chrome-gutter)">
+ <div class="mx-auto w-full macro-message-width macro-message-padding">
+ <div class="text-sm font-mono text-failure-ink">{error()}</div>
+ </div>
</div>
- </div>
- </Show>
- <div class="px-2">
- <ChannelInputContainer>
- <Input.Root
- input={inputState.view()}
- commands={inputState.commands}
- >
- <Surface
- depth={2}
- class="rounded-xl ring-1 ring-edge"
- style={{ border: '0' }}
+ </Show>
+ {/* ChannelInputContainer owns the mobile chrome gutter, so drop the
+ desktop px-2 there. */}
+ <div class="px-2 mobile:px-0">
+ <ChannelInputContainer>
+ <Input.Root
+ input={inputState.view()}
+ commands={inputState.commands}
>
- <Input.DropZone
- onDragStart={(valid) => inputState.setIsDraggedOver(valid)}
- onDragEnd={() => inputState.setIsDraggedOver(false)}
+ <Surface
+ depth={2}
+ class="rounded-xl mobile:rounded-3xl ring-1 ring-edge"
+ style={{ border: '0' }}
>
- <Input.Layout>
- <Input.DropOverlay />
- <Input.FormatRibbon>
- <FormatButtons
- selectionState={() => markdownEditor.selection}
- onInlineFormat={(format) =>
- applyInlineFormat(markdownEditor.lexical, format)
- }
- onNodeFormat={(format) =>
- applyNodeFormat(markdownEditor.lexical, format)
- }
- />
- </Input.FormatRibbon>
- <Input.EditorShell
- ref={setScrollContainer}
- onClick={(event) => {
- if (!isMobile()) {
- event.stopPropagation();
- markdownEditor.controls.focus();
- }
- }}
- >
- <Input.Editor>
- <MarkdownShell
- config={markdownEditor}
- placeholder={placeholder()}
- autofocus={false}
- class="text-sm"
+ <Input.DropZone
+ onDragStart={(valid) => inputState.setIsDraggedOver(valid)}
+ onDragEnd={() => inputState.setIsDraggedOver(false)}
+ >
+ <Input.Layout>
+ <Input.DropOverlay />
+ <Input.FormatRibbon>
+ <FormatButtons
+ selectionState={() => markdownEditor.selection}
+ onInlineFormat={(format) =>
+ applyInlineFormat(markdownEditor.lexical, format)
+ }
+ onNodeFormat={(format) =>
+ applyNodeFormat(markdownEditor.lexical, format)
+ }
/>
- </Input.Editor>
- </Input.EditorShell>
- <Input.Attachments kind="media" />
- <Input.Attachments kind="document" />
- <Input.Footer>
- <Input.Actions>
- <Input.Actions.Left>
- <Show
- when={!isPlatform('ios')}
- fallback={<Input.AttachNativeMediaAction />}
- >
- <Input.AttachFilesAction />
- </Show>
- <Input.ToggleFormatAction />
- </Input.Actions.Left>
- <Input.Actions.Right>
- <Input.SendAction />
- </Input.Actions.Right>
- </Input.Actions>
- </Input.Footer>
- </Input.Layout>
- </Input.DropZone>
- </Surface>
- </Input.Root>
- </ChannelInputContainer>
- </div>
+ </Input.FormatRibbon>
+ <Input.EditorShell
+ ref={setScrollContainer}
+ onClick={(event) => {
+ if (!isMobile()) {
+ event.stopPropagation();
+ markdownEditor.controls.focus();
+ }
+ }}
+ >
+ <Input.Editor>
+ <MarkdownShell
+ config={markdownEditor}
+ placeholder={placeholder()}
+ autofocus={false}
+ class="text-sm"
+ />
+ </Input.Editor>
+ </Input.EditorShell>
+ <Input.Attachments kind="media" />
+ <Input.Attachments kind="document" />
+ <Input.Footer>
+ <Input.Actions>
+ <Input.Actions.Left>
+ <Show
+ when={!isPlatform('ios')}
+ fallback={<Input.AttachNativeMediaAction />}
+ >
+ <Input.AttachFilesAction />
+ </Show>
+ <Input.ToggleFormatAction />
+ </Input.Actions.Left>
+ <Input.Actions.Right>
+ <Input.SendAction />
+ </Input.Actions.Right>
+ </Input.Actions>
+ </Input.Footer>
+ </Input.Layout>
+ </Input.DropZone>
+ </Surface>
+ </Input.Root>
+ </ChannelInputContainer>
+ </div>
+ </FloatRegionOrInline>
</div>
</>
);
diff --git a/js/app/packages/block-channel/component/NewChannelBlockAdapter.tsx b/js/app/packages/block-channel/component/NewChannelBlockAdapter.tsx
index ea95bd09b1..6032978143 100644
--- a/js/app/packages/block-channel/component/NewChannelBlockAdapter.tsx
+++ b/js/app/packages/block-channel/component/NewChannelBlockAdapter.tsx
@@ -1,5 +1,6 @@
import { useBlockEntityCommands } from '@app/component/next-soup/actions';
import { useMaybePreviewPanel } from '@app/component/PreviewPanel';
+import { HeaderIsland } from '@app/component/split-layout/components/HeaderIsland';
import { SplitHeaderRight } from '@app/component/split-layout/components/SplitHeader';
import { useNavigatedFromJK } from '@app/component/useNavigatedFromJK';
import { globalSplitManager } from '@app/signal/splitLayout';
@@ -46,6 +47,7 @@ import { useActiveCallQuery } from '@queries/call/call';
import { useChannelParticipantsQuery } from '@queries/channel/channel-participants';
import { ChannelTypeEnum } from '@service-storage/client';
import { useSearchParams } from '@solidjs/router';
+import { cn } from '@ui';
import {
createComputed,
createSignal,
@@ -142,11 +144,22 @@ function NewTop(props: { channelId: string }) {
activeTab={activeTab()}
onTabChange={setActiveTab}
/>
- <Show when={ENABLE_CALLS()}>
+ {/* Hidden once the user has joined — the call surface owns the UI. */}
+ <Show when={ENABLE_CALLS() && !call.isInThisChannel()}>
<SplitHeaderRight>
- <div class="flex items-center gap-1.5">
- <ChannelCallButton channelId={props.channelId} />
- </div>
+ <HeaderIsland
+ class={cn(
+ 'px-1',
+ // Call in progress: tint the whole island, matching the call
+ // button's `success` variant.
+ !!activeCallQuery.data &&
+ 'bg-success ring-success [&_button]:text-surface'
+ )}
+ >
+ <div class="flex items-center gap-1.5">
+ <ChannelCallButton channelId={props.channelId} />
+ </div>
+ </HeaderIsland>
</SplitHeaderRight>
</Show>
<ChannelTopBarLiveIndicators />
@@ -308,7 +321,16 @@ export function NewChannelBlockAdapter(props: BlockChannelProps) {
pendingJoinCall={pendingJoinCall}
onHandled={() => setPendingJoinCall(false)}
/>
- <div class="h-full flex flex-col px-2 mobile:px-0">
+ <div
+ class={cn(
+ 'h-full flex flex-col px-2 mobile:px-0',
+ // The channel block is full-frame on mobile (messages scroll
+ // behind the chrome); the other tabs still need to start below
+ // the status bar + floating header.
+ activeTab() !== 'messages' &&
+ 'mobile:pt-(--mobile-content-inset-top)'
+ )}
+ >
<Switch>
<Match when={activeTab() === 'messages'}>
<NewChannel
diff --git a/js/app/packages/block-channel/component/Top.tsx b/js/app/packages/block-channel/component/Top.tsx
index b168756c43..f27a03ac1c 100644
--- a/js/app/packages/block-channel/component/Top.tsx
+++ b/js/app/packages/block-channel/component/Top.tsx
@@ -1,4 +1,6 @@
import { CollapsibleHeaderItem } from '@app/component/split-layout/components/CollapsibleHeaderItem';
+import { HeaderIsland } from '@app/component/split-layout/components/HeaderIsland';
+import { HeaderTitleMenu } from '@app/component/split-layout/components/HeaderTitleMenu';
import { SplitHeaderLeft } from '@app/component/split-layout/components/SplitHeader';
import { SplitLabel } from '@app/component/split-layout/components/SplitLabel';
import type { ChannelTabId } from '@channel/Channel/channel-tabs';
@@ -84,53 +86,77 @@ export function ChannelTopLeft(props: ChannelTopLeftProps) {
};
});
+ const hasTabsMenu = () => !!(props.tabs?.length && props.onTabChange);
+
return (
<SplitHeaderLeft>
- <div class="ph-no-capture z-page-overlay relative flex items-center gap-2 max-w-full h-full shrink min-w-15">
- <TopIcon
- channelType={props.channelType}
- participants={props.participants}
- />
- <SplitLabel
- label={channelName() ?? 'New Channel'}
- lockRename={props.lockRename}
- renameOverrides={{ channelType: props.channelType }}
- maxDisplayLength={48}
- />
- </div>
- <Show when={props.tabs && props.activeTab && props.onTabChange}>
- <Show
- when={!isMobile()}
- fallback={
- <div class="ph-no-capture flex items-center min-w-0 shrink-0 h-full mx-2">
- <TabsInset
- list={iconTabList()}
- value={props.activeTab}
- onChange={(value) => props.onTabChange?.(value as ChannelTabId)}
- />
- </div>
- }
- >
- <CollapsibleHeaderItem
- id="channel-tabs"
- priority={1}
- containerClass="ph-no-capture min-w-0 shrink-0 h-full mx-2"
- expanded={() => (
- <TabsInset
- list={[...(props.tabs ?? [])]}
- value={props.activeTab}
- onChange={(value) => props.onTabChange?.(value as ChannelTabId)}
- />
- )}
- collapsed={() => (
- <TabsInset
- list={iconTabList()}
- value={props.activeTab}
- onChange={(value) => props.onTabChange?.(value as ChannelTabId)}
+ <Show
+ when={isMobile() && hasTabsMenu()}
+ fallback={
+ <>
+ <HeaderIsland class="shrink">
+ <div class="ph-no-capture z-page-overlay relative flex items-center gap-2 max-w-full h-full shrink min-w-15">
+ <TopIcon
+ channelType={props.channelType}
+ participants={props.participants}
+ />
+ <SplitLabel
+ label={channelName() ?? 'New Channel'}
+ lockRename={props.lockRename}
+ renameOverrides={{ channelType: props.channelType }}
+ maxDisplayLength={48}
+ />
+ </div>
+ </HeaderIsland>
+ <Show when={!isMobile() && hasTabsMenu() && props.activeTab}>
+ <CollapsibleHeaderItem
+ id="channel-tabs"
+ priority={1}
+ containerClass="ph-no-capture min-w-0 shrink-0 h-full mx-2"
+ expanded={() => (
+ <TabsInset
+ list={[...(props.tabs ?? [])]}
+ value={props.activeTab}
+ onChange={(value) =>
+ props.onTabChange?.(value as ChannelTabId)
+ }
+ />
+ )}
+ collapsed={() => (
+ <TabsInset
+ list={iconTabList()}
+ value={props.activeTab}
+ onChange={(value) =>
+ props.onTabChange?.(value as ChannelTabId)
+ }
+ />
+ )}
/>
- )}
- />
- </Show>
+ </Show>
+ </>
+ }
+ >
+ {/* Mobile: the tabs hide behind the channel name — tapping the title
+ opens a menu of the tab views. */}
+ <HeaderIsland class="shrink">
+ <HeaderTitleMenu
+ items={(props.tabs ?? []).map((tab) => ({
+ value: tab.value,
+ label: tab.label,
+ icon: CHANNEL_TAB_ICONS[tab.value],
+ }))}
+ active={props.activeTab}
+ onSelect={(value) => props.onTabChange?.(value as ChannelTabId)}
+ >
+ <TopIcon
+ channelType={props.channelType}
+ participants={props.participants}
+ />
+ <span class="min-w-0 truncate text-sm font-medium">
+ {channelName() ?? 'New Channel'}
+ </span>
+ </HeaderTitleMenu>
+ </HeaderIsland>
</Show>
</SplitHeaderLeft>
);
diff --git a/js/app/packages/block-chat/component/Chat.tsx b/js/app/packages/block-chat/component/Chat.tsx
index fad304192d..1801f152a0 100644
--- a/js/app/packages/block-chat/component/Chat.tsx
+++ b/js/app/packages/block-chat/component/Chat.tsx
@@ -1,4 +1,5 @@
import { useAnalytics } from '@app/component/analytics-context';
+import { FloatRegionOrInline } from '@app/component/mobile/float-regions/FloatRegion';
import { useMaybePreviewPanel } from '@app/component/PreviewPanel';
import { SplitToolbarLeft } from '@app/component/split-layout/components/SplitToolbar';
import { useNavigatedFromJK } from '@app/component/useNavigatedFromJK';
@@ -299,7 +300,7 @@ function ChatInner(props: {
class="h-full min-h-0 overflow-auto scrollbar-hidden"
ref={setScrollRef}
>
- <div class="mx-auto w-full max-w-3xl">
+ <div class="mx-auto w-full max-w-3xl mobile:pt-[calc(var(--mobile-content-inset-top,0)+0.5rem)] mobile:pb-(--mobile-content-inset-bottom)">
<ChatMessages
editDisabled={disabled()}
pendingLocationParams={pendingLocationParamsSignal.get}
@@ -309,19 +310,21 @@ function ChatInner(props: {
<CustomScrollbar scrollContainer={scrollRef} />
</div>
<Show when={!disabled()}>
- <div class="flex w-full justify-center pb-2 px-2">
- <div class="w-3xl">
- <ChatInput
- editor={editor}
- initialValue={props.loadedInputText}
- onChange={setMarkdownText}
- chatId={chat.chatId()}
- onSend={onSend}
- onStop={onStop}
- autoFocusOnMount={!isPreview && !navigatedFromJK()}
- />
+ <FloatRegionOrInline region="accessory">
+ <div class="flex w-full justify-center pb-2 px-2 mobile:pb-0 mobile:px-(--mobile-chrome-gutter) mobile:pointer-events-auto">
+ <div class="w-3xl">
+ <ChatInput
+ editor={editor}
+ initialValue={props.loadedInputText}
+ onChange={setMarkdownText}
+ chatId={chat.chatId()}
+ onSend={onSend}
+ onStop={onStop}
+ autoFocusOnMount={!isPreview && !navigatedFromJK()}
+ />
+ </div>
</div>
- </div>
+ </FloatRegionOrInline>
</Show>
</DragDropWrapper>
);
diff --git a/js/app/packages/block-code/component/CodeMirror.tsx b/js/app/packages/block-code/component/CodeMirror.tsx
index 3d2ab1b96e..6bb13e4bba 100644
--- a/js/app/packages/block-code/component/CodeMirror.tsx
+++ b/js/app/packages/block-code/component/CodeMirror.tsx
@@ -177,5 +177,13 @@ export function CodeMirror() {
view?.destroy();
});
- return <div class="size-full overflow-auto" ref={containerRef} />;
+ return (
+ <div
+ // Full-frame mobile: the floating split chrome overlays the panel, so
+ // the inset lives on the CodeMirror scroller — code rests below the
+ // chrome but under-scrolls it.
+ class="size-full overflow-auto mobile:[&_.cm-scroller]:pt-(--mobile-content-inset-top) mobile:[&_.cm-scroller]:pb-(--mobile-content-inset-bottom)"
+ ref={containerRef}
+ />
+ );
}
diff --git a/js/app/packages/block-code/component/HtmlPreview.tsx b/js/app/packages/block-code/component/HtmlPreview.tsx
index e2e2213131..116f994bba 100644
--- a/js/app/packages/block-code/component/HtmlPreview.tsx
+++ b/js/app/packages/block-code/component/HtmlPreview.tsx
@@ -8,7 +8,9 @@ export function HtmlPreview() {
});
return (
- <div class="size-full bg-surface overflow-auto">
+ // Static pads on mobile: the iframe scrolls internally, so its content
+ // can't under-scroll the floating chrome — the viewport sits between it.
+ <div class="size-full bg-surface overflow-auto mobile:pt-(--mobile-content-inset-top) mobile:pb-(--mobile-content-inset-bottom)">
<iframe
title="HTML preview"
class="size-full border-0"
diff --git a/js/app/packages/block-email/component/BottomReplyButtons.tsx b/js/app/packages/block-email/component/BottomReplyButtons.tsx
index 378b675850..2611e232cd 100644
--- a/js/app/packages/block-email/component/BottomReplyButtons.tsx
+++ b/js/app/packages/block-email/component/BottomReplyButtons.tsx
@@ -1,10 +1,12 @@
+import { FloatRegionOrInline } from '@app/component/mobile/float-regions/FloatRegion';
import { useEmail } from '@core/context/user';
+import { isMobile } from '@core/mobile/isMobile';
import ArrowBendDoubleUpLeft from '@phosphor/arrow-bend-double-up-left.svg';
import ArrowBendUpLeft from '@phosphor/arrow-bend-up-left.svg';
import ArrowBendUpRight from '@phosphor/arrow-bend-up-right.svg';
import type { ApiMessage } from '@service-email/generated/schemas';
import { createCallback } from '@solid-primitives/rootless';
-import { Button } from '@ui';
+import { Button, cn } from '@ui';
import { type Component, Show } from 'solid-js';
import { isReplyAllEligible } from '../util/recipientConversion';
import type { ReplyType } from '../util/replyType';
@@ -20,7 +22,16 @@ function ReplyActionButton(props: {
<Button
variant="base"
size="sm"
- class="rounded-lg px-3 py-1.5 text-sm text-ink-muted hover:text-ink border border-ink-muted/8 bg-ink-muted/2.5 hover:bg-ink-muted/6"
+ // 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.)
+ depth={isMobile() ? 4 : undefined}
+ class={cn(
+ 'rounded-lg px-3 py-1.5 text-sm text-ink-muted hover:text-ink border border-ink-muted/8 bg-ink-muted/2.5 hover:bg-ink-muted/6',
+ // Island pills when floating in the mobile accessory region.
+ 'mobile:island mobile:h-8 mobile:rounded-full mobile:border-0'
+ )}
onClick={props.onClick}
>
<props.icon class="size-3.5" />
@@ -51,26 +62,28 @@ export function BottomReplyButtons(props: { lastMessage: ApiMessage }) {
});
return (
- <div class="w-full pt-2 pb-1">
- <div class="flex flex-row items-center gap-2">
- <ReplyActionButton
- icon={ArrowBendUpLeft}
- label="Reply"
- onClick={open('reply')}
- />
- <Show when={shouldShowReplyAll()}>
+ <FloatRegionOrInline region="accessory">
+ <div class="w-full pt-2 pb-1 mobile:py-0 mobile:px-(--mobile-chrome-gutter)">
+ <div class="flex flex-row items-center gap-2 mobile:pointer-events-auto">
<ReplyActionButton
- icon={ArrowBendDoubleUpLeft}
- label="Reply all"
- onClick={open('reply-all')}
+ icon={ArrowBendUpLeft}
+ label="Reply"
+ onClick={open('reply')}
/>
- </Show>
- <ReplyActionButton
- icon={ArrowBendUpRight}
- label="Forward"
- onClick={open('forward')}
- />
+ <Show when={shouldShowReplyAll()}>
+ <ReplyActionButton
+ icon={ArrowBendDoubleUpLeft}
+ label="Reply all"
+ onClick={open('reply-all')}
+ />
+ </Show>
+ <ReplyActionButton
+ icon={ArrowBendUpRight}
+ label="Forward"
+ onClick={open('forward')}
+ />
+ </div>
</div>
- </div>
+ </FloatRegionOrInline>
);
}
diff --git a/js/app/packages/block-email/component/Email.tsx b/js/app/packages/block-email/component/Email.tsx
index ec2f704187..1a617cbd6c 100644
--- a/js/app/packages/block-email/component/Email.tsx
+++ b/js/app/packages/block-email/component/Email.tsx
@@ -19,6 +19,7 @@ import {
} from '@core/signal/blockElement';
import type { ApiMessage } from '@service-email/generated/schemas';
import { createCallback } from '@solid-primitives/rootless';
+import { cn } from '@ui';
import {
type Accessor,
createEffect,
@@ -498,6 +499,22 @@ function EmailContent(props: EmailViewProps) {
return { replyingTo: undefined, draft: latest };
});
+ // The bottom reply area renders when the user can compose and there's a
+ // message to reply to or a draft to edit. Returns the reply info so it can
+ // drive the keyed <Show> around the reply area.
+ const replyArea = () =>
+ context.permissions().isOwner &&
+ context.drafts.initialDraftsSettled() &&
+ emailReplyInfo();
+
+ // The expanded compose input, as opposed to the collapsed reply buttons
+ // (which float in the mobile accessory region).
+ const replyInputOpen = () =>
+ context.messages.bottomReplyOpen() || emailReplyInfo()?.replyingTo == null;
+
+ // Whether the compose input is rendered in normal flow.
+ const replyInputInFlow = () => Boolean(replyArea() && replyInputOpen());
+
return (
<ModalsProvider subject={props.title}>
<Show when={!isUserLoading()}>
@@ -509,7 +526,13 @@ function EmailContent(props: EmailViewProps) {
emailReplyInfo()?.draft
}
>
- {(draft) => <EmailCompose draftID={draft().db_id!} />}
+ {(draft) => (
+ // The email block is bottom-anchored (no default panel inset),
+ // so the compose branch pads around the chrome itself.
+ <div class="size-full mobile:pt-(--mobile-content-inset-top) mobile:pb-(--mobile-content-inset-bottom)">
+ <EmailCompose draftID={draft().db_id!} />
+ </div>
+ )}
</Match>
<Match when={true}>
@@ -521,6 +544,8 @@ function EmailContent(props: EmailViewProps) {
onRecipientsChange: context.onRecipientsChange,
}}
>
+ {/* Edge-to-edge on mobile: the message list carries its own
+ insets in-scroll and under-scrolls the floating chrome. */}
<div class="size-full bg-surface select-none overscroll-none overflow-hidden flex flex-col">
<TopBar
id={props.threadId()}
@@ -556,31 +581,34 @@ function EmailContent(props: EmailViewProps) {
initialLoadComplete={context.initialLoadComplete()}
onScrollPositionChange={handleScrollPositionChange}
title={props.title}
+ underScrollsBottom={!replyInputInFlow()}
/>
<CustomScrollbar
reverse
scrollContainer={context.messagesListRef}
/>
</div>
- <Show
- when={
- context.permissions().isOwner &&
- context.drafts.initialDraftsSettled() &&
- emailReplyInfo()
- }
- >
+ <Show when={replyArea()}>
{(info) => (
- <div class="shrink-0 w-full pb-4">
+ <div
+ class={cn(
+ 'shrink-0 w-full pb-4',
+ // Edge-to-edge mobile: the in-flow input clears the
+ // bottom chrome itself; when collapsed, the reply
+ // buttons float in the accessory region instead and
+ // this wrapper drops out of the layout.
+ replyInputInFlow()
+ ? 'mobile:pb-[calc(var(--mobile-content-inset-bottom,0)+1rem)]'
+ : 'mobile:hidden'
+ )}
+ >
<div class="relative w-full flex flex-row justify-center bg-surface macro-message-width macro-message-padding mx-auto">
<FloatingInputLoader
isLoading={context.query.isFetching}
loadingText="Loading messages"
/>
<Show
- when={
- context.messages.bottomReplyOpen() ||
- info().replyingTo == null
- }
+ when={replyInputOpen()}
fallback={
<Show when={info().replyingTo}>
{(lastMessage) => (
diff --git a/js/app/packages/block-email/component/MessageList.tsx b/js/app/packages/block-email/component/MessageList.tsx
index f16e4ee2ff..a972964470 100644
--- a/js/app/packages/block-email/component/MessageList.tsx
+++ b/js/app/packages/block-email/component/MessageList.tsx
@@ -2,6 +2,7 @@ import { useEmailContext } from '@block-email/component/EmailContext';
import { isScrollingToMessage } from '@block-email/signal/scrollState';
import { StaticMarkdownContext } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
import { isMobile } from '@core/mobile/isMobile';
+import { cn } from '@ui';
import { createMemo, createSelector, Index, Show } from 'solid-js';
import { MessageContainer } from './MessageContainer';
@@ -9,6 +10,12 @@ interface MessageListProps {
initialLoadComplete: boolean;
onScrollPositionChange?: (scrollFromTop: number) => void;
title?: string;
+ /**
+ * Full-frame mobile: when nothing is in flow below the list (the collapsed
+ * reply buttons float in the accessory region), the list carries the bottom
+ * inset in-scroll so the last message rests above the floating chrome.
+ */
+ underScrollsBottom?: boolean;
}
export function MessageList(props: MessageListProps) {
@@ -25,7 +32,14 @@ export function MessageList(props: MessageListProps) {
return (
<div
- class="pt-1 pb-6 w-full flex flex-col-reverse items-center overflow-y-scroll overflow-x-hidden scrollbar-hidden text-sm gap-1.5"
+ class={cn(
+ 'pt-1 pb-6 w-full flex flex-col-reverse items-center overflow-y-scroll overflow-x-hidden scrollbar-hidden text-sm gap-1.5',
+ // In-scroll top inset: messages rest below the floating split chrome
+ // but under-scroll it.
+ 'mobile:pt-[calc(var(--mobile-content-inset-top,0)+0.5rem)]',
+ props.underScrollsBottom &&
+ 'mobile:pb-[calc(var(--mobile-content-inset-bottom,0)+1.5rem)]'
+ )}
ref={context.registerMessagesList}
onscroll={(e) => {
// Since the list is reversed, calculate scroll from visual top
diff --git a/js/app/packages/block-email/component/compose/ComposeLayout.tsx b/js/app/packages/block-email/component/compose/ComposeLayout.tsx
index 069136db12..c8d2361c3a 100644
--- a/js/app/packages/block-email/component/compose/ComposeLayout.tsx
+++ b/js/app/packages/block-email/component/compose/ComposeLayout.tsx
@@ -2,6 +2,7 @@ import { CircleSpinner } from '@core/component/CircleSpinner';
import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';
import { TOKENS } from '@core/hotkey/tokens';
import { isMobile } from '@core/mobile/isMobile';
+import { cn } from '@ui';
import { createSignal, type JSX, onMount, Show, Suspense } from 'solid-js';
import { FromInboxSelector } from '../FromInboxSelector';
import { ComposeBody } from './ComposeBody';
@@ -179,7 +180,13 @@ export function ComposeLayout(props: {
};
return (
- <div ref={registerRef('containerRef')} class={props.class}>
+ <div
+ ref={registerRef('containerRef')}
+ class={cn(
+ 'mobile:pt-[calc(var(--mobile-content-inset-top)+.5rem)]',
+ props.class
+ )}
+ >
<div class="pb-1 w-full h-max shrink-0">
<div
class="mb-4 h-6 flex items-center justify-between gap-3"
diff --git a/js/app/packages/block-email/component/compose/ComposeToolbar.tsx b/js/app/packages/block-email/component/compose/ComposeToolbar.tsx
index 4be7910eeb..761d9a4597 100644
--- a/js/app/packages/block-email/component/compose/ComposeToolbar.tsx
+++ b/js/app/packages/block-email/component/compose/ComposeToolbar.tsx
@@ -1,3 +1,4 @@
+import { HeaderIsland } from '@app/component/split-layout/components/HeaderIsland';
import { SplitHeaderRight } from '@app/component/split-layout/components/SplitHeader';
import { EmailDateSelector } from '@block-email/component/email-date-selector';
import { MAX_ATTACHMENTS_BYTES_SIZE } from '@block-email/constants';
@@ -173,31 +174,32 @@ function MobileToolbar(props: {
return (
<SplitHeaderRight>
- <div class="flex items-center gap-1 pl-2">
- <div class="relative" ref={props.attachButtonRef}>
- <Button
- ref={(el) =>
- fileSelector(el, () => ({
- multiple: true,
- onSelect: props.handleAddAttachments,
- }))
- }
- tooltip="Attach"
- size="icon-sm"
- disabled={ctx.disabled()}
- >
- <PaperclipIcon />
- </Button>
- </div>
- <Show when={ENABLE_EMAIL_SCHEDULED_SEND && ctx.onSendTimeChange}>
- <EmailDateSelector
- sendTime={ctx.sendTime()}
- onSendTimeChange={ctx.onSendTimeChange}
- disabled={ctx.scheduleSendDisabled?.()}
- compact
- />
- </Show>
- <Tooltip label={ctx.sendTime() ? 'Send time is scheduled' : ''}>
+ <HeaderIsland>
+ <div class="flex items-center gap-1 pl-2">
+ <Show when={!ctx.hideAttachments}>
+ <div class="relative" ref={props.attachButtonRef}>
+ <Button
+ ref={(el) =>
+ fileSelector(el, () => ({
+ multiple: true,
+ onSelect: props.handleAddAttachments,
+ }))
+ }
+ size="icon-sm"
+ disabled={ctx.disabled()}
+ >
+ <PaperclipIcon />
+ </Button>
+ </div>
+ </Show>
+ <Show when={ENABLE_EMAIL_SCHEDULED_SEND && ctx.onSendTimeChange}>
+ <EmailDateSelector
+ sendTime={ctx.sendTime()}
+ onSendTimeChange={ctx.onSendTimeChange}
+ disabled={ctx.scheduleSendDisabled?.()}
+ compact
+ />
+ </Show>
<Show when={ctx.onSaveDraft}>
<Button
variant="base"
@@ -219,10 +221,9 @@ function MobileToolbar(props: {
}
pending={ctx.isSending()}
onClick={() => ctx.onSend()}
- tooltip="Send email"
/>
- </Tooltip>
- </div>
+ </div>
+ </HeaderIsland>
</SplitHeaderRight>
);
}
diff --git a/js/app/packages/block-md/component/Block.tsx b/js/app/packages/block-md/component/Block.tsx
index 96e8b07899..92dc4aaa0a 100644
--- a/js/app/packages/block-md/component/Block.tsx
+++ b/js/app/packages/block-md/component/Block.tsx
@@ -203,7 +203,7 @@ function BlockMarkdownContent({ optimisticSnapshot }: BlockMarkdownProps) {
data-block-content
>
<Scroll class="relative" ref={setScrollRef}>
- <div class="relative portal-scope">
+ <div class="relative portal-scope mobile:pt-(--mobile-content-inset-top) mobile:pb-(--mobile-content-inset-bottom)">
<Suspense>
<Show
when={!isInstructionsMd()}
diff --git a/js/app/packages/block-md/component/Notebook.tsx b/js/app/packages/block-md/component/Notebook.tsx
index c5782076cc..00dc16784f 100644
--- a/js/app/packages/block-md/component/Notebook.tsx
+++ b/js/app/packages/block-md/component/Notebook.tsx
@@ -236,7 +236,7 @@ export function Notebook(props: { loroManager: LoroManager }) {
const contentDivClasses = createMemo(() => {
const mode = layoutMode();
- const shared = 'grow max-w-3xl pt-12 min-w-0';
+ const shared = 'grow max-w-3xl pt-12 mobile:pt-6 min-w-0';
switch (mode) {
case CommentLayoutMode.lg:
return `${shared} mx-auto`;
diff --git a/js/app/packages/block-md/component/TopBar.tsx b/js/app/packages/block-md/component/TopBar.tsx
index 62cfcd81e6..9e86bf0586 100644
--- a/js/app/packages/block-md/component/TopBar.tsx
+++ b/js/app/packages/block-md/component/TopBar.tsx
@@ -257,7 +257,8 @@ export function TopBar(props: { name?: Accessor<string | undefined> } = {}) {
</SplitHeaderLeft>
<SplitHeaderRight>
- <div class="-order-1">
+ {/* Hidden on mobile: no floating-island treatment for live avatars yet. */}
+ <div class="-order-1 mobile:hidden">
<BlockLiveIndicators />
</div>
</SplitHeaderRight>
diff --git a/js/app/packages/block-pdf/component/TopBar.tsx b/js/app/packages/block-pdf/component/TopBar.tsx
index 04bb338e9a..964ee72984 100644
--- a/js/app/packages/block-pdf/component/TopBar.tsx
+++ b/js/app/packages/block-pdf/component/TopBar.tsx
@@ -243,7 +243,8 @@ export function TopBar() {
<BlockItemSplitLabel />
</SplitHeaderLeft>
<SplitHeaderRight>
- <div class="-order-1">
+ {/* Hidden on mobile: no floating-island treatment for live avatars yet. */}
+ <div class="-order-1 mobile:hidden">
<BlockLiveIndicators />
</div>
</SplitHeaderRight>
diff --git a/js/app/packages/block-pdf/component/block.css b/js/app/packages/block-pdf/component/block.css
index 314b46000d..ddc186e51d 100644
--- a/js/app/packages/block-pdf/component/block.css
+++ b/js/app/packages/block-pdf/component/block.css
@@ -299,3 +299,14 @@ tspan {
pointer-events: none;
}
+
+/* Full-frame mobile (mirrors the `mobile` Tailwind variant): the floating
+ chrome overlays the panel, so the document scroller carries both insets
+ itself — pages rest between the chrome but under-scroll it, and the end
+ of the document can scroll clear of the bottom chrome. */
+@media (max-width: 639px) {
+ html[data-touch-device='true'] .pdfViewerContainer {
+ padding-top: var(--mobile-content-inset-top, 0px);
+ padding-bottom: var(--mobile-content-inset-bottom, 0px);
+ }
+}
diff --git a/js/app/packages/block-project/component/TopBar.tsx b/js/app/packages/block-project/component/TopBar.tsx
index 00e56cbe92..95011e1b18 100644
--- a/js/app/packages/block-project/component/TopBar.tsx
+++ b/js/app/packages/block-project/component/TopBar.tsx
@@ -8,6 +8,7 @@ import {
ResponsivePermissionsBadge,
ToolButton,
} from '@app/component/ResponsiveBlockToolbar';
+import { HeaderIsland } from '@app/component/split-layout/components/HeaderIsland';
import { useDrawerControl } from '@app/component/split-layout/components/SplitDrawerContext';
import {
type FileOperation,
@@ -168,13 +169,15 @@ export function TopBar() {
{/* Mobile layout */}
<SplitHeaderRight>
<Show when={ops().length > 0 || !isSpecialProject}>
- <SplitFileMenu
- id={id}
- itemType="project"
- name={name()}
- ops={ops()}
- tools={[...tools, ...createTools]}
- />
+ <HeaderIsland>
+ <SplitFileMenu
+ id={id}
+ itemType="project"
+ name={name()}
+ ops={ops()}
+ tools={[...tools, ...createTools]}
+ />
+ </HeaderIsland>
</Show>
</SplitHeaderRight>
</Show>
diff --git a/js/app/packages/channel/Call/ChannelCallButton.tsx b/js/app/packages/channel/Call/ChannelCallButton.tsx
index 4437683d57..5bdc200b4d 100644
--- a/js/app/packages/channel/Call/ChannelCallButton.tsx
+++ b/js/app/packages/channel/Call/ChannelCallButton.tsx
@@ -1,4 +1,5 @@
import { useChannelTab } from '@channel/Channel/ChannelTabContext';
+import { isMobile } from '@core/mobile/isMobile';
import PhoneIcon from '@icon/wide-call.svg';
import { useActiveCallQuery } from '@queries/call/call';
import { Button, cn } from '@ui';
@@ -19,6 +20,12 @@ export function ChannelCallButton(props: { channelId: string }) {
const tooltip = () => (isCallInProgress() ? 'Join Call' : 'Start Call');
const label = () => (isCallInProgress() ? 'Join' : 'Call');
+ const variant = () => {
+ if (isMobile()) return 'ghost';
+ if (isCallInProgress()) return 'success';
+ return 'base';
+ };
+
const handleClick = async () => {
if (call.isJoining()) return;
try {
@@ -33,10 +40,13 @@ export function ChannelCallButton(props: { channelId: string }) {
<Button
onClick={handleClick}
tooltip={tooltip()}
- variant={isCallInProgress() ? 'success' : 'base'}
+ variant={variant()}
size="sm"
depth={2}
- class={cn(!isCallInProgress() && 'bg-surface')}
+ class={cn(
+ !isCallInProgress() && !isMobile() && 'bg-surface',
+ isMobile() && 'active:bg-transparent'
+ )}
>
<PhoneIcon />
<span>{label()}</span>
diff --git a/js/app/packages/channel/Channel/ActiveCallMessage.tsx b/js/app/packages/channel/Channel/ActiveCallMessage.tsx
index 0380d0274e..2bcc85d8ea 100644
--- a/js/app/packages/channel/Channel/ActiveCallMessage.tsx
+++ b/js/app/packages/channel/Channel/ActiveCallMessage.tsx
@@ -36,7 +36,8 @@ export function ActiveCallMessage(props: { channelId: string }) {
return (
<Show when={shouldShow()}>
- <div class="w-full flex justify-center">
+ {/* Full-frame mobile: place above the floating input/dock stack. */}
+ <div class="w-full flex justify-center mobile:pb-(--mobile-content-inset-bottom)">
<div class="macro-message-width w-full relative">
<div class="w-full pr-2 pl-(--message-padding-x)">
<div
diff --git a/js/app/packages/channel/Channel/Channel.tsx b/js/app/packages/channel/Channel/Channel.tsx
index 40decc430e..7aa2edc3f8 100644
--- a/js/app/packages/channel/Channel/Channel.tsx
+++ b/js/app/packages/channel/Channel/Channel.tsx
@@ -1,5 +1,8 @@
import { openChatWithInput } from '@app/component/ChatWithAgentButton';
+import { FloatRegionOrInline } from '@app/component/mobile/float-regions/FloatRegion';
+import { FloatRegions } from '@app/component/mobile/float-regions/float-region-state';
import { useSplitLayout } from '@app/component/split-layout/layout';
+import { useSplitPanel } from '@app/component/split-layout/layoutUtils';
import { createActivityTracker } from '@channel/activity-tracker';
import { DebugSuspense } from '@channel/DebugSuspense';
import type { ChannelInputProps } from '@channel/Input/ChannelInput';
@@ -16,6 +19,7 @@ import { StaticMarkdownContext } from '@core/component/LexicalMarkdown/component
import { toast } from '@core/component/Toast/Toast';
import { useChannelActivity, useChannelName } from '@core/context/channels';
import { useUserId } from '@core/context/user';
+import { isMobile } from '@core/mobile/isMobile';
import type { DateValue } from '@core/util/date';
import {
extractUserMentions,
@@ -109,6 +113,19 @@ export type ChannelHandle = {
export function Channel(props: ChannelProps) {
const userId = useUserId();
+ const splitPanel = useSplitPanel();
+
+ // Full-frame mobile: the thread list spans the whole screen and messages
+ // scroll behind the floating header islands (top) and the floating
+ // input + dock (bottom). contentOffsetTop already includes the safe area.
+ const threadListScrollInsets = () =>
+ isMobile()
+ ? {
+ start: splitPanel?.contentOffsetTop() ?? 0,
+ // '4' here is a magic offset so that the ThreadRail correctly hits the the curved edge of the floating input. Not idea, but low impact and it works.
+ end: FloatRegions.hostHeight() - 4,
+ }
+ : { start: 0, end: 0 };
const sendMessageMutation = useSendMessageMutation();
const patchMessageMutation = usePatchMessageMutation();
@@ -457,7 +474,7 @@ export function Channel(props: ChannelProps) {
>
<Show when={findBar.isOpen()}>
<FindBar
- class="absolute top-2 right-3 z-10 w-80 max-w-[calc(100%-1.5rem)]"
+ class="absolute top-2 right-3 z-10 w-80 max-w-[calc(100%-1.5rem)] mobile:top-[calc(var(--mobile-content-inset-top,0)+0.5rem)]"
controller={findBar}
direction="desc"
/>
@@ -467,6 +484,7 @@ export function Channel(props: ChannelProps) {
<ThreadList
keys={() => messageIndex.keys}
initialScrollTarget={threadListInitialScrollTarget()}
+ fullFrameScrollInsets={threadListScrollInsets}
shift={shift}
prepend={threadPaginator.isPrepending}
onScrollNearTop={threadPaginator.shiftPaginate}
@@ -528,6 +546,7 @@ export function Channel(props: ChannelProps) {
<ScrollToBottomOverlay
scrollState={threadListScrollState}
onScrollToBottom={handleScrollToBottom}
+ class="mobile:top-[calc(var(--mobile-content-inset-top,0)+1rem)]"
/>
</Show>
</div>
@@ -535,51 +554,54 @@ export function Channel(props: ChannelProps) {
<ActiveCallMessage channelId={props.channelId} />
</div>
<DebugSuspense name="Channel.input">
- <ChannelInputContainer
- ref={(el) => {
- attachInputRef(el);
- setChannelInputEl(el);
- }}
- isHidden={isChannelInputHidden()}
- >
- <ChannelInput
- autofocus={props.autofocus}
- collapsible
- input={{
- mode: 'channel',
- id: `channel-input-${props.channelId}`,
- placeholder: 'Message channel',
- isDraggingOverChannel: dragState.isDraggingOverChannel(),
- isValidChannelDrag: dragState.isValidChannelDrag(),
+ <FloatRegionOrInline region="accessory">
+ <ChannelInputContainer
+ ref={(el) => {
+ attachInputRef(el);
+ setChannelInputEl(el);
}}
- participants={participants.users}
- attachmentTracker={attachmentTracker}
- persistenceKey={makeInputValuePersistenceKey({
- channelId: props.channelId,
- })}
- onReady={(handle) => {
- dragState.setAttachFilesToChannel(handle.attachFiles);
- dragState.setEntityMentionInputHandlers(handle);
- setChannelInputHandle(handle);
- }}
- onChange={(snapshot) =>
- void setChannelInputSnapshot(snapshot)
- }
- onSend={onSend}
- onStartTyping={() =>
- typingMutation.mutate({
- channelId: props.channelId,
- action: 'start',
- })
- }
- onStopTyping={() =>
- typingMutation.mutate({
+ isHidden={isChannelInputHidden()}
+ >
+ <ChannelInput
+ autofocus={props.autofocus}
+ collapsible
+ input={{
+ mode: 'channel',
+ id: `channel-input-${props.channelId}`,
+ placeholder: 'Message channel',
+ isDraggingOverChannel:
+ dragState.isDraggingOverChannel(),
+ isValidChannelDrag: dragState.isValidChannelDrag(),
+ }}
+ participants={participants.users}
+ attachmentTracker={attachmentTracker}
+ persistenceKey={makeInputValuePersistenceKey({
channelId: props.channelId,
- action: 'stop',
- })
- }
- />
- </ChannelInputContainer>
+ })}
+ onReady={(handle) => {
+ dragState.setAttachFilesToChannel(handle.attachFiles);
+ dragState.setEntityMentionInputHandlers(handle);
+ setChannelInputHandle(handle);
+ }}
+ onChange={(snapshot) =>
+ void setChannelInputSnapshot(snapshot)
+ }
+ onSend={onSend}
+ onStartTyping={() =>
+ typingMutation.mutate({
+ channelId: props.channelId,
+ action: 'start',
+ })
+ }
+ onStopTyping={() =>
+ typingMutation.mutate({
+ channelId: props.channelId,
+ action: 'stop',
+ })
+ }
+ />
+ </ChannelInputContainer>
+ </FloatRegionOrInline>
</DebugSuspense>
</ChannelDropZone>
</MaybeMessageActionDrawerManager>
diff --git a/js/app/packages/channel/Channel/ChannelTopBarLiveIndicators.tsx b/js/app/packages/channel/Channel/ChannelTopBarLiveIndicators.tsx
index d28377b7c3..32cadff727 100644
--- a/js/app/packages/channel/Channel/ChannelTopBarLiveIndicators.tsx
+++ b/js/app/packages/channel/Channel/ChannelTopBarLiveIndicators.tsx
@@ -35,7 +35,8 @@ export function ChannelTopBarLiveIndicators() {
return (
<SplitHeaderRight>
- <div class="-order-1">
+ {/* Hidden on mobile: no floating-island treatment for live avatars yet. */}
+ <div class="-order-1 mobile:hidden">
<BlockLiveIndicators />
</div>
</SplitHeaderRight>
diff --git a/js/app/packages/channel/Channel/ThreadList.tsx b/js/app/packages/channel/Channel/ThreadList.tsx
index bfd20a292f..770ca77e23 100644
--- a/js/app/packages/channel/Channel/ThreadList.tsx
+++ b/js/app/packages/channel/Channel/ThreadList.tsx
@@ -59,6 +59,13 @@ export type ThreadListScrollState = {
viewportSize: number;
};
+export type FullFrameThreadListScrollInsets = {
+ /** Space reserved before the first message (e.g. status bar + floating header). */
+ start: number;
+ /** Space reserved after the last message (e.g. floating input + dock). */
+ end: number;
+};
+
type ThreadListProps = {
keys: Accessor<string[]>;
children: (item: { id: string }) => JSX.Element;
@@ -69,6 +76,12 @@ type ThreadListProps = {
onScrollStateChange?: (state: ThreadListScrollState) => void;
shift?: Accessor<boolean>;
prepend?: Accessor<boolean>;
+ /**
+ * For full-frame insets where the scroll surface spans the whole screen and content
+ * scrolls behind the floating chrome. Rendered as scroll-content padding and fed to
+ * virtua via `startMargin` + per-align scroll offsets.
+ */
+ fullFrameScrollInsets?: Accessor<FullFrameThreadListScrollInsets>;
};
const NEAR_TOP_THRESHOLD = 800;
@@ -97,12 +110,36 @@ export function getTargetAlign(
}
}
+const NO_SCROLL_INSETS: FullFrameThreadListScrollInsets = { start: 0, end: 0 };
+
export function ThreadList(props: ThreadListProps) {
const [virtualHandle, setVirtualHandle] = createSignal<VirtualizerHandle>();
const [isNearBottom, setIsNearBottom] = createSignal(true);
const [didInitialScroll, setDidInitialScroll] = createSignal(false);
const [scrollEl, setScrollEl] = createSignal<HTMLDivElement>();
+ const insets = () => props.fullFrameScrollInsets?.() ?? NO_SCROLL_INSETS;
+
+ /**
+ * Correction so alignment targets the inset-adjusted usable viewport
+ * (below the floating header, above the floating bottom chrome) instead
+ * of the physical scroll viewport. Derived against virtua's scrollToIndex
+ * math with `startMargin = insets().start`.
+ */
+ const insetAlignOffset = (align: ScrollAlignment): number => {
+ const { start, end } = insets();
+ switch (align) {
+ case 'start':
+ return -start;
+ case 'end':
+ return end;
+ case 'center':
+ return (end - start) / 2;
+ default:
+ return 0;
+ }
+ };
+
let scrollRef: HTMLDivElement | undefined;
let nearTopFired = false;
let nearBottomFired = false;
@@ -147,12 +184,22 @@ export function ThreadList(props: ThreadListProps) {
): boolean => {
const index = resolveTargetIndex(target);
if (index < 0) return false;
- handle.scrollToIndex(index, { align: getTargetAlign(target) });
+ const align = getTargetAlign(target);
+ handle.scrollToIndex(index, { align, offset: insetAlignOffset(align) });
return true;
};
- const getDistanceFromBottom = (handle: VirtualizerHandle): number =>
- handle.scrollSize - handle.viewportSize - handle.scrollOffset;
+ // DOM-based so the scroll insets are accounted for — virtua's scrollSize
+ // only covers its own items, not the inset padding around them.
+ const getDistanceFromBottom = (handle: VirtualizerHandle): number => {
+ if (scrollRef) {
+ return Math.max(
+ 0,
+ scrollRef.scrollHeight - scrollRef.clientHeight - scrollRef.scrollTop
+ );
+ }
+ return handle.scrollSize - handle.viewportSize - handle.scrollOffset;
+ };
const isScrollPositionCorrect = (
handle: VirtualizerHandle,
@@ -167,7 +214,9 @@ export function ThreadList(props: ThreadListProps) {
case 'index': {
const targetIndex = resolveTargetIndex(target);
if (targetIndex < 0) return true; // target gone, nothing to verify
- const currentIndex = handle.findItemIndex(handle.scrollOffset);
+ const currentIndex = handle.findItemIndex(
+ handle.scrollOffset + insets().start
+ );
// Consider correct if the target is within a reasonable range of
// the current viewport (within ±5 items accounts for alignment).
return Math.abs(currentIndex - targetIndex) <= 5;
@@ -178,7 +227,11 @@ export function ThreadList(props: ThreadListProps) {
const getCurrentIndex = (handle: VirtualizerHandle): number => {
const itemCount = props.keys().length;
if (!itemCount) return -1;
- return clamp(handle.findItemIndex(handle.scrollOffset), 0, itemCount - 1);
+ return clamp(
+ handle.findItemIndex(handle.scrollOffset + insets().start),
+ 0,
+ itemCount - 1
+ );
};
const emitScrollState = (
@@ -414,6 +467,11 @@ export function ThreadList(props: ThreadListProps) {
'flex-direction': 'column',
}}
>
+ {/* Spacer div for full-frame inset. */}
+ <div
+ aria-hidden
+ style={{ height: `${insets().start}px`, 'flex-shrink': 0 }}
+ />
<div style="flex-grow: 1" />
<Virtualizer
ref={(ref) => {
@@ -426,6 +484,7 @@ export function ThreadList(props: ThreadListProps) {
scrollOnMount(ref);
}}
scrollRef={scrollRef}
+ startMargin={insets().start}
itemSize={BASE_ITEM_SIZE}
bufferSize={BASE_BUFFER_SIZE}
data={props.keys()}
@@ -435,6 +494,11 @@ export function ThreadList(props: ThreadListProps) {
>
{(key) => props.children({ id: key })}
</Virtualizer>
+ {/* Spacer div for full-frame inset. */}
+ <div
+ aria-hidden
+ style={{ height: `${insets().end}px`, 'flex-shrink': 0 }}
+ />
</div>
<CustomScrollbar scrollContainer={scrollEl} />
</>
diff --git a/js/app/packages/channel/Input/ChannelInput.tsx b/js/app/packages/channel/Input/ChannelInput.tsx
index 3f3f948fe3..d3de000404 100644
--- a/js/app/packages/channel/Input/ChannelInput.tsx
+++ b/js/app/packages/channel/Input/ChannelInput.tsx
@@ -359,6 +359,7 @@ export function ChannelInput(props: ChannelInputProps) {
data-collapsed-input-file-picker
/>
<CollapsedInput
+ class="mobile:rounded-full"
draft={inputState.view().value}
renderDraft={(draft) => (
<StaticMarkdown
@@ -387,7 +388,7 @@ export function ChannelInput(props: ChannelInputProps) {
}}
onFocusIn={() => setIsFocused(true)}
active={isFocused()}
- class={cn('rounded-xl', isCollapsed() && 'hidden')}
+ class={cn('rounded-xl mobile:rounded-3xl', isCollapsed() && 'hidden')}
depth={2}
solid
>
diff --git a/js/app/packages/channel/Input/ChannelInputContainer.tsx b/js/app/packages/channel/Input/ChannelInputContainer.tsx
index f72758ede1..1c251af79c 100644
--- a/js/app/packages/channel/Input/ChannelInputContainer.tsx
+++ b/js/app/packages/channel/Input/ChannelInputContainer.tsx
@@ -9,7 +9,7 @@ export function ChannelInputContainer(props: {
return (
<div
class={cn(
- 'pb-2 mobile:pb-0 w-full flex justify-center **:data-input-editor-shell:max-h-[calc(60*var(--dvh,1dvh))] mobile:**:data-input-editor-shell:max-h-[calc(32*var(--dvh,1dvh))]',
+ 'pb-2 mobile:pb-0 w-full flex justify-center **:data-input-editor-shell:max-h-[calc(60*var(--dvh,1dvh))] mobile:**:data-input-editor-shell:max-h-[calc(32*var(--dvh,1dvh))] mobile:px-(--mobile-chrome-gutter) mobile:pointer-events-auto',
props.isHidden && 'hidden'
)}
ref={props.ref}
diff --git a/js/app/packages/channel/Input/SendAction.tsx b/js/app/packages/channel/Input/SendAction.tsx
index 7c5d948588..7dba0863de 100644
--- a/js/app/packages/channel/Input/SendAction.tsx
+++ b/js/app/packages/channel/Input/SendAction.tsx
@@ -1,5 +1,5 @@
import { isMobile } from '@core/mobile/isMobile';
-import { SendButton } from '@ui';
+import { cn, SendButton } from '@ui';
import { type JSX, splitProps } from 'solid-js';
import { useInput, useInputCommands } from './context';
import { hasSendableInputContent } from './utils/sendable-content';
@@ -34,7 +34,8 @@ export function SendAction(props: SendActionProps) {
pending={isBlockedByPending()}
disabled={isDisabled()}
hidden={isMobile() && isBlockedByEmptyInput()}
- class={local.class}
+ // Full-frame mobile: pill rounding to match the dock/accessory islands.
+ class={cn('mobile:rounded-full', local.class)}
onPointerDown={(event) => {
event.preventDefault();
void commands.send();
diff --git a/js/app/packages/core/component/AI/component/message/ChatMessages.tsx b/js/app/packages/core/component/AI/component/message/ChatMessages.tsx
index 4c24612454..ebfaaaad56 100644
--- a/js/app/packages/core/component/AI/component/message/ChatMessages.tsx
+++ b/js/app/packages/core/component/AI/component/message/ChatMessages.tsx
@@ -3,6 +3,7 @@ import type { ChatMessageWithAttachments } from '@core/component/AI/types';
import { asChatMessage } from '@core/component/AI/util/message';
import { StaticMarkdownContext } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
import { aiChatTheme } from '@core/component/LexicalMarkdown/theme';
+import { isMobile } from '@core/mobile/isMobile';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
import { isMobileWidth } from '@core/mobile/mobileWidth';
import { PulsingStar } from '@entity/components/PulsingStar';
@@ -22,6 +23,7 @@ import {
import { createStore } from 'solid-js/store';
import { idStream, timeStream } from '../../util/stream/extendedStream';
import { AssistantMessage } from './AssistantMessage';
+import { createMobileKeyboardScrollPin } from './create-mobile-keyboard-scroll-pin';
import { EmptyChatState } from './EmptyChatState';
import { UserMessage } from './UserMessage';
@@ -132,6 +134,14 @@ export function ChatMessages(props: ChatMessagesProps) {
setParentHeight(size);
});
+ // Full-frame mobile: keep pinned to the bottom across virtual-keyboard
+ // show/hide when the user was already at the bottom.
+ createMobileKeyboardScrollPin({
+ scrollEl: selectScroll,
+ wrapperEl: () => messagesRef?.parentElement,
+ scrollToBottom,
+ });
+
onMount(() => {
scrollToBottom('instant');
});
@@ -239,7 +249,16 @@ export function ChatMessages(props: ChatMessagesProps) {
<div
class="shrink-0 flex flex-col gap-y-4"
style={{
- 'min-height': `${parentHeight()}px`,
+ // Sized so scrollToBottom rests the just-sent message at
+ // the top of the viewport. Full-frame mobile keeps the
+ // chrome insets inside the scroller (see Chat.tsx), so
+ // subtract them — the trailing bottom inset otherwise
+ // pushes the message above the viewport, and the message
+ // should rest below the floating top chrome, not under
+ // it. (0.5rem matches the scroll content's top gap.)
+ 'min-height': isMobile()
+ ? `calc(${parentHeight()}px - var(--mobile-content-inset-top, 0px) - var(--mobile-content-inset-bottom, 0px) - 0.5rem)`
+ : `${parentHeight()}px`,
}}
>
<Show when={lastPair()}>
diff --git a/js/app/packages/core/component/AI/component/message/create-mobile-keyboard-scroll-pin.ts b/js/app/packages/core/component/AI/component/message/create-mobile-keyboard-scroll-pin.ts
new file mode 100644
index 0000000000..39d750fc49
--- /dev/null
+++ b/js/app/packages/core/component/AI/component/message/create-mobile-keyboard-scroll-pin.ts
@@ -0,0 +1,85 @@
+import { isMobile } from '@core/mobile/isMobile';
+import {
+ createElementSize,
+ makeResizeObserver,
+} from '@solid-primitives/resize-observer';
+import { type Accessor, createEffect, on, onMount } from 'solid-js';
+
+// Matches the AI chat's own near-bottom threshold (see ChatMessages); larger
+// than the channel list's 50 so streaming/keyboard reflow still re-pins.
+const NEAR_BOTTOM_THRESHOLD = 100;
+
+/**
+ * Full-frame mobile: keep the AI chat pinned to the bottom across virtual
+ * keyboard show/hide, when the user was already at the bottom. Two distinct
+ * geometry changes move the bottom, so two observers:
+ *
+ * - The keyboard squishes the app (--dvh), shrinking the scroller while
+ * scrollTop stays put — the latest messages would slide behind the input.
+ * - On dismissal the dock reappears and grows the wrapper's trailing inset
+ * (--mobile-content-inset-bottom, applied as padding-bottom), growing
+ * scrollHeight after the browser already clamped scrollTop — the view would
+ * rest slightly above the bottom.
+ *
+ * No-op off mobile (evaluated once at mount, matching the channel keyboard
+ * handler).
+ */
+export function createMobileKeyboardScrollPin(opts: {
+ /** The scroll container (the `[data-chat-scroll]` element). */
+ scrollEl: Accessor<Element | null | undefined>;
+ /** The messages wrapper that carries the trailing inset as padding. */
+ wrapperEl: Accessor<HTMLElement | null | undefined>;
+ scrollToBottom: (behavior: 'instant' | 'smooth') => void;
+}): void {
+ if (!isMobile()) return;
+ const { scrollEl, wrapperEl, scrollToBottom } = opts;
+
+ // Scroller shrink (keyboard appearing). "Was at bottom" is measured against
+ // the pre-shrink height: after the resize the bottom has already moved up,
+ // so a live near-bottom check would read false.
+ const scrollerSize = createElementSize(scrollEl);
+ createEffect(
+ on(
+ () => scrollerSize.height,
+ (height, prevHeight) => {
+ if (!height || !prevHeight || height >= prevHeight) return;
+ const el = scrollEl();
+ if (!el) return;
+ const wasNearBottom =
+ el.scrollTop + prevHeight >= el.scrollHeight - NEAR_BOTTOM_THRESHOLD;
+ if (wasNearBottom) scrollToBottom('instant');
+ }
+ )
+ );
+
+ // Wrapper border-box growth (keyboard dismissing → dock inset restored).
+ // Must observe the border-box: a content-box observer (createElementSize)
+ // never sees a padding-only change, so it'd silently miss the dock's inset.
+ onMount(() => {
+ const wrapper = wrapperEl();
+ if (!wrapper) return;
+ let prevHeight = wrapper.getBoundingClientRect().height;
+ const { observe } = makeResizeObserver(
+ (entries) => {
+ for (const entry of entries) {
+ const height =
+ entry.borderBoxSize?.[0]?.blockSize ??
+ (entry.target as HTMLElement).offsetHeight;
+ const grew = height - prevHeight;
+ prevHeight = height;
+ if (grew <= 0) continue;
+ const el = scrollEl();
+ if (!el) continue;
+ // scrollHeight already includes the growth; compare against where
+ // the bottom was before it.
+ const wasNearBottom =
+ el.scrollTop + el.clientHeight >=
+ el.scrollHeight - grew - NEAR_BOTTOM_THRESHOLD;
+ if (wasNearBottom) scrollToBottom('instant');
+ }
+ },
+ { box: 'border-box' }
+ );
+ observe(wrapper);
+ });
+}
diff --git a/js/app/packages/core/constant/stackingContext.ts b/js/app/packages/core/constant/stackingContext.ts
index 20caa926a4..c7ed038664 100644
--- a/js/app/packages/core/constant/stackingContext.ts
+++ b/js/app/packages/core/constant/stackingContext.ts
@@ -30,7 +30,11 @@ export const zTopBarLayout = above + zViewerNotificationModal;
export const zSidePanelLayout = above + zTopBarLayout; // Side Panel Layout (LHS Recent Files + RHS AI Side Panel)
export const zItemOptionsMenu = above + zSidePanelLayout;
export const zActionMenu = zItemOptionsMenu;
-export const zMobileNavBar = above + zActionMenu;
+// Full-frame mobile search results: full-screen surface that sits below the
+// mobile nav bar / float host, so the search input (dock region) and category
+// tabs (accessory region) float over it.
+export const zMobileSearch = above + zActionMenu;
+export const zMobileNavBar = above + zMobileSearch;
export const zSidePanelSearchAndFilter = above + zMobileNavBar;
// Modal
diff --git a/js/app/packages/ui/components/CollapsedInput.tsx b/js/app/packages/ui/components/CollapsedInput.tsx
index 6d9454ad5e..78e116a0be 100644
--- a/js/app/packages/ui/components/CollapsedInput.tsx
+++ b/js/app/packages/ui/components/CollapsedInput.tsx
@@ -114,6 +114,8 @@ export function CollapsedInput(props: CollapsedInputProps) {
</Show>
<Show when={!isMobile() || !props.disabled}>
<SendButton
+ // Match the expanded input's send button (pill on mobile).
+ class="mobile:rounded-full"
pending={props.pending}
disabled={props.disabled || props.pending}
onPointerDown={(event) => {