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.

fix(ai): align task header padding and actions (#100635)

Chris Volzer777d92b95618
diff --git a/docs/published/handbook/engineering/ai/sandboxed-agents.md b/docs/published/handbook/engineering/ai/sandboxed-agents.md
index 30b5a8f66128..3b9cf6aaea8d 100644
--- a/docs/published/handbook/engineering/ai/sandboxed-agents.md
+++ b/docs/published/handbook/engineering/ai/sandboxed-agents.md
@@ -118,6 +118,8 @@ Without organization-level AI data-processing consent, the prompt only prefills
Task links in shared AI history open `/ai?task=<task-id>` and render the task runner, regardless of the saved chat view preference.
The task stays selected on reload and when navigating back or forward.
Existing `/tasks/<task-id>` links still open the standalone runner.
+Task headers keep horizontal padding around the title and run metadata.
+In the AI chat view, the staff options menu sits beside the task actions, including **Open in PostHog Desktop**.
## Fine-grained access tokens
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index be0d04e9440d..aa8c59184ca7 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -10001,9 +10001,9 @@ snapshots:
scenes-app-tasks--mobile-new-task--light:
hash: v1.k794b7964.4e46fc238eaa36f61f17bb56c33d2f2e1dfc2c097b08da0cf5a4acd7a331b8f9.BwgsVP8F0KpL4GnPbv3hnGxEi8al2XBdoAByGydlOnI
scenes-app-tasks--mobile-task-selected--dark:
- hash: v1.k794b7964.d62477cbcb9408400e76d3cb0071deb3d03faff4ac520b2d4ecdab6258a1a7ad.crUdc0PsNoOFZ91X7UTIgYXgUxCHJRxLiUt67SP-ZIk
+ hash: v1.k794b7964.d06ab26a48af8a3d13b40df8f367237125ec26d8dd81ecf9774aa1620230d306.0_z8CXJemIhKB7vh6Ht7QXcrPG_PHg55oMU8BYaK4WA
scenes-app-tasks--mobile-task-selected--light:
- hash: v1.k794b7964.b65826b2b012393f45046c4ed288096a85f6aca78b4910c0c3007a271767ffaa.HVnEcnGs6oiFe-3r24AafcbzANt_xRt5Zwb1FNk-fRA
+ hash: v1.k794b7964.af53418e87eba4270c502100139b47d996d15d259ea2078f25bd302ef1431eeb.ObkxJ7qFQbwv5q5qKFnp4f0nqfKw5RJZ93Ae4CYkIqc
scenes-app-tasks--new-task--dark:
hash: v1.k794b7964.7eef9b267cd20f210bf5f20c395acbd04f412df23a4e5591fb5513ffd82334e8.igtYZYdMAjdMTWuPyiI8UjcKM2v2atwlbdF2GcbufqU
scenes-app-tasks--new-task--light:
@@ -10013,9 +10013,9 @@ snapshots:
scenes-app-tasks--new-task-with-repository--light:
hash: v1.k794b7964.9e3733a4b644973157675b87f9d5c93279803c83b236223008a7f0275906127a.TLun3X19lpf5HQJhm-68oFXFf_l-39SBlQP779lf8XE
scenes-app-tasks--task-detail-loading--dark:
- hash: v1.k794b7964.941ec3a5b05523b0ee00f5671c58aa19fbbf4d54785c9bc49387a9a51d65121d.ln3p7-YC5TFzCDXOJI0C8a-F4AA36fHS0TarfQmdXGc
+ hash: v1.k794b7964.8c04d529d803b961fcd596d0f748a22e0254ab185dc85bd42d3be47ff68e1902.3-VexQvKrWZFj_n7bOgXF3_lGw9S9zB4QYHA00Rpfh0
scenes-app-tasks--task-detail-loading--light:
- hash: v1.k794b7964.cf66aaef1d8b5d59017acd2a91dbf148fb87fb3e19eda70583e318127a5b52b6.F3PWVbTXInzfojH4Uv6o2d_8Gfkc1bN-nwBULgEtN8I
+ hash: v1.k794b7964.c8fb0a7ee9be9b7e43c86e1ef0ab08afa36fc1ee73e37c7db3f295cacd7f428e.LTBA5SJdNLyUSgSShns_HEJxKkHVYFN0T0lGWEKMTPs
scenes-app-tasks--task-load-error--dark:
hash: v1.k794b7964.8c160753039593f051efc147d69f447a861f14a8281d97f8f612b1b2279bb241.wB8WL7fVnS3sNEHJtbST0gUGVoyv2V2TwcnemxoSeBw
scenes-app-tasks--task-load-error--light:
@@ -10025,17 +10025,17 @@ snapshots:
scenes-app-tasks--task-not-found--light:
hash: v1.k794b7964.ba0258d71a153077d78895c251518dd05810884eda29937720025fdc09f1dee4.kfd78wcAqNuCyYxFGp9oQ6JxKtwA7nizg1RDwox3DR8
scenes-app-tasks--task-run-not-found--dark:
- hash: v1.k794b7964.c05e9ecd2cf29ddab2e5033c8de0a57e2813c536a2f659abcba351ae7d024d17.AHHcGww408YFyBdUPBTR7IUK_QuEhA8I2_BxvSZjXkY
+ hash: v1.k794b7964.b457b06ec2a45a22aeb6bc575104982e0a5660577711f970c865c416889373e6.ZsU6iidyliZ0Y4Pwv1LdO5W9ZdYtn9c_whL5RJyz2HY
scenes-app-tasks--task-run-not-found--light:
- hash: v1.k794b7964.89fe5064ecd6c305c839fbd7bcac35b60d6bb23e5dd3716f80271d031628535e.1cdWwFSH8nG-Mz-lQSKzNs0k1TbzwPs3Pob0nZNaLcw
+ hash: v1.k794b7964.a506f03a25deb7712b3b04458f94ebaef874655daab46960dc3eb6917e3bca55.urTGWlZeinJRaBu6rq43yyEnBG5eL-Mw4ov4BULSFqc
scenes-app-tasks--task-runs-load-error--dark:
- hash: v1.k794b7964.4e2bbc04b75c49d35589d8c275c777034d6afab28507d68aababcfd19232a45c.R0mnkM8UCMjCJAV5DqeOrYtwnF-gxWpE6Rle55jAoaY
+ hash: v1.k794b7964.28f83f3359dae03462b1338d6c9080cc48f026b40e0afc6677c6235e5c98596f.s356pLCrSDeMzpw2U5wXCIU7tlEThrBjUKH5nlpIqRQ
scenes-app-tasks--task-runs-load-error--light:
- hash: v1.k794b7964.fdf3f8bb967ff9b5741fd10c49b4ce2b7e3cd13c3060ea81a4ffa4c81e209c7b.GoOApSFkzjBf_rJn7J2qTtiPSwlrtlpfSNOx37mlrKw
+ hash: v1.k794b7964.38350d68c0c57a9f804e0d7d5424dfaa7a65c0e817a951e2e3e69c3b7c3b1198.a5BUKSHvDZURt_Q1qcmXd5j3z2xIBYA3ZxTH9N9z06U
scenes-app-tasks--task-selected--dark:
- hash: v1.k794b7964.5022d3dde1540f86819fccfc1d7c0a337569b2213ccdf1a730d3b7fdf16d57ed.2713dyfaJHLc5PWhqZEWOjuyotRUNPgOuqaEdJUaI9k
+ hash: v1.k794b7964.936e04793912272fae02d3ca93c45f817cc35bff660e1f2c639155c996cfee7c.MMlOi3C0qO0lKqv2lc-v9miEewtRxVKurIcucfgvMY0
scenes-app-tasks--task-selected--light:
- hash: v1.k794b7964.a3c996704d86f0854bc4aaaa07cbf709a25391cd776e54a9ba054241d364099d.6L6U3eW3Nxye1C7mVa1g2p0le8gClLpYZE8kZ5UkqX4
+ hash: v1.k794b7964.be92d85b9e4f3559fbebeaeba21773bad45153830331d93ae6379ccdf69f4840.EDcuiSWkGmKJhCerK5b59iSQeXK1blDRBdj2Qic3nvI
scenes-app-tasks--unified-navigation--dark:
hash: v1.k794b7964.d4169f92563f1a61588ba823f6be7392267558bfbb86124b6e53ec9b18056418.acrrts8TAMCVepFdVIC0S1wZjdtoI-atFC1n-9B9Qwk
scenes-app-tasks--unified-navigation--light:
diff --git a/frontend/src/scenes/max/components/AiFirstMaxInstance.tsx b/frontend/src/scenes/max/components/AiFirstMaxInstance.tsx
index a4f7ba10adf3..dab4bff3aa4a 100644
--- a/frontend/src/scenes/max/components/AiFirstMaxInstance.tsx
+++ b/frontend/src/scenes/max/components/AiFirstMaxInstance.tsx
@@ -117,14 +117,16 @@ export function AiFirstMaxInstance({ tabId, taskId, chatId }: AiFirstMaxInstance
if (aiSceneView({ taskId, chatId, effectivePhaiView }) === 'runner') {
return (
<div className="flex flex-col grow overflow-hidden h-full">
- <div className="flex w-full items-center justify-end gap-2 py-2 px-2 border-b border-primary">
- {/* The new view is the runner, which is always the sandbox runtime — no runtime check needed. */}
- <DebugLogsMenu variant="lemon" />
- {!taskId && <PhaiViewToggle variant="lemon" />}
- </div>
+ {!taskId && (
+ <div className="flex w-full items-center justify-end gap-2 py-2 px-2 border-b border-primary">
+ {/* The new view is the runner, which is always the sandbox runtime — no runtime check needed. */}
+ <DebugLogsMenu variant="lemon" />
+ <PhaiViewToggle variant="lemon" />
+ </div>
+ )}
<div className="flex flex-col flex-1 min-h-0">
<BindLogic logic={phaiAiComposerSeedLogic} props={{}}>
- <EmbeddedRunner taskId={taskId} />
+ <EmbeddedRunner taskId={taskId} titleActions={<DebugLogsMenu variant="lemon" />} />
</BindLogic>
</div>
</div>
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.tsx
index f8be539db52a..764e80a26442 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.tsx
@@ -15,6 +15,7 @@ import { taskTrackerSceneLogic } from './taskTrackerSceneLogic'
export interface TaskTrackerProps {
/** From the `/tasks/:taskId` route. A UUID selects a task; `new` or absent shows the composer. */
taskId?: string
+ titleActions?: JSX.Element
}
export const scene: SceneExport<TaskTrackerProps> = {
@@ -24,7 +25,7 @@ export const scene: SceneExport<TaskTrackerProps> = {
paramsToProps: ({ params: { taskId } }) => ({ taskId }),
}
-export function TaskTracker({ taskId }: TaskTrackerProps): JSX.Element {
+export function TaskTracker({ taskId, titleActions }: TaskTrackerProps): JSX.Element {
const { isWindowLessThan } = useWindowSize()
const isMobile = isWindowLessThan('lg')
const { activeCreation } = useValues(taskTrackerSceneLogic)
@@ -37,7 +38,7 @@ export function TaskTracker({ taskId }: TaskTrackerProps): JSX.Element {
<AllowTrainingCallout featureName={selectedTaskId ? 'PostHog Desktop' : 'Tasks'} />
<div className="flex flex-1 min-h-0 flex-col overflow-hidden">
{selectedTaskId ? (
- <TaskDetailPage taskId={selectedTaskId} isMobile={isMobile} />
+ <TaskDetailPage taskId={selectedTaskId} isMobile={isMobile} titleActions={titleActions} />
) : (
<TaskCreateThread streamKey={activeCreation!.streamKey} isMobile={isMobile} />
)}
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskDetailPage.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskDetailPage.tsx
index 40ae96fe1a98..ee30db22ae57 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskDetailPage.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskDetailPage.tsx
@@ -16,9 +16,10 @@ import { TaskRunSceneShell } from './TaskRunSceneShell'
export interface TaskDetailPageProps {
taskId: string
isMobile: boolean
+ titleActions?: JSX.Element
}
-export function TaskDetailPage({ taskId, isMobile }: TaskDetailPageProps): JSX.Element {
+export function TaskDetailPage({ taskId, isMobile, titleActions }: TaskDetailPageProps): JSX.Element {
const sceneLogic = taskDetailSceneLogic({ taskId })
const { task, taskNotFound, taskError, latestRun, selectedRun, isTaskPending, isHeaderLoading, runTaskInFlight } =
useValues(sceneLogic)
@@ -39,13 +40,13 @@ export function TaskDetailPage({ taskId, isMobile }: TaskDetailPageProps): JSX.E
const runButtonText = latestRun ? 'Retry task' : 'Run task'
const prUrl = selectedRun?.output?.pr_url as string | undefined
- const titleActions =
+ const taskActions =
isHeaderLoading || !task ? (
isActiveCreation ? undefined : (
<TaskHeaderActionsSkeleton />
)
) : (
- <div className="flex items-center gap-2">
+ <div className="flex flex-wrap items-center gap-2">
{hasDesktopAccess && (
<LemonButton
type="secondary"
@@ -94,7 +95,12 @@ export function TaskDetailPage({ taskId, isMobile }: TaskDetailPageProps): JSX.E
task={task}
selectedRun={selectedRun}
isHeaderLoading={isHeaderLoading && !isActiveCreation}
- titleActions={titleActions}
+ titleActions={
+ <div className="flex flex-wrap items-center gap-2">
+ {taskActions}
+ {titleActions}
+ </div>
+ }
onArchive={deleteTask}
taskError={taskError}
onRetry={loadTask}
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunSceneShell.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunSceneShell.tsx
index 007964bd16a9..21a6d0600fb4 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunSceneShell.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/components/TaskRunSceneShell.tsx
@@ -122,7 +122,7 @@ export function TaskRunSceneShell({
/>
)}
- <header className={cn('flex flex-col gap-y-2', taskError && 'mt-4')}>
+ <header className={cn('flex flex-col gap-y-2 px-4 pt-2', taskError && 'mt-4')}>
<SceneTitleSection
className="-mt-2"
name={task?.title || 'Task'}