: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
feat(desktop): delete legacy ad-hoc announcement surfaces (#78886)
Adam Bowkera5a9809b4129
diff --git a/products/desktop/packages/api-client/src/posthog-client.ts b/products/desktop/packages/api-client/src/posthog-client.tsindex af235a8fb0ae..7ccda6971e06 100644--- a/products/desktop/packages/api-client/src/posthog-client.ts+++ b/products/desktop/packages/api-client/src/posthog-client.ts@@ -422,26 +422,6 @@ export interface ScoutConfig {created_at: string;}-/** A team's enforced scout run caps and current usage, as dispatch applies them. */-export interface ScoutLimits {- max_runs_per_tick: number;- /** Null when the daily budget is uncapped. */- max_runs_per_day: number | null;- runs_today: number;- /** Null when the daily budget is uncapped. */- runs_remaining_today: number | null;-}--/**- * Team-scoped scout metadata from the `signals-scout` flag: enrollment, an optional- * announcement banner, and the enforced run limits. `banner_message` is null when unset.- */-export interface ScoutMetadata {- enrolled: boolean;- banner_message: string | null;- limits: ScoutLimits;-}-export interface ScoutRun {run_id: string;skill_name: string;@@ -1885,10 +1865,6 @@ export class PostHogAPIClient {return Array.isArray(data) ? data : (data.results ?? []);}- async getScoutMetadata(projectId: number): Promise<ScoutMetadata> {- return this.scoutGet<ScoutMetadata>(projectId, "metadata/current/");- }-async updateScoutConfig(projectId: number,configId: string,diff --git a/products/desktop/packages/shared/src/analytics-events.ts b/products/desktop/packages/shared/src/analytics-events.tsindex b44cce817225..0a1ea8fff99e 100644--- a/products/desktop/packages/shared/src/analytics-events.ts+++ b/products/desktop/packages/shared/src/analytics-events.ts@@ -1101,11 +1101,6 @@ export interface CloudTaskUsageBlockedProperties {is_pro: boolean;}-export interface UsageBillingAnnouncementAcknowledgedProperties {- /** Stamps the acknowledgment on the person for support auditability. */- $set: { code_usage_billing_acknowledged_at: string };-}-// Claude Code session import events/** Where in the new-task suggestions the import was launched from. */export type ClaudeSessionImportSource = "inline_card" | "picker_dialog";@@ -1431,8 +1426,6 @@ export const ANALYTICS_EVENTS = {UPGRADE_PROMPT_SHOWN: "Upgrade prompt shown",UPGRADE_PROMPT_CLICKED: "Upgrade prompt clicked",CLOUD_TASK_USAGE_BLOCKED: "Cloud task usage blocked",- USAGE_BILLING_ANNOUNCEMENT_ACKNOWLEDGED:- "Usage billing announcement acknowledged",// Project Bluebird (Channels) eventsCHANNELS_SPACE_VIEWED: "Channels space viewed",@@ -1445,11 +1438,6 @@ export const ANALYTICS_EVENTS = {AUTORESEARCH_ARMED: "Autoresearch armed",AUTORESEARCH_RUN_STARTED: "Autoresearch run started",- // Loops promo events- LOOPS_PROMO_OPENED: "Loops promo opened",- LOOPS_PROMO_DISMISSED: "Loops promo dismissed",- LOOPS_PROMO_LEARN_MORE_CLICKED: "Loops promo learn more clicked",-// Loops eventsLOOP_LIST_VIEWED: "Loop list viewed",LOOP_VIEWED: "Loop viewed",@@ -1610,7 +1598,6 @@ export type EventPropertyMap = {// Subscription events[ANALYTICS_EVENTS.UPGRADE_PROMPT_SHOWN]: UpgradePromptShownProperties;[ANALYTICS_EVENTS.UPGRADE_PROMPT_CLICKED]: UpgradePromptClickedProperties;- [ANALYTICS_EVENTS.USAGE_BILLING_ANNOUNCEMENT_ACKNOWLEDGED]: UsageBillingAnnouncementAcknowledgedProperties;[ANALYTICS_EVENTS.CLOUD_TASK_USAGE_BLOCKED]: CloudTaskUsageBlockedProperties;// Project Bluebird (Channels) events@@ -1624,11 +1611,6 @@ export type EventPropertyMap = {[ANALYTICS_EVENTS.AUTORESEARCH_ARMED]: AutoresearchArmedProperties;[ANALYTICS_EVENTS.AUTORESEARCH_RUN_STARTED]: AutoresearchRunStartedProperties;- // Loops promo events- [ANALYTICS_EVENTS.LOOPS_PROMO_OPENED]: never;- [ANALYTICS_EVENTS.LOOPS_PROMO_DISMISSED]: never;- [ANALYTICS_EVENTS.LOOPS_PROMO_LEARN_MORE_CLICKED]: never;-// Loops events[ANALYTICS_EVENTS.LOOP_LIST_VIEWED]: LoopListViewedProperties;[ANALYTICS_EVENTS.LOOP_VIEWED]: LoopViewedProperties;diff --git a/products/desktop/packages/shared/src/flags.ts b/products/desktop/packages/shared/src/flags.tsindex 1ae04e045979..805dd2c7009f 100644--- a/products/desktop/packages/shared/src/flags.ts+++ b/products/desktop/packages/shared/src/flags.ts@@ -1,10 +1,5 @@export const BILLING_FLAG = "posthog-code-billing";export const SPEND_ANALYSIS_FLAG = "posthog-code-spend-analysis";-/**- * Launch switch for the one-time usage-based billing announcement: flip at- * cutover, delete once the fleet has acknowledged.- */-export const USAGE_BILLING_FLAG = "posthog-code-usage-billing";export const EXPERIMENT_SUGGESTIONS_FLAG ="posthog-code-experiment-suggestions";export const SYNC_CLOUD_TASKS_FLAG = "posthog-code-sync-cloud-tasks";diff --git a/products/desktop/packages/ui/src/features/billing/UsageBillingAnnouncementModal.tsx b/products/desktop/packages/ui/src/features/billing/UsageBillingAnnouncementModal.tsxdeleted file mode 100644index fe2751c9d070..000000000000--- a/products/desktop/packages/ui/src/features/billing/UsageBillingAnnouncementModal.tsx+++ /dev/null@@ -1,114 +0,0 @@-import { ArrowSquareOut, CreditCard } from "@phosphor-icons/react";-import {- codeOrgSpendLimitUsd,- formatUsdAmount,-} from "@posthog/core/billing/usageDisplay";-import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";-import { Button, Dialog, Flex, Text } from "@radix-ui/themes";-import { useEffect } from "react";-import { track } from "../../shell/analytics";-import { openExternalUrl } from "../../shell/openExternal";-import { getBillingUrl } from "../../utils/urls";-import { useAuthStateValue } from "../auth/store";-import { useBillingAnnouncementStore } from "./billingAnnouncementStore";-import { useBillingAnnouncementVisible } from "./useBillingAnnouncementVisible";-import { useUsage } from "./useUsage";--/**- * One-time blocking announcement of the usage-based billing cutover. The- * flag is its launch switch — flip at cutover, delete once the fleet has- * acknowledged.- */-export function UsageBillingAnnouncementModal() {- const isOpen = useBillingAnnouncementVisible();- const acknowledge = useBillingAnnouncementStore((s) => s.acknowledge);- const cloudRegion = useAuthStateValue((state) => state.cloudRegion);- const { usage } = useUsage({ enabled: isOpen });-- const spendLimitUsd = codeOrgSpendLimitUsd(usage);-- useEffect(() => {- if (isOpen) {- track(ANALYTICS_EVENTS.UPGRADE_PROMPT_SHOWN, {- surface: "billing_announcement",- });- }- }, [isOpen]);-- const handleAcknowledge = () => {- track(ANALYTICS_EVENTS.USAGE_BILLING_ANNOUNCEMENT_ACKNOWLEDGED, {- $set: {- code_usage_billing_acknowledged_at: new Date().toISOString(),- },- });- acknowledge();- };-- const handleManageBilling = () => {- track(ANALYTICS_EVENTS.UPGRADE_PROMPT_CLICKED, {- surface: "billing_announcement",- });- const billingUrl = getBillingUrl(cloudRegion);- if (billingUrl) openExternalUrl(billingUrl);- };-- return (- <Dialog.Root open={isOpen}>- <Dialog.Content- maxWidth="480px"- onInteractOutside={(e) => e.preventDefault()}- onEscapeKeyDown={(e) => e.preventDefault()}- >- <Flex direction="column" gap="3">- <Flex align="center" gap="2">- <CreditCard size={20} weight="bold" color="var(--accent-9)" />- <Dialog.Title className="mb-0">Billing has changed</Dialog.Title>- </Flex>- <Dialog.Description>- <Text className="text-sm">- Seat-based plans are gone — usage-based billing is here. You only- pay for what you use.- </Text>- </Dialog.Description>- <Flex direction="column" gap="2" className="text-sm">- <Text color="gray">- • The first <Text weight="medium">$20</Text> of usage each month- is included.- </Text>- <Text color="gray">- • Premium models need a payment method; an open model stays free.- </Text>- <Text color="gray">- {spendLimitUsd != null ? (- <>- • Your organization's spend limit is{" "}- <Text weight="medium">{`${formatUsdAmount(spendLimitUsd)}/month`}</Text>{" "}- — adjust it any time in billing settings.- </>- ) : (- <>- • A default <Text weight="medium">$50/month</Text> spend limit- applies — adjust it any time in billing settings.- </>- )}- </Text>- </Flex>- <Flex justify="end" gap="3" mt="2">- <Button- type="button"- variant="soft"- color="gray"- onClick={handleManageBilling}- >- Manage billing- <ArrowSquareOut size={12} />- </Button>- <Button type="button" onClick={handleAcknowledge}>- Got it- </Button>- </Flex>- </Flex>- </Dialog.Content>- </Dialog.Root>- );-}diff --git a/products/desktop/packages/ui/src/features/billing/billingAnnouncementStore.ts b/products/desktop/packages/ui/src/features/billing/billingAnnouncementStore.tsdeleted file mode 100644index 8da4ee98031d..000000000000--- a/products/desktop/packages/ui/src/features/billing/billingAnnouncementStore.ts+++ /dev/null@@ -1,38 +0,0 @@-import { electronStorage } from "@posthog/ui/shell/rendererStorage";-import { create } from "zustand";-import { persist } from "zustand/middleware";--interface BillingAnnouncementState {- acknowledged: boolean;- // Hydration is async (Electron storage over IPC); the announcement must not- // flash open before a persisted acknowledgment has been read back.- _hasHydrated: boolean;- acknowledge: () => void;- setHasHydrated: (hydrated: boolean) => void;-}--export const useBillingAnnouncementStore = create<BillingAnnouncementState>()(- persist(- (set) => ({- acknowledged: false,- _hasHydrated: false,- acknowledge: () => set({ acknowledged: true }),- setHasHydrated: (hydrated) => set({ _hasHydrated: hydrated }),- }),- {- name: "posthog-code-usage-billing-acknowledged",- storage: electronStorage,- partialize: (state) => ({ acknowledged: state.acknowledged }),- onRehydrateStorage: () => (state) => {- if (state) {- state.setHasHydrated(true);- return;- }- // Failed storage read: fail open as unacknowledged — re-showing the- // one-time announcement beats never showing it, and the in-memory- // acknowledgment still dismisses it for the rest of the session.- useBillingAnnouncementStore.setState({ _hasHydrated: true });- },- },- ),-);diff --git a/products/desktop/packages/ui/src/features/billing/useBillingAnnouncementVisible.ts b/products/desktop/packages/ui/src/features/billing/useBillingAnnouncementVisible.tsdeleted file mode 100644index 5c2c4dbc36ea..000000000000--- a/products/desktop/packages/ui/src/features/billing/useBillingAnnouncementVisible.ts+++ /dev/null@@ -1,13 +0,0 @@-import { USAGE_BILLING_FLAG } from "@posthog/shared";-import { useAuthStateValue } from "../auth/store";-import { useFeatureFlag } from "../feature-flags/useFeatureFlag";-import { useBillingAnnouncementStore } from "./billingAnnouncementStore";--/** Whether the one-time billing announcement is currently blocking the app. */-export function useBillingAnnouncementVisible(): boolean {- const armed = useFeatureFlag(USAGE_BILLING_FLAG);- const acknowledged = useBillingAnnouncementStore((s) => s.acknowledged);- const hasHydrated = useBillingAnnouncementStore((s) => s._hasHydrated);- const isLoggedIn = useAuthStateValue((state) => state.currentOrgId !== null);- return armed && isLoggedIn && hasHydrated && !acknowledged;-}diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelsSidebar.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelsSidebar.test.tsxindex c546e2988ff8..c9fa34042180 100644--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelsSidebar.test.tsx+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelsSidebar.test.tsx@@ -73,9 +73,6 @@ vi.mock("@posthog/ui/features/sidebar/components/ProjectSwitcher", () => ({vi.mock("@posthog/ui/features/sidebar/components/UpdateBanner", () => ({UpdateBanner: () => null,}));-vi.mock("@posthog/ui/features/loops/components/LoopsPromoCard", () => ({- LoopsPromoCard: () => null,-}));vi.mock("@posthog/ui/features/workspace/useWorkspace", () => ({useWorkspaces: () => ({ data: {}, isFetched: true }),}));diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelsSidebar.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelsSidebar.tsxindex e955687b4c53..b5f13dc1236e 100644--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelsSidebar.tsx+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelsSidebar.tsx@@ -19,7 +19,6 @@ import {} from "@posthog/ui/features/canvas/stores/channelPaneStore";import { useCurrentChannelStore } from "@posthog/ui/features/canvas/stores/currentChannelStore";import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag";-import { LoopsPromoCard } from "@posthog/ui/features/loops/components/LoopsPromoCard";import { useOnboardingStore } from "@posthog/ui/features/onboarding/onboardingStore";import { ProjectSwitcher } from "@posthog/ui/features/sidebar/components/ProjectSwitcher";import { SidebarMenu } from "@posthog/ui/features/sidebar/components/SidebarMenu";@@ -277,8 +276,6 @@ export function ChannelsSidebar() {</Box>)}- <LoopsPromoCard />-{/* The code layout keeps it in the footer: that sidebar's top is the navsection and task header, and there's no nav row to sit above. */}{!channelsLayout && (diff --git a/products/desktop/packages/ui/src/features/loops/components/LoopsPromoCard.tsx b/products/desktop/packages/ui/src/features/loops/components/LoopsPromoCard.tsxdeleted file mode 100644index 89aa99975dfa..000000000000--- a/products/desktop/packages/ui/src/features/loops/components/LoopsPromoCard.tsx+++ /dev/null@@ -1,269 +0,0 @@-import {- GitPullRequestIcon,- type Icon,- LifebuoyIcon,- ListChecksIcon,- SunIcon,- TestTubeIcon,- XIcon,-} from "@phosphor-icons/react";-import {- Button,- Dialog,- DialogContent,- DialogDescription,- DialogTitle,-} from "@posthog/quill";-import { LOOPS_FLAG } from "@posthog/shared";-import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";-import { loopHog } from "@posthog/ui/assets/hedgehogs";-import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag";-import { useLoopsPromoStore } from "@posthog/ui/features/loops/loopsPromoStore";-import { Button as UiButton } from "@posthog/ui/primitives/Button";-import { navigateToLoops } from "@posthog/ui/router/navigationBridge";-import { useAppView } from "@posthog/ui/router/useAppView";-import { track } from "@posthog/ui/shell/analytics";-import { Box } from "@radix-ui/themes";-import { useEffect, useState } from "react";--const EXAMPLES: { icon: Icon; label: string }[] = [- {- icon: GitPullRequestIcon,- label: "Digest open pull requests and flag what needs attention",- },- {- icon: TestTubeIcon,- label: "Track down flaky tests and summarize CI failures",- },- {- icon: ListChecksIcon,- label: "Triage new issues and flag likely duplicates",- },- { icon: SunIcon, label: "Post a standup summary every weekday morning" },- {- icon: LifebuoyIcon,- label: "Review support tickets and surface the urgent ones",- },-];--function GeometricPattern() {- return (- <svg- className="absolute inset-0 h-full w-full text-white"- viewBox="0 0 232 96"- preserveAspectRatio="xMidYMid slice"- aria-hidden="true"- >- <circle cx="26" cy="22" r="11" fill="currentColor" opacity="0.25" />- <circle- cx="204"- cy="66"- r="17"- fill="none"- stroke="currentColor"- strokeWidth="3"- opacity="0.3"- />- <rect- x="176"- y="10"- width="15"- height="15"- rx="2"- transform="rotate(18 183 17)"- fill="currentColor"- opacity="0.2"- />- <polygon points="64,10 75,30 53,30" fill="currentColor" opacity="0.3" />- <path- d="M8 62 l7 -8 7 8 7 -8 7 8"- fill="none"- stroke="currentColor"- strokeWidth="2.5"- strokeLinecap="round"- strokeLinejoin="round"- opacity="0.35"- />- <circle cx="118" cy="14" r="4" fill="currentColor" opacity="0.35" />- <path- d="M148 78 h12 M154 72 v12"- stroke="currentColor"- strokeWidth="3"- strokeLinecap="round"- opacity="0.3"- />- <circle- cx="52"- cy="78"- r="6"- fill="none"- stroke="currentColor"- strokeWidth="2.5"- opacity="0.25"- />- <rect- x="96"- y="70"- width="10"- height="10"- transform="rotate(-12 101 75)"- fill="currentColor"- opacity="0.18"- />- <polygon- points="206,18 214,32 198,32"- fill="none"- stroke="currentColor"- strokeWidth="2.5"- strokeLinejoin="round"- opacity="0.3"- />- </svg>- );-}--export function LoopsPromoCard() {- const loopsEnabled = useFeatureFlag(LOOPS_FLAG, import.meta.env.DEV);- const dismissed = useLoopsPromoStore((state) => state.dismissed);- const hasHydrated = useLoopsPromoStore((state) => state._hasHydrated);- const dismiss = useLoopsPromoStore((state) => state.dismiss);- const [dialogOpen, setDialogOpen] = useState(false);-- // Reaching the Loops page on their own means the promo did its job (or was- // never needed), so it retires the card the same way answering the dialog does.- const view = useAppView();- const onLoopsPage = view.type === "loops";- useEffect(() => {- if (onLoopsPage && hasHydrated && !dismissed) dismiss();- }, [onLoopsPage, hasHydrated, dismissed, dismiss]);-- if (!loopsEnabled || !hasHydrated || (dismissed && !dialogOpen)) return null;-- const openDialog = () => {- track(ANALYTICS_EVENTS.LOOPS_PROMO_OPENED);- setDialogOpen(true);- };-- const handleDismiss = () => {- track(ANALYTICS_EVENTS.LOOPS_PROMO_DISMISSED);- dismiss();- };-- // Answering the dialog either way retires the card: it exists to get the- // user into this dialog once, not to nag after they've decided.- const handleNotNow = () => {- track(ANALYTICS_EVENTS.LOOPS_PROMO_DISMISSED);- setDialogOpen(false);- dismiss();- };-- const handleLearnMore = () => {- track(ANALYTICS_EVENTS.LOOPS_PROMO_LEARN_MORE_CLICKED);- setDialogOpen(false);- dismiss();- navigateToLoops();- };-- return (- <>- {!dismissed && (- <Box className="shrink-0 px-2 pb-2">- <div className="group relative overflow-hidden rounded-md border border-gray-6 bg-gray-2 transition-shadow hover:shadow-md">- <button- type="button"- className="block w-full text-left"- onClick={openDialog}- >- <div className="relative flex h-24 items-center justify-center bg-[#2f80fa]">- <GeometricPattern />- <img- src={loopHog}- alt=""- className="relative h-[72px] w-auto object-contain"- />- <div className="absolute inset-x-0 bottom-0 h-10 bg-gradient-to-b from-transparent to-(--gray-2)" />- </div>- <div className="flex flex-col gap-0.5 px-3 pt-3 pb-3">- <span className="font-medium text-[13px] text-gray-12">- Introducing Loops- </span>- <span className="text-[11px] text-gray-11 leading-snug">- Recurring agent jobs that run in the cloud and report back.- </span>- {/* Rendered as a span: the whole card is already a button, and- nesting real buttons is invalid HTML. */}- <UiButton- asChild- variant="outline"- color="gray"- size="1"- className="mt-2 self-start"- >- <span>Learn more</span>- </UiButton>- </div>- </button>- <button- type="button"- aria-label="Dismiss Loops announcement"- title="Dismiss"- className="absolute top-1.5 right-1.5 rounded-full bg-black/20 p-1 text-white opacity-0 transition-all hover:bg-black/30 focus-visible:opacity-100 group-hover:opacity-100"- onClick={handleDismiss}- >- <XIcon size={10} weight="bold" />- </button>- </div>- </Box>- )}-- <Dialog open={dialogOpen} onOpenChange={setDialogOpen}>- <DialogContent className="sm:max-w-md">- <div className="relative flex h-48 items-center justify-center bg-[#2f80fa]">- <GeometricPattern />- <img- src={loopHog}- alt=""- className="relative h-36 w-auto object-contain"- />- <div className="absolute inset-x-0 bottom-0 h-12 bg-gradient-to-b from-transparent to-(--background)" />- </div>- <div className="flex flex-col gap-4 px-5 pt-4 pb-5">- <div className="flex flex-col gap-1.5">- <DialogTitle className="font-semibold text-[17px] text-gray-12 tracking-tight">- Introducing Loops- </DialogTitle>- <DialogDescription className="text-[13px] text-gray-11 leading-relaxed">- Describe a job once and it keeps running in the cloud, on a- schedule or when something happens in your repos, even with your- laptop closed. Every run reports back.- </DialogDescription>- </div>- <div className="flex flex-col gap-2.5">- <span className="font-medium text-[11px] text-gray-10 uppercase tracking-wide">- Things to try- </span>- <ul className="flex flex-col gap-2">- {EXAMPLES.map(({ icon: ExampleIcon, label }) => (- <li key={label} className="flex items-center gap-2.5">- <span className="flex size-6 shrink-0 items-center justify-center rounded-(--radius-2) bg-(--gray-a3) text-gray-11">- <ExampleIcon size={13} />- </span>- <span className="text-[13px] text-gray-11">{label}</span>- </li>- ))}- </ul>- </div>- <div className="flex justify-end gap-2 pt-1">- <Button variant="outline" size="sm" onClick={handleNotNow}>- Not now- </Button>- <Button variant="primary" size="sm" onClick={handleLearnMore}>- Try now- </Button>- </div>- </div>- </DialogContent>- </Dialog>- </>- );-}diff --git a/products/desktop/packages/ui/src/features/loops/loopsPromoStore.ts b/products/desktop/packages/ui/src/features/loops/loopsPromoStore.tsdeleted file mode 100644index 918dce9a7b00..000000000000--- a/products/desktop/packages/ui/src/features/loops/loopsPromoStore.ts+++ /dev/null@@ -1,48 +0,0 @@-import {- electronStorage,- flushRendererStateWrites,-} from "@posthog/ui/shell/rendererStorage";-import { create } from "zustand";-import { persist } from "zustand/middleware";--interface LoopsPromoState {- dismissed: boolean;- // Hydration is async (Electron storage over IPC); the card must not flash- // for users whose persisted dismissal hasn't been read back yet.- _hasHydrated: boolean;- dismiss: () => void;- reset: () => void;- setHasHydrated: (hydrated: boolean) => void;-}--export const useLoopsPromoStore = create<LoopsPromoState>()(- persist(- (set) => ({- dismissed: false,- _hasHydrated: false,- // Flushed immediately: the debounced write could otherwise be lost if- // the window closes right after the click, resurrecting the card.- dismiss: () => {- set({ dismissed: true });- void flushRendererStateWrites();- },- reset: () => {- set({ dismissed: false });- void flushRendererStateWrites();- },- setHasHydrated: (hydrated) => set({ _hasHydrated: hydrated }),- }),- {- name: "posthog-code-loops-promo-dismissed",- storage: electronStorage,- partialize: (state) => ({ dismissed: state.dismissed }),- onRehydrateStorage: () => (state) => {- if (state) {- state.setHasHydrated(true);- return;- }- useLoopsPromoStore.setState({ _hasHydrated: true });- },- },- ),-);diff --git a/products/desktop/packages/ui/src/features/scouts/components/ScoutAlphaBanner.tsx b/products/desktop/packages/ui/src/features/scouts/components/ScoutAlphaBanner.tsxdeleted file mode 100644index 7c9cd24802e5..000000000000--- a/products/desktop/packages/ui/src/features/scouts/components/ScoutAlphaBanner.tsx+++ /dev/null@@ -1,52 +0,0 @@-import { Info, X } from "@phosphor-icons/react";-import { useState } from "react";-import { useScoutMetadata } from "../hooks/useScoutMetadata";--const DISMISS_KEY_PREFIX = "scout-alpha-banner-dismissed:";--const dismissKeyFor = (message: string): string =>- `${DISMISS_KEY_PREFIX}${message}`;--/**- * Alpha/announcement banner for the scout fleet, sourced from the `signals-scout` flag via the- * metadata endpoint — so the copy (e.g. a run-limit notice) changes with no app release. Renders- * nothing when no message is set. Dismissal is remembered per-message, so a reworded notice- * resurfaces. localStorage is read during render against the current message, which keeps it- * correct even though the message arrives after the first paint.- */-export function ScoutAlphaBanner() {- const { data: metadata } = useScoutMetadata();- const message = metadata?.banner_message ?? null;- const [dismissedKeys, setDismissedKeys] = useState<Set<string>>(- () => new Set(),- );-- if (!message) {- return null;- }-- const key = dismissKeyFor(message);- if (dismissedKeys.has(key) || localStorage.getItem(key) === "1") {- return null;- }-- const dismiss = () => {- localStorage.setItem(key, "1");- setDismissedKeys((prev) => new Set(prev).add(key));- };-- return (- <div className="flex w-full items-start gap-2.5 rounded-(--radius-2) border border-(--blue-6) bg-(--blue-2) px-3.5 py-2.5 text-(--blue-11) text-[12.5px]">- <Info size={16} weight="duotone" className="mt-px shrink-0" />- <span className="min-w-0 flex-1 leading-snug">{message}</span>- <button- type="button"- aria-label="Dismiss"- onClick={dismiss}- className="-mr-1 shrink-0 rounded-(--radius-1) p-0.5 text-(--blue-11) transition-colors hover:bg-(--blue-4)"- >- <X size={14} />- </button>- </div>- );-}diff --git a/products/desktop/packages/ui/src/features/scouts/components/ScoutsFleetSection.tsx b/products/desktop/packages/ui/src/features/scouts/components/ScoutsFleetSection.tsxindex cb7fc41d3178..4d130fed5d84 100644--- a/products/desktop/packages/ui/src/features/scouts/components/ScoutsFleetSection.tsx+++ b/products/desktop/packages/ui/src/features/scouts/components/ScoutsFleetSection.tsx@@ -43,7 +43,6 @@ import { useScoutRuns } from "../hooks/useScoutRuns";import { useScoutSkillCreators } from "../hooks/useScoutSkillCreators";import { FleetFindingsCallout } from "./FleetFindingsCallout";import { FleetMemoryCallout } from "./FleetMemoryCallout";-import { ScoutAlphaBanner } from "./ScoutAlphaBanner";import { ScoutHelperSkillLinks } from "./ScoutHelperSkillLinks";import { ScoutRowCard } from "./ScoutRowCard";@@ -110,7 +109,6 @@ export function ScoutsFleetSection() {return (<Flex direction="column" gap="3">- <ScoutAlphaBanner /><buttontype="button"onClick={() => setExpanded((value) => !value)}@@ -448,7 +446,6 @@ function ScoutsEmptyState() {useTrackFleetViewed(EMPTY_CONFIGS);return (<Flex direction="column" gap="3">- <ScoutAlphaBanner /><Flexdirection="column"gap="2"diff --git a/products/desktop/packages/ui/src/features/scouts/hooks/scoutQueryKeys.ts b/products/desktop/packages/ui/src/features/scouts/hooks/scoutQueryKeys.tsindex a01c41eb0310..0a8181a5778f 100644--- a/products/desktop/packages/ui/src/features/scouts/hooks/scoutQueryKeys.ts+++ b/products/desktop/packages/ui/src/features/scouts/hooks/scoutQueryKeys.ts@@ -1,8 +1,6 @@export const scoutQueryKeys = {configs: (projectId: number | null) =>["scouts", "configs", projectId] as const,- metadata: (projectId: number | null) =>- ["scouts", "metadata", projectId] as const,runs: (projectId: number | null) => ["scouts", "runs", projectId] as const,skillCreators: (projectId: number | null) =>["scouts", "skillCreators", projectId] as const,diff --git a/products/desktop/packages/ui/src/features/scouts/hooks/useScoutMetadata.ts b/products/desktop/packages/ui/src/features/scouts/hooks/useScoutMetadata.tsdeleted file mode 100644index 990295975447..000000000000--- a/products/desktop/packages/ui/src/features/scouts/hooks/useScoutMetadata.ts+++ /dev/null@@ -1,14 +0,0 @@-import type { ScoutMetadata } from "@posthog/api-client/posthog-client";-import { useAuthenticatedQuery } from "@posthog/ui/hooks/useAuthenticatedQuery";-import { useAuthStateValue } from "../../auth/store";-import { scoutQueryKeys } from "./scoutQueryKeys";--export function useScoutMetadata() {- const projectId = useAuthStateValue((state) => state.currentProjectId);- return useAuthenticatedQuery<ScoutMetadata | null>(- scoutQueryKeys.metadata(projectId),- (client) =>- projectId ? client.getScoutMetadata(projectId) : Promise.resolve(null),- { enabled: !!projectId, staleTime: 60_000 },- );-}diff --git a/products/desktop/packages/ui/src/features/settings/sections/AdvancedSettings.tsx b/products/desktop/packages/ui/src/features/settings/sections/AdvancedSettings.tsxindex 127299c0fc5b..cfa2c923c390 100644--- a/products/desktop/packages/ui/src/features/settings/sections/AdvancedSettings.tsx+++ b/products/desktop/packages/ui/src/features/settings/sections/AdvancedSettings.tsx@@ -1,7 +1,6 @@import { useServiceOptional } from "@posthog/di/react";import { useHostTRPC } from "@posthog/host-router/react";import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag";-import { useLoopsPromoStore } from "@posthog/ui/features/loops/loopsPromoStore";import { useOnboardingStore } from "@posthog/ui/features/onboarding/onboardingStore";import {DEV_MODE_CLIENT,@@ -99,7 +98,6 @@ export function AdvancedSettings() {useOnboardingStore.getState().resetOnboarding();useSetupStore.getState().resetSetup();useTourStore.getState().resetTours();- useLoopsPromoStore.getState().reset();}}>Resetdiff --git a/products/desktop/packages/ui/src/features/updates/WhatsNewModal.tsx b/products/desktop/packages/ui/src/features/updates/WhatsNewModal.tsxindex 79991f242fd1..6ebab91498c2 100644--- a/products/desktop/packages/ui/src/features/updates/WhatsNewModal.tsx+++ b/products/desktop/packages/ui/src/features/updates/WhatsNewModal.tsx@@ -1,6 +1,5 @@import { X } from "@phosphor-icons/react";import { useHostTRPC } from "@posthog/host-router/react";-import { useBillingAnnouncementVisible } from "@posthog/ui/features/billing/useBillingAnnouncementVisible";import { ReleaseNotesSections } from "@posthog/ui/features/updates/ReleaseNotesSections";import {groupReleases,@@ -43,9 +42,6 @@ function ChangelogSkeleton() {export function WhatsNewModal() {const isOpen = useWhatsNewStore((state) => state.isOpen);const close = useWhatsNewStore((state) => state.close);- // The blocking billing announcement takes the stage alone — the post-update- // auto-open waits here until it's acknowledged, then appears.- const billingAnnouncementVisible = useBillingAnnouncementVisible();const prefetchForActiveUpdate = useHasActiveUpdate();const hostTRPC = useHostTRPC();const { data: currentVersion, isError: isVersionError } = useQuery(@@ -67,7 +63,7 @@ export function WhatsNewModal() {return (<Dialog.Root- open={isOpen && !billingAnnouncementVisible}+ open={isOpen}onOpenChange={(open) => {if (!open) close();}}diff --git a/products/desktop/packages/ui/src/router/routes/__root.tsx b/products/desktop/packages/ui/src/router/routes/__root.tsxindex 6abf62970161..8e425e339317 100644--- a/products/desktop/packages/ui/src/router/routes/__root.tsx+++ b/products/desktop/packages/ui/src/router/routes/__root.tsx@@ -15,7 +15,6 @@ import { isContentlessTask } from "@posthog/shared/domain-types";import { DeepLinkApprovalModal } from "@posthog/ui/features/agent-applications/components/DeepLinkApprovalModal";import { useApprovalDeepLink } from "@posthog/ui/features/agent-applications/hooks/useApprovalDeepLink";import { useAuthStateValue } from "@posthog/ui/features/auth/store";-import { UsageBillingAnnouncementModal } from "@posthog/ui/features/billing/UsageBillingAnnouncementModal";import { UsageButton } from "@posthog/ui/features/billing/UsageButton";import { UsageLimitModal } from "@posthog/ui/features/billing/UsageLimitModal";import { BlankTabView } from "@posthog/ui/features/browser-tabs/BlankTabView";@@ -346,7 +345,6 @@ function RootLayout() {was stopping Cmd+W from closing the window. */}<TabShortcutFallback enabled />{billingEnabled && <UsageLimitModal />}- <UsageBillingAnnouncementModal /><UpdateAvailableModal /><WhatsNewModal /><RemoteBranchCheckoutDialog />@@ -530,7 +528,6 @@ function RootLayout() {/><TourOverlay />{billingEnabled && <UsageLimitModal />}- <UsageBillingAnnouncementModal /><UpdateAvailableModal /><WhatsNewModal /><RemoteBranchCheckoutDialog />