: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
chore(desktop): remove the posthog-desktop-canvas-comments flag (#109413)
Shy Altere1391d6c7ee2
diff --git a/products/desktop/packages/shared/src/feature-flag-keys.json b/products/desktop/packages/shared/src/feature-flag-keys.jsonindex 951aa1312a77..74d2f456118d 100644--- a/products/desktop/packages/shared/src/feature-flag-keys.json+++ b/products/desktop/packages/shared/src/feature-flag-keys.json@@ -4,7 +4,6 @@"BACKGROUND_AGENT_LOGS_FLAG": "posthog-code-background-agent-logs","BEDROCK_LLM_GATEWAY_FLAG": "bedrock-llm-gateway","BILLING_FLAG": "posthog-code-billing",- "CANVAS_COMMENTS_FLAG": "posthog-desktop-canvas-comments","CHANNEL_REPORTS_FLAG": "posthog-desktop-channel-reports","CHANNELS_LAYOUT_FLAG": "code-spaces-layout","CLAUDE_OWN_SUBSCRIPTION_FLAG": "posthog-code-claude-own-subscription",diff --git a/products/desktop/packages/shared/src/flags.ts b/products/desktop/packages/shared/src/flags.tsindex 086597392196..8dae8249ef09 100644--- a/products/desktop/packages/shared/src/flags.ts+++ b/products/desktop/packages/shared/src/flags.ts@@ -13,7 +13,6 @@ export const ONBOARDING_TEST_TOOLS_FLAG =// Gates the entire canvas feature: the app rail's Channels space, the /website// routes, channels and dashboards.export const PROJECT_BLUEBIRD_FLAG = featureFlagKeys.PROJECT_BLUEBIRD_FLAG;-export const CANVAS_COMMENTS_FLAG = featureFlagKeys.CANVAS_COMMENTS_FLAG;/*** Gates the new channels layout (channel-scoped sidebar + task Activity panel).* Off keeps the previous experience and its "Enable channels" toggle. Requiresdiff --git a/products/desktop/packages/ui/src/features/canvas/components/ShellLayout.tsx b/products/desktop/packages/ui/src/features/canvas/components/ShellLayout.tsxindex 9c2a584a0e94..4551d1c8d4fd 100644--- a/products/desktop/packages/ui/src/features/canvas/components/ShellLayout.tsx+++ b/products/desktop/packages/ui/src/features/canvas/components/ShellLayout.tsx@@ -33,7 +33,6 @@ import { CanvasFrameHost } from "@posthog/ui/features/canvas/freeform/CanvasFramimport { canvasCommentTaskId } from "@posthog/ui/features/canvas/freeform/canvasCommentTask";import { useCanvasFrameStore } from "@posthog/ui/features/canvas/freeform/canvasFrameStore";import { CANVAS_QUERY_KEY } from "@posthog/ui/features/canvas/freeform/freeformDataBridge";-import { useCanvasCommentsEnabled } from "@posthog/ui/features/canvas/hooks/useCanvasCommentsEnabled";import { useChannels } from "@posthog/ui/features/canvas/hooks/useChannels";import { useChannelsLayout } from "@posthog/ui/features/canvas/hooks/useChannelsLayout";import { useChannelTasks } from "@posthog/ui/features/canvas/hooks/useChannelTasks";@@ -295,12 +294,9 @@ function CanvasBreadcrumb({dashboard?.generationTaskId,versions,);- const commentsEnabled = useCanvasCommentsEnabled(commentTaskId);- const comments = useCommentsQuery(- commentsEnabled ? commentTarget : null,- commentTaskId ?? "",- { live: true },- );+ const comments = useCommentsQuery(commentTarget, commentTaskId ?? "", {+ live: true,+ });const openCommentCount = buildCommentThreads(comments.data ?? []).filter((thread) => !thread.resolved,).length;@@ -323,15 +319,13 @@ function CanvasBreadcrumb({}trailing={<>- {commentsEnabled && (- <Button size="sm" variant="outline" onClick={openComments}>- <ChatCircleIcon />- Comments- {openCommentCount > 0 && (- <span className="tabular-nums">{openCommentCount}</span>- )}- </Button>- )}+ <Button size="sm" variant="outline" onClick={openComments}>+ <ChatCircleIcon />+ Comments+ {openCommentCount > 0 && (+ <span className="tabular-nums">{openCommentCount}</span>+ )}+ </Button>{trailing}</>}diff --git a/products/desktop/packages/ui/src/features/canvas/freeform/CanvasSidePanel.test.tsx b/products/desktop/packages/ui/src/features/canvas/freeform/CanvasSidePanel.test.tsxindex 921698f80c9b..654059a7dcdf 100644--- a/products/desktop/packages/ui/src/features/canvas/freeform/CanvasSidePanel.test.tsx+++ b/products/desktop/packages/ui/src/features/canvas/freeform/CanvasSidePanel.test.tsx@@ -42,7 +42,6 @@ describe("CanvasSidePanel", () => {<CanvasSidePanelchatTaskId="task-1"commentTaskId="task-1"- commentsEnabledonMinimize={vi.fn()}dashboardId="canvas-1"channelId="channel-1"@@ -67,7 +66,6 @@ describe("CanvasSidePanel", () => {useCanvasChatPanelStore.setState({ tab: "comments", collapsed: false });const props = {commentTaskId: "task-1",- commentsEnabled: true,interactive,onMinimize: vi.fn(),dashboardId: "canvas-1",@@ -107,7 +105,6 @@ describe("CanvasSidePanel", () => {<CanvasSidePanelchatTaskId={null}commentTaskId={commentTaskId}- commentsEnabledonMinimize={vi.fn()}dashboardId="canvas-1"channelId="channel-1"@@ -127,32 +124,4 @@ describe("CanvasSidePanel", () => {);expect(screen.getByTestId("task-comments")).toHaveTextContent(expected);});-- it("disables comments when they are off for the canvas", () => {- useCanvasChatPanelStore.setState({ tab: "comments", collapsed: false });-- render(- <CanvasSidePanel- chatTaskId="task-1"- commentTaskId={null}- commentsEnabled={false}- onMinimize={vi.fn()}- dashboardId="canvas-1"- channelId="channel-1"- channelName="General"- name="Launch canvas"- displayedVersionId="version-2"- liveVersionId="version-2"- onAskAgent={vi.fn()}- commentVersionLabel={(versionId) => versionId}- onCommentOpen={vi.fn()}- />,- );-- expect(screen.getByLabelText("Comments")).toHaveAttribute(- "aria-disabled",- "true",- );- expect(screen.queryByTestId("task-comments")).not.toBeInTheDocument();- });});diff --git a/products/desktop/packages/ui/src/features/canvas/freeform/CanvasSidePanel.tsx b/products/desktop/packages/ui/src/features/canvas/freeform/CanvasSidePanel.tsxindex 49d34d498fdc..393c8233b7f5 100644--- a/products/desktop/packages/ui/src/features/canvas/freeform/CanvasSidePanel.tsx+++ b/products/desktop/packages/ui/src/features/canvas/freeform/CanvasSidePanel.tsx@@ -90,7 +90,6 @@ function PanelTabButton({export function CanvasSidePanel({chatTaskId,commentTaskId,- commentsEnabled,interactive,onMinimize,dashboardId,@@ -112,7 +111,6 @@ export function CanvasSidePanel({* here, even while it is in flight. */chatTaskId: string | null;commentTaskId: string | null;- commentsEnabled: boolean;/** Whether the canvas is being edited. The composer is an edit affordance, so* view mode shows an empty chat when this person has no run. */interactive?: boolean;@@ -163,10 +161,7 @@ export function CanvasSidePanel({key={option}tab={option}active={visibleTab === option}- disabled={- (option === "comments" && !commentsEnabled) ||- (option === "blocks" && firstBuildRunning)- }+ disabled={option === "blocks" && firstBuildRunning}onSelect={setTab}/>))}@@ -207,7 +202,7 @@ export function CanvasSidePanel({versionLabel={commentVersionLabel}onOpen={onCommentOpen}/>- ) : visibleTab === "comments" && commentsEnabled ? (+ ) : visibleTab === "comments" ? (<CanvasCommentstaskId={commentTaskId}dashboardId={dashboardId}diff --git a/products/desktop/packages/ui/src/features/canvas/freeform/FreeformCanvasView.tsx b/products/desktop/packages/ui/src/features/canvas/freeform/FreeformCanvasView.tsxindex 53fba32f880b..acc9371b6611 100644--- a/products/desktop/packages/ui/src/features/canvas/freeform/FreeformCanvasView.tsx+++ b/products/desktop/packages/ui/src/features/canvas/freeform/FreeformCanvasView.tsx@@ -67,7 +67,6 @@ import {} from "@posthog/ui/features/canvas/freeform/canvasGenerationStatus";import { invalidateCanvasLifecycle } from "@posthog/ui/features/canvas/hooks/invalidateCanvasLifecycle";import { useCanvasBuilds } from "@posthog/ui/features/canvas/hooks/useCanvasBuilds";-import { useCanvasCommentsEnabled } from "@posthog/ui/features/canvas/hooks/useCanvasCommentsEnabled";import { useChannels } from "@posthog/ui/features/canvas/hooks/useChannels";import {useCanvasDrafts,@@ -356,7 +355,6 @@ export function FreeformCanvasView({interactive ? dashboardId : undefined,);const commentTaskId = canvasCommentTaskId(genTaskId, versions);- const commentsEnabled = useCanvasCommentsEnabled(commentTaskId);// The run whose chat the panel shows: this person's own run on the canvas,// found through the record's task or the versions they published. Another// person's run never shows, so each editor keeps their own conversation.@@ -534,17 +532,13 @@ export function FreeformCanvasView({() => ({ scope: "canvas" as const, itemId: dashboardId }),[dashboardId],);- const commentsQuery = useCommentsQuery(- commentsEnabled ? commentTarget : null,- commentTaskId ?? "",- );+ const commentsQuery = useCommentsQuery(commentTarget, commentTaskId ?? "");const focusedCommentId = useCommentNavigationStore((state) =>state.focusByTask[canvasCommentFocusKey(dashboardId)]?.threadId ?? null,);const activateComment = useCallback((id: string) => {- if (!commentsEnabled) return;useCanvasChatPanelStore.getState().openComments();useCommentNavigationStore.getState()@@ -555,7 +549,7 @@ export function FreeformCanvasView({{ intent: "reveal-thread" },);},- [commentsEnabled, commentTarget, dashboardId],+ [commentTarget, dashboardId],);const commentHighlights = useMemo<CanvasCommentHighlight[]>(() => {const threads = buildCommentThreads(commentsQuery.data ?? []);@@ -862,7 +856,6 @@ export function FreeformCanvasView({generatingPanelOpen,viewOpen: embedded ? false : panelViewOpen,collapsed,- commentsEnabled,});const showPanel = panelVisibility.editing;// Build failures/progress surface in view mode too — the toolbar renders@@ -1358,7 +1351,6 @@ export function FreeformCanvasView({<CanvasSidePanelchatTaskId={chatTaskId}commentTaskId={commentTaskId}- commentsEnabled={commentsEnabled}interactive={interactive}onMinimize={() => {setCollapsed(true);@@ -1386,7 +1378,7 @@ export function FreeformCanvasView({</ResizableSidebar>)}- {!embedded && commentsEnabled && (+ {!embedded && (<CanvasSelectionCommentActionselection={textSelection}taskId={commentTaskId}diff --git a/products/desktop/packages/ui/src/features/canvas/freeform/canvasSidePanelVisibility.test.ts b/products/desktop/packages/ui/src/features/canvas/freeform/canvasSidePanelVisibility.test.tsindex 9d90923b2848..113897e71985 100644--- a/products/desktop/packages/ui/src/features/canvas/freeform/canvasSidePanelVisibility.test.ts+++ b/products/desktop/packages/ui/src/features/canvas/freeform/canvasSidePanelVisibility.test.ts@@ -8,7 +8,6 @@ const base = {generatingPanelOpen: false,viewOpen: false,collapsed: false,- commentsEnabled: true,};describe("canvasSidePanelVisibility", () => {@@ -39,12 +38,6 @@ describe("canvasSidePanelVisibility", () => {false,false,],- [- "viewing a canvas with comments off",- { viewOpen: true, commentsEnabled: false },- false,- false,- ],])("%s", (_name, overrides, editing, viewing) => {expect(canvasSidePanelVisibility({ ...base, ...overrides })).toEqual({editing,diff --git a/products/desktop/packages/ui/src/features/canvas/freeform/canvasSidePanelVisibility.ts b/products/desktop/packages/ui/src/features/canvas/freeform/canvasSidePanelVisibility.tsindex 69308b8fde87..6507784ad299 100644--- a/products/desktop/packages/ui/src/features/canvas/freeform/canvasSidePanelVisibility.ts+++ b/products/desktop/packages/ui/src/features/canvas/freeform/canvasSidePanelVisibility.ts@@ -25,13 +25,11 @@ export function canvasSidePanelVisibility(args: {viewOpen: boolean;/** Whether the dock is minimized to the rail. */collapsed: boolean;- /** Whether this canvas's comments are available. */- commentsEnabled: boolean;}): CanvasSidePanelVisibility {return {editing:(args.interactive && (args.hasContent || args.hasActiveTask)) ||args.generatingPanelOpen,- viewing: args.viewOpen && !args.collapsed && args.commentsEnabled,+ viewing: args.viewOpen && !args.collapsed,};}diff --git a/products/desktop/packages/ui/src/features/canvas/grid/GridCanvasView.tsx b/products/desktop/packages/ui/src/features/canvas/grid/GridCanvasView.tsxindex 0a15b9ceb94b..fdf62c99cbce 100644--- a/products/desktop/packages/ui/src/features/canvas/grid/GridCanvasView.tsx+++ b/products/desktop/packages/ui/src/features/canvas/grid/GridCanvasView.tsx@@ -5,7 +5,6 @@ import type {} from "@posthog/core/canvas/gridLayoutSchemas";import { Button, Text } from "@posthog/quill";import { canvasCommentTaskId } from "@posthog/ui/features/canvas/freeform/canvasCommentTask";-import { useCanvasCommentsEnabled } from "@posthog/ui/features/canvas/hooks/useCanvasCommentsEnabled";import { useChannels } from "@posthog/ui/features/canvas/hooks/useChannels";import {useCanvasVersions,@@ -78,7 +77,6 @@ export function GridCanvasView({dashboard?.generationTaskId ?? startedCanvasTaskId,versions,);- const commentsEnabled = useCanvasCommentsEnabled(commentTaskId);const versionText = useMemo(() => {if (!currentVersionId || versions.length === 0) return null;const index = versions.findIndex(@@ -261,7 +259,6 @@ export function GridCanvasView({target={widgetTarget}canvasTaskId={dashboard.generationTaskId ?? startedCanvasTaskId}commentTaskId={commentTaskId}- commentsEnabled={commentsEnabled}canvasVersionId={currentVersionId ?? null}commentVersionLabel={commentVersionLabel}canvasId={canvasId}diff --git a/products/desktop/packages/ui/src/features/canvas/grid/GridChatPanel.tsx b/products/desktop/packages/ui/src/features/canvas/grid/GridChatPanel.tsxindex c74635203def..1c0c277087e7 100644--- a/products/desktop/packages/ui/src/features/canvas/grid/GridChatPanel.tsx+++ b/products/desktop/packages/ui/src/features/canvas/grid/GridChatPanel.tsx@@ -34,7 +34,6 @@ export function GridChatPanel({target,canvasTaskId,commentTaskId,- commentsEnabled,canvasVersionId,commentVersionLabel,canvasId,@@ -52,7 +51,6 @@ export function GridChatPanel({/** The task canvas comments anchor to (the canvas conversation, or the run* that produced the current layout). */commentTaskId: string | null;- commentsEnabled: boolean;/** The layout version currently shown, for labeling new comments. */canvasVersionId: string | null;commentVersionLabel: (versionId: string) => string | null;@@ -118,17 +116,13 @@ export function GridChatPanel({<TabsTrigger value="chat" className="px-2.5">Chat</TabsTrigger>- <TabsTrigger- value="comments"- disabled={!commentsEnabled}- className="px-2.5"- >+ <TabsTrigger value="comments" className="px-2.5">Comments</TabsTrigger></TabsList></Tabs></ChromeBar>- {tab === "comments" && commentsEnabled ? (+ {tab === "comments" ? (<CanvasCommentstaskId={commentTaskId}canvasId={canvasId}diff --git a/products/desktop/packages/ui/src/features/canvas/hooks/useCanvasCommentsEnabled.ts b/products/desktop/packages/ui/src/features/canvas/hooks/useCanvasCommentsEnabled.tsdeleted file mode 100644index 7b6e157bb1bb..000000000000--- a/products/desktop/packages/ui/src/features/canvas/hooks/useCanvasCommentsEnabled.ts+++ /dev/null@@ -1,8 +0,0 @@-import { CANVAS_COMMENTS_FLAG } from "@posthog/shared";-import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag";--export function useCanvasCommentsEnabled(- commentTaskId: string | null,-): boolean {- return useFeatureFlag(CANVAS_COMMENTS_FLAG) || !!commentTaskId;-}