Skip to content

: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.

feat(today): make the task page and typing feel native on phones (#111221)

Shy Alter7221307b3ba4
diff --git a/frontend/src/layout/scenes/components/QuillSceneHeader.tsx b/frontend/src/layout/scenes/components/QuillSceneHeader.tsx
index 9c600d55e6c9..6fcef799a378 100644
--- a/frontend/src/layout/scenes/components/QuillSceneHeader.tsx
+++ b/frontend/src/layout/scenes/components/QuillSceneHeader.tsx
@@ -30,9 +30,9 @@ export function QuillSceneHeader({ back, icon, title, actions, className }: Quil
{icon}
</span>
)}
- <div className="flex min-w-0 flex-1 items-center gap-1">{title}</div>
+ <div className="flex min-w-0 flex-1 items-center gap-1 @max-xl/main-content:min-w-48">{title}</div>
{actions && (
- <div className="ml-auto flex shrink-0 items-center gap-1 @max-xl/main-content:ml-0 @max-xl/main-content:basis-full @max-xl/main-content:flex-wrap">
+ <div className="ml-auto flex shrink-0 items-center gap-1 @max-xl/main-content:shrink @max-xl/main-content:flex-wrap @max-xl/main-content:justify-end">
{actions}
</div>
)}
diff --git a/frontend/src/layout/today/TodayShell.scss b/frontend/src/layout/today/TodayShell.scss
index 2a6d28ec2564..cae08972525c 100644
--- a/frontend/src/layout/today/TodayShell.scss
+++ b/frontend/src/layout/today/TodayShell.scss
@@ -109,6 +109,16 @@
display: contents;
}
+@media (pointer: coarse) {
+ .TodayAppLayout--phone:has(:is(input, textarea, [contenteditable='true']):focus) {
+ --today-tab-bar-height: 0px;
+
+ .TodayTabBar {
+ display: none;
+ }
+ }
+}
+
body:has(.TodayAppLayout--phone) :is(input, textarea, select) {
font-size: 1rem;
}
@@ -138,6 +148,7 @@ body:has(.TodayAppLayout--phone) .Toastify__toast-container--bottom-right {
}
.quill-button--size-row {
+ -webkit-touch-callout: none;
height: 2.75rem;
font-size: 0.9375rem;
}
@@ -158,7 +169,10 @@ body:has(.TodayAppLayout--phone) .Toastify__toast-container--bottom-right {
align-items: center;
height: var(--today-tab-bar-height);
padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
+ user-select: none;
background: var(--today-paper);
+ -webkit-tap-highlight-color: transparent;
+ -webkit-touch-callout: none;
}
@media (prefers-reduced-motion: reduce) {
diff --git a/products/posthog_ai/frontend/components/quill/QuillComposerSendButton.tsx b/products/posthog_ai/frontend/components/quill/QuillComposerSendButton.tsx
index be6c1fa7372e..218273962fcb 100644
--- a/products/posthog_ai/frontend/components/quill/QuillComposerSendButton.tsx
+++ b/products/posthog_ai/frontend/components/quill/QuillComposerSendButton.tsx
@@ -1,18 +1,23 @@
+import { useValues } from 'kea'
import { forwardRef } from 'react'
import { IconArrowRight, IconStopFilled } from '@posthog/icons'
import { Button, Tooltip, TooltipContent, TooltipTrigger } from '@posthog/quill-primitives'
+import { todayShellLogic } from '~/layout/today/todayShellLogic'
+
import { useComposerContext } from '../composer/Composer'
export const QuillComposerSendButton = forwardRef<HTMLSpanElement, { 'data-attr'?: string }>(
function QuillComposerSendButton({ 'data-attr': dataAttr }, ref): JSX.Element {
const { sendDisabledReason, loading, stopLoading, showStop, onStop } = useComposerContext()
+ const { todayRailEnabled, phoneLayout } = useValues(todayShellLogic)
+ const size = todayRailEnabled && phoneLayout ? 'icon-lg' : 'icon'
const button = showStop ? (
<Button
type="button"
variant="destructive"
- size="icon"
+ size={size}
aria-label="Stop"
loading={stopLoading}
onClick={() => onStop?.()}
@@ -24,7 +29,7 @@ export const QuillComposerSendButton = forwardRef<HTMLSpanElement, { 'data-attr'
<Button
type="submit"
variant="primary"
- size="icon"
+ size={size}
aria-label="Send message"
loading={loading}
disabled={!!sendDisabledReason}
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/QuillTaskNotRunEmpty.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/QuillTaskNotRunEmpty.tsx
new file mode 100644
index 000000000000..b895e92a0ddf
--- /dev/null
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/QuillTaskNotRunEmpty.tsx
@@ -0,0 +1,48 @@
+import { useActions, useValues } from 'kea'
+
+import { IconPlay } from '@posthog/icons'
+import {
+ Button,
+ Empty,
+ EmptyContent,
+ EmptyDescription,
+ EmptyHeader,
+ EmptyMedia,
+ EmptyTitle,
+} from '@posthog/quill-primitives'
+
+import { isPiTaskRuntime } from '../../../types/taskTypes'
+import { taskDetailSceneLogic } from '../taskDetailSceneLogic'
+
+export function QuillTaskNotRunEmpty({ taskId }: { taskId: string }): JSX.Element {
+ const { task, runTaskInFlight } = useValues(taskDetailSceneLogic({ taskId }))
+ const { runTask } = useActions(taskDetailSceneLogic({ taskId }))
+ const canRun = !!task && !isPiTaskRuntime(task.runtime)
+
+ return (
+ <Empty data-quill className="flex-1 px-4">
+ <EmptyHeader>
+ <EmptyMedia variant="icon">
+ <IconPlay />
+ </EmptyMedia>
+ <EmptyTitle>Not started yet</EmptyTitle>
+ {task?.description && <EmptyDescription className="line-clamp-4">{task.description}</EmptyDescription>}
+ </EmptyHeader>
+ {canRun && (
+ <EmptyContent>
+ <Button
+ variant="primary"
+ size="lg"
+ onClick={runTask}
+ loading={runTaskInFlight}
+ className="w-full max-w-60"
+ data-attr="task-empty-run"
+ >
+ <IconPlay />
+ Run task
+ </Button>
+ </EmptyContent>
+ )}
+ </Empty>
+ )
+}
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskDetailPage.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskDetailPage.tsx
index 7dd34311a8e8..0a2171c0b19e 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskDetailPage.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskDetailPage.tsx
@@ -63,7 +63,7 @@ export function TaskDetailPage({ taskId, isMobile, titleActions }: TaskDetailPag
<QuillTaskHeaderActions
desktopUrl={hasDesktopAccess ? urls.codeTaskLink(task.id) : null}
prUrl={prUrl}
- runLabel={canRun ? runButtonText : null}
+ runLabel={canRun && latestRun ? runButtonText : null}
onRun={runTask}
running={runTaskInFlight}
/>
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunChat.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunChat.tsx
index 9cc295052bc9..bd14f936a732 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunChat.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunChat.tsx
@@ -1,6 +1,7 @@
import { BindLogic, useActions, useValues } from 'kea'
import { type MutableRefObject, useEffect, useRef } from 'react'
+import { cn } from 'lib/utils/css-classes'
import { userLogic } from 'scenes/userLogic'
import { runInteractionLogic, type RunInteractionLogicProps } from 'products/posthog_ai/frontend/api/logics'
@@ -165,7 +166,7 @@ function TaskRunChatContent({
textAreaRef={textAreaRef}
onEscape={handleEscape}
disabled={readOnly}
- className="@container/thread flex flex-col h-full -mx-4"
+ className={cn('@container/thread flex flex-col h-full', skin === 'lemon' && '-mx-4')}
>
<RunSurface.Thread
restoreReadPosition
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunComposer.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunComposer.tsx
index bbda68a44c72..dee893cb9a04 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunComposer.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunComposer.tsx
@@ -8,6 +8,8 @@ import { AIConsentPopoverWrapper } from 'scenes/settings/organization/AIConsentP
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
+import { todayShellLogic } from '~/layout/today/todayShellLogic'
+
import { runInteractionLogic, type RunInteractionLogicProps } from 'products/posthog_ai/frontend/api/logics'
import { Composer, QueuedMessageList, useThreadSkin } from 'products/posthog_ai/frontend/api/primitives'
import { modelCatalogueLogic } from 'products/posthog_ai/frontend/logics/modelCatalogueLogic'
@@ -114,9 +116,15 @@ export function TaskRunComposer({
const skin = useThreadSkin()
const codexBillingEnabled = useFeatureFlag('POSTHOG_CODE_CODEX_OWN_SUBSCRIPTION_CLOUD')
- const placeholder = isTerminal
- ? 'Send a message to start a new run, or type / for commands…'
- : 'Send a follow-up message, or type / for commands…'
+ const { todayRailEnabled, phoneLayout } = useValues(todayShellLogic)
+ const placeholder =
+ todayRailEnabled && phoneLayout
+ ? isTerminal
+ ? 'Start a new run…'
+ : 'Reply…'
+ : isTerminal
+ ? 'Send a message to start a new run, or type / for commands…'
+ : 'Send a follow-up message, or type / for commands…'
// Selection lives in the bound runInteractionLogic and is applied when the message is sent — synced to the
// running agent on a follow-up, or used to seed the next run once terminal.
const modePicker = (
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunLoadingSkeleton.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunLoadingSkeleton.tsx
index 433c6339c283..f4f28cc4ec20 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunLoadingSkeleton.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunLoadingSkeleton.tsx
@@ -12,7 +12,7 @@ export function TaskRunLoadingSkeleton(): JSX.Element {
return <RunLogSkeleton />
}
return (
- <div className="@container/thread flex h-full min-h-0 flex-col -mx-4">
+ <div className="@container/thread flex h-full min-h-0 flex-col">
<RunLogSkeleton className="flex-1" listClassName="py-4" rowClassName="px-4" />
<QuillRunSurfaceInputs
approval={null}
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunLog.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunLog.tsx
index c7bf832fa201..ce581ff63943 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunLog.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunLog.tsx
@@ -2,7 +2,9 @@ import { useActions, useValues } from 'kea'
import { NotFound } from 'lib/components/NotFound'
+import { useThreadSkin } from '../../../hooks/useThreadSkin'
import { taskDetailSceneLogic } from '../taskDetailSceneLogic'
+import { QuillTaskNotRunEmpty } from './QuillTaskNotRunEmpty'
import { TaskErrorBanner } from './TaskErrorBanner'
import { TaskRunChat } from './TaskRunChat'
import { TaskRunLoadingSkeleton } from './TaskRunLoadingSkeleton'
@@ -41,6 +43,7 @@ export function TaskRunLog({
runContinuation,
} = useValues(logic)
const { loadTaskRuns, loadSelectedTaskRun, clearContinuationDraft } = useActions(logic)
+ const skin = useThreadSkin()
if (runContinuation && selectedRunId === runContinuation.run.id) {
return (
@@ -101,6 +104,9 @@ export function TaskRunLog({
return <TaskRunLoadingSkeleton />
}
if (runs.length === 0 && !selectedRunId) {
+ if (skin === 'quill') {
+ return <QuillTaskNotRunEmpty taskId={taskId} />
+ }
return (
<div className="text-center py-16">
<p className="text-muted">This task hasn't been run yet</p>
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunSceneShell.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunSceneShell.tsx
index cc99e1955829..4525495a7c0d 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunSceneShell.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunSceneShell.tsx
@@ -1,3 +1,4 @@
+import { useValues } from 'kea'
import { type ReactNode } from 'react'
import { IconArchive, IconChevronLeft } from '@posthog/icons'
@@ -21,6 +22,7 @@ import {
ScenePanelInfoSection,
} from '~/layout/scenes/SceneLayout'
import { TodaySessionIcon } from '~/layout/today/TodaySessionIcon'
+import { todayShellLogic } from '~/layout/today/todayShellLogic'
import { sessionIconFields } from '~/layout/today/todayWorkItems'
import type { TaskRunDetailDTOApi } from 'products/tasks/frontend/generated/api.schemas'
@@ -74,6 +76,8 @@ export function TaskRunSceneShell({
children,
}: TaskRunSceneShellProps): JSX.Element {
const skin = useThreadSkin()
+ const { todayRailEnabled, phoneLayout } = useValues(todayShellLogic)
+ const todayPhone = todayRailEnabled && phoneLayout
return (
<SceneContent className="h-full min-h-0 gap-y-0">
{/* The quill skin moves the panel's facts and actions into the title's overflow menu (QuillTaskMenu). */}
@@ -147,7 +151,7 @@ export function TaskRunSceneShell({
<QuillSceneHeader
className={cn(taskError && 'mt-4')}
back={
- isMobile ? (
+ isMobile && !todayPhone ? (
<Button
variant="default"
size="icon-sm"