: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
onboarding tweaks (#92809)
Adam Bowkerb9f440fb8811
diff --git a/products/canvas/backend/teaching.py b/products/canvas/backend/teaching.pyindex 9e87572a08ce..9174ad0aec88 100644--- a/products/canvas/backend/teaching.py+++ b/products/canvas/backend/teaching.py@@ -21,7 +21,7 @@ from products.canvas.backend.models import Canvasfrom products.canvas.backend.source import synthetic_source_projectTEACHING_CANVAS_TEMPLATE_ID = "desktop-onboarding-teaching"-TEACHING_CANVAS_NAME = "Start here"+TEACHING_CANVAS_NAME = "Explore PostHog Desktop"# Template ids the create API refuses, so a user-created canvas can never be# mistaken for (or pre-claim and suppress) a PostHog-seeded one.@@ -274,7 +274,7 @@ function HomeView({ onOpen, seen, seenCount, allSeen }) {<div className="flex items-start justify-between gap-3"><div className="flex flex-col gap-1.5"><Heading size="2xl" render={<h1 />}>- How PostHog Desktop works+ Explore PostHog Desktop</Heading><Text variant="muted">A quick tour in five stops. Pick one.</Text></div>@@ -403,7 +403,7 @@ function DetailView({ topic, index, next, seen, onBack, onNext }) {);}-export default function StartHere() {+export default function ExploreDesktop() {const [topicId, setTopicId] = useState(null);const [seen, setSeen] = useState(null);useEffect(() => {diff --git a/products/desktop/packages/agent/src/adapters/local-tools/tools/show-actions.ts b/products/desktop/packages/agent/src/adapters/local-tools/tools/show-actions.tsindex 63f26a526b7f..894e59df56c5 100644--- a/products/desktop/packages/agent/src/adapters/local-tools/tools/show-actions.ts+++ b/products/desktop/packages/agent/src/adapters/local-tools/tools/show-actions.ts@@ -26,7 +26,10 @@ const SHOW_ACTIONS_TOOL_DESCRIPTION ="on its own. Pass `report_id` to open one report instead of the whole inbox. " +"Offer only what the person actually wants to do next, in the order they " +"would want it. Buttons that decorate an answer are noise, so skip the call " +- "entirely when there is nothing worth clicking.";+ "entirely when there is nothing worth clicking. " ++ "The buttons are drawn where you call the tool, so write the text they " ++ "follow from first and call this after it. Calling it before the text puts " ++ "the buttons above the message that explains them.";/*** Offers the user buttons; it does not press them. The handler onlydiff --git a/products/desktop/packages/ui/src/features/onboarding/components/ConnectGitHubStep.tsx b/products/desktop/packages/ui/src/features/onboarding/components/ConnectGitHubStep.tsxindex 096501fc8a03..ae49b824b538 100644--- a/products/desktop/packages/ui/src/features/onboarding/components/ConnectGitHubStep.tsx+++ b/products/desktop/packages/ui/src/features/onboarding/components/ConnectGitHubStep.tsx@@ -66,13 +66,13 @@ export function ConnectGitHubStep({ onNext, onBack }: ConnectGitHubStepProps) {<Flex direction="column" gap="2"><Flex align="center" gap="2"><Text className="font-bold text-(--gray-12) text-2xl">- Connect GitHub+ Connect your codebase</Text><OptionalBadge /></Flex><Text className="text-(--gray-11) text-sm">- Allows agents to run tasks in the cloud, push branches, and- open pull requests.+ Code access helps us understand your product, and helps you+ build.</Text></Flex></motion.div>diff --git a/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsx b/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsxindex d85d579eab03..0348a7c29586 100644--- a/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsx+++ b/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatThread.tsx@@ -103,6 +103,7 @@ import { extractCustomInstructions } from "@posthog/ui/features/sessions/componeimport {extractOnboardingBrief,ONBOARDING_BRIEF_LABEL,+ ONBOARDING_BRIEF_TOOLTIP,} from "@posthog/ui/features/sessions/components/session-update/onboardingBrief";import {hasFileMentions,@@ -626,8 +627,9 @@ function UserBubble({)}{onboardingBrief && (<MentionChip- icon={<FileText size={12} />}+ icon={<Robot size={12} />}label={ONBOARDING_BRIEF_LABEL}+ tooltip={ONBOARDING_BRIEF_TOOLTIP}/>)}{showChannelContextTag && channelContext && (diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.stories.tsx b/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.stories.tsxnew file mode 100644index 000000000000..294bf5e81f14--- /dev/null+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.stories.tsx@@ -0,0 +1,38 @@+import { UserMessage } from "@posthog/ui/features/sessions/components/session-update/UserMessage";+import type { Meta, StoryObj } from "@storybook/react-vite";++const meta: Meta<typeof UserMessage> = {+ title: "Features/Sessions/UserMessage",+ component: UserMessage,+ decorators: [+ (Story) => (+ <div className="max-w-2xl p-6">+ <Story />+ </div>+ ),+ ],+};++export default meta;+type Story = StoryObj<typeof UserMessage>;++const FIXED_TIMESTAMP = Date.parse("2026-07-01T10:30:00Z");++export const Typed: Story = {+ args: {+ content: "What are our top errors this week?",+ timestamp: FIXED_TIMESTAMP,+ animate: false,+ },+};++// The first-run session's whole prompt is an <onboarding_brief> block, so the bubble strips to+// nothing and the chip is all the reader has while the agent's first turn streams.+export const OnboardingBrief: Story = {+ args: {+ content:+ "<onboarding_brief>\nWrite the first message someone sees in PostHog Desktop.\n</onboarding_brief>",+ timestamp: FIXED_TIMESTAMP,+ animate: false,+ },+};diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.tsx b/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.tsxindex 1f3267937395..b4feeb94f424 100644--- a/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.tsx+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/UserMessage.tsx@@ -24,6 +24,7 @@ import { extractCustomInstructions } from "./customInstructions";import {extractOnboardingBrief,ONBOARDING_BRIEF_LABEL,+ ONBOARDING_BRIEF_TOOLTIP,} from "./onboardingBrief";import {hasFileMentions,@@ -179,8 +180,9 @@ export const UserMessage = memo(function UserMessage({)}{onboardingBrief && (<MentionChip- icon={<FileText size={12} />}+ icon={<Robot size={12} />}label={ONBOARDING_BRIEF_LABEL}+ tooltip={ONBOARDING_BRIEF_TOOLTIP}/>)}{showChannelContextTag && channelContext && (diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/onboardingBrief.ts b/products/desktop/packages/ui/src/features/sessions/components/session-update/onboardingBrief.tsindex c90594aa9be0..505f8456784b 100644--- a/products/desktop/packages/ui/src/features/sessions/components/session-update/onboardingBrief.ts+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/onboardingBrief.ts@@ -7,6 +7,9 @@ const ONBOARDING_BRIEF_REGEX =export const ONBOARDING_BRIEF_LABEL = "Getting started with PostHog Desktop";+export const ONBOARDING_BRIEF_TOOLTIP =+ "The agent is looking over your project to help set up the PostHog Desktop experience.";+export function extractOnboardingBrief(content: string,): { stripped: string } | null {diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/parseFileMentions.tsx b/products/desktop/packages/ui/src/features/sessions/components/session-update/parseFileMentions.tsxindex 2d32bf34de60..a32c82b70696 100644--- a/products/desktop/packages/ui/src/features/sessions/components/session-update/parseFileMentions.tsx+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/parseFileMentions.tsx@@ -1,4 +1,5 @@import { File, Folder, Warning } from "@phosphor-icons/react";+import { Tooltip, TooltipContent, TooltipTrigger } from "@posthog/quill";import { unescapeXmlAttr } from "@posthog/shared";import { Text } from "@radix-ui/themes";import type { ReactNode } from "react";@@ -54,10 +55,12 @@ export function MentionChip({icon,label,onClick,+ tooltip,}: {icon: ReactNode;label: string;onClick?: () => void;+ tooltip?: string;}) {const style = { margin: "0 2px" };@@ -68,24 +71,34 @@ export function MentionChip({</>);- if (onClick) {- return (- <button- type="button"- className={`${chipClass} cursor-pointer border-none text-[13px]`}- onClick={onClick}- style={style}- >- {content}- </button>- );- }-- return (- <span className={`${chipClass} text-[13px]`} style={style}>+ const chip = onClick ? (+ <button+ type="button"+ className={`${chipClass} cursor-pointer border-none text-[13px]`}+ onClick={onClick}+ style={style}+ >+ {content}+ </button>+ ) : (+ <span+ className={`${chipClass} text-[13px]`}+ style={style}+ // A span takes no focus of its own, so a keyboard reader would never+ // reach the tooltip that carries the chip's only explanation.+ tabIndex={tooltip ? 0 : undefined}+ >{content}</span>);++ if (!tooltip) return chip;+ return (+ <Tooltip>+ <TooltipTrigger render={chip} />+ <TooltipContent className="max-w-64">{tooltip}</TooltipContent>+ </Tooltip>+ );}function parseMentionTags(content: string): ReactNode[] {diff --git a/products/desktop/packages/ui/src/features/settings/sections/OnboardingTestToolsDialog.tsx b/products/desktop/packages/ui/src/features/settings/sections/OnboardingTestToolsDialog.tsxindex d2c3a81348fc..7fc4b16274da 100644--- a/products/desktop/packages/ui/src/features/settings/sections/OnboardingTestToolsDialog.tsx+++ b/products/desktop/packages/ui/src/features/settings/sections/OnboardingTestToolsDialog.tsx@@ -67,7 +67,7 @@ interface Draft {const DEFAULT_DRAFT: Draft = {joining: false,companyDomain: "posthog.com",- otherMembers: "Max, Lotte",+ otherMembers: "Max, Lottie",situation: "nothing-connected",sourcesWatching: "errors, conversion drops",};@@ -233,7 +233,7 @@ export function OnboardingTestToolsDialog({</QuestionnaireDescription><TextAnswerlabel="People already in the workspace"- placeholder="Max, Lotte"+ placeholder="Max, Lottie"value={draft.otherMembers}onValueChange={(otherMembers) => patch({ otherMembers })}/>diff --git a/products/tasks/backend/facade/onboarding_brief.py b/products/tasks/backend/facade/onboarding_brief.pyindex f455a3088a4d..ea8faab8458c 100644--- a/products/tasks/backend/facade/onboarding_brief.py+++ b/products/tasks/backend/facade/onboarding_brief.py@@ -178,7 +178,8 @@ def self_driving_line(reports: Sequence[InboxReportSummary]) -> str:line = ("Findings land in Self-driving, their inbox in the sidebar. When one comes up, offer a ""`show_actions` `open_inbox` button rather than describing where to look. That button "- "opens Self-driving on its own, or one report when you pass `report_id`."+ "opens Self-driving on its own, or one report when you pass `report_id`. Write what you "+ "have to say first, then call `show_actions`, so the button sits under the text.")if not reports:return line@@ -198,8 +199,9 @@ def teaching_canvas_line(teaching: TeachingCanvas) -> str:return (f'A canvas named "{TEACHING_CANVAS_NAME}" is pinned in this space: a short tour of how '"the app works, and itself an example of a canvas. At a natural moment after your first "- "message, mention it in one sentence and offer it with a `show_actions` `open_canvas` "- f"button (channel_id `{teaching.channel_id}`, canvas_id `{teaching.canvas_id}`). "+ "message, mention it in one sentence, then offer it with a `show_actions` `open_canvas` "+ f"button (channel_id `{teaching.channel_id}`, canvas_id `{teaching.canvas_id}`). Write "+ "the sentence before you make the call, so the button sits under it rather than above. ""You did not make it, so never claim it as your work.")diff --git a/products/tasks/backend/facade/onboarding_prompt.py b/products/tasks/backend/facade/onboarding_prompt.pyindex 41a38533ded8..c35fc31066e3 100644--- a/products/tasks/backend/facade/onboarding_prompt.py+++ b/products/tasks/backend/facade/onboarding_prompt.py@@ -120,7 +120,7 @@ Use the canonical `posthog:exec` tool for every PostHog operation. Follow its buFor questions about PostHog products, features, settings, SDKs, limits, how-to guidance, or pricing, use `docs-search` before answering. Ground your answer in what it returns, not in your memory.-`show_actions` is how anything else gets done. When the next step is outside what you can reach, or points at something already in the workspace, offer the button rather than only describing the destination. Anything touching their code is a `compose` button with a prompt you write.+`show_actions` is how anything else gets done. When the next step is outside what you can reach, or points at something already in the workspace, offer the button rather than only describing the destination. Anything touching their code is a `compose` button with a prompt you write. Buttons are drawn where you call the tool, so always write the text they explain first and call `show_actions` after it. A call that comes before the text puts the buttons above it, where they read as arriving out of nowhere.A `compose` button opens the composer filled in; it does not send. It is an offer they still have to accept, so nothing is underway until they do.