: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(today): polish the space feed cards to match desktop (#109592)
Shy Alter3239defedeaf
diff --git a/frontend/src/scenes/project-homepage/today/Today.stories.tsx b/frontend/src/scenes/project-homepage/today/Today.stories.tsxindex 6a7e3876f5b2..6fb57a1df742 100644--- a/frontend/src/scenes/project-homepage/today/Today.stories.tsx+++ b/frontend/src/scenes/project-homepage/today/Today.stories.tsx@@ -91,12 +91,29 @@ const RECENT_SESSIONS = [id: 'run-1',status: 'completed',environment: 'cloud',- output: { pr_url: 'https://github.com/example-org/webapp/pull/421' },+ output: {+ pr_url: 'https://github.com/example-org/webapp/pull/421',+ pr_urls: [+ 'https://github.com/example-org/webapp/pull/422',+ 'https://github.com/example-org/webapp/pull/423',+ ],+ },},description_preview: 'Retry the billing webhook three times with a backoff before it reports a failure.',repository: 'example-org/webapp',created_by: { id: 179, uuid: 'user-john', first_name: 'John', last_name: 'Baker', email: '[email protected]' },},+ {+ id: 'task-3',+ channel: 'space-checkout',+ title: 'Speed up the invoice export',+ archived: false,+ last_activity_at: '2026-09-28T15:30:00Z',+ latest_run: { id: 'run-3', status: 'completed', environment: 'cloud', output: null },+ description_preview: 'The monthly invoice export takes minutes for large teams. Batch the queries.',+ repository: 'example-org/billing',+ created_by: { id: 42, first_name: 'Grace', last_name: 'Hopper', email: '[email protected]' },+ },{id: 'task-2',channel: 'space-checkout',diff --git a/frontend/src/styles/quill-bridge.scss b/frontend/src/styles/quill-bridge.scssindex f5b9786f796c..1dc300d99990 100644--- a/frontend/src/styles/quill-bridge.scss+++ b/frontend/src/styles/quill-bridge.scss@@ -148,6 +148,20 @@background-color: var(--fill-expanded);}+/* stylelint-disable-next-line selector-class-pattern -- the name of Tailwind's hover variant class */+[data-quill] .hover\:bg-fill-selected:hover {+ background-color: var(--fill-selected);+}++/*+ * PostHog's compiled `hover:bg-muted` reads `--muted-3000`, which is a text colour, and it is `!important`.+ * Pin the hover to quill's muted surface, like `.bg-muted` above.+ */+/* stylelint-disable-next-line selector-class-pattern -- the name of Tailwind's hover variant class */+[data-quill] .hover\:bg-muted:hover {+ background-color: var(--muted) !important;+}+[data-quill] .bg-destructive-foreground {background-color: var(--destructive-foreground);}diff --git a/products/posthog_ai/frontend/components/EmbeddedTaskComposer.tsx b/products/posthog_ai/frontend/components/EmbeddedTaskComposer.tsxindex c91bf543d1f0..1fa37df6de5f 100644--- a/products/posthog_ai/frontend/components/EmbeddedTaskComposer.tsx+++ b/products/posthog_ai/frontend/components/EmbeddedTaskComposer.tsx@@ -1,11 +1,14 @@-import { Suspense } from 'react'+import { ReactNode, Suspense } from 'react'import { Spinner } from 'lib/lemon-ui/Spinner'import { lazyWithRetry } from 'lib/utils/retryImport'import type { EmbeddedTaskComposerImplProps } from '../scenes/TaskTracker/components/EmbeddedTaskComposerImpl'-export type EmbeddedTaskComposerProps = EmbeddedTaskComposerImplProps+export type EmbeddedTaskComposerProps = EmbeddedTaskComposerImplProps & {+ /** Shown while the composer chunk loads. A host passes a placeholder shaped like the composer. */+ fallback?: ReactNode+}// The composer pulls in the TaskTracker scene logic and its pickers, so it loads on demand. A host that// only imports this module keeps its own chunk light.@@ -16,13 +19,15 @@ const Lazy = lazyWithRetry(() =>)/** The new-task composer (repository, mode, model and effort pickers, attachments, context) without the run view. */-export function EmbeddedTaskComposer(props: EmbeddedTaskComposerProps): JSX.Element {+export function EmbeddedTaskComposer({ fallback, ...props }: EmbeddedTaskComposerProps): JSX.Element {return (<Suspensefallback={- <div className="flex items-center justify-center py-6">- <Spinner className="text-2xl" />- </div>+ fallback ?? (+ <div className="flex items-center justify-center py-6">+ <Spinner className="text-2xl" />+ </div>+ )}><Lazy {...props} />diff --git a/products/tasks/frontend/spaces/SpaceFeed.tsx b/products/tasks/frontend/spaces/SpaceFeed.tsxindex 52b5ae7bd22e..8000972de88c 100644--- a/products/tasks/frontend/spaces/SpaceFeed.tsx+++ b/products/tasks/frontend/spaces/SpaceFeed.tsx@@ -71,10 +71,11 @@ export function SpaceFeed({ id }: { id: string }): JSX.Element {)}return (- <div className="flex flex-col gap-3">+ // No gap: the cards' own margins and the separators' padding space the feed, like PostHog Desktop.+ <div className="flex flex-col">{feedGroups.map((group) => (<Fragment key={group.key}>- <div className="flex items-center gap-3 pt-2">+ <div className="flex items-center gap-3 pt-5 pb-2"><Separator className="flex-1" /><Textrender={<span />}diff --git a/products/tasks/frontend/spaces/SpaceFeedCard.tsx b/products/tasks/frontend/spaces/SpaceFeedCard.tsxindex a3cf4261bbde..76ebb747cdab 100644--- a/products/tasks/frontend/spaces/SpaceFeedCard.tsx+++ b/products/tasks/frontend/spaces/SpaceFeedCard.tsx@@ -3,7 +3,6 @@ import { useValues } from 'kea'import { IconGitBranch } from '@posthog/icons'import {Badge,- Button,Card,Popover,PopoverContent,@@ -13,6 +12,7 @@ import {Tooltip,TooltipContent,TooltipTrigger,+ badgeVariants,cn,} from '@posthog/quill'@@ -30,7 +30,7 @@ import { TaskListItemApi } from '../generated/api.schemas'import { spaceFeedPreview } from './spaceFeedPreview'import { spaceFeedStatus } from './spaceFeedStatus'import { SpaceFeedStatusIcon } from './SpaceFeedStatusIcon'-import { TaskPullRequestChip } from './TaskPullRequestChip'+import { TASK_CHIP_CLASS, TaskPullRequestChip } from './TaskPullRequestChip'import { pullRequestLabel, splitPullRequests } from './taskPullRequests'import { TaskUserAvatar, taskUserName } from './TaskUserAvatar'@@ -57,22 +57,23 @@ export function SpaceFeedCard({ task, pinned, unread, repository }: SpaceFeedCarreturn (<Cardsize="sm"- className="group/card relative gap-0 rounded-xl px-4 pt-3.5 pb-3 transition-colors hover:bg-muted"+ className="group/card relative my-1.5 gap-0 rounded-xl px-4 pt-3.5 pb-3 transition-colors hover:bg-muted">- <div className="flex min-w-0 items-center gap-2">- <SpaceFeedStatusIcon item={item} />+ <div className="flex min-w-0 items-center gap-3">{renaming?.sessionId === task.id && renaming.surface === 'feed' ? (- <div className="min-w-0 flex-1">- <TodaySessionRenameInput sessionId={task.id} title={task.title} />+ <div className="flex min-w-0 flex-1 items-center gap-1.5">+ <SpaceFeedStatusIcon item={item} />+ <div className="min-w-0 flex-1">+ <TodaySessionRenameInput sessionId={task.id} title={task.title} />+ </div></div>) : (<div className="flex min-w-0 flex-1 items-baseline gap-1.5">+ {/* Nudged down so the icon sits on the title's baseline, like PostHog Desktop's feed cards. */}+ <SpaceFeedStatusIcon item={item} className="translate-y-0.5" /><LinkPrimitiveto={urls.aiTask(task.id)}- className={cn(- 'min-w-0 truncate text-sm text-foreground after:absolute after:inset-0 hover:underline',- unread ? 'font-semibold' : 'font-medium'- )}+ className="min-w-0 truncate text-sm leading-snug font-semibold text-foreground after:absolute after:inset-0 hover:underline"data-attr="today-space-feed-card">{item.title || 'Untitled session'}@@ -112,22 +113,22 @@ export function SpaceFeedCard({ task, pinned, unread, repository }: SpaceFeedCar</div></div>{preview && (- <Text size="xs" variant="muted" className="mt-1.5 line-clamp-2 break-words">+ <Text size="xs" variant="muted" className="mt-1.5 line-clamp-2 leading-normal break-words">{preview}</Text>)}{(repository || author || item.pullRequests.length > 0) && (- <div className="mt-3 flex min-w-0 items-center gap-1.5">+ <div className="mt-3 flex min-w-0 flex-wrap items-center gap-1.5">{repository && (- <Text- render={<span />}- size="xs"- variant="muted"- className="inline-flex min-w-0 items-center gap-1"+ <Badge+ className={cn(+ TASK_CHIP_CLASS,+ 'min-w-0 border-transparent bg-transparent text-muted-foreground'+ )}>- <IconGitBranch className="shrink-0" />- <span className="truncate">{repository}</span>- </Text>+ <IconGitBranch className="size-3 shrink-0" />+ <span className="min-w-0 truncate">{repository}</span>+ </Badge>)}{pullRequests.visible.map((pullRequest) => (<TaskPullRequestChip@@ -141,14 +142,12 @@ export function SpaceFeedCard({ task, pinned, unread, repository }: SpaceFeedCar{pullRequests.overflow.length > 0 && (<Popover><PopoverTrigger- render={- <Button- size="xs"- variant="outline"- className="relative shrink-0"- data-attr="today-pr-chip-overflow"- />- }+ className={cn(+ badgeVariants(),+ TASK_CHIP_CLASS,+ 'border-dashed border-border bg-fill-hover text-muted-foreground hover:bg-fill-selected hover:text-foreground'+ )}+ data-attr="today-pr-chip-overflow">{`+${pullRequests.overflow.length} ${pullRequests.overflow.length === 1 ? 'PR' : 'PRs'}`}</PopoverTrigger>diff --git a/products/tasks/frontend/spaces/SpaceFeedStatusIcon.tsx b/products/tasks/frontend/spaces/SpaceFeedStatusIcon.tsxindex 272e2e49d193..9be19170c054 100644--- a/products/tasks/frontend/spaces/SpaceFeedStatusIcon.tsx+++ b/products/tasks/frontend/spaces/SpaceFeedStatusIcon.tsx@@ -1,4 +1,5 @@import { IconChat, IconCloud, IconPinFilled, IconSpinner } from '@posthog/icons'+import { cn } from '@posthog/quill'import { TodaySessionIconKind, todaySessionIcon } from '~/layout/today/todaySessionIcon'import { TodayWorkItem } from '~/layout/today/todayWorkItems'@@ -16,10 +17,14 @@ const ICONS: Record<TodaySessionIconKind, { label: string; icon: JSX.Element }>session: { label: 'Session', icon: <IconCloud className="text-muted-foreground" /> },}-export function SpaceFeedStatusIcon({ item }: { item: TodayWorkItem }): JSX.Element {+export function SpaceFeedStatusIcon({ item, className }: { item: TodayWorkItem; className?: string }): JSX.Element {const { label, icon } = ICONS[todaySessionIcon(item, false)]return (- <span role="img" aria-label={label} className="flex">+ <span+ role="img"+ aria-label={label}+ className={cn('flex size-3.5 shrink-0 items-center justify-center', className)}+ >{icon}</span>)diff --git a/products/tasks/frontend/spaces/SpaceScene.tsx b/products/tasks/frontend/spaces/SpaceScene.tsxindex f7ea749fade1..54a136edd4c7 100644--- a/products/tasks/frontend/spaces/SpaceScene.tsx+++ b/products/tasks/frontend/spaces/SpaceScene.tsx@@ -9,6 +9,7 @@ import {EmptyDescription,EmptyHeader,EmptyTitle,+ Skeleton,Tabs,TabsContent,TabsList,@@ -41,6 +42,14 @@ const SPACE_COMPOSER_OVERRIDE = {hideOnboardingReplay: true,}+// The repository picker and the input frame at their loaded sizes, so the feed does not jump when the chunk lands.+const COMPOSER_SKELETON = (+ <div className="flex flex-col gap-2">+ <Skeleton className="h-8 w-36" />+ <Skeleton className="h-36 w-full rounded-lg" />+ </div>+)+export const scene: SceneExport<SpaceSceneLogicProps> = {component: SpaceScene,logic: spaceSceneLogic,@@ -121,27 +130,31 @@ export function SpaceScene({ id }: SpaceSceneLogicProps): JSX.Element {) : null}/>+ {/* Pulled up to the title and ruled off full width, like PostHog Desktop's space tabs. */}<Tabsvalue={activeTab}onValueChange={(tab: SpaceTab) =>router.actions.push(tab === 'settings' ? urls.taskSpaceSettings(id) : urls.taskSpace(id))}+ className="-mt-4"data-quill>- <TabsList variant="line">- <TabsTrigger value="feed" data-attr="today-space-tab-feed">- Feed- </TabsTrigger>- <TabsTrigger value="settings" data-attr="today-space-tab-settings">- Settings- </TabsTrigger>- </TabsList>+ <div className="-mx-4 border-b border-border px-4">+ <TabsList variant="line" aria-label="Space pages">+ <TabsTrigger value="feed" data-attr="today-space-tab-feed">+ Feed+ </TabsTrigger>+ <TabsTrigger value="settings" data-attr="today-space-tab-settings">+ Settings+ </TabsTrigger>+ </TabsList>+ </div><TabsContent value="feed">- {/* The same centered column as PostHog Desktop's space feed. */}- <div className="mx-auto flex w-full max-w-165 flex-col gap-4">+ {/* The same centered column and top inset as PostHog Desktop's space feed. */}+ <div className="mx-auto flex w-full max-w-165 flex-col pt-3">{/* Mounted once the space loads, so the composer starts on the space's repository. */}{space && (- <div data-attr="today-space-new-task">+ <div className="mb-1 border-b border-border pb-4" data-attr="today-space-new-task"><EmbeddedTaskComposerkey={space.id}panelId={`space-${space.id}`}@@ -151,6 +164,7 @@ export function SpaceScene({ id }: SpaceSceneLogicProps): JSX.Element {onTaskCreated={sessionStarted}focusRequest={composerFocusRequest}autoFocus={false}+ fallback={COMPOSER_SKELETON}/></div>)}diff --git a/products/tasks/frontend/spaces/TaskPullRequestChip.tsx b/products/tasks/frontend/spaces/TaskPullRequestChip.tsxindex adb82a748669..c44615ee5327 100644--- a/products/tasks/frontend/spaces/TaskPullRequestChip.tsx+++ b/products/tasks/frontend/spaces/TaskPullRequestChip.tsx@@ -30,6 +30,12 @@ export function pullRequestLinkLabel(pullRequest: TaskPullRequest, state: PrStatreturn known ? `Open ${known.label.toLowerCase()} ${name} on GitHub` : `Open ${name} on GitHub`}+/**+ * A chip in the feed card footer, like PostHog Desktop's. `relative` lifts it above the card's full-card link.+ * Regular weight, because RoundHog's medium "4" leaves a gap after it that reads as "#4 21".+ */+export const TASK_CHIP_CLASS = 'relative h-6 max-w-full shrink-0 gap-1.5 rounded-md px-2 text-xs font-normal'+interface TaskPullRequestChipProps {pullRequest: TaskPullRequestlabel: string@@ -47,8 +53,10 @@ export function TaskPullRequestChip({ pullRequest, label, dataAttr, state }: Tasrender={<LinkPrimitive to={pullRequest.url} target="_blank" />}aria-label={pullRequestLinkLabel(pullRequest, state)}data-attr={dataAttr}- // `relative` lifts it above the feed card's full-card link, so it stays clickable.- className="relative h-6 max-w-full shrink-0 gap-1 rounded-md border-border bg-fill-hover px-2 text-xs text-muted-foreground tabular-nums hover:bg-fill-selected hover:text-foreground"+ className={cn(+ TASK_CHIP_CLASS,+ 'border-border bg-fill-hover text-muted-foreground hover:bg-fill-selected hover:text-foreground'+ )}/>}>