: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
fix(desktop): restore session drag to command center (#76565)
Ben Whiteab6bb031ff70
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.test.tsxindex 80f9ba7857a4..0f464b413a4f 100644--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.test.tsx+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.test.tsx@@ -209,6 +209,29 @@ describe("ChannelItemRow", () => {expect(screen.queryByRole("img", { name: "Pinned" })).toBeNull();});+ it("makes tasks draggable into the Command Center", () => {+ renderRow(item());+ const setData = vi.fn();+ const dataTransfer = { setData, effectAllowed: "none" };++ fireEvent.dragStart(screen.getByRole("button"), { dataTransfer });++ expect(setData).toHaveBeenCalledWith("text/x-task-id", "task-1");+ expect(dataTransfer.effectAllowed).toBe("copy");+ });++ it("does not make canvases draggable into the Command Center", () => {+ renderRow(+ item({+ key: "canvas:canvas-1",+ kind: "canvas",+ id: "canvas-1",+ }),+ );++ expect(screen.getByRole("button")).not.toHaveAttribute("draggable", "true");+ });+// The hover card and right-click render the same item list from one// definition, so both are asserted against the same expectations.const MENU_ITEMS = [diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.tsxindex 195e40f385b2..e2362f90afaa 100644--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.tsx+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelItemRow.tsx@@ -53,7 +53,7 @@ import {taskDot,} from "@posthog/ui/features/sidebar/components/items/taskStatusVocabulary";import { SidebarItem } from "@posthog/ui/features/sidebar/components/SidebarItem";-import { type ReactNode, useCallback, useState } from "react";+import { type DragEvent, type ReactNode, useCallback, useState } from "react";/*** What a row can do. One object per channel rather than closures per item, so@@ -204,6 +204,15 @@ export function ChannelItemRow({const closeCard = useCallback(() => setCardOpen(false), []);const statusLabel = runStatusLabel(item.rawStatus);const author = authorLabel(item);+ const handleDragStart = useCallback(+ (event: DragEvent) => {+ if (item.kind !== "task") return;++ event.dataTransfer.setData("text/x-task-id", item.id);+ event.dataTransfer.effectAllowed = "copy";+ },+ [item.id, item.kind],+ );// The row's leading mark is always the task-list state vocabulary. Canvases// have no live run, so they use the quiet dot and move their glyph to the// right-side identity stack — except while one is being deleted, which is the@@ -270,6 +279,8 @@ export function ChannelItemRow({// A non-string label opts out of SidebarItem's truncation tooltip.label={<span>{item.title}</span>}isActive={isActive}+ draggable={item.kind === "task"}+ onDragStart={handleDragStart}onClick={() => actions.open(item)}endContent={<span className={TRAILING_CLASS}>