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): add the right-click menu to space feed list rows (#109830)

Shy Alterf12c315f40c8
diff --git a/products/tasks/frontend/spaces/SpaceFeedListRow.tsx b/products/tasks/frontend/spaces/SpaceFeedListRow.tsx
index 08d331c4dfaa..ea9623fd89a1 100644
--- a/products/tasks/frontend/spaces/SpaceFeedListRow.tsx
+++ b/products/tasks/frontend/spaces/SpaceFeedListRow.tsx
@@ -7,6 +7,7 @@ import { LinkPrimitive } from 'lib/lemon-ui/Link'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
+import { TodaySessionContextMenu } from '~/layout/today/TodaySessionContextMenu'
import { TodaySessionDialogs } from '~/layout/today/TodaySessionDialogs'
import { TodaySessionMenu } from '~/layout/today/TodaySessionMenu'
import { todaySessionMenuLogic } from '~/layout/today/todaySessionMenuLogic'
@@ -48,50 +49,54 @@ export function SpaceFeedListRow({ task, pinned, unread }: SpaceFeedListRowProps
)
}
return (
- <div className="group/row relative flex h-8 w-full items-center gap-2 rounded-md px-2 transition-colors hover:bg-fill-selected">
- <SpaceFeedStatusIcon item={item} />
- <LinkPrimitive
- to={urls.aiTask(task.id)}
- className="min-w-0 flex-1 truncate text-sm font-medium text-foreground after:absolute after:inset-0"
- data-attr="today-space-feed-row"
- >
- {item.title || 'Untitled session'}
- </LinkPrimitive>
- {unread && (
- <span
- role="img"
- aria-label="Unread"
- className="size-1.5 shrink-0 rounded-full bg-primary"
- data-attr="today-unread-feed-dot"
- />
- )}
- {status && (
- <Badge variant={status.variant} className="shrink-0">
- {status.running && <Spinner aria-hidden data-icon="inline-start" />}
- {status.label}
- </Badge>
- )}
- {author && (
- <span role="img" aria-label={taskUserName(author)} className="relative flex shrink-0">
- <TaskUserAvatar user={author} />
- </span>
- )}
- {/* The age gives way to the menu on hover, so the row keeps its width. */}
- {item.timestamp && (
- <Text
- render={<span />}
- size="xs"
- variant="muted"
- className="w-8 shrink-0 text-right transition-opacity group-focus-within/row:opacity-0 group-hover/row:opacity-0"
- translate="no"
- >
- {shortTimeAgo(item.timestamp)}
- </Text>
- )}
- <span className="absolute right-1 opacity-0 transition-opacity group-focus-within/row:opacity-100 group-hover/row:opacity-100">
- <TodaySessionMenu target={menu} surface="feed" />
- </span>
+ <>
+ <TodaySessionContextMenu target={menu} surface="feed">
+ <div className="group/row relative flex h-8 w-full items-center gap-2 rounded-md px-2 transition-colors hover:bg-fill-selected">
+ <SpaceFeedStatusIcon item={item} />
+ <LinkPrimitive
+ to={urls.aiTask(task.id)}
+ className="min-w-0 flex-1 truncate text-sm font-medium text-foreground after:absolute after:inset-0"
+ data-attr="today-space-feed-row"
+ >
+ {item.title || 'Untitled session'}
+ </LinkPrimitive>
+ {unread && (
+ <span
+ role="img"
+ aria-label="Unread"
+ className="size-1.5 shrink-0 rounded-full bg-primary"
+ data-attr="today-unread-feed-dot"
+ />
+ )}
+ {status && (
+ <Badge variant={status.variant} className="shrink-0">
+ {status.running && <Spinner aria-hidden data-icon="inline-start" />}
+ {status.label}
+ </Badge>
+ )}
+ {author && (
+ <span role="img" aria-label={taskUserName(author)} className="relative flex shrink-0">
+ <TaskUserAvatar user={author} />
+ </span>
+ )}
+ {/* The age gives way to the menu on hover, so the row keeps its width. */}
+ {item.timestamp && (
+ <Text
+ render={<span />}
+ size="xs"
+ variant="muted"
+ className="w-8 shrink-0 text-right transition-opacity group-focus-within/row:opacity-0 group-hover/row:opacity-0"
+ translate="no"
+ >
+ {shortTimeAgo(item.timestamp)}
+ </Text>
+ )}
+ <span className="absolute right-1 opacity-0 transition-opacity group-focus-within/row:opacity-100 group-hover/row:opacity-100">
+ <TodaySessionMenu target={menu} surface="feed" />
+ </span>
+ </div>
+ </TodaySessionContextMenu>
<TodaySessionDialogs target={menu} />
- </div>
+ </>
)
}