: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): put the command palette on quill tokens (#87607)
Adam Leithad85c310cb70
diff --git a/products/desktop/packages/ui/src/features/canvas/components/FeedQueryInput.tsx b/products/desktop/packages/ui/src/features/canvas/components/FeedQueryInput.tsxindex 118b8362d12c..ce64afee473b 100644--- a/products/desktop/packages/ui/src/features/canvas/components/FeedQueryInput.tsx+++ b/products/desktop/packages/ui/src/features/canvas/components/FeedQueryInput.tsx@@ -42,7 +42,7 @@ export function FeedQueryHighlight({function renderSegment(segment: FeedQuerySegment): ReactNode {if (segment.kind !== "token" || !segment.token) {- return <span className="text-(--gray-12)">{segment.raw}</span>;+ return <span className="text-foreground">{segment.raw}</span>;}const { token, raw } = segment;const negPrefix = raw.startsWith("-") ? "-" : "";@@ -60,23 +60,29 @@ function renderSegment(segment: FeedQuerySegment): ReactNode {<spanclassName={cn("rounded-[3px]",- negated ? "bg-(--red-a3)" : "bg-(--gray-a3)",+ negated ? "bg-destructive" : "bg-fill-hover",)}>- {negPrefix && <span className="text-(--red-11)">{negPrefix}</span>}- <span className={negated ? "text-(--red-11)" : "text-(--blue-11)"}>+ {negPrefix && (+ <span className="text-destructive-foreground">{negPrefix}</span>+ )}+ <span+ className={negated ? "text-destructive-foreground" : "text-primary"}+ >{keyText}</span>- {notPrefix && <span className="text-(--red-11)">{notPrefix}</span>}+ {notPrefix && (+ <span className="text-destructive-foreground">{notPrefix}</span>+ )}<spanclassName={cn(token.invalid- ? "text-(--red-11) underline decoration-(--red-8) decoration-wavy underline-offset-2"+ ? "text-destructive-foreground underline decoration-destructive-foreground decoration-wavy underline-offset-2": token.unsupported- ? "text-(--amber-11) underline decoration-(--amber-8) decoration-dotted underline-offset-2"+ ? "text-warning-foreground underline decoration-warning-foreground decoration-dotted underline-offset-2": negated- ? "text-(--red-12)"- : "text-(--gray-12)",+ ? "text-destructive-foreground"+ : "text-foreground",)}>{valueText}@@ -226,8 +232,8 @@ export function FeedQueryInput({className={cn("absolute inset-0 w-full bg-transparent px-2.5 outline-none",EDITOR_TEXT_CLASS,- "text-transparent caret-(--gray-12) placeholder:text-(--gray-9)",- "selection:bg-(--blue-a4) selection:text-transparent",+ "text-transparent caret-foreground placeholder:text-subtle-foreground",+ "selection:bg-primary/25 selection:text-transparent",)}onChange={(e) => {onChange(e.target.value);diff --git a/products/desktop/packages/ui/src/features/canvas/components/feedQuerySuggestions.tsx b/products/desktop/packages/ui/src/features/canvas/components/feedQuerySuggestions.tsxindex b895ed03b3d3..9e78cf86fe28 100644--- a/products/desktop/packages/ui/src/features/canvas/components/feedQuerySuggestions.tsx+++ b/products/desktop/packages/ui/src/features/canvas/components/feedQuerySuggestions.tsx@@ -37,7 +37,7 @@ interface FeedQuerySuggestionGroup {function keyIcon(icon: ReactNode): ReactNode {return (- <span className="flex size-4 items-center justify-center text-(--gray-9)">+ <span className="flex size-4 items-center justify-center text-subtle-foreground">{icon}</span>);diff --git a/products/desktop/packages/ui/src/features/command/CommandMenu.feedQuery.test.tsx b/products/desktop/packages/ui/src/features/command/CommandMenu.feedQuery.test.tsxindex 96e022905cbb..76613919ffa2 100644--- a/products/desktop/packages/ui/src/features/command/CommandMenu.feedQuery.test.tsx+++ b/products/desktop/packages/ui/src/features/command/CommandMenu.feedQuery.test.tsx@@ -36,6 +36,7 @@ vi.mock("@posthog/ui/features/archive/useTaskArchive", () => ({}));vi.mock("@posthog/ui/features/workspace/useWorkspace", () => ({useWorkspaces: () => ({ data: [], isFetched: true }),+ useWorkspace: () => undefined,}));vi.mock("@posthog/ui/features/canvas/hooks/useChannels", () => ({useChannels: () => ({ channels: [], isLoading: false }),@@ -77,6 +78,10 @@ vi.mock("@posthog/ui/router/useAppView", () => ({vi.mock("@posthog/ui/features/sidebar/useTaskPrStatus", () => ({useTaskPrStatus: () => ({ prState: null, hasDiff: false, prUrl: null }),}));+vi.mock("@posthog/ui/features/canvas/hooks/useChannelTaskStatus", () => ({+ useTaskStatusInput: () => null,+ useChannelTaskStatus: () => null,+}));vi.mock("@posthog/ui/features/canvas/hooks/useTaskFeedResults", () => ({useTaskFeedResults: (query: string | undefined) => ({tasks: querydiff --git a/products/desktop/packages/ui/src/features/command/CommandMenu.tsx b/products/desktop/packages/ui/src/features/command/CommandMenu.tsxindex dcea8a58c255..abcea73e5b7d 100644--- a/products/desktop/packages/ui/src/features/command/CommandMenu.tsx+++ b/products/desktop/packages/ui/src/features/command/CommandMenu.tsx@@ -1,14 +1,25 @@import {ArchiveIcon,+ ArrowClockwiseIcon,CaretLeftIcon,CaretRightIcon,- ChartLine,+ ChartLineIcon,CubeIcon,- EnvelopeSimple,- Gauge,+ DesktopIcon,+ EnvelopeSimpleIcon,+ FileTextIcon,+ GaugeIcon,+ GearIcon,GitDiffIcon,HashIcon,+ HouseIcon,+ MagnifyingGlassIcon,+ MagnifyingGlassMinusIcon,+ MagnifyingGlassPlusIcon,+ MoonIcon,+ SidebarSimpleIcon,SquaresFourIcon,+ SunIcon,} from "@phosphor-icons/react";import { workspaceIdSet } from "@posthog/core/command-center/eligibility";import { resolveService } from "@posthog/di/container";@@ -60,6 +71,7 @@ import {SHORTCUTS,} from "@posthog/ui/features/command/keyboard-shortcuts";import { PaletteFilterChips } from "@posthog/ui/features/command/PaletteFilterChips";+import { sessionSubtitle } from "@posthog/ui/features/command/sessionSubtitle";import { TaskCommandIcon } from "@posthog/ui/features/command/TaskCommandIcon";import { taskSearchDelay } from "@posthog/ui/features/command/taskSearchQuery";import {@@ -100,19 +112,6 @@ import { openTask, openTaskInput } from "@posthog/ui/router/useOpenTask";import { track } from "@posthog/ui/shell/analytics";import { showLogFolder } from "@posthog/ui/shell/openExternal";import { useThemeStore } from "@posthog/ui/shell/themeStore";-import {- DesktopIcon,- FileTextIcon,- GearIcon,- HomeIcon,- MagnifyingGlassIcon,- MoonIcon,- ReloadIcon,- SunIcon,- ViewVerticalIcon,- ZoomInIcon,- ZoomOutIcon,-} from "@radix-ui/react-icons";import {lazy,type KeyboardEvent as ReactKeyboardEvent,@@ -325,7 +324,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "switch-theme-light",label: "Switch to light mode",keywords: "theme appearance",- icon: <SunIcon className="h-3 w-3 text-gray-11" />,+ icon: <SunIcon size={12} className="text-muted-foreground" />,action: "toggle-theme",onRun: () => setTheme("light"),});@@ -335,7 +334,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "switch-theme-dark",label: "Switch to dark mode",keywords: "theme appearance",- icon: <MoonIcon className="h-3 w-3 text-gray-11" />,+ icon: <MoonIcon size={12} className="text-muted-foreground" />,action: "toggle-theme",onRun: () => setTheme("dark"),});@@ -348,7 +347,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "switch-theme-system",label: "Switch to system theme",keywords: "theme appearance auto",- icon: <DesktopIcon className="h-3 w-3 text-gray-11" />,+ icon: <DesktopIcon size={12} className="text-muted-foreground" />,action: "toggle-theme",onRun: () => setTheme("system"),});@@ -361,7 +360,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {{id: "home",label: "Home",- icon: <HomeIcon className="h-3 w-3 text-gray-11" />,+ icon: <HouseIcon size={12} className="text-muted-foreground" />,action: "home",onRun: () => {closeSettingsDialog();@@ -371,7 +370,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {{id: "settings",label: "Settings",- icon: <GearIcon className="h-3 w-3 text-gray-11" />,+ icon: <GearIcon size={12} className="text-muted-foreground" />,action: "settings",shortcut: SHORTCUTS.SETTINGS,onRun: () => openSettingsDialog(),@@ -382,7 +381,12 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "inbox",label: "Self-driving",keywords: "reports pull requests agents notifications",- icon: <EnvelopeSimple size={12} className="text-gray-11" />,+ icon: (+ <EnvelopeSimpleIcon+ size={12}+ className="text-muted-foreground"+ />+ ),action: "open-inbox",shortcut: SHORTCUTS.INBOX,onRun: () => {@@ -396,7 +400,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "archived",label: "Archived",keywords: "archive archived tasks",- icon: <ArchiveIcon size={12} className="text-gray-11" />,+ icon: <ArchiveIcon size={12} className="text-muted-foreground" />,action: "open-archived",onRun: () => {closeSettingsDialog();@@ -407,7 +411,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "command-center",label: "Command center",keywords: "grid tasks parallel dashboard",- icon: <SquaresFourIcon className="h-3 w-3 text-gray-11" />,+ icon: <SquaresFourIcon size={12} className="text-muted-foreground" />,action: "open-command-center",onRun: () => {closeSettingsDialog();@@ -420,7 +424,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "loops",label: "Loops",keywords: "automations schedules recurring",- icon: <LoopIcon size={12} className="text-gray-11" />,+ icon: <LoopIcon size={12} className="text-muted-foreground" />,action: "open-loops" as CommandMenuAction,onRun: () => {closeSettingsDialog();@@ -433,7 +437,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "cost-management",label: "Cost management",keywords: "cost spend limits budget savings recommendations",- icon: <Gauge size={12} className="text-gray-11" />,+ icon: <GaugeIcon size={12} className="text-muted-foreground" />,action: "open-cost-management" as CommandMenuAction,onRun: () => openSettingsDialog("cost-management"),},@@ -441,7 +445,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "plan-usage",label: "Plan & usage",keywords: "billing spend cost credits usage plan",- icon: <ChartLine size={12} className="text-gray-11" />,+ icon: <ChartLineIcon size={12} className="text-muted-foreground" />,action: "open-usage",onRun: () => openSettingsDialog("plan-usage"),},@@ -449,7 +453,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "go-back",label: "Go back",keywords: "navigate history previous",- icon: <CaretLeftIcon size={12} className="text-gray-11" />,+ icon: <CaretLeftIcon size={12} className="text-muted-foreground" />,action: "go-back",shortcut: SHORTCUTS.GO_BACK,onRun: goBackInHistory,@@ -458,7 +462,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "go-forward",label: "Go forward",keywords: "navigate history next",- icon: <CaretRightIcon size={12} className="text-gray-11" />,+ icon: <CaretRightIcon size={12} className="text-muted-foreground" />,action: "go-forward",shortcut: SHORTCUTS.GO_FORWARD,onRun: goForwardInHistory,@@ -470,7 +474,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "new-task",label: "New task",keywords: "create",- icon: <FileTextIcon className="h-3 w-3 text-gray-11" />,+ icon: <FileTextIcon size={12} className="text-muted-foreground" />,action: "new-task",shortcut: SHORTCUTS.NEW_TASK,onRun: () => {@@ -485,9 +489,9 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {label: spacesLayout ? "New space" : "New channel",keywords: "create add space channel context",icon: spacesLayout ? (- <CubeIcon size={12} className="text-gray-11" />+ <CubeIcon size={12} className="text-muted-foreground" />) : (- <HashIcon size={12} className="text-gray-11" />+ <HashIcon size={12} className="text-muted-foreground" />),action: "create-channel" as CommandMenuAction,onRun: () => {@@ -501,7 +505,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {{id: "toggle-left-sidebar",label: "Toggle left sidebar",- icon: <ViewVerticalIcon className="h-3 w-3 text-gray-11" />,+ icon: <SidebarSimpleIcon size={12} className="text-muted-foreground" />,action: "toggle-left-sidebar",shortcut: SHORTCUTS.TOGGLE_LEFT_SIDEBAR,onRun: toggleLeftSidebar,@@ -511,7 +515,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {{id: "open-review-panel",label: "Open diff view",- icon: <GitDiffIcon className="h-3 w-3 text-gray-11" />,+ icon: <GitDiffIcon size={12} className="text-muted-foreground" />,action: "open-review-panel" as CommandMenuAction,shortcut: SHORTCUTS.TOGGLE_REVIEW_PANEL,onRun: openReviewPanel,@@ -524,7 +528,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "archive-task",label: "Archive task",keywords: "archive close remove",- icon: <ArchiveIcon size={12} className="text-gray-11" />,+ icon: <ArchiveIcon size={12} className="text-muted-foreground" />,action: "archive-task" as CommandMenuAction,shortcut: SHORTCUTS.ARCHIVE_TASK,onRun: requestArchive,@@ -540,7 +544,9 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "search-files",label: "Search files",keywords: "file find open",- icon: <MagnifyingGlassIcon className="h-3 w-3 text-gray-11" />,+ icon: (+ <MagnifyingGlassIcon size={12} className="text-muted-foreground" />+ ),action: "search-files",onRun: openFilePicker,});@@ -551,7 +557,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "show-log-folder",label: "Show log folder",keywords: "logs debug files finder",- icon: <FileTextIcon className="h-3 w-3 text-gray-11" />,+ icon: <FileTextIcon size={12} className="text-muted-foreground" />,action: "show-log-folder",onRun: showLogFolder,},@@ -559,7 +565,9 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "reload-window",label: "Reload window",keywords: "refresh restart",- icon: <ReloadIcon className="h-3 w-3 text-gray-11" />,+ icon: (+ <ArrowClockwiseIcon size={12} className="text-muted-foreground" />+ ),action: "reload-window",shortcut: SHORTCUTS.RELOAD_WINDOW,onRun: () => window.location.reload(),@@ -571,7 +579,12 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "zoom-in",label: "Zoom in",keywords: "zoom increase larger",- icon: <ZoomInIcon className="h-3 w-3 text-gray-11" />,+ icon: (+ <MagnifyingGlassPlusIcon+ size={12}+ className="text-muted-foreground"+ />+ ),action: "zoom-in",shortcut: SHORTCUTS.ZOOM_IN,onRun: () =>@@ -583,7 +596,12 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "zoom-out",label: "Zoom out",keywords: "zoom decrease smaller",- icon: <ZoomOutIcon className="h-3 w-3 text-gray-11" />,+ icon: (+ <MagnifyingGlassMinusIcon+ size={12}+ className="text-muted-foreground"+ />+ ),action: "zoom-out",shortcut: SHORTCUTS.ZOOM_OUT,onRun: () =>@@ -595,7 +613,9 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: "zoom-reset",label: "Reset zoom",keywords: "zoom actual size default",- icon: <MagnifyingGlassIcon className="h-3 w-3 text-gray-11" />,+ icon: (+ <MagnifyingGlassIcon size={12} className="text-muted-foreground" />+ ),action: "zoom-reset",shortcut: SHORTCUTS.RESET_ZOOM,onRun: () =>@@ -619,7 +639,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {id: `new-task-folder-${folder.id}`,label: `New task in ${folder.name}`,keywords: folder.path,- icon: <FileTextIcon className="h-3 w-3 text-gray-11" />,+ icon: <FileTextIcon size={12} className="text-muted-foreground" />,action: "new-task",onRun: () => {closeSettingsDialog();@@ -671,7 +691,17 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {return {id: `task-${task.id}`,label: task.title,- detail: channel?.name,+ // Under the spaces layout a session wears the same row everywhere:+ // status dot, title, and a second line saying where it lives. The+ // legacy layout keeps the trailing `#channel`.+ detail: spacesLayout ? undefined : channel?.name,+ subtitle: spacesLayout+ ? sessionSubtitle({+ space: channel?.name,+ repository: task.repository,+ createdAt: task.created_at,+ })+ : undefined,// Include the channel name so searching it surfaces filed tasks.keywords: channel?.name,icon: <TaskCommandIcon task={task} />,@@ -700,6 +730,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {provisioningTaskIds,channels,bluebirdEnabled,+ spacesLayout,closeSettingsDialog,]);@@ -957,8 +988,8 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {spacesLayout? cn("[&_input]:whitespace-pre [&_input]:font-mono [&_input]:text-[13px] [&_input]:tracking-normal",- "[&_input]:text-transparent [&_input]:caret-(--gray-12) [&_input]:placeholder:text-(--gray-9)",- "[&_input]:selection:bg-(--blue-a4) [&_input]:selection:text-transparent",+ "[&_input]:text-transparent [&_input]:caret-foreground [&_input]:placeholder:text-subtle-foreground",+ "[&_input]:selection:bg-primary/25 [&_input]:selection:text-transparent",): undefined}@@ -976,7 +1007,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {/>)}{showMatchSummary ? (- <div className="border-(--gray-a4) border-b px-3 py-1.5 text-(--gray-9) text-xs tabular-nums">+ <div className="border-border border-b px-3 py-1.5 text-subtle-foreground text-xs tabular-nums">{partialResults? "Some matching tasks may not be shown.": matchSummary(matchCount, shownCount, hasRepairs)}@@ -1008,13 +1039,13 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {<span className="wrap-break-word min-w-0 whitespace-normal">{cmd.label}{cmd.subtitle && (- <span className="block truncate text-gray-9 text-xs">+ <span className="block truncate text-muted-foreground text-xs">{cmd.subtitle}</span>)}</span>{cmd.detail && (- <span className="shrink-0 text-gray-9">+ <span className="shrink-0 text-muted-foreground">· {cmd.detailPrefix ?? "#"}{cmd.detail}</span>diff --git a/products/desktop/packages/ui/src/features/command/PaletteFilterChips.tsx b/products/desktop/packages/ui/src/features/command/PaletteFilterChips.tsxindex 2d6993853c0f..a1df9a0e408d 100644--- a/products/desktop/packages/ui/src/features/command/PaletteFilterChips.tsx+++ b/products/desktop/packages/ui/src/features/command/PaletteFilterChips.tsx@@ -18,11 +18,11 @@ export function PaletteFilterChips({return (<divclassName={cn(- "flex gap-1.5 border-(--gray-a4) border-b px-3 py-1.5",+ "flex gap-1.5 border-border border-b px-3 py-1.5",open ? "flex-wrap items-start" : "items-center",)}>- <span className="shrink-0 select-none py-1 text-(--gray-9) text-[11px]">+ <span className="shrink-0 select-none py-1 text-[11px] text-subtle-foreground">Filter by</span>{visible.map((chip) => (@@ -30,20 +30,20 @@ export function PaletteFilterChips({key={chip.label}type="button"className={cn(- "flex h-[22px] shrink-0 items-center rounded-md border border-(--gray-a6) bg-(--gray-a2) px-2",+ "flex h-[22px] shrink-0 items-center rounded-md border border-border bg-fill-hover px-2","text-[11.5px]",- "hover:border-(--gray-a8) hover:bg-(--gray-a4)",- "focus-visible:-outline-offset-1 focus-visible:outline focus-visible:outline-(--focus-8) focus-visible:outline-2",+ "hover:bg-fill-selected",+ "focus-visible:-outline-offset-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring",)}onMouseDown={(e) => e.preventDefault()}onClick={chip.apply}><span className="flex items-baseline gap-1.5 leading-none">- <span className="font-mono text-(--blue-11) text-[11px]">+ <span className="font-mono text-[11px] text-primary">{chip.label}</span>{open && chip.hint && (- <span className="text-(--gray-9)">{chip.hint}</span>+ <span className="text-subtle-foreground">{chip.hint}</span>)}</span></button>@@ -52,9 +52,9 @@ export function PaletteFilterChips({<buttontype="button"className={cn(- "h-[22px] shrink-0 rounded-md px-2 text-(--gray-11) text-[11.5px] leading-none",- "hover:bg-(--gray-a3) hover:text-(--gray-12)",- "focus-visible:-outline-offset-1 focus-visible:outline focus-visible:outline-(--focus-8) focus-visible:outline-2",+ "h-[22px] shrink-0 rounded-md px-2 text-[11.5px] text-muted-foreground leading-none",+ "hover:bg-fill-hover hover:text-foreground",+ "focus-visible:-outline-offset-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring",)}onMouseDown={(e) => e.preventDefault()}onClick={() => setExpanded((value) => !value)}diff --git a/products/desktop/packages/ui/src/features/command/TaskCommandIcon.tsx b/products/desktop/packages/ui/src/features/command/TaskCommandIcon.tsxindex 1c1a51bf8bb8..f660e6976e9f 100644--- a/products/desktop/packages/ui/src/features/command/TaskCommandIcon.tsx+++ b/products/desktop/packages/ui/src/features/command/TaskCommandIcon.tsx@@ -1,13 +1,44 @@import type { Task } from "@posthog/shared/domain-types";+import { useChannelsLayout } from "@posthog/ui/features/canvas/hooks/useChannelsLayout";+import { useTaskStatusInput } from "@posthog/ui/features/canvas/hooks/useChannelTaskStatus";import { TaskIcon } from "@posthog/ui/features/sidebar/components/items/TaskIcon";+import { TaskDotMark } from "@posthog/ui/features/sidebar/components/items/TaskStatusDot";+import { taskDot } from "@posthog/ui/features/sidebar/components/items/taskStatusVocabulary";import { useTaskPrStatus } from "@posthog/ui/features/sidebar/useTaskPrStatus";/**- * Task icon for the command palette. Renders the same shared `TaskIcon` as- * the sidebar, including cloud run and PR/branch status, while deriving its- * inputs from the raw task and a per-task PR-status query.+ * The leading mark on a session row in the command palette.+ *+ * Under the spaces layout it is the space tree's status dot, so a session reads+ * the same wherever it is listed. The legacy layout keeps the older combined+ * icon, which is what the Code sidebar still shows beside it.*/export function TaskCommandIcon({ task }: { task: Task }) {+ const spacesLayout = useChannelsLayout();+ return spacesLayout ? (+ <SessionDot task={task} />+ ) : (+ <TaskRunIcon task={task} />+ );+}++/**+ * Dot only, no tooltip: the palette is walked with the keyboard, and a popup+ * that follows the highlight down the list is in the way of reading it.+ *+ * No PR lookup either — that is a host round trip per row, and an empty query+ * lists a screenful of sessions.+ */+function SessionDot({ task }: { task: Task }) {+ const status = useTaskStatusInput(task, { withPrStatus: false });+ return <TaskDotMark dot={taskDot(status ?? {})} />;+}++/**+ * The same shared `TaskIcon` as the sidebar, including cloud run and PR/branch+ * status, deriving its inputs from the raw task and a per-task PR-status query.+ */+function TaskRunIcon({ task }: { task: Task }) {const { prState, hasDiff } = useTaskPrStatus({id: task.id,cloudPrUrl: null,diff --git a/products/desktop/packages/ui/src/features/command/sessionSubtitle.test.ts b/products/desktop/packages/ui/src/features/command/sessionSubtitle.test.tsnew file mode 100644index 000000000000..15a79d773d7d--- /dev/null+++ b/products/desktop/packages/ui/src/features/command/sessionSubtitle.test.ts@@ -0,0 +1,33 @@+import { describe, expect, it } from "vitest";+import { sessionSubtitle } from "./sessionSubtitle";++describe("sessionSubtitle", () => {+ it.each([+ {+ name: "names the space without a hash",+ input: { space: "access-control", createdAt: null },+ expected: "access-control",+ },+ {+ name: "calls the private space what a reader sees",+ input: { space: "me", createdAt: null },+ expected: "personal",+ },+ {+ name: "orders repository, space, then age",+ input: {+ space: "access-control",+ repository: "example-org/webapp",+ createdAt: new Date(Date.now() - 60_000).toISOString(),+ },+ expected: "example-org/webapp · access-control · 1m",+ },+ {+ name: "says nothing when there is nothing to say",+ input: { space: null, repository: null, createdAt: null },+ expected: undefined,+ },+ ])("$name", ({ input, expected }) => {+ expect(sessionSubtitle(input)).toBe(expected);+ });+});diff --git a/products/desktop/packages/ui/src/features/command/sessionSubtitle.ts b/products/desktop/packages/ui/src/features/command/sessionSubtitle.tsnew file mode 100644index 000000000000..ad4af8cd258e--- /dev/null+++ b/products/desktop/packages/ui/src/features/command/sessionSubtitle.ts@@ -0,0 +1,23 @@+import { channelDisplayName } from "@posthog/core/canvas/channelName";+import { formatRelativeTimeShort } from "@posthog/shared";++/**+ * The muted second line under a session's title in the command palette: where+ * it lives and how long ago it started.+ *+ * The space carries no `#`. The spaces layout dropped that mark everywhere else+ * it names a space, and a lone hash in this one list reads as a different kind+ * of thing.+ */+export function sessionSubtitle(input: {+ space?: string | null;+ repository?: string | null;+ createdAt?: string | null;+}): string | undefined {+ const parts = [+ input.repository ?? undefined,+ input.space ? channelDisplayName(input.space) : undefined,+ input.createdAt ? formatRelativeTimeShort(input.createdAt) : undefined,+ ].filter(Boolean);+ return parts.length > 0 ? parts.join(" · ") : undefined;+}diff --git a/products/desktop/packages/ui/src/features/command/useFeedQueryCommands.tsx b/products/desktop/packages/ui/src/features/command/useFeedQueryCommands.tsxindex 906df19235f8..54230e233c35 100644--- a/products/desktop/packages/ui/src/features/command/useFeedQueryCommands.tsx+++ b/products/desktop/packages/ui/src/features/command/useFeedQueryCommands.tsx@@ -4,12 +4,12 @@ import {parseFeedQuery,type TypeValue,} from "@posthog/core/tasks/feedQuery";-import { formatRelativeTimeShort } from "@posthog/shared";import { useFeedQuerySuggestions } from "@posthog/ui/features/canvas/components/feedQuerySuggestions";import { applyFeedQuerySuggestion } from "@posthog/ui/features/canvas/components/feedQuerySuggestionUtils";import { useChannels } from "@posthog/ui/features/canvas/hooks/useChannels";import { useProjectTaskFeeds } from "@posthog/ui/features/canvas/hooks/useProjectTaskFeeds";import { useTaskFeedResults } from "@posthog/ui/features/canvas/hooks/useTaskFeedResults";+import { sessionSubtitle } from "@posthog/ui/features/command/sessionSubtitle";import { TaskCommandIcon } from "@posthog/ui/features/command/TaskCommandIcon";import type {Command,@@ -214,7 +214,9 @@ export function useFeedQueryCommands({detail: feed.query,detailPrefix: "",keywords: `${query} ${searchText} ${feed.name}`,- icon: <ArrowRightIcon size={12} className="text-gray-11" />,+ icon: (+ <ArrowRightIcon size={12} className="text-muted-foreground" />+ ),action: "open-feed",onRun: () => {closeSettings();@@ -232,14 +234,11 @@ export function useFeedQueryCommands({const shown = runsQuery ? results.tasks.slice(0, limit) : [];if (shown.length > 0) {const items = shown.map((task): Command => {- const space = task.channel ? channelNames.get(task.channel) : undefined;- const subtitle = [- task.repository ?? undefined,- space ? `#${space}` : undefined,- formatRelativeTimeShort(task.created_at),- ]- .filter(Boolean)- .join(" · ");+ const subtitle = sessionSubtitle({+ space: task.channel ? channelNames.get(task.channel) : undefined,+ repository: task.repository,+ createdAt: task.created_at,+ });return {id: `feed-query-task-${task.id}`,label: task.title,@@ -261,7 +260,9 @@ export function useFeedQueryCommands({items.push({id: "feed-query-show-all",label: `Show all ${matchCount} matches`,- icon: <MagnifyingGlassIcon size={12} className="text-gray-11" />,+ icon: (+ <MagnifyingGlassIcon size={12} className="text-muted-foreground" />+ ),action: "show-all-matches",keepOpen: true,onRun: onShowAll,@@ -285,7 +286,9 @@ export function useFeedQueryCommands({label,detail: `${count} ${count === 1 ? "task" : "tasks"}`,detailPrefix: "",- icon: <MagnifyingGlassIcon size={12} className="text-gray-11" />,+ icon: (+ <MagnifyingGlassIcon size={12} className="text-muted-foreground" />+ ),action: "repair-query",keepOpen: true,onRun: () => onApply(`${next} `, next.length + 1),diff --git a/products/desktop/packages/ui/src/features/command/useSearchSections.tsx b/products/desktop/packages/ui/src/features/command/useSearchSections.tsxindex 090d4239d605..4ae5c899361f 100644--- a/products/desktop/packages/ui/src/features/command/useSearchSections.tsx+++ b/products/desktop/packages/ui/src/features/command/useSearchSections.tsx@@ -1,4 +1,4 @@-import { GitDiffIcon } from "@phosphor-icons/react";+import { FileTextIcon, GitDiffIcon } from "@phosphor-icons/react";import { channelDisplayName } from "@posthog/core/canvas/channelName";import type { CommandMenuAction } from "@posthog/shared/analytics-events";import type { Task, TaskSearchResult } from "@posthog/shared/domain-types";@@ -10,7 +10,6 @@ import {navigateToTaskDetail,} from "@posthog/ui/router/navigationBridge";import { openTask } from "@posthog/ui/router/useOpenTask";-import { FileTextIcon } from "@radix-ui/react-icons";import { type ReactNode, useMemo } from "react";export type Command = {@@ -93,12 +92,15 @@ export function useSearchSections({items.push({id: `search-${result.id}`,label: title,- detail: result.subtitle || undefined,+ // Under the spaces layout a session's context goes on a second line, so+ // a long title truncates its own text rather than eating the context.+ detail: spacesLayout ? undefined : result.subtitle || undefined,+ subtitle: spacesLayout ? result.subtitle || undefined : undefined,detailPrefix: "",keywords: `${remoteQuery} ${result.subtitle} ${Object.values(result.metadata).join(" ")}`,icon:result.kind === "pull_request" ? (- <GitDiffIcon size={12} className="text-gray-11" />+ <GitDiffIcon size={12} className="text-muted-foreground" />) : result.kind === "channel" ? (channelGlyph(title, {size: 12,@@ -106,7 +108,7 @@ export function useSearchSections({className: "text-muted-foreground",})) : (- <FileTextIcon className="h-3 w-3 text-gray-11" />+ <FileTextIcon size={12} className="text-muted-foreground" />),action: (result.kind === "channel"? "open-channel"