:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(mobile): show chats as full-screen pages (#125604)
Chris Volzeraba89f1588f0
diff --git a/products/mobile/.argent/flows/demo-smoke.yaml b/products/mobile/.argent/flows/demo-smoke.yamlindex a2d1b2b34749..aae0669c646d 100644--- a/products/mobile/.argent/flows/demo-smoke.yaml+++ b/products/mobile/.argent/flows/demo-smoke.yaml@@ -70,8 +70,8 @@ steps:- await: { visible: { text: Which deploy caused this? } }- echo: Reply shown. Close the chat. Expect the report again- - tap: { id: chat-close }- - await: { hidden: { id: chat-close } }+ - tap: { id: chat-back }+ - await: { hidden: { id: chat-back } }- await: { visible: { id: decision-request } }- await: { idle: true }@@ -86,15 +86,15 @@ steps:- await: { idle: true }- assert: { text: { in: { id: chat-row-session-demo-session-flaky-test }, contains: Fix the flaky checkout test } }- - echo: On Chats. Open the session Fix the flaky checkout test. Expect the chat sheet with its title and thread+ - echo: On Chats. Open the session Fix the flaky checkout test. Expect the full-screen chat with its action pill and thread- tap: { id: chat-row-session-demo-session-flaky-test }- await: { visible: { id: session-thread } }- await: { idle: true }- - assert: { text: { in: { id: chat-header }, contains: Fix the flaky checkout test } }+ - assert: { visible: { id: chat-more } }- assert: { visible: { id: session-assistant } }- echo: Session open. Close it. Expect the chats list again- - tap: { id: chat-close }+ - tap: { id: chat-back }- await: { visible: { id: chats-screen } }- await: { idle: true }@@ -104,7 +104,7 @@ steps:- await: { idle: true }- echo: Decision card open. Close the session. Expect the chats list again- - tap: { id: chat-close }+ - tap: { id: chat-back }- await: { visible: { id: chats-screen } }- await: { idle: true }diff --git a/products/mobile/app/_layout.tsx b/products/mobile/app/_layout.tsxindex cd0aa17cac2b..716ac5c41d8b 100644--- a/products/mobile/app/_layout.tsx+++ b/products/mobile/app/_layout.tsx@@ -105,9 +105,7 @@ export default function RootLayout(): ReactElement {name="chat"dangerouslySingular={(): string => 'chat'}options={{- presentation: 'transparentModal',- animation: 'none',- contentStyle: { backgroundColor: 'transparent' },+ presentation: 'card',}}/></Stack>diff --git a/products/mobile/app/chat.tsx b/products/mobile/app/chat.tsxindex 777443395aff..d0cca97e3c6b 100644--- a/products/mobile/app/chat.tsx+++ b/products/mobile/app/chat.tsx@@ -2,7 +2,7 @@ import { useLocalSearchParams, useRouter } from 'expo-router'import { type ReactElement, useCallback } from 'react'import { useDataMode } from '@/demo/demoMode'-import { ChatSheet } from '@/features/chat/ChatSheet'+import { ChatScreen } from '@/features/chat/ChatScreen'import { chatSheetSource } from '@/features/chat/chatSheetEvents'import { objectContextFromParams } from '@/features/chat/objectContext'import { currentDefaultPageHref } from '@/features/settings/defaultPageStore'@@ -28,14 +28,14 @@ export default function ChatRoute(): ReactElement {}}, [router])return (- <ChatSheet+ <ChatScreenkey={JSON.stringify([dataMode, taskId, runId, reportId, objectId])}initialReportId={reportId}initialTaskId={taskId}initialRunId={runId}initialObject={objectContextFromParams({ objectType, objectId, objectLabel })}source={chatSheetSource({ entry, origin, reportId, taskId, objectType })}- onClosed={close}+ onBack={close}/>)}diff --git a/products/mobile/docs/CHAT.md b/products/mobile/docs/CHAT.mdindex cc4ed232e03a..f4c91d0eefdd 100644--- a/products/mobile/docs/CHAT.md+++ b/products/mobile/docs/CHAT.md@@ -1,15 +1,22 @@# Chat-The chat sheet talks to PostHog AI on the task runtime, as the web app's side-panel chat does.+The chat screen talks to PostHog AI on the task runtime, as the web app's side-panel chat does.Every chat is a task with interactive runs in a sandbox.A new chat creates the task on its first message; the Chats list reopens one by its task id.+New and existing chats open as full-screen stack pages. Back returns to the previous screen or the+configured default page for a direct link. The title-free header uses the shared blur and fading edge;+New chat and the ellipsis share the Inbox's pill control. The composer clears the keyboard and safe area.++The ellipsis menu offers **Copy link to chat** and **Archive chat**. Copy uses the current project's+web URL. Archive returns to the previous page after success and keeps the chat open for retry on failure.+The menu is disabled for an unsaved new chat. Model, Mode, and attachment options still open as overlays.The protocol below follows the web's `taskTrackerSceneLogic.ts`, `runInteractionLogic.ts` and `runStreamLogic.ts` in `products/posthog_ai/frontend`.## Files| File | Role || ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| `src/features/chat/ChatSheet.tsx` | The sheet: header, thread or empty state, composer, the options reducer, draft restore |+| `src/features/chat/ChatScreen.tsx` | The sheet: header, thread or empty state, composer, the options reducer, draft restore || `src/features/chat/chatSheetEvents.ts` | The sheet's `entry` from the route params, and the opened and closed events || `src/features/chat/ChatAccessGate.tsx` | The organization AI approval and the personal consent before the composer (see [AI consent](#ai-consent)) || `src/features/chat/session/useSession.ts` | `useSession({ taskId?, runId? })`: create, follow, send, sync options, resume, stop, answer, reset, demo replies |@@ -382,27 +389,27 @@ New chat drops it.## New chat-The compose button in the header shows once a chat has a task or a message.+The compose button stays available in the header.It drops the open task (or the one the first send created), clears the text and attached reports, and resets the options to Default and Auto.-The header shows the task title, else "New chat".+The header has no chat title.The empty state with suggested prompts shows while there is no task and no message.`mobile_chat_suggestion_picked` is captured with `source` (`report` for the report's own prompts, else `default`), `index` and `report_count`; never the prompt.`@` or the @ button opens the report list. `mobile_chat_mention_opened` is captured with `trigger` (`typed` or `button`),`mobile_chat_report_attached` with `attached_count`, and `mobile_chat_report_removed` (a chip's ×) with `attached_count` and `initial` (the report the sheet opened with).-## Sheet lifecycle+## Page lifecycleThe navigator keeps one chat screen. Opening another chat reuses that screen and loads freshconversation state. A notification for the chat already on screen leaves its session, draft andscroll position intact, including a chat started from the composer. A notification for a different-chat replaces the open chat, so one Close returns to the screen underneath. Starting New chat+chat replaces the open chat, so one Back returns to the screen underneath. Starting New chatdoes not prevent a later notification from reopening the previous conversation.Changing the selected account, host or project closes an open chat and aborts its scoped work. Callbacks captured in the old scope cannot send to the newly selected project.A send waiting for encrypted draft storage is cancelled by New chat or closing the sheet, and its text remains recoverable in the original draft.-The sheet opens from the bottom bar's compose button, a report's Chat button, a report's task status, an inbox row's menu and the Chats tab.+The page opens from the bottom bar's compose button, a report's Chat button, a report's task status, an inbox row's menu and the Chats tab.The route takes an optional `entry` param; `chatSheetSource` falls back on `report` with a `reportId`, `task` with only a `taskId`, else `compose`.- `mobile_chat_sheet_opened` is captured once per open with `entry` (`chats_list`, `chats_search`, `chats_empty`, `compose`, `report`, `report_task`, `inbox_menu` or `task`),diff --git a/products/mobile/docs/TESTING.md b/products/mobile/docs/TESTING.mdindex c03c8ea2a267..efc0429d3ce5 100644--- a/products/mobile/docs/TESTING.md+++ b/products/mobile/docs/TESTING.md@@ -76,6 +76,18 @@ Keep ingestion, ClickHouse, and replay storage running, wait for the returned seIf a session is missing, inspect local capture, ingestion, and replay storage logs before recording a playback pass.The dummy's normal development shortcut can choose the latest project; the explicit command above keeps the SDK on the account's selected project.+## Chat navigation and header++On iOS and Android, open an existing chat and start a new chat. Both must fill the screen without a+sheet grabber or drag-down dismissal. Header Back and platform Back return to the previous page;+a direct link falls back to the configured default page. Scroll a long thread under the title-free+blurred header and focus the composer to check the keyboard and safe-area spacing.++New chat and the ellipsis share the Inbox's pill control. Open the menu, copy the link, and confirm+it targets the current project and chat. Archive a saved chat and confirm it disappears from Chats+only after success. Fail each action and retry; repeated taps must not start duplicate requests.+An unsaved chat has no link or task to archive, so its ellipsis is disabled.+## Chat drafts and rich repliesUse a native development build that includes `react-native-webview`.diff --git a/products/mobile/src/features/chat/ChatHeader.test.tsx b/products/mobile/src/features/chat/ChatHeader.test.tsxnew file mode 100644index 000000000000..15412c27dbc6--- /dev/null+++ b/products/mobile/src/features/chat/ChatHeader.test.tsx@@ -0,0 +1,131 @@+import { act, fireEvent, render, screen } from '@testing-library/react-native'+import * as Clipboard from 'expo-clipboard'+import type { ReactElement } from 'react'++import { taskWebUrl } from '@/model/adapters/chats'+import { OverlayHost } from '@/ui/OverlayPortal'++import { ChatHeader } from './ChatHeader'++jest.mock('react-native-worklets', () => jest.requireActual('react-native-worklets/src/mock'))+jest.mock('react-native-reanimated', () => ({+ ...jest.requireActual('react-native-reanimated/mock'),+ useReducedMotion: () => true,+}))+jest.mock(+ 'react-native-safe-area-context',+ () => jest.requireActual('react-native-safe-area-context/jest/mock').default+)++afterEach(() => jest.restoreAllMocks())++describe('ChatHeader', () => {+ test('copies the current chat from its menu and follows chat and project changes', async () => {+ const copy = jest.spyOn(Clipboard, 'setStringAsync').mockResolvedValue(true)+ const scope = { host: 'https://us.posthog.com/', projectId: 7 }+ const onBack = jest.fn()+ const onNewChat = jest.fn()+ const header = (url: string | undefined): ReactElement => (+ <ChatHeader webUrl={url} onBack={onBack} onNewChat={onNewChat} />+ )+ const view = render(header(taskWebUrl(scope, null)), { wrapper: OverlayHost })+ expect(screen.getByTestId('chat-more')).toBeDisabled()+ expect(screen.queryByTestId('chat-copy-link')).toBeNull()++ view.rerender(header(taskWebUrl(scope, 'first-task')))+ fireEvent.press(screen.getByTestId('chat-more'))+ expect(screen.getByText('Copy link to chat')).toBeTruthy()+ expect(screen.getByTestId('chat-archive')).toBeDisabled()+ await act(async () => fireEvent.press(screen.getByTestId('chat-copy-link')))+ expect(copy).toHaveBeenLastCalledWith('https://us.posthog.com/project/7/ai?task=first-task')+ expect(screen.getByText('Chat link copied')).toBeTruthy()+ expect(screen.getByTestId('chat-more').props.accessibilityState.expanded).toBe(false)++ view.rerender(header(taskWebUrl({ host: 'https://eu.posthog.com', projectId: 9 }, 'next-task')))+ fireEvent.press(screen.getByTestId('chat-more'))+ await act(async () => fireEvent.press(screen.getByTestId('chat-copy-link')))+ expect(copy).toHaveBeenLastCalledWith('https://eu.posthog.com/project/9/ai?task=next-task')+ fireEvent.press(screen.getByTestId('chat-new'))+ expect(onNewChat).toHaveBeenCalledTimes(1)+ fireEvent.press(screen.getByTestId('chat-back'))+ expect(onBack).toHaveBeenCalledTimes(1)+ })++ test.each(['rejected', 'false'] as const)(+ 'prevents duplicate copies, reports a %s write and allows retry',+ async (failure) => {+ let resolveCopy!: (copied: boolean) => void+ let rejectCopy!: (error: Error) => void+ const copy = jest.spyOn(Clipboard, 'setStringAsync').mockImplementationOnce(+ () =>+ new Promise<boolean>((resolve, reject) => {+ resolveCopy = resolve+ rejectCopy = reject+ })+ )+ render(+ <ChatHeader+ webUrl="https://us.posthog.com/project/7/ai?task=task-1"+ onBack={jest.fn()}+ onNewChat={jest.fn()}+ />,+ { wrapper: OverlayHost }+ )+ fireEvent.press(screen.getByTestId('chat-more'))+ fireEvent.press(screen.getByTestId('chat-copy-link'))+ fireEvent.press(screen.getByTestId('chat-copy-link'))+ expect(copy).toHaveBeenCalledTimes(1)+ expect(screen.getByTestId('chat-copy-link')).toBeDisabled()+ expect(screen.queryByText('Chat link copied')).toBeNull()+ await act(async () => {+ if (failure === 'rejected') {+ rejectCopy(new Error('Clipboard unavailable'))+ } else {+ resolveCopy(false)+ }+ })+ expect(screen.getByText("Couldn't copy the link. Try again.")).toBeTruthy()+ expect(screen.getByTestId('chat-more').props.accessibilityState.expanded).toBe(true)+ expect(screen.getByTestId('chat-copy-link')).toBeEnabled()++ copy.mockResolvedValueOnce(true)+ await act(async () => fireEvent.press(screen.getByTestId('chat-copy-link')))+ expect(copy).toHaveBeenCalledTimes(2)+ expect(screen.getByText('Chat link copied')).toBeTruthy()+ }+ )++ test('guards archive against double taps and allows retry after failure', async () => {+ let rejectArchive!: (error: Error) => void+ const onArchive = jest.fn(+ () =>+ new Promise<void>((_, reject) => {+ rejectArchive = reject+ })+ )+ render(+ <ChatHeader+ webUrl="https://us.posthog.com/project/7/ai?task=task-1"+ onBack={jest.fn()}+ onNewChat={jest.fn()}+ onArchive={onArchive}+ />,+ { wrapper: OverlayHost }+ )+ fireEvent.press(screen.getByTestId('chat-more'))+ fireEvent.press(screen.getByTestId('chat-archive'))+ fireEvent.press(screen.getByTestId('chat-archive'))+ expect(onArchive).toHaveBeenCalledTimes(1)+ expect(screen.getByTestId('chat-archive')).toBeDisabled()+ expect(screen.getByTestId('chat-copy-link')).toBeDisabled()+ await act(async () => rejectArchive(new Error('offline')))+ expect(screen.getByText("Couldn't archive this chat. Try again.")).toBeTruthy()+ expect(screen.getByTestId('chat-archive')).toBeEnabled()+ expect(screen.getByTestId('chat-more').props.accessibilityState.expanded).toBe(true)++ onArchive.mockResolvedValueOnce(undefined)+ await act(async () => fireEvent.press(screen.getByTestId('chat-archive')))+ expect(onArchive).toHaveBeenCalledTimes(2)+ expect(screen.getByTestId('chat-more').props.accessibilityState.expanded).toBe(false)+ })+})diff --git a/products/mobile/src/features/chat/ChatHeader.tsx b/products/mobile/src/features/chat/ChatHeader.tsxnew file mode 100644index 000000000000..c7418a86516b--- /dev/null+++ b/products/mobile/src/features/chat/ChatHeader.tsx@@ -0,0 +1,137 @@+import { type ReactElement, type RefObject, useState } from 'react'+import { View } from 'react-native'++import { useToasts, ViewsToast } from '@/features/views/ViewsToast'+import { useAsyncAction } from '@/lib/useAsyncAction'+import { BlurEdge } from '@/ui/BlurEdge'+import { FadeEdge } from '@/ui/FadeEdge'+import { ChevronLeftIcon } from '@/ui/icons/ChevronLeftIcon'+import { ComposeIcon } from '@/ui/icons/ComposeIcon'+import { MoreIcon } from '@/ui/icons/MoreIcon'+import { PillControl } from '@/ui/PillControl'+import { Pressable44 } from '@/ui/Pressable44'+import { createStyles, useColors } from '@/ui/theme'+import { iconSizes, layout, radii } from '@/ui/tokens'+import { useScreenInsets } from '@/ui/useScreenInsets'++import { ChatHeaderMenu } from './ChatHeaderMenu'+import { useCopyChatLink } from './useCopyChatLink'++const HEADER_TOP = 16+const ROW_HEIGHT = 54+const HEADER_FADE = 24+export const CHAT_HEADER_HEIGHT = HEADER_TOP + ROW_HEIGHT + HEADER_FADE++interface ChatHeaderProps {+ webUrl: string | undefined+ blurTarget?: RefObject<View | null>+ onBack: () => void+ onNewChat: () => void+ onArchive?: () => Promise<void>+}++export function ChatHeader({ webUrl, blurTarget, onBack, onNewChat, onArchive }: ChatHeaderProps): ReactElement {+ const colors = useColors()+ const styles = useStyles()+ const insets = useScreenInsets()+ const [menuOpen, setMenuOpen] = useState(false)+ const toasts = useToasts()+ const { copyLink, copying } = useCopyChatLink(toasts.show)+ const archive = useAsyncAction(async () => {+ if (!onArchive) {+ return+ }+ try {+ await onArchive()+ setMenuOpen(false)+ } catch {+ toasts.show("Couldn't archive this chat. Try again.")+ }+ })+ const copy = async (): Promise<void> => {+ if (await copyLink(webUrl)) {+ setMenuOpen(false)+ }+ }+ return (+ <View collapsable={false} style={[styles.header, { paddingTop: insets.top + HEADER_TOP }]} testID="chat-header">+ <BlurEdge solid={0.7} blurTarget={blurTarget} />+ <FadeEdge direction="down" solid={0.7} opacity={layout.chromeTint} />+ <Pressable44+ onPress={onBack}+ accessibilityLabel="Back"+ pressedBackground={colors.background}+ style={styles.round}+ testID="chat-back"+ >+ <ChevronLeftIcon size={iconSizes.control} />+ </Pressable44>+ <PillControl height={ROW_HEIGHT}>+ <Pressable44+ onPress={onNewChat}+ accessibilityLabel="New chat"+ pressedBackground={colors.background}+ style={styles.button}+ testID="chat-new"+ >+ <ComposeIcon size={iconSizes.control} />+ </Pressable44>+ <Pressable44+ onPress={() => setMenuOpen(true)}+ accessibilityLabel="Chat options"+ accessibilityState={{ expanded: menuOpen, disabled: !webUrl && !onArchive }}+ disabled={!webUrl && !onArchive}+ pressedBackground={colors.background}+ style={styles.button}+ testID="chat-more"+ >+ <MoreIcon size={iconSizes.control} color={webUrl || onArchive ? colors.ink : colors.disabled} />+ </Pressable44>+ </PillControl>+ <ChatHeaderMenu+ visible={menuOpen}+ top={insets.top + HEADER_TOP + ROW_HEIGHT + 8}+ copying={copying}+ archiving={archive.pending}+ canCopy={!!webUrl}+ canArchive={!!onArchive}+ onCopy={() => void copy()}+ onArchive={() => void archive.run()}+ onClose={() => setMenuOpen(false)}+ />+ <ViewsToast toast={toasts.toast} onHide={toasts.hide} bottom={28} />+ </View>+ )+}++const useStyles = createStyles(({ colors }) => ({+ header: {+ position: 'absolute',+ top: 0,+ left: 0,+ right: 0,+ flexDirection: 'row',+ alignItems: 'center',+ justifyContent: 'space-between',+ paddingHorizontal: 16,+ paddingBottom: HEADER_FADE,+ pointerEvents: 'box-none',+ },+ button: {+ width: 56,+ height: 46,+ borderRadius: radii.pill,+ alignItems: 'center',+ justifyContent: 'center',+ },+ round: {+ width: 44,+ height: 44,+ borderRadius: 22,+ borderWidth: 1,+ borderColor: colors.hairline,+ backgroundColor: colors.surface,+ alignItems: 'center',+ justifyContent: 'center',+ },+}))diff --git a/products/mobile/src/features/chat/ChatHeaderMenu.tsx b/products/mobile/src/features/chat/ChatHeaderMenu.tsxnew file mode 100644index 000000000000..305072bce7dc--- /dev/null+++ b/products/mobile/src/features/chat/ChatHeaderMenu.tsx@@ -0,0 +1,73 @@+import type { ReactElement } from 'react'+import { ActivityIndicator, useWindowDimensions } from 'react-native'++import { MenuDivider, MenuItem } from '@/features/views/list/ViewsMenu'+import { FloatingCard } from '@/ui/FloatingCard'+import { ArchiveIcon } from '@/ui/icons/ArchiveIcon'+import { CopyIcon } from '@/ui/icons/CopyIcon'+import { createStyles, useColors } from '@/ui/theme'++interface ChatHeaderMenuProps {+ visible: boolean+ top: number+ copying: boolean+ archiving: boolean+ canCopy: boolean+ canArchive: boolean+ onCopy: () => void+ onArchive: () => void+ onClose: () => void+}++export function ChatHeaderMenu({+ visible,+ top,+ copying,+ archiving,+ canCopy,+ canArchive,+ onCopy,+ onArchive,+ onClose,+}: ChatHeaderMenuProps): ReactElement {+ const colors = useColors()+ const styles = useStyles()+ const { width } = useWindowDimensions()+ const busy = copying || archiving+ return (+ <FloatingCard+ visible={visible}+ onClose={onClose}+ transformOrigin="top right"+ accessibilityLabel="Chat options"+ testID="chat-header-menu"+ style={[styles.menu, { top, width: Math.min(272, width - 32) }]}+ >+ <MenuItem+ label="Copy link to chat"+ onPress={onCopy}+ disabled={!canCopy || busy}+ trailing={copying ? <ActivityIndicator size="small" color={colors.ink} /> : <CopyIcon size={18} />}+ testID="chat-copy-link"+ />+ <MenuDivider />+ <MenuItem+ label="Archive chat"+ onPress={onArchive}+ disabled={!canArchive || busy}+ trailing={archiving ? <ActivityIndicator size="small" color={colors.ink} /> : <ArchiveIcon size={18} />}+ testID="chat-archive"+ />+ </FloatingCard>+ )+}++const useStyles = createStyles(({ colors }) => ({+ menu: {+ right: 16,+ padding: 6,+ borderRadius: 16,+ borderWidth: 1,+ borderColor: colors.hairline,+ },+}))diff --git a/products/mobile/src/features/chat/ChatSheet.test.tsx b/products/mobile/src/features/chat/ChatScreen.test.tsxsimilarity index 93%rename from products/mobile/src/features/chat/ChatSheet.test.tsxrename to products/mobile/src/features/chat/ChatScreen.test.tsxindex 44d32d69e01c..9970662527d3 100644--- a/products/mobile/src/features/chat/ChatSheet.test.tsx+++ b/products/mobile/src/features/chat/ChatScreen.test.tsx@@ -1,5 +1,5 @@import { act, fireEvent, render, screen } from '@testing-library/react-native'-import { ChatSheet } from './ChatSheet'+import { ChatScreen } from './ChatScreen'import { useSession } from './session/useSession'import { useChatDraft } from './useChatDraft'@@ -20,6 +20,7 @@ jest.mock(jest.mock('react-native-keyboard-controller', () => jest.requireActual('react-native-keyboard-controller/jest'))jest.mock('@/auth/useProjectScope', () => ({ useProjectScope: () => ({ host: 'https://example.com', projectId: 1 }) }))jest.mock('@/demo/demoMode', () => ({ useDataMode: () => 'live' }))+jest.mock('@/features/chats/hooks', () => ({ useArchiveChat: () => ({ archive: jest.fn() }) }))jest.mock('../inbox/hooks', () => ({ useInboxItems: () => ({ data: [] }) }))jest.mock('../handoff/useRunOptions', () => ({useRunDefaults: () => undefined,@@ -78,13 +79,13 @@ describe('chat send preparation', () => {reset,dismissNotice: jest.fn(),})- const view = render(<ChatSheet source={{ entry: 'compose', origin: null }} onClosed={jest.fn()} />)+ const view = render(<ChatScreen source={{ entry: 'compose', origin: null }} onBack={jest.fn()} />)fireEvent.press(screen.getByTestId('chat-send'))expect(beginSend).toHaveBeenCalled()if (transition === 'unmount') {view.unmount()} else {- fireEvent.press(screen.getByTestId(transition === 'new' ? 'chat-new' : 'chat-close'))+ fireEvent.press(screen.getByTestId(transition === 'new' ? 'chat-new' : 'chat-back'))}await act(async () => {finishStorage(settle)diff --git a/products/mobile/src/features/chat/ChatSheet.tsx b/products/mobile/src/features/chat/ChatScreen.tsxsimilarity index 83%rename from products/mobile/src/features/chat/ChatSheet.tsxrename to products/mobile/src/features/chat/ChatScreen.tsxindex 198277bc7817..5035ab928e18 100644--- a/products/mobile/src/features/chat/ChatSheet.tsx+++ b/products/mobile/src/features/chat/ChatScreen.tsx@@ -1,7 +1,7 @@+import { BlurTargetView } from 'expo-blur'import { usePathname } from 'expo-router'import { type ReactElement, useCallback, useEffect, useMemo, useReducer, useRef, useState } from 'react'-import { Keyboard, Text, type TextInput, useWindowDimensions, View } from 'react-native'-import { GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler'+import { Keyboard, type TextInput, View } from 'react-native'import { useReanimatedKeyboardAnimation } from 'react-native-keyboard-controller'import Animated, { useAnimatedStyle } from 'react-native-reanimated'@@ -9,22 +9,17 @@ import { useAuthStore } from '@/auth/authStore'import { sessionGeneration } from '@/auth/tokens'import { useProjectScope } from '@/auth/useProjectScope'import { useDataMode } from '@/demo/demoMode'+import { useArchiveChat } from '@/features/chats/hooks'import { setViewedNotificationTask } from '@/features/notifications/foregroundNotifications'import { track } from '@/lib/analytics'import { isReportId } from '@/lib/ids'import { useNow } from '@/lib/useNow'+import { taskWebUrl } from '@/model/adapters/chats'import { reportWebUrl } from '@/model/adapters/report'import type { InboxItem, ReportView } from '@/model/types'-import { CloseIcon } from '@/ui/icons/CloseIcon'-import { ComposeIcon } from '@/ui/icons/ComposeIcon'import { OverlayHost } from '@/ui/OverlayPortal'-import { Pressable44 } from '@/ui/Pressable44'-import { Scrim } from '@/ui/Scrim'-import { createStyles, useTheme } from '@/ui/theme'-import { iconSizes, motion, radii, type } from '@/ui/tokens'-import { usePresence } from '@/ui/usePresence'+import { createStyles } from '@/ui/theme'import { useScreenInsets } from '@/ui/useScreenInsets'-import { useSheetDrag } from '@/ui/useSheetDrag'import { defaultModelSelection, isPermissionMode, modeLabel } from '../handoff/runOptions'import { useModelCatalogue, useRunDefaults } from '../handoff/useRunOptions'@@ -35,6 +30,7 @@ import type { AttachmentSource, PendingAttachment } from './attachments/types'import { releaseAttachments, useComposerAttachments } from './attachments/useComposerAttachments'import { ChatAccessGate } from './ChatAccessGate'import { ChatEmptyState } from './ChatEmptyState'+import { CHAT_HEADER_HEIGHT, ChatHeader } from './ChatHeader'import { type ChatOptionsPage, ChatOptionsSheet } from './ChatOptionsSheet'import { Composer } from './Composer'import { ContextChip } from './ContextChip'@@ -75,14 +71,14 @@ import { useChatDraft } from './useChatDraft'/** The Discuss shape and the context block name each attached report, so the list stays short. */const MAX_ATTACHED_REPORTS = 5-interface ChatSheetProps {+interface ChatScreenProps {initialReportId?: string/** An issue or a recording the chat opens about. It frames each message while its chip stays. */initialObject?: ChatObjectContext | nullinitialTaskId?: stringinitialRunId?: stringsource: ChatSheetSource- onClosed: () => void+ onBack: () => void}function sessionTarget(taskId: string | undefined, runId: string | undefined): SessionOptions {@@ -92,18 +88,16 @@ function sessionTarget(taskId: string | undefined, runId: string | undefined): Sreturn runId ? { taskId, runId } : { taskId }}-export function ChatSheet({+export function ChatScreen({initialReportId,initialObject = null,initialTaskId,initialRunId,source,- onClosed,-}: ChatSheetProps): ReactElement {- const { colors, shadows } = useTheme()+ onBack,+}: ChatScreenProps): ReactElement {const styles = useStyles()const insets = useScreenInsets()- const { height: windowHeight } = useWindowDimensions()const now = useNow()const inbox = useInboxItems()const [target, setTarget] = useState<SessionOptions>(() => sessionTarget(initialTaskId, initialRunId))@@ -111,6 +105,15 @@ export function ChatSheet({const scope = useProjectScope()const demo = useDataMode() === 'demo'const keyboard = useReanimatedKeyboardAnimation()+ const blurTarget = useRef<View>(null)+ const archiveActions = useArchiveChat()+ const activeArchiveTarget = useRef(session.taskId)+ useEffect(() => {+ activeArchiveTarget.current = session.taskId+ return () => {+ activeArchiveTarget.current = null+ }+ }, [session.taskId])const preparingSend = useRef(false)const [preparing, setPreparing] = useState(false)const queueEpoch = useRef(0)@@ -129,11 +132,11 @@ export function ChatSheet({)return () => setViewedNotificationTask(null)}, [visible, pathname, demo, scope, userUuid, session.taskId])- const { progress } = usePresence(visible, motion.sheet)const close = useCallback((): void => {queueEpoch.current++setVisible(false)- }, [])+ onBack()+ }, [onBack])const accountScope = useAuthStore((state) =>JSON.stringify([state.host, state.projectId, state.user?.uuid, sessionGeneration()]))@@ -143,7 +146,6 @@ export function ChatSheet({close()}}, [accountScope, close])- const { drag, pan } = useSheetDrag(visible, close)const [draftReportId, setDraftReportId] = useState(() =>initialReportId && isReportId(initialReportId, demo) ? initialReportId : undefined)@@ -228,14 +230,6 @@ export function ChatSheet({}}, [optionsDisabled])- useEffect(() => {- if (visible) {- return undefined- }- const timer = setTimeout(onClosed, motion.sheet)- return () => clearTimeout(timer)- }, [visible, onClosed])-const hasRunConfig = session.runConfig !== undefinedconst seedAdapter = session.runConfig?.runtimeAdapter ?? nullconst seedModel = session.runConfig?.model ?? null@@ -271,11 +265,6 @@ export function ChatSheet({const itemsById = useMemo(() => new Map(items.map((item) => [item.reportId, item])), [items])const mentionItems = useMemo(() => items.filter((item) => !attached.includes(item.reportId)), [items, attached])const canMention = attachedObject === null && attached.length < MAX_ATTACHED_REPORTS && mentionItems.length > 0- const sheetStyle = useAnimatedStyle(() => ({- transform: [{ translateY: (1 - progress.value) * windowHeight + drag.value }],- }))- // The sheet ends at the bottom edge of the window, so padding it by the keyboard height keeps the composer above- // the keyboard. `height` is negative while the keyboard is open, and the keyboard covers the home indicator.const bottomInset = insets.bottomconst keyboardStyle = useAnimatedStyle(() => ({ paddingBottom: Math.max(-keyboard.height.value, bottomInset) }))// A message sent before the stored history loads would land in a thread the person cannot see yet.@@ -429,14 +418,7 @@ export function ChatSheet({change(next)return joinQueueAttachments(current.rows)}- // The draft keeps text only, so a closed sheet loses the queued files, as it loses unsent composer files.- // biome-ignore lint/correctness/useExhaustiveDependencies: `foldQueue` reads only refs.- useEffect(() => {- if (!visible) {- releaseAttachments(foldQueue())- }- }, [visible])- // An Android back pops the route without the sheet's own close.+ // Native Back also unmounts the route without the header callback.// biome-ignore lint/correctness/useExhaustiveDependencies: `foldQueue` reads only refs.useEffect(() => () => releaseAttachments(foldQueue()), [])// The mode the chip shows, already mapped onto the harness the message runs on.@@ -575,6 +557,17 @@ export function ChatSheet({input.current?.focus()}+ const archiveChat = async (): Promise<void> => {+ const taskId = session.taskId+ if (!taskId) {+ return+ }+ await archiveActions.archive({ sourceId: taskId })+ if (activeArchiveTarget.current === taskId) {+ close()+ }+ }+const chips =attachedObject !== null || shownReports.length > 0 || attachments.files.length > 0 ? (<>@@ -601,56 +594,24 @@ export function ChatSheet({</>) : null- // The route is a native modal, so on Android the app's gesture root does not reach it and the sheet needs its own.return (- <GestureHandlerRootView style={styles.overlay} testID="chat-sheet">+ <View style={styles.page} testID="chat-screen"><OverlayHost>- <View style={styles.overlay}>- <Scrim color={colors.scrimChat} progress={progress} />- <Animated.View style={[styles.sheet, shadows.bottomSheet, sheetStyle]} accessibilityViewIsModal>+ <View style={styles.page}>+ <BlurTargetView ref={blurTarget} style={styles.body}><Animated.View style={[styles.keyboard, keyboardStyle]}>- {/* The thread scrolls, so only the header takes the drag; a drag there never competes with a scroll. */}- <GestureDetector gesture={pan}>- <View style={styles.header} testID="chat-header">- <View style={styles.grabber} />- <View style={styles.headerRow}>- <Pressable44- onPress={close}- accessibilityLabel="Close"- pressedBackground={colors.background}- style={styles.round}- testID="chat-close"- >- <CloseIcon size={iconSizes.control} />- </Pressable44>- <Text style={styles.title} accessibilityRole="header" numberOfLines={1}>- {session.title ?? 'New chat'}- </Text>- {showEmptyState ? (- <View style={styles.headerSpacer} />- ) : (- <Pressable44- onPress={startNewChat}- accessibilityLabel="New chat"- pressedBackground={colors.background}- style={styles.round}- testID="chat-new"- >- <ComposeIcon size={iconSizes.control} />- </Pressable44>- )}- </View>- </View>- </GestureDetector>{showEmptyState ? (- <ChatEmptyState- reportCount={attached.length}- suggestedPrompts={suggestedPrompts}- onPrompt={setText}- />+ <View style={[styles.empty, { paddingTop: insets.top + CHAT_HEADER_HEIGHT }]}>+ <ChatEmptyState+ reportCount={attached.length}+ suggestedPrompts={suggestedPrompts}+ onPrompt={setText}+ />+ </View>) : (<SessionThreadsession={session}+ topInset={insets.top + CHAT_HEADER_HEIGHT}onRetryHistory={() => {track('mobile_session_load_retried')session.reloadHistory().catch(() => undefined)@@ -707,7 +668,15 @@ export function ChatSheet({</ChatAccessGate></View></Animated.View>- </Animated.View>+ </BlurTargetView>+ <ChatHeader+ key={session.taskId ?? 'new'}+ webUrl={demo ? undefined : taskWebUrl(scope, session.taskId)}+ blurTarget={blurTarget}+ onBack={close}+ onNewChat={startNewChat}+ onArchive={session.taskId ? archiveChat : undefined}+ /><ChatOptionsSheetvisible={optionsOpen}page={optionsPage}@@ -721,64 +690,17 @@ export function ChatSheet({<AttachMenuSheet visible={attachOpen} onPick={pickAttachment} onClose={closeAttach} /></View></OverlayHost>- </GestureHandlerRootView>+ </View>)}const useStyles = createStyles(({ colors }) => ({- overlay: {+ page: {flex: 1,- justifyContent: 'flex-end',- },- sheet: {- height: '94%',backgroundColor: colors.surface,- borderTopLeftRadius: radii.floating,- borderTopRightRadius: radii.floating,- },- keyboard: {- flex: 1,- },- header: {- paddingTop: 10,- },- grabber: {- width: 40,- height: 5,- borderRadius: 3,- backgroundColor: colors.border,- alignSelf: 'center',- },- headerRow: {- flexDirection: 'row',- alignItems: 'center',- justifyContent: 'space-between',- gap: 12,- paddingTop: 6,- paddingHorizontal: 16,- paddingBottom: 8,- },- round: {- width: 44,- height: 44,- borderRadius: 22,- borderWidth: 1,- borderColor: colors.hairline,- backgroundColor: colors.surface,- alignItems: 'center',- justifyContent: 'center',- },- title: {- ...type.sheetTitle,- color: colors.ink,- flexShrink: 1,- textAlign: 'center',- },- headerSpacer: {- width: 44,- height: 44,- },- composerArea: {- position: 'relative',},+ body: { flex: 1 },+ keyboard: { flex: 1 },+ empty: { flex: 1 },+ composerArea: { position: 'relative' },}))diff --git a/products/mobile/src/features/chat/chatNavigation.test.tsx b/products/mobile/src/features/chat/chatNavigation.test.tsxindex 8927d47333fd..77b546670ff2 100644--- a/products/mobile/src/features/chat/chatNavigation.test.tsx+++ b/products/mobile/src/features/chat/chatNavigation.test.tsx@@ -7,6 +7,7 @@ import { AppState, View } from 'react-native'import { useAuthStore } from '@/auth/authStore'import { setViewedNotificationTask } from '@/features/notifications/foregroundNotifications'import { findTask } from '@/features/notifications/taskLookup'+import { useDefaultPageStore } from '@/features/settings/defaultPageStore'import RootLayout from '../../../app/_layout'import ChatRoute from '../../../app/chat'@@ -38,14 +39,14 @@ jest.mock('expo-notifications', () => ({jest.mock('@/features/notifications/pushSupport', () => ({ notificationsSupported: () => true }))jest.mock('@/features/notifications/taskLookup', () => ({ findTask: jest.fn() }))jest.mock('@/lib/posthogClient', () => ({ initAnalytics: jest.fn() }))-jest.mock('@/features/chat/ChatSheet', () => {+jest.mock('@/features/chat/ChatScreen', () => {const { useEffect, useState } = jest.requireActual<typeof import('react')>('react')const { Button, Text, TextInput, View } = jest.requireActual<typeof import('react-native')>('react-native')const { setViewedNotificationTask } = jest.requireActual<typeof import('@/features/notifications/foregroundNotifications')>('@/features/notifications/foregroundNotifications')return {- ChatSheet: ({ initialTaskId, onClosed }: { initialTaskId?: string; onClosed: () => void }): ReactElement => {+ ChatScreen: ({ initialTaskId, onBack }: { initialTaskId?: string; onBack: () => void }): ReactElement => {const [taskId, setTaskId] = useState(initialTaskId)const [draft, setDraft] = useState('')useEffect(() => {@@ -55,10 +56,10 @@ jest.mock('@/features/chat/ChatSheet', () => {return () => setViewedNotificationTask(null)}, [taskId])return (- <View testID="chat-sheet">+ <View testID="chat-screen"><Text testID="loaded-task">{taskId ?? 'new'}</Text><TextInput testID="draft" value={draft} onChangeText={setDraft} />- <Button title="Close" testID="chat-close" onPress={onClosed} />+ <Button title="Back" testID="chat-back" onPress={onBack} /><Button title="Start task" testID="start-task" onPress={() => setTaskId('task-a')} /><Button title="New chat" testID="new-chat" onPress={() => setTaskId(undefined)} /></View>@@ -75,6 +76,7 @@ describe('chat navigation', () => {beforeEach(() => {jest.clearAllMocks()setViewedNotificationTask(null)+ useDefaultPageStore.setState({ page: null })AppState.currentState = 'active'jest.mocked(findTask).mockResolvedValue({ found: true, reportId: null })useAuthStore.setState({@@ -93,17 +95,24 @@ describe('chat navigation', () => {fireEvent.changeText(screen.getByTestId('draft'), 'Unsent message')act(() => router.push('/chat?taskId=task-a&from=push'))- expect(screen.getAllByTestId('chat-sheet')).toHaveLength(1)+ expect(screen.getAllByTestId('chat-screen')).toHaveLength(1)expect(screen.getByTestId('draft').props.value).toBe('Unsent message')act(() => router.push('/chat?taskId=task-b&from=push'))- expect(screen.getAllByTestId('chat-sheet')).toHaveLength(1)+ expect(screen.getAllByTestId('chat-screen')).toHaveLength(1)expect(screen.getByTestId('loaded-task').props.children).toBe('task-b')expect(screen.getByTestId('draft').props.value).toBe('')- fireEvent.press(screen.getByTestId('chat-close'))+ fireEvent.press(screen.getByTestId('chat-back'))expect(app.getPathname()).toBe('/inbox')- expect(screen.queryByTestId('chat-sheet')).toBeNull()+ expect(screen.queryByTestId('chat-screen')).toBeNull()+ })++ test.each(['/chat', '/chat?taskId=task-a'])('uses the default page for a direct link to %s', (initialUrl) => {+ useDefaultPageStore.setState({ page: 'views' })+ const app = renderRouter({ _layout: RootLayout, inbox: Inbox, views: Inbox, chat: ChatRoute }, { initialUrl })+ fireEvent.press(screen.getByTestId('chat-back'))+ expect(app.getPathname()).toBe('/views')})test.each([@@ -148,11 +157,11 @@ describe('chat navigation', () => {})await act(async () => listener(response))- expect(screen.getAllByTestId('chat-sheet')).toHaveLength(1)+ expect(screen.getAllByTestId('chat-screen')).toHaveLength(1)expect(screen.getByTestId('loaded-task').props.children).toBe('task-a')expect(screen.getByTestId('draft').props.value).toBe(preserveDraft ? 'Keep this draft' : '')- fireEvent.press(screen.getByTestId('chat-close'))+ fireEvent.press(screen.getByTestId('chat-back'))expect(app.getPathname()).toBe('/inbox')- expect(screen.queryByTestId('chat-sheet')).toBeNull()+ expect(screen.queryByTestId('chat-screen')).toBeNull()})})diff --git a/products/mobile/src/features/chat/session/SessionThread.tsx b/products/mobile/src/features/chat/session/SessionThread.tsxindex 2b7999f0396c..d72b5a086b37 100644--- a/products/mobile/src/features/chat/session/SessionThread.tsx+++ b/products/mobile/src/features/chat/session/SessionThread.tsx@@ -20,6 +20,7 @@ import type { Session, SessionAssistantItem, SessionDisplayItem, SessionErrorIteinterface SessionThreadProps {session: SessiononRetryHistory: () => void+ topInset?: number}const AssistantRow = memo(function AssistantRow({ item }: { item: SessionAssistantItem }): ReactElement {@@ -51,7 +52,7 @@ function statusLine(session: Session): string | null {}}-export function SessionThread({ session, onRetryHistory }: SessionThreadProps): ReactElement {+export function SessionThread({ session, onRetryHistory, topInset = 0 }: SessionThreadProps): ReactElement {const colors = useColors()const styles = useStyles()const scroll = useRef<ScrollView>(null)@@ -60,18 +61,24 @@ export function SessionThread({ session, onRetryHistory }: SessionThreadProps):if (session.history.status === 'loading') {positioned.current = false- return <LoadingView label="Loading session" />+ return (+ <View style={[styles.scroll, { paddingTop: topInset }]}>+ <LoadingView label="Loading session" />+ </View>+ )}if (session.history.status === 'error') {return (- <StateView- icon={<WarningIcon size={iconSizes.empty} color={colors.orange} />}- title="Couldn't load this session"- message={session.history.error?.message}- actionLabel="Try again"- onAction={onRetryHistory}- testID="session-history-error"- />+ <View style={[styles.scroll, { paddingTop: topInset }]}>+ <StateView+ icon={<WarningIcon size={iconSizes.empty} color={colors.orange} />}+ title="Couldn't load this session"+ message={session.history.error?.message}+ actionLabel="Try again"+ onAction={onRetryHistory}+ testID="session-history-error"+ />+ </View>)}@@ -109,7 +116,8 @@ export function SessionThread({ session, onRetryHistory }: SessionThreadProps):<ScrollViewref={scroll}style={styles.scroll}- contentContainerStyle={styles.content}+ contentContainerStyle={[styles.content, { paddingTop: topInset + 12 }]}+ scrollIndicatorInsets={{ top: topInset }}onContentSizeChange={() => {scroll.current?.scrollToEnd({ animated: positioned.current })positioned.current = truediff --git a/products/mobile/src/features/chat/useCopyChatLink.ts b/products/mobile/src/features/chat/useCopyChatLink.tsnew file mode 100644index 000000000000..229082d9ef3f--- /dev/null+++ b/products/mobile/src/features/chat/useCopyChatLink.ts@@ -0,0 +1,33 @@+import * as Clipboard from 'expo-clipboard'+import { useRef, useState } from 'react'++interface CopyChatLink {+ copyLink: (url: string | undefined) => Promise<boolean>+ copying: boolean+}++export function useCopyChatLink(showNotice: (message: string) => void): CopyChatLink {+ const pending = useRef(false)+ const [copying, setCopying] = useState(false)++ const copyLink = async (url: string | undefined): Promise<boolean> => {+ if (!url || pending.current) {+ return false+ }+ pending.current = true+ setCopying(true)+ try {+ const copied = await Clipboard.setStringAsync(url)+ showNotice(copied ? 'Chat link copied' : "Couldn't copy the link. Try again.")+ return copied+ } catch {+ showNotice("Couldn't copy the link. Try again.")+ return false+ } finally {+ pending.current = false+ setCopying(false)+ }+ }++ return { copyLink, copying }+}diff --git a/products/mobile/src/features/chats/hooks.test.tsx b/products/mobile/src/features/chats/hooks.test.tsxindex 1197588eef32..bd6ba8b51e10 100644--- a/products/mobile/src/features/chats/hooks.test.tsx+++ b/products/mobile/src/features/chats/hooks.test.tsx@@ -186,5 +186,14 @@ describe('chats hooks', () => {await waitFor(() => expect(result.current.list.data?.map((item) => item.sourceId)).toEqual(expected))})++ test('archives a directly opened task that is not in the cached list', async () => {+ mocked.setTaskArchived.mockResolvedValue(undefined)+ const { result } = renderChats()+ await waitFor(() => expect(result.current.list.data).toHaveLength(2))+ await act(async () => result.current.archive.archive({ sourceId: 'direct-task' }))+ expect(mocked.setTaskArchived).toHaveBeenCalledWith('direct-task', true)+ expect(result.current.list.data?.map((item) => item.sourceId)).toEqual(['task-1', 'task-2'])+ })})})diff --git a/products/mobile/src/features/chats/hooks.ts b/products/mobile/src/features/chats/hooks.tsindex d3ca589f38f4..9c15b58c468d 100644--- a/products/mobile/src/features/chats/hooks.ts+++ b/products/mobile/src/features/chats/hooks.ts@@ -119,9 +119,9 @@ export function useChatList(): QueryState<ChatListItem[]> {export interface ChatArchiveActions {/** Hides the row at once and archives the task. A failed request puts the row back and rejects. */- archive: (item: ChatListItem) => Promise<void>+ archive: (item: Pick<ChatListItem, 'sourceId'>) => Promise<void>/** Puts the row back at once and unarchives the task, for the toast's Undo. */- restore: (item: ChatListItem) => Promise<void>+ restore: (item: Pick<ChatListItem, 'sourceId'>) => Promise<void>}function useLiveArchiveChat(): ChatArchiveActions {@@ -147,7 +147,7 @@ function useLiveArchiveChat(): ChatArchiveActions {)const archive = useCallback(- (item: ChatListItem): Promise<void> => {+ (item: Pick<ChatListItem, 'sourceId'>): Promise<void> => {const pending = archivesInFlight.current.get(item.sourceId)if (pending) {return pending@@ -185,7 +185,7 @@ function useLiveArchiveChat(): ChatArchiveActions {)const restore = useCallback(- async (item: ChatListItem): Promise<void> => {+ async (item: Pick<ChatListItem, 'sourceId'>): Promise<void> => {if (!scope) {throw new NotSignedInError()}diff --git a/products/mobile/src/model/adapters/chats.ts b/products/mobile/src/model/adapters/chats.tsindex 512d5be7f947..83c032b40a98 100644--- a/products/mobile/src/model/adapters/chats.ts+++ b/products/mobile/src/model/adapters/chats.ts@@ -21,8 +21,10 @@ function titleOr(title: string | null | undefined, fallback: string): string {return title?.trim() || fallback}-function taskWebUrl(scope: ProjectScope | null, taskId: string): string | undefined {- return scope ? `${scope.host}/project/${scope.projectId}/ai?task=${encodeURIComponent(taskId)}` : undefined+export function taskWebUrl(scope: ProjectScope | null, taskId: string | null): string | undefined {+ return scope && taskId+ ? `${scope.host.replace(/\/$/, '')}/project/${scope.projectId}/ai?task=${encodeURIComponent(taskId)}`+ : undefined}function sessionStatus(session: TaskSummaryApi): ChatSessionStatus {diff --git a/products/mobile/src/ui/BlurEdge.tsx b/products/mobile/src/ui/BlurEdge.tsxindex e51cdf1261ad..402af2da2c80 100644--- a/products/mobile/src/ui/BlurEdge.tsx+++ b/products/mobile/src/ui/BlurEdge.tsx@@ -1,7 +1,7 @@import MaskedView from '@react-native-masked-view/masked-view'import { BlurView } from 'expo-blur'-import type { ReactElement } from 'react'-import { Platform, StyleSheet, type ViewStyle } from 'react-native'+import type { ReactElement, RefObject } from 'react'+import { Platform, StyleSheet, type View, type ViewStyle } from 'react-native'import { FadeEdge } from './FadeEdge'import { useColorSchemeName } from './theme'@@ -10,18 +10,25 @@ interface BlurEdgeProps {direction?: 'down' | 'up'solid: numberintensity?: number+ blurTarget?: RefObject<View | null>}const DEFAULT_INTENSITY = 11-export function BlurEdge({ direction = 'down', solid, intensity = DEFAULT_INTENSITY }: BlurEdgeProps): ReactElement {+export function BlurEdge({+ direction = 'down',+ solid,+ intensity = DEFAULT_INTENSITY,+ blurTarget,+}: BlurEdgeProps): ReactElement {const scheme = useColorSchemeName()const blur = (<BlurViewstyle={[styles.fill, webMask(direction, solid)]}intensity={intensity}tint={scheme}- experimentalBlurMethod="dimezisBlurView"+ blurMethod="dimezisBlurView"+ blurTarget={Platform.OS === 'android' ? blurTarget : undefined}/>)if (Platform.OS === 'web') {