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(desktop): remove artifacts tab from spaces (#82522)

Peter Kirkham621460370feb
diff --git a/products/desktop/packages/shared/src/analytics-events.ts b/products/desktop/packages/shared/src/analytics-events.ts
index 4cb04a062d77..d998b1300982 100644
--- a/products/desktop/packages/shared/src/analytics-events.ts
+++ b/products/desktop/packages/shared/src/analytics-events.ts
@@ -943,7 +943,6 @@ export type ChannelsSurface =
| "task_input"
| "channel_home"
| "channel_history"
- | "channel_artifacts"
| "pinned"
| "dashboards_grid"
| "canvas"
@@ -973,8 +972,6 @@ export type ChannelActionType =
| "new_task_suggestion"
| "view_context"
| "view_history"
- | "view_artifacts"
- | "open_artifact"
| "file_task"
| "unfile_task"
| "archive_task"
@@ -988,8 +985,7 @@ export type ChannelActionType =
| "canvas_mode_toggle"
/** Submitted a canvas-mode prompt (the agent resolves or creates the canvas). */
| "canvas_generate"
- | "activity_tab_change"
- | "artifacts_view_change";
+ | "activity_tab_change";
export interface ChannelActionProperties {
action_type: ChannelActionType;
@@ -1010,8 +1006,6 @@ export interface ChannelActionProperties {
armed?: boolean;
/** For activity_tab_change: the tab landed on. */
tab?: string;
- /** For artifacts_view_change: the selected layout. */
- view_mode?: "list" | "grid" | "masonry";
/** Whether the underlying mutation resolved successfully. */
success?: boolean;
}
diff --git a/products/desktop/packages/ui/src/features/browser-tabs/AGENTS.md b/products/desktop/packages/ui/src/features/browser-tabs/AGENTS.md
index 72d2aaff0139..b29609bd0886 100644
--- a/products/desktop/packages/ui/src/features/browser-tabs/AGENTS.md
+++ b/products/desktop/packages/ui/src/features/browser-tabs/AGENTS.md
@@ -12,17 +12,17 @@ the label resolves from the canvas name or the task title, and switching back
returns to whichever the tab points at. `setTabTarget` is the in-tab-nav
primitive for both.
-Channel sub-sections are tabs too: the header nav (`Inbox`, `Artifacts`,
-`Recents`, `CONTEXT.md` — see `canvas/channelSections.ts`) routes to
+Channel sub-sections are tabs too: the header nav (`Loops`, `Recents`,
+`CONTEXT.md` — see `canvas/channelSections.ts`) routes to
`/website/$channelId/<section>`, which is identified by `channelId` +
-`channelSection`. The tab labels by the section (`Inbox`) with a `#` icon; the
+`channelSection`. The tab labels by the section (`Recents`) with a `#` icon; the
channel home (`/website/$channelId`, no section) labels by the channel name.
Every channel tab's hover leads with `#<channel>` then the page name (the home
tab, whose label already is the channel, shows just the one line). Switching
sections is an in-tab replace — one channel tab, the section is sub-navigation
within it — because the identity differs only by `channelSection`.
-Dedup/identity keys on all four fields, so two channels' inboxes (or one
-channel's inbox vs artifacts) are distinct tabs.
+Dedup/identity keys on all four fields, so two channels' sub-sections are
+distinct tabs.
## Components & styling
diff --git a/products/desktop/packages/ui/src/features/browser-tabs/BrowserTabStrip.tsx b/products/desktop/packages/ui/src/features/browser-tabs/BrowserTabStrip.tsx
index ae440331fd83..09a545fda011 100644
--- a/products/desktop/packages/ui/src/features/browser-tabs/BrowserTabStrip.tsx
+++ b/products/desktop/packages/ui/src/features/browser-tabs/BrowserTabStrip.tsx
@@ -502,7 +502,7 @@ export function BrowserTabStrip() {
pinned,
};
}
- // A channel tab: a sub-section (Artifacts/Recents/…) or the channel home.
+ // A channel tab: a sub-section (Recents/CONTEXT.md/…) or the channel home.
// The section drives the label; the channel name carries the space
// context. Home has no section, so it labels by the channel name.
if (channelId) {
diff --git a/products/desktop/packages/ui/src/features/canvas/channelSections.ts b/products/desktop/packages/ui/src/features/canvas/channelSections.ts
index 6c5e881c155d..a0573f6b50a7 100644
--- a/products/desktop/packages/ui/src/features/canvas/channelSections.ts
+++ b/products/desktop/packages/ui/src/features/canvas/channelSections.ts
@@ -5,13 +5,12 @@
* `channelSection`; `label` is the tab + nav text.
*/
export interface ChannelSection {
- key: "loops" | "artifacts" | "history" | "context";
+ key: "loops" | "history" | "context";
label: string;
}
export const CHANNEL_SECTIONS: readonly ChannelSection[] = [
{ key: "loops", label: "Loops" },
- { key: "artifacts", label: "Artifacts" },
{ key: "history", label: "Recents" },
{ key: "context", label: "CONTEXT.md" },
] as const;
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ArtifactsViewToggle.tsx b/products/desktop/packages/ui/src/features/canvas/components/ArtifactsViewToggle.tsx
deleted file mode 100644
index c2b91d3aae58..000000000000
--- a/products/desktop/packages/ui/src/features/canvas/components/ArtifactsViewToggle.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { Kanban, ListIcon, SquaresFourIcon } from "@phosphor-icons/react";
-import {
- ToggleGroup,
- ToggleGroupItem,
- Tooltip,
- TooltipContent,
- TooltipProvider,
- TooltipTrigger,
-} from "@posthog/quill";
-import {
- ARTIFACTS_VIEW_MODES,
- type ArtifactsViewMode,
- useArtifactsViewStore,
-} from "@posthog/ui/features/canvas/stores/artifactsViewStore";
-import type { ComponentType } from "react";
-
-const OPTIONS: {
- mode: ArtifactsViewMode;
- label: string;
- Icon: ComponentType<{ size?: number; weight?: "bold" }>;
-}[] = [
- { mode: "list", label: "List", Icon: ListIcon },
- { mode: "grid", label: "Grid", Icon: SquaresFourIcon },
- { mode: "masonry", label: "Masonry", Icon: Kanban },
-];
-
-function isViewMode(value: string | undefined): value is ArtifactsViewMode {
- return ARTIFACTS_VIEW_MODES.some((mode) => mode === value);
-}
-
-// Layout switcher for the artifacts list. A quill ToggleGroup carries the
-// pressed state itself, so there's no hand-rolled active styling here.
-export function ArtifactsViewToggle({ channelId }: { channelId?: string }) {
- const view = useArtifactsViewStore((s) => s.view);
- const setView = useArtifactsViewStore((s) => s.setView);
-
- return (
- <TooltipProvider delay={0}>
- <ToggleGroup
- aria-label="Artifacts view"
- value={[view]}
- onValueChange={(next: string[]) => {
- // Pressing the active item would otherwise clear the group — a view
- // is always on, so ignore the empty result.
- const mode = next[0];
- if (isViewMode(mode)) setView(mode, channelId);
- }}
- >
- {OPTIONS.map(({ mode, label, Icon }) => (
- <Tooltip key={mode}>
- <TooltipTrigger
- render={
- <ToggleGroupItem
- value={mode}
- size="icon"
- aria-label={`${label} view`}
- >
- <Icon size={14} weight="bold" />
- </ToggleGroupItem>
- }
- />
- <TooltipContent side="bottom">{label}</TooltipContent>
- </Tooltip>
- ))}
- </ToggleGroup>
- </TooltipProvider>
- );
-}
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelSidebar.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelSidebar.tsx
index 1394aad7c65d..bfe809b8410c 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelSidebar.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelSidebar.tsx
@@ -502,7 +502,7 @@ export function ChannelSidebar({ channelId }: { channelId: string }) {
// Label comes from the shared space-page table, so a sidebar row and the
// header breadcrumb for the same page can never disagree. No icon: this is a
- // four-row list of words, and glyphs here only compete with the status dots
+ // short list of words, and glyphs here only compete with the status dots
// in the sessions list below for the eye's attention.
const sectionRow = (
page: ChannelPageKey,
@@ -563,15 +563,6 @@ export function ChannelSidebar({ channelId }: { channelId: string }) {
params: { channelId },
}),
)}
- {sectionRow(
- "artifacts",
- `${base}/artifacts`,
- () =>
- void navigate({
- to: "/website/$channelId/artifacts",
- params: { channelId },
- }),
- )}
</div>
{/* Relative so the FAB and the drag-selection band can float over the
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelTabs.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelTabs.tsx
index 6bd815d842d1..e8e2fff3d320 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelTabs.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelTabs.tsx
@@ -11,7 +11,7 @@ const TABS = CHANNEL_SECTIONS.map((s) => ({
to: `/website/$channelId/${s.key}` as const,
}));
-// Home / History / Artifacts tab switcher shown in the channel header bar, with
+// Channel section switcher shown in the channel header bar, with
// a Pinned quick-access menu alongside. Pathname-driven active state (the
// codebase's convention) rather than Link's activeProps.
export function ChannelTabs({ channelId }: { channelId: string }) {
diff --git a/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelArtifacts.tsx b/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelArtifacts.tsx
deleted file mode 100644
index b2a3af46005c..000000000000
--- a/products/desktop/packages/ui/src/features/canvas/components/WebsiteChannelArtifacts.tsx
+++ /dev/null
@@ -1,623 +0,0 @@
-import { CaretRightIcon, FilesIcon, TrashIcon } from "@phosphor-icons/react";
-import type { ChannelTaskRecord } from "@posthog/core/canvas/channelTaskSchemas";
-import type { DashboardRecord } from "@posthog/core/canvas/dashboardSchemas";
-import {
- Badge,
- Card,
- CardContent,
- cn,
- Empty,
- EmptyDescription,
- EmptyHeader,
- EmptyMedia,
- EmptyTitle,
- Text,
-} from "@posthog/quill";
-import { formatRelativeTimeShort } from "@posthog/shared";
-import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";
-import { useArchivedTaskIds } from "@posthog/ui/features/archive/useArchivedTaskIds";
-import { ArtifactsViewToggle } from "@posthog/ui/features/canvas/components/ArtifactsViewToggle";
-import { ChannelHeader } from "@posthog/ui/features/canvas/components/ChannelHeader";
-import { iconForTemplate } from "@posthog/ui/features/canvas/components/canvasTemplateIcon";
-import { useChannelsLayout } from "@posthog/ui/features/canvas/hooks/useChannelsLayout";
-import { useChannelTasks } from "@posthog/ui/features/canvas/hooks/useChannelTasks";
-import { useDashboards } from "@posthog/ui/features/canvas/hooks/useDashboards";
-import { useArtifactsViewStore } from "@posthog/ui/features/canvas/stores/artifactsViewStore";
-import { useIsCanvasPendingDelete } from "@posthog/ui/features/canvas/stores/pendingCanvasDeleteStore";
-import { masonryPreviewHeight } from "@posthog/ui/features/canvas/utils/masonryPreviewHeight";
-import { usePrArtifact } from "@posthog/ui/features/git-interaction/usePrArtifact";
-import { useTasks } from "@posthog/ui/features/tasks/useTasks";
-import { useSetHeaderContent } from "@posthog/ui/hooks/useSetHeaderContent";
-import {
- PageHeader,
- PageHeaderActions,
- PageHeaderChip,
- PageHeaderDescription,
- PageHeaderHeading,
- PageHeaderTitle,
- PageHeaderTitleRow,
-} from "@posthog/ui/primitives/PageHeader";
-import { track } from "@posthog/ui/shell/analytics";
-import { openExternalUrl } from "@posthog/ui/shell/openExternal";
-import { useNavigate } from "@tanstack/react-router";
-import { type ReactNode, useCallback, useEffect, useMemo } from "react";
-
-// Uniform media height for the grid: cards line up row to row, and a PR tile
-// (which has nothing to preview) fills the same band as a canvas thumbnail.
-const GRID_PREVIEW_HEIGHT = 176;
-
-// Artifacts are the durable outputs of a channel's work. Canvases for now; PRs
-// are surfaced from each filed task's latest run output. More kinds (reports,
-// files, …) slot into this union later.
-type ArtifactItem =
- | {
- kind: "canvas";
- key: string;
- title: string;
- ts: number;
- templateId: string;
- dashboardId: string;
- }
- | {
- kind: "pr";
- key: string;
- title: string;
- ts: number;
- prUrl: string;
- };
-
-// A channel's artifacts: canvases and the pull requests produced by its tasks,
-// most recent first. Sibling of the History tab, but scoped to outputs rather
-// than the full activity stream. The view toggle switches between a dense row
-// list and card layouts.
-export function WebsiteChannelArtifacts({ channelId }: { channelId: string }) {
- const spacesLayout = useChannelsLayout();
- const navigate = useNavigate();
- const view = useArtifactsViewStore((s) => s.view);
-
- useEffect(() => {
- track(ANALYTICS_EVENTS.CHANNEL_ACTION, {
- action_type: "view_artifacts",
- surface: "channel_artifacts",
- channel_id: channelId,
- });
- }, [channelId]);
-
- useSetHeaderContent(
- useMemo(
- () => <ChannelHeader channelId={channelId} page="artifacts" />,
- [channelId],
- ),
- );
-
- const { dashboards } = useDashboards(channelId);
- const { tasks: filedTasks } = useChannelTasks(channelId);
- const { data: tasks } = useTasks();
- const archivedTaskIds = useArchivedTaskIds();
-
- const items = useMemo<ArtifactItem[]>(() => {
- const canvasItems: ArtifactItem[] = dashboards.map(
- (d: DashboardRecord) => ({
- kind: "canvas",
- key: `canvas:${d.id}`,
- title: d.name,
- ts: d.updatedAt,
- templateId: d.templateId,
- dashboardId: d.id,
- }),
- );
-
- const taskById = new Map(tasks?.map((t) => [t.id, t]) ?? []);
- type PrArtifact = Extract<ArtifactItem, { kind: "pr" }>;
- const prItems: PrArtifact[] = filedTasks.flatMap((f: ChannelTaskRecord) => {
- const task = taskById.get(f.taskId);
- const prUrl = task?.latest_run?.output?.pr_url;
- if (archivedTaskIds.has(f.taskId) || !task) return [];
- if (typeof prUrl !== "string" || !prUrl) return [];
- return [
- {
- kind: "pr" as const,
- key: `pr:${f.taskId}`,
- title: task.title || "Pull request",
- ts: Date.parse(task.updated_at) || 0,
- prUrl,
- },
- ];
- });
-
- // Most recent first.
- return [...canvasItems, ...prItems].sort((a, b) => b.ts - a.ts);
- }, [dashboards, filedTasks, tasks, archivedTaskIds]);
-
- const openCanvas = useCallback(
- (dashboardId: string) => {
- track(ANALYTICS_EVENTS.CHANNEL_ACTION, {
- action_type: "open_artifact",
- surface: "channel_artifacts",
- channel_id: channelId,
- });
- void navigate({
- to: "/website/$channelId/dashboards/$dashboardId",
- params: { channelId, dashboardId },
- });
- },
- [channelId, navigate],
- );
-
- const openPr = useCallback(
- (prUrl: string) => {
- track(ANALYTICS_EVENTS.CHANNEL_ACTION, {
- action_type: "open_artifact",
- surface: "channel_artifacts",
- channel_id: channelId,
- });
- openExternalUrl(prUrl);
- },
- [channelId],
- );
-
- return (
- <div className="flex h-full min-h-0 flex-col bg-gray-1">
- {/* Full-bleed header over a container-width body — the Inbox shape. Ships
- behind the spaces layout like every other space page header; off,
- the view switcher rides above the list instead. */}
- {spacesLayout ? (
- <PageHeader>
- <PageHeaderHeading>
- <PageHeaderTitleRow>
- <PageHeaderTitle>Artifacts</PageHeaderTitle>
- {items.length > 0 && (
- <PageHeaderChip icon={<FilesIcon size={12} weight="fill" />}>
- {items.length} item{items.length === 1 ? "" : "s"}
- </PageHeaderChip>
- )}
- <PageHeaderActions>
- <ArtifactsViewToggle channelId={channelId} />
- </PageHeaderActions>
- </PageHeaderTitleRow>
- <PageHeaderDescription>
- Canvases and pull requests from this{" "}
- {spacesLayout ? "space's" : "channel's"} tasks.
- </PageHeaderDescription>
- </PageHeaderHeading>
- </PageHeader>
- ) : null}
-
- <div className="min-h-0 flex-1 overflow-y-auto">
- {/* Full width, flush with the page header above it — every layout
- here (rows and cards alike) is a scannable list, not prose, so a
- measure cap just strands whitespace on wide windows. */}
- <div className="w-full px-6 py-6">
- {!spacesLayout && (
- <div className="mb-3 flex items-center justify-between gap-3">
- <Text size="sm" variant="muted">
- {items.length === 0
- ? "Artifacts"
- : `${items.length} artifact${items.length === 1 ? "" : "s"}`}
- </Text>
- <ArtifactsViewToggle channelId={channelId} />
- </div>
- )}
- {items.length === 0 ? (
- <Empty className="mx-auto max-w-md py-20">
- <EmptyHeader>
- <EmptyMedia variant="icon">
- <FilesIcon size={24} />
- </EmptyMedia>
- <EmptyTitle>No artifacts yet</EmptyTitle>
- <EmptyDescription>
- Canvases and pull requests from this{" "}
- {spacesLayout ? "space's" : "channel's"} tasks show up here.
- </EmptyDescription>
- </EmptyHeader>
- </Empty>
- ) : view === "list" ? (
- <div className="flex flex-col gap-0.5">
- {items.map((item) => (
- <ArtifactListItem
- key={item.key}
- item={item}
- onOpenCanvas={openCanvas}
- onOpenPr={openPr}
- />
- ))}
- </div>
- ) : view === "grid" ? (
- // items-stretch + a full-height card: a PR tile (no preview to
- // show) matches the canvas cards in its row instead of ending
- // short.
- <div className="grid grid-cols-1 items-stretch gap-4 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4">
- {items.map((item) => (
- <ArtifactCard
- key={item.key}
- item={item}
- previewHeight={GRID_PREVIEW_HEIGHT}
- fillHeight
- onOpenCanvas={openCanvas}
- onOpenPr={openPr}
- />
- ))}
- </div>
- ) : (
- // CSS columns rather than a JS masonry: cards are self-contained and
- // never reflow into each other, so break-inside-avoid is enough. The
- // trade-off is column-major order — newest runs down column one, not
- // across the row — which is fine for a browse-y wall of cards.
- <div className="columns-1 gap-4 sm:columns-2 lg:columns-3 2xl:columns-4">
- {items.map((item) => (
- <div key={item.key} className="mb-4 break-inside-avoid">
- <ArtifactCard
- item={item}
- previewHeight={masonryPreviewHeight(item.key)}
- onOpenCanvas={openCanvas}
- onOpenPr={openPr}
- />
- </div>
- ))}
- </div>
- )}
- </div>
- </div>
- </div>
- );
-}
-
-function ArtifactListItem({
- item,
- onOpenCanvas,
- onOpenPr,
-}: {
- item: ArtifactItem;
- onOpenCanvas: (dashboardId: string) => void;
- onOpenPr: (safeUrl: string) => void;
-}) {
- return item.kind === "canvas" ? (
- <CanvasArtifactRow
- dashboardId={item.dashboardId}
- templateId={item.templateId}
- title={item.title}
- ts={item.ts}
- onClick={onOpenCanvas}
- />
- ) : (
- <PrArtifactRow
- title={item.title}
- prUrl={item.prUrl}
- ts={item.ts}
- onClick={onOpenPr}
- />
- );
-}
-
-function ArtifactCard({
- item,
- previewHeight,
- fillHeight,
- onOpenCanvas,
- onOpenPr,
-}: {
- item: ArtifactItem;
- previewHeight: number;
- /** Grid only: stretch to the tallest card in the row. */
- fillHeight?: boolean;
- onOpenCanvas: (dashboardId: string) => void;
- onOpenPr: (safeUrl: string) => void;
-}) {
- return item.kind === "canvas" ? (
- <CanvasArtifactCard
- dashboardId={item.dashboardId}
- templateId={item.templateId}
- title={item.title}
- ts={item.ts}
- previewHeight={previewHeight}
- fillHeight={fillHeight}
- onClick={onOpenCanvas}
- />
- ) : (
- <PrArtifactCard
- title={item.title}
- prUrl={item.prUrl}
- ts={item.ts}
- mediaHeight={fillHeight ? previewHeight : undefined}
- fillHeight={fillHeight}
- onClick={onOpenPr}
- />
- );
-}
-
-// A canvas artifact row. While the canvas is inside its delete-undo window the
-// row stays put — its template icon becomes a pulsing trash can and the row
-// stops opening — so undoing puts it back exactly where it was.
-function CanvasArtifactRow({
- dashboardId,
- templateId,
- title,
- ts,
- onClick,
-}: {
- dashboardId: string;
- templateId: string;
- title: string;
- ts: number;
- onClick: (dashboardId: string) => void;
-}) {
- const deleting = useIsCanvasPendingDelete(dashboardId);
-
- return (
- <ArtifactRow
- accent={deleting ? "red" : "violet"}
- icon={
- deleting ? (
- <TrashIcon size={15} className="animate-pulse text-red-9" />
- ) : (
- iconForTemplate(templateId, { size: 15, className: "text-violet-9" })
- )
- }
- title={title}
- subtitle={
- deleting ? "Deleting…" : `Canvas · ${formatRelativeTimeShort(ts)}`
- }
- onClick={deleting ? undefined : () => onClick(dashboardId)}
- />
- );
-}
-
-// A PR artifact row. The PR's lifecycle state (open / draft / merged / closed)
-// comes from usePrArtifact, which also gates the URL — PR links come from run
-// output, so a row must not fetch from whatever host that names.
-function PrArtifactRow({
- title,
- prUrl,
- ts,
- onClick,
-}: {
- title: string;
- prUrl: string;
- ts: number;
- onClick: (safeUrl: string) => void;
-}) {
- const {
- safeUrl,
- title: prTitle,
- stateLabel,
- Icon,
- iconColor,
- accentColor,
- } = usePrArtifact(prUrl);
-
- const subtitle = [prTitle, stateLabel, formatRelativeTimeShort(ts)]
- .filter(Boolean)
- .join(" · ");
-
- return (
- <ArtifactRow
- accent={accentColor}
- icon={<Icon size={15} weight="bold" style={{ color: iconColor }} />}
- title={title}
- subtitle={subtitle}
- onClick={safeUrl ? () => onClick(safeUrl) : undefined}
- />
- );
-}
-
-function ArtifactRow({
- icon,
- accent,
- title,
- subtitle,
- onClick,
-}: {
- icon: ReactNode;
- accent: string;
- title: string;
- subtitle: string;
- /** Absent for a row with nowhere safe to go — a non-github PR link. */
- onClick?: () => void;
-}) {
- return (
- <button
- type="button"
- onClick={onClick}
- disabled={!onClick}
- className="group flex w-full items-center gap-3 rounded-lg px-2.5 py-2 text-left transition-colors enabled:hover:bg-fill-hover"
- >
- <span
- className="flex size-7 shrink-0 items-center justify-center rounded-md"
- style={{ backgroundColor: `var(--${accent}-3)` }}
- >
- {icon}
- </span>
- <span className="flex min-w-0 flex-1 flex-col">
- <span className="truncate font-medium text-[13px] text-gray-12 leading-tight">
- {title}
- </span>
- <span className="truncate text-[11px] text-muted-foreground leading-tight">
- {subtitle}
- </span>
- </span>
- <CaretRightIcon
- size={14}
- className="shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100"
- />
- </button>
- );
-}
-
-// The card form of a canvas artifact. Canvas records no longer carry source
-// code (the rendered output lives behind the build lifecycle), so the media
-// slot is a stable placeholder frame until per-card artifact previews are
-// wired up, mirroring WebsiteDashboardsIndex. Same delete-undo behaviour as
-// the row: the card stays in place, dimmed, until the undo window closes.
-function CanvasArtifactCard({
- dashboardId,
- templateId,
- title,
- ts,
- previewHeight,
- fillHeight,
- onClick,
-}: {
- dashboardId: string;
- templateId: string;
- title: string;
- ts: number;
- previewHeight: number;
- fillHeight?: boolean;
- onClick: (dashboardId: string) => void;
-}) {
- const deleting = useIsCanvasPendingDelete(dashboardId);
-
- return (
- <ArtifactCardShell
- media={
- <>
- <div
- className="relative overflow-hidden border-border border-b bg-muted"
- style={{ height: previewHeight }}
- >
- <div className="absolute inset-0 flex items-center justify-center px-4 text-center">
- <Text size="xs" variant="muted">
- Canvas preview
- </Text>
- </div>
- </div>
- {deleting && (
- <div className="absolute inset-0 flex items-center justify-center gap-2 bg-gray-1/80">
- <TrashIcon size={18} className="animate-pulse text-red-9" />
- <Text size="xs" variant="muted">
- Deleting…
- </Text>
- </div>
- )}
- </>
- }
- icon={iconForTemplate(templateId, {
- size: 14,
- className: "text-violet-9",
- })}
- title={title}
- badge="Canvas"
- subtitle={
- deleting ? "Deleting…" : `Updated ${formatRelativeTimeShort(ts)}`
- }
- dimmed={deleting}
- fillHeight={fillHeight}
- onClick={deleting ? undefined : () => onClick(dashboardId)}
- />
- );
-}
-
-// The card form of a PR artifact. A PR has nothing to preview, so its media
-// slot is a short tinted band carrying the lifecycle icon — which also keeps PR
-// cards visibly shorter than canvas cards in the masonry layout.
-function PrArtifactCard({
- title,
- prUrl,
- ts,
- mediaHeight,
- fillHeight,
- onClick,
-}: {
- title: string;
- prUrl: string;
- ts: number;
- /** Grid only: match the canvas cards' band instead of a short strip. */
- mediaHeight?: number;
- fillHeight?: boolean;
- onClick: (safeUrl: string) => void;
-}) {
- const {
- safeUrl,
- title: prTitle,
- stateLabel,
- Icon,
- iconColor,
- accentColor,
- } = usePrArtifact(prUrl);
-
- const subtitle = [prTitle, formatRelativeTimeShort(ts)]
- .filter(Boolean)
- .join(" · ");
-
- return (
- <ArtifactCardShell
- media={
- <div
- className="flex items-center justify-center border-border border-b"
- style={{
- backgroundColor: `var(--${accentColor}-3)`,
- height: mediaHeight ?? 80,
- }}
- >
- <Icon size={28} weight="bold" style={{ color: iconColor }} />
- </div>
- }
- icon={<Icon size={14} weight="bold" style={{ color: iconColor }} />}
- title={title}
- badge={stateLabel || "Pull request"}
- subtitle={subtitle}
- fillHeight={fillHeight}
- onClick={safeUrl ? () => onClick(safeUrl) : undefined}
- />
- );
-}
-
-function ArtifactCardShell({
- media,
- icon,
- title,
- badge,
- subtitle,
- dimmed,
- fillHeight,
- onClick,
-}: {
- media: ReactNode;
- icon: ReactNode;
- title: string;
- badge: string;
- subtitle: string;
- dimmed?: boolean;
- /** Grid only: fill the row so neighbouring cards end at the same line. */
- fillHeight?: boolean;
- /** Absent for a card with nowhere safe to go — a non-github PR link. */
- onClick?: () => void;
-}) {
- return (
- <button
- type="button"
- onClick={onClick}
- disabled={!onClick}
- className={cn(
- // A card with nowhere to go (or mid-delete) takes no pointer events, so
- // the hover treatment below can key off plain group-hover.
- "group w-full text-left disabled:pointer-events-none",
- fillHeight && "h-full",
- dimmed && "pointer-events-none opacity-60",
- )}
- >
- <Card
- className={cn(
- "gap-0 overflow-hidden p-0 transition-colors group-hover:border-accent",
- fillHeight && "flex h-full flex-col",
- )}
- >
- <div className="relative shrink-0">{media}</div>
- <CardContent className="flex flex-1 flex-col gap-0.5 p-3">
- <div className="flex items-center justify-between gap-2">
- <div className="flex min-w-0 items-center gap-1.5">
- <span className="shrink-0">{icon}</span>
- <Text size="sm" weight="medium" className="truncate">
- {title}
- </Text>
- </div>
- <Badge>{badge}</Badge>
- </div>
- <Text size="xxs" variant="muted" className="truncate">
- {subtitle}
- </Text>
- </CardContent>
- </Card>
- </button>
- );
-}
diff --git a/products/desktop/packages/ui/src/features/canvas/components/WebsiteLayout.tsx b/products/desktop/packages/ui/src/features/canvas/components/WebsiteLayout.tsx
index 67a53f9117ce..0322f77208ac 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/WebsiteLayout.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/WebsiteLayout.tsx
@@ -91,8 +91,8 @@ function FreeformEditControls({
// its version history go away for everyone in the space.
const [confirmDeleteOpen, setConfirmDeleteOpen] = useState(false);
- // Once confirmed the canvas vanishes from every list and we leave for the
- // space's artifacts list, but the delete isn't sent until the undo toast's
+ // Once confirmed the canvas vanishes from every list and we return to the
+ // space, but the delete isn't sent until the undo toast's
// timer runs out — Undo simply cancels it.
const confirmDelete = () => {
setConfirmDeleteOpen(false);
@@ -104,7 +104,7 @@ function FreeformEditControls({
invalidate: invalidateDashboards,
});
void navigate({
- to: "/website/$channelId/artifacts",
+ to: "/website/$channelId",
params: { channelId },
});
};
diff --git a/products/desktop/packages/ui/src/features/canvas/components/channelPages.tsx b/products/desktop/packages/ui/src/features/canvas/components/channelPages.tsx
index 69318f2f45ef..c7417dda6ed6 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/channelPages.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/channelPages.tsx
@@ -3,7 +3,6 @@ import {
ChatsCircleIcon,
ClockCounterClockwiseIcon,
type IconProps,
- PackageIcon,
ShapesIcon,
} from "@phosphor-icons/react";
import { LoopIcon } from "@posthog/ui/primitives/LoopIcon";
@@ -24,7 +23,6 @@ export type ChannelPageKey =
| "home"
| "context"
| "loops"
- | "artifacts"
| "canvases"
| "history";
@@ -35,7 +33,6 @@ export const CHANNEL_PAGES: Record<
home: { label: "Feed", Icon: ChatsCircleIcon },
context: { label: "Context", Icon: BookOpenTextIcon },
loops: { label: "Loops", Icon: LoopIcon },
- artifacts: { label: "Artifacts", Icon: PackageIcon },
canvases: { label: "Canvases", Icon: ShapesIcon },
history: { label: "Recents", Icon: ClockCounterClockwiseIcon },
};
diff --git a/products/desktop/packages/ui/src/features/canvas/hooks/useGenerateContext.ts b/products/desktop/packages/ui/src/features/canvas/hooks/useGenerateContext.ts
index 0df9d1ad0975..640bd819dad0 100644
--- a/products/desktop/packages/ui/src/features/canvas/hooks/useGenerateContext.ts
+++ b/products/desktop/packages/ui/src/features/canvas/hooks/useGenerateContext.ts
@@ -127,7 +127,7 @@ export function useGenerateContext() {
}
const task = result.data.task;
- // File into the context so its Recents/Artifacts tabs pick it up.
+ // File into the context so its Recents list picks it up.
// Best-effort — a failure here shouldn't undo a started task.
void fileTask(channelId, task.id).catch(() => {});
// Announce the CONTEXT.md build in the channel feed (durable, team-
diff --git a/products/desktop/packages/ui/src/features/canvas/stores/artifactsViewStore.ts b/products/desktop/packages/ui/src/features/canvas/stores/artifactsViewStore.ts
deleted file mode 100644
index 939420cf820f..000000000000
--- a/products/desktop/packages/ui/src/features/canvas/stores/artifactsViewStore.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";
-import { track } from "@posthog/ui/shell/analytics";
-import { create } from "zustand";
-import { persist } from "zustand/middleware";
-
-// How a space's artifacts are laid out. "list" is the dense row list, "grid" a
-// uniform card grid with live canvas previews, "masonry" the same cards in
-// staggered columns so previews get varied vertical room.
-export type ArtifactsViewMode = "list" | "grid" | "masonry";
-
-export const ARTIFACTS_VIEW_MODES: ArtifactsViewMode[] = [
- "list",
- "grid",
- "masonry",
-];
-
-interface ArtifactsViewStore {
- view: ArtifactsViewMode;
- setView: (view: ArtifactsViewMode, channelId?: string) => void;
-}
-
-// Per-device preference, not per-space: picking masonry once should hold as you
-// move between spaces, the way a file browser's view setting does.
-export const useArtifactsViewStore = create<ArtifactsViewStore>()(
- persist(
- (set) => ({
- view: "list",
- setView: (view, channelId) =>
- set((state) => {
- if (state.view === view) return state;
- track(ANALYTICS_EVENTS.CHANNEL_ACTION, {
- action_type: "artifacts_view_change",
- surface: "channel_artifacts",
- channel_id: channelId,
- view_mode: view,
- });
- return { view };
- }),
- }),
- { name: "artifacts-view-storage" },
- ),
-);
diff --git a/products/desktop/packages/ui/src/features/canvas/utils/masonryPreviewHeight.test.ts b/products/desktop/packages/ui/src/features/canvas/utils/masonryPreviewHeight.test.ts
deleted file mode 100644
index f7a4ed61f224..000000000000
--- a/products/desktop/packages/ui/src/features/canvas/utils/masonryPreviewHeight.test.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { masonryPreviewHeight } from "@posthog/ui/features/canvas/utils/masonryPreviewHeight";
-import { describe, expect, it } from "vitest";
-
-describe("masonryPreviewHeight", () => {
- it("is stable for a key", () => {
- expect(masonryPreviewHeight("canvas:abc")).toBe(
- masonryPreviewHeight("canvas:abc"),
- );
- });
-
- it("stays inside the bucket set", () => {
- const keys = Array.from({ length: 50 }, (_, i) => `canvas:${i}`);
- const heights = new Set(keys.map(masonryPreviewHeight));
- expect([...heights].every((h) => [168, 224, 288].includes(h))).toBe(true);
- });
-
- it("staggers across keys so masonry has something to stagger", () => {
- const keys = Array.from({ length: 50 }, (_, i) => `canvas:${i}`);
- expect(new Set(keys.map(masonryPreviewHeight)).size).toBeGreaterThan(1);
- });
-});
diff --git a/products/desktop/packages/ui/src/features/canvas/utils/masonryPreviewHeight.ts b/products/desktop/packages/ui/src/features/canvas/utils/masonryPreviewHeight.ts
deleted file mode 100644
index 3a5321413871..000000000000
--- a/products/desktop/packages/ui/src/features/canvas/utils/masonryPreviewHeight.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-// Masonry needs cards of differing height or it degrades into a ragged grid.
-// Canvas previews have no intrinsic height to measure (the app is rendered into
-// a clipped, scaled frame), so each card gets a stable height picked from its
-// key — same canvas, same height across renders and reloads, no layout churn.
-const MASONRY_HEIGHTS = [168, 224, 288] as const;
-
-export function masonryPreviewHeight(key: string): number {
- let hash = 0;
- for (let i = 0; i < key.length; i++) {
- hash = (hash * 31 + key.charCodeAt(i)) >>> 0;
- }
- return MASONRY_HEIGHTS[hash % MASONRY_HEIGHTS.length];
-}
diff --git a/products/desktop/packages/ui/src/features/command/useSearchSections.tsx b/products/desktop/packages/ui/src/features/command/useSearchSections.tsx
index 2519a4bcfca3..ea8080fd6f1d 100644
--- a/products/desktop/packages/ui/src/features/command/useSearchSections.tsx
+++ b/products/desktop/packages/ui/src/features/command/useSearchSections.tsx
@@ -6,7 +6,6 @@ import { channelGlyph } from "@posthog/ui/features/canvas/components/channelGlyp
import { closeSettings } from "@posthog/ui/features/settings/hooks/useOpenSettings";
import {
navigateToChannel,
- navigateToChannelArtifacts,
navigateToChannelTask,
navigateToTaskDetail,
} from "@posthog/ui/router/navigationBridge";
@@ -122,13 +121,6 @@ export function useSearchSections({
result.channel_id
) {
navigateToChannel(result.channel_id);
- } else if (
- bluebirdEnabled &&
- result.kind === "artifact" &&
- result.channel_id &&
- result.metadata.living === true
- ) {
- navigateToChannelArtifacts(result.channel_id);
} else if (task) {
// PR matches intentionally open their containing task. Cmd+K is a
// navigator for Desktop context, not an external-link launcher.
diff --git a/products/desktop/packages/ui/src/router/navigationBridge.ts b/products/desktop/packages/ui/src/router/navigationBridge.ts
index 4c8bb1be7e2e..1992d0fd8a03 100644
--- a/products/desktop/packages/ui/src/router/navigationBridge.ts
+++ b/products/desktop/packages/ui/src/router/navigationBridge.ts
@@ -51,13 +51,6 @@ export function navigateToChannel(channelId: string): void {
});
}
-export function navigateToChannelArtifacts(channelId: string): void {
- void getRouterOrNull()?.navigate({
- to: "/website/$channelId/artifacts",
- params: { channelId },
- });
-}
-
export function navigateToChannelTask(channelId: string, taskId: string): void {
void getRouterOrNull()?.navigate({
to: "/website/$channelId/tasks/$taskId",
diff --git a/products/desktop/packages/ui/src/router/routes/website/$channelId/artifacts.tsx b/products/desktop/packages/ui/src/router/routes/website/$channelId/artifacts.tsx
index c6d74c182c2d..f58c3f317f45 100644
--- a/products/desktop/packages/ui/src/router/routes/website/$channelId/artifacts.tsx
+++ b/products/desktop/packages/ui/src/router/routes/website/$channelId/artifacts.tsx
@@ -1,16 +1,11 @@
-import { WebsiteChannelArtifacts } from "@posthog/ui/features/canvas/components/WebsiteChannelArtifacts";
-import {
- ChannelSkeleton,
- withRouteSkeleton,
-} from "@posthog/ui/router/routeSkeletons";
-import { createFileRoute } from "@tanstack/react-router";
+import { createFileRoute, redirect } from "@tanstack/react-router";
export const Route = createFileRoute("/website/$channelId/artifacts")({
- component: ChannelArtifactsRoute,
- ...withRouteSkeleton(ChannelSkeleton),
+ beforeLoad: ({ params }) => {
+ throw redirect({
+ to: "/website/$channelId",
+ params: { channelId: params.channelId },
+ replace: true,
+ });
+ },
});
-
-function ChannelArtifactsRoute() {
- const { channelId } = Route.useParams();
- return <WebsiteChannelArtifacts channelId={channelId} />;
-}