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(today): use template icons on space feed canvas rows (#109818)

Shy Alter3f85276156a2
diff --git a/products/tasks/frontend/spaces/SpaceFeedCanvasRow.tsx b/products/tasks/frontend/spaces/SpaceFeedCanvasRow.tsx
index 5de3593acbf1..336bea4ccc5d 100644
--- a/products/tasks/frontend/spaces/SpaceFeedCanvasRow.tsx
+++ b/products/tasks/frontend/spaces/SpaceFeedCanvasRow.tsx
@@ -1,4 +1,4 @@
-import { IconBrowser } from '@posthog/icons'
+import { IconDocument, IconGraph, IconLineGraph, IconPalette } from '@posthog/icons'
import { Badge, Card, Text, Tooltip, TooltipContent, TooltipTrigger, cn } from '@posthog/quill'
import { shortTimeAgo } from '~/layout/today/todayWorkItems'
@@ -7,6 +7,12 @@ import type { CanvasApi } from 'products/canvas/frontend/generated/api.schemas'
import { TaskAvatarUser, TaskUserAvatar, taskUserName } from './TaskUserAvatar'
+const TEMPLATE_ICONS: Record<string, typeof IconGraph> = {
+ 'web-analytics': IconLineGraph,
+ blank: IconDocument,
+ freeform: IconPalette,
+}
+
interface SpaceFeedCanvasRowProps {
canvas: CanvasApi
listRow: boolean
@@ -20,7 +26,8 @@ export function SpaceFeedCanvasRow({ canvas, listRow }: SpaceFeedCanvasRowProps)
first_name: canvas.created_by.first_name ?? '',
last_name: canvas.created_by.last_name ?? '',
}
- const icon = <IconBrowser className="size-3.5 shrink-0 text-muted-foreground" />
+ const TemplateIcon = TEMPLATE_ICONS[canvas.template_id] ?? IconGraph
+ const icon = <TemplateIcon className="size-3.5 shrink-0 text-muted-foreground" />
const age = shortTimeAgo(canvas.updated_at)
const avatar = (
<span role="img" aria-label={taskUserName(author)} className="relative flex shrink-0">
@@ -74,7 +81,7 @@ export function SpaceFeedCanvasRow({ canvas, listRow }: SpaceFeedCanvasRowProps)
<Badge className="shrink-0">Canvas</Badge>
</div>
{canvas.description && (
- <Text size="xs" variant="muted" className="mt-1.5 line-clamp-2 leading-normal break-words">
+ <Text size="xs" variant="muted" className="mt-1 line-clamp-2 leading-normal break-words">
{canvas.description}
</Text>
)}