Skip to content

: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.

fix(desktop): use one spinner for every loading state (#93792)

Charles Vien9d6fb098aa32
diff --git a/products/desktop/AGENTS.md b/products/desktop/AGENTS.md
index 0511c7ceee26..89872f8c2f15 100644
--- a/products/desktop/AGENTS.md
+++ b/products/desktop/AGENTS.md
@@ -301,7 +301,8 @@ Everything else has a quill equivalent — import it from `@posthog/quill`:
| `TextField`, `TextArea` | `Input`, `Textarea`, `InputGroup*` |
| `Select`, `Checkbox`, `Switch`, `Slider`, `Progress` | same names |
| `SegmentedControl`, `RadioGroup` | `ToggleGroup` + `ToggleGroupItem`, or `Tabs` |
-| `Badge`, `Avatar`, `Separator`, `Skeleton`, `Spinner`, `Kbd`, `Card`, `Table*`, `Tabs*` | same names |
+| `Badge`, `Avatar`, `Separator`, `Skeleton`, `Kbd`, `Card`, `Table*`, `Tabs*` | same names |
+| `Spinner` | `Spinner` or `LoadingState` from `packages/ui/src/primitives`, never quill's `Spinner` (see [Code Style](#code-style)) |
| `Tooltip`, `Popover`, `Dialog`, `AlertDialog`, `DropdownMenu`, `ContextMenu` | same names, as `*Trigger` / `*Content` compounds |
| `Callout` | compose a `div` with Tailwind, or quill `Item*` |
@@ -330,6 +331,7 @@ Pulling in a Radix package is not the fallback.
- No barrel files (`index.ts`).
- Use Tailwind first. Keep classes sorted. Use inline `style` only for runtime values, library configuration, or CSS variables.
- Empty/placeholder/loading screens (canvas and elsewhere) are a `@posthog/quill` `<Empty>` (`EmptyHeader` → `EmptyMedia variant="icon"` → `EmptyTitle` → `EmptyDescription`, then `EmptyContent` for CTAs). Don't hand-roll the centered Flex + dashed icon box. CTAs are quill `Button`s: primary action `variant="primary"`, secondary `variant="outline"`, `size="default"`. For a link CTA use `render={<Link … />}` (Base UI), not `asChild`.
+- Loading indicators are `Spinner` and `LoadingState` from `packages/ui/src/primitives`. `LoadingState` fills a pane or section while its data loads (24px spinner, optional label). `Spinner` sits inline in a button, row or badge; omit `size` inside quill buttons and media slots so it matches the icons beside it, and pick `xs`/`sm`/`md`/`lg` elsewhere. Do not import `Spinner` from `@posthog/quill` or `@radix-ui/themes`, and do not spin phosphor's `CircleNotch` or `SpinnerGap`: Biome rejects those imports. Pass `aria-hidden="true"` when the spinner sits next to visible loading text or inside an element that already announces the loading state, so the label is not read twice. The braille `DotsCircleSpinner` and `DotRingSpinner` mark agent activity (a running tool call, a working task), not data loading.
- Abort controllers before awaiting cleanup that depends on them.
See [docs/CONVENTIONS.md](./docs/CONVENTIONS.md).
diff --git a/products/desktop/biome.jsonc b/products/desktop/biome.jsonc
index fbbf6a84f694..5eaf27cd98a0 100644
--- a/products/desktop/biome.jsonc
+++ b/products/desktop/biome.jsonc
@@ -370,6 +370,27 @@
"noRestrictedImports": {
"level": "error",
"options": {
+ "paths": {
+ "@posthog/quill": {
+ "importNames": ["Spinner"],
+ "message": "Use Spinner or LoadingState from @posthog/ui/primitives so every loading indicator shares one glyph, size scale and compositor-only animation."
+ },
+ "@radix-ui/themes": {
+ "importNames": ["Spinner"],
+ "message": "Use Spinner or LoadingState from @posthog/ui/primitives so every loading indicator shares one glyph, size scale and compositor-only animation."
+ },
+ "@phosphor-icons/react": {
+ "importNames": [
+ "Spinner",
+ "SpinnerIcon",
+ "SpinnerGap",
+ "SpinnerGapIcon",
+ "CircleNotch",
+ "CircleNotchIcon"
+ ],
+ "message": "Use Spinner from @posthog/ui/primitives/Spinner instead of spinning a phosphor glyph."
+ }
+ },
"patterns": [
{
"group": [
diff --git a/products/desktop/docs/CONVENTIONS.md b/products/desktop/docs/CONVENTIONS.md
index e8ab9b7b1cd6..78956b14b517 100644
--- a/products/desktop/docs/CONVENTIONS.md
+++ b/products/desktop/docs/CONVENTIONS.md
@@ -168,7 +168,14 @@ When creating reusable styled components, accept both `className?: string` and `
Default line heights are set in [packages/ui/src/styles/globals.css](../packages/ui/src/styles/globals.css). Add `leading-*` only when the component needs a non-default line height. Pair arbitrary body text sizes with `leading-snug`; pair titles with `leading-tight`.
-Spinning icons go through `Spin` or `Spinner` from [packages/ui/src/primitives/Spinner.tsx](../packages/ui/src/primitives/Spinner.tsx). Never put `animate-spin` on an `<svg>`: Chromium animates SVG transforms on the main thread, so one visible spinner costs a style recalc and a layerize pass on every frame. Stop the animation (`spinning={false}`) or unmount the spinner when it is hidden behind `opacity-0`.
+Loading indicators are `Spinner` from [packages/ui/src/primitives/Spinner.tsx](../packages/ui/src/primitives/Spinner.tsx) and `LoadingState` from [packages/ui/src/primitives/LoadingState.tsx](../packages/ui/src/primitives/LoadingState.tsx).
+`LoadingState` is the centered pane or section loader.
+`Spinner` is the inline one: leave `size` off inside quill buttons and media slots, which size it like the icons beside it, and use `xs` (badges), `sm` (12px text), `md` (default rows) or `lg` (a pane) elsewhere.
+Biome rejects `Spinner` imports from `@posthog/quill` and `@radix-ui/themes`, and the phosphor spinner glyphs.
+It carries `role="status"` and a "Loading" label. Pass `aria-hidden="true"` where visible text or a wrapping live region already says the same thing, so a screen reader reads it once.
+An icon that has to rotate for another reason (a refresh arrow while refreshing) goes through `Spin` from the same file.
+Never put `animate-spin` on an `<svg>`: Chromium animates SVG transforms on the main thread, so one visible spinner costs a style recalc and a layerize pass on every frame.
+Stop the animation (`spinning={false}`) or unmount the spinner when it is hidden behind `opacity-0`.
Do not write a `:has()` rule with `html` or `body` as the anchor and a descendant subject (`body:has(...) .thing`). Chromium re-checks such a rule after DOM mutations anywhere and restyles the whole document. Set custom properties on the anchor instead and consume them where the style applies, as the quill portal rule in `globals.css` does.
diff --git a/products/desktop/packages/ui/src/features/actions/ActionTabIcon.tsx b/products/desktop/packages/ui/src/features/actions/ActionTabIcon.tsx
index ab361a3f2a4e..004adc04ab1c 100644
--- a/products/desktop/packages/ui/src/features/actions/ActionTabIcon.tsx
+++ b/products/desktop/packages/ui/src/features/actions/ActionTabIcon.tsx
@@ -9,8 +9,8 @@ import {
type ShellClient,
} from "@posthog/ui/features/terminal/shellClient";
import { terminalManager } from "@posthog/ui/features/terminal/TerminalManager";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { Tooltip } from "@posthog/ui/primitives/Tooltip";
-import { Spinner } from "@radix-ui/themes";
import { useCallback, useState } from "react";
interface ActionTabIconProps {
@@ -50,7 +50,7 @@ export function ActionTabIcon({ actionId }: ActionTabIconProps) {
} else if (status === "error") {
icon = <X size={14} weight="bold" className="text-red-9" />;
} else {
- icon = <Spinner size="1" />;
+ icon = <Spinner size="sm" />;
}
const content = (
diff --git a/products/desktop/packages/ui/src/features/archive/ArchivedTasksView.tsx b/products/desktop/packages/ui/src/features/archive/ArchivedTasksView.tsx
index 80182152022b..afcd63645fa5 100644
--- a/products/desktop/packages/ui/src/features/archive/ArchivedTasksView.tsx
+++ b/products/desktop/packages/ui/src/features/archive/ArchivedTasksView.tsx
@@ -20,6 +20,7 @@ import {
import { useHostTRPC } from "@posthog/host-router/react";
import type { WorkspaceMode } from "@posthog/shared";
import { taskDetailQuery } from "@posthog/ui/features/tasks/queries";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { openTask } from "@posthog/ui/router/useOpenTask";
import {
AlertDialog,
@@ -36,7 +37,6 @@ import { useQuery, useQueryClient } from "@tanstack/react-query";
import { useVirtualizer } from "@tanstack/react-virtual";
import { useEffect, useMemo, useRef, useState } from "react";
import { useSetHeaderContent } from "../../hooks/useSetHeaderContent";
-import { DotsCircleSpinner } from "../../primitives/DotsCircleSpinner";
import { Tooltip } from "../../primitives/Tooltip";
import { toast } from "../../primitives/toast";
import { useTasks } from "../tasks/useTasks";
@@ -323,12 +323,7 @@ export function ArchivedTasksViewPresentation({
style={{ scrollbarGutter: "stable" }}
>
{isLoading ? (
- <Flex align="center" justify="center" gap="2" py="8">
- <DotsCircleSpinner size={16} className="text-gray-10" />
- <Text className="text-[13px] text-gray-10">
- Loading archived tasks...
- </Text>
- </Flex>
+ <LoadingState label="Loading archived tasks..." className="py-8" />
) : visibleItems.length === 0 ? (
<Flex align="center" justify="center" py="8">
<Text className="text-[13px] text-gray-10">
diff --git a/products/desktop/packages/ui/src/features/auth/OAuthControls.tsx b/products/desktop/packages/ui/src/features/auth/OAuthControls.tsx
index f3bb3e635592..b1e617fd5984 100644
--- a/products/desktop/packages/ui/src/features/auth/OAuthControls.tsx
+++ b/products/desktop/packages/ui/src/features/auth/OAuthControls.tsx
@@ -1,5 +1,6 @@
import type { CloudRegion } from "@posthog/shared";
-import { Callout, Spinner } from "@radix-ui/themes";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
+import { Callout } from "@radix-ui/themes";
import { RegionSelect } from "./RegionSelect";
import { useOAuthFlow } from "./useOAuthFlow";
@@ -60,7 +61,7 @@ export function OAuthControls({
transition: "opacity 150ms ease, box-shadow 100ms ease",
}}
>
- {isPending && <Spinner size="1" />}
+ {isPending && <Spinner size="sm" />}
{isPending ? "Cancel" : "Sign in with PostHog"}
</button>
diff --git a/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.tsx b/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.tsx
index 76bfc2807aec..ea60263bfd36 100644
--- a/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.tsx
+++ b/products/desktop/packages/ui/src/features/auth/components/DesktopAccessScreen.tsx
@@ -24,9 +24,9 @@ import {
EmptyTitle,
Field,
FieldLabel,
- Spinner,
} from "@posthog/quill";
import { FullScreenLayout } from "@posthog/ui/primitives/FullScreenLayout";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import {
FIELD_CONTENT_CLASS,
FIELD_TRIGGER_CLASS,
diff --git a/products/desktop/packages/ui/src/features/auth/components/ScopeReauthPrompt.tsx b/products/desktop/packages/ui/src/features/auth/components/ScopeReauthPrompt.tsx
index acd781399e65..488dfda2bc94 100644
--- a/products/desktop/packages/ui/src/features/auth/components/ScopeReauthPrompt.tsx
+++ b/products/desktop/packages/ui/src/features/auth/components/ScopeReauthPrompt.tsx
@@ -1,4 +1,5 @@
import { ShieldWarning } from "@phosphor-icons/react";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { Button, Dialog, Flex, Text } from "@radix-ui/themes";
import { logger } from "../../../shell/logger";
import { useAuthStateValue } from "../store";
@@ -57,9 +58,9 @@ export function ScopeReauthPrompt() {
<Button
type="button"
onClick={handleSignIn}
- loading={loginMutation.isPending}
- disabled={!cloudRegion}
+ disabled={!cloudRegion || loginMutation.isPending}
>
+ {loginMutation.isPending && <Spinner size="sm" />}
Sign in
</Button>
</Flex>
diff --git a/products/desktop/packages/ui/src/features/autoresearch/AutoresearchPanel.test.tsx b/products/desktop/packages/ui/src/features/autoresearch/AutoresearchPanel.test.tsx
index 8bd5fff9c60e..61c69b9cc6f3 100644
--- a/products/desktop/packages/ui/src/features/autoresearch/AutoresearchPanel.test.tsx
+++ b/products/desktop/packages/ui/src/features/autoresearch/AutoresearchPanel.test.tsx
@@ -57,12 +57,8 @@ describe("PreBaselineState", () => {
});
expect(screen.getByText("Establishing the baseline")).toBeVisible();
- expect(
- screen.getByRole("status", { name: "Loading" }).parentElement,
- ).toHaveClass("animate-spin", "motion-reduce:animate-none");
expect(screen.getByRole("status", { name: "Loading" })).toHaveClass(
- "size-5",
- "animate-none",
+ "animate-spin",
);
const metrics = screen.getByRole("status", {
name: "Loading autoresearch metrics",
diff --git a/products/desktop/packages/ui/src/features/autoresearch/PreBaselineState.tsx b/products/desktop/packages/ui/src/features/autoresearch/PreBaselineState.tsx
index df43ef988e41..c3917a510309 100644
--- a/products/desktop/packages/ui/src/features/autoresearch/PreBaselineState.tsx
+++ b/products/desktop/packages/ui/src/features/autoresearch/PreBaselineState.tsx
@@ -1,7 +1,6 @@
import { MagnifyingGlass } from "@phosphor-icons/react";
import type { AutoresearchRun } from "@posthog/core/autoresearch/schemas";
-import { Spinner } from "@posthog/quill";
-import { Spin } from "@posthog/ui/primitives/Spinner";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { Badge, Skeleton, Text } from "@radix-ui/themes";
export interface SessionActivity {
@@ -23,13 +22,7 @@ export function PreBaselineState({
return (
<div className="flex flex-col gap-4" aria-live="polite">
<div className="flex items-start gap-3 rounded-md border border-blue-6 bg-blue-2 px-3 py-3">
- {live && (
- <span className="relative mt-0.5 size-5 shrink-0">
- <Spin className="size-5 motion-reduce:animate-none">
- <Spinner className="size-5 animate-none" />
- </Spin>
- </span>
- )}
+ {live && <Spinner size="md" className="mt-0.5" />}
<div>
<Text as="div" size="2" weight="medium">
{activity.title}
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ActivityFeedList.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/ActivityFeedList.test.tsx
index 9f098fdd2388..56c7a4c353a3 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ActivityFeedList.test.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ActivityFeedList.test.tsx
@@ -72,7 +72,6 @@ vi.mock("@posthog/quill", async (importOriginal) => ({
PopoverContent: ({ children }: { children: ReactNode }) => (
<div>{children}</div>
),
- Spinner: () => <div>Loading</div>,
Switch: ({
checked,
onCheckedChange,
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ActivityFeedList.tsx b/products/desktop/packages/ui/src/features/canvas/components/ActivityFeedList.tsx
index e5f66b84dd6a..7d5c784cc1df 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ActivityFeedList.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ActivityFeedList.tsx
@@ -10,7 +10,6 @@ import {
EmptyMedia,
EmptyTitle,
MenuLabel,
- Spinner,
} from "@posthog/quill";
import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";
import type { SignalReport } from "@posthog/shared/types";
@@ -32,6 +31,8 @@ import { useMarkTaskActivityRead } from "@posthog/ui/features/canvas/hooks/useMa
import { useTaskActivity } from "@posthog/ui/features/canvas/hooks/useTaskActivity";
import { useActivityFilterStore } from "@posthog/ui/features/canvas/stores/activityFilterStore";
import { useInView } from "@posthog/ui/primitives/hooks/useInView";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { track } from "@posthog/ui/shell/analytics";
import { Fragment, useEffect, useMemo, useState } from "react";
import {
@@ -198,9 +199,7 @@ export function ActivityFeedList({
className="sidebar-autocomplete-tree scroll-mask-8 !max-h-none !p-1.5 min-h-0 flex-1 overflow-y-auto"
>
{isLoading && feedItems.length === 0 ? (
- <div className="flex justify-center py-10">
- <Spinner />
- </div>
+ <LoadingState className="py-10" />
) : searchedFeedItems.length === 0 ? (
<Empty className="border-0 py-8">
<EmptyHeader>
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ActivityView.tsx b/products/desktop/packages/ui/src/features/canvas/components/ActivityView.tsx
index 493db63de15d..3832ece412b0 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ActivityView.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ActivityView.tsx
@@ -8,7 +8,6 @@ import {
EmptyMedia,
EmptyTitle,
MenuLabel,
- Spinner,
} from "@posthog/quill";
import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";
import { useArchivedTaskIds } from "@posthog/ui/features/archive/useArchivedTaskIds";
@@ -27,6 +26,7 @@ import { useLocalDayStart } from "@posthog/ui/features/canvas/hooks/useLocalDayS
import { useMarkTaskActivityRead } from "@posthog/ui/features/canvas/hooks/useMarkTaskActivityRead";
import { useTaskActivity } from "@posthog/ui/features/canvas/hooks/useTaskActivity";
import { useActivityFilterStore } from "@posthog/ui/features/canvas/stores/activityFilterStore";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { track } from "@posthog/ui/shell/analytics";
import { Fragment, useCallback, useEffect, useMemo } from "react";
import {
@@ -133,9 +133,7 @@ export function ActivityView() {
// the layout's naming ("spaces" vs "channels").
const feed =
isLoading && feedItems.length === 0 ? (
- <div className="flex justify-center py-16">
- <Spinner />
- </div>
+ <LoadingState className="py-16" />
) : feedItems.length === 0 ? (
<>
<Empty>
diff --git a/products/desktop/packages/ui/src/features/canvas/components/CanvasesPane.tsx b/products/desktop/packages/ui/src/features/canvas/components/CanvasesPane.tsx
index 50cc21455b35..9edc3e5e2ffe 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/CanvasesPane.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/CanvasesPane.tsx
@@ -18,7 +18,6 @@ import {
EmptyMedia,
EmptyTitle,
MenuLabel,
- Spinner,
} from "@posthog/quill";
import { formatAbsoluteDateTime, formatRelativeAge } from "@posthog/shared";
import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";
@@ -32,6 +31,7 @@ import { useAllCanvases } from "@posthog/ui/features/canvas/hooks/useDashboards"
import { useSelectedCanvasId } from "@posthog/ui/features/canvas/hooks/useSelectedCanvasId";
import { useCanvasViewedStore } from "@posthog/ui/features/canvas/stores/canvasViewedStore";
import { userDisplayName } from "@posthog/ui/features/canvas/utils/userDisplay";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { track } from "@posthog/ui/shell/analytics";
import { useNavigate } from "@tanstack/react-router";
import {
@@ -166,9 +166,7 @@ export function CanvasesPane({
/>
<AutocompleteList className="sidebar-autocomplete-tree scroll-mask-8 !max-h-none !p-1.5 min-h-0 flex-1 overflow-y-auto">
{isLoading ? (
- <div className="flex justify-center py-10">
- <Spinner />
- </div>
+ <LoadingState className="py-10" />
) : viewModel.canvases.length === 0 ? (
<Empty className="border-0 py-8">
<EmptyHeader>
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelFeedView.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelFeedView.tsx
index a504c728afeb..7ecab7b689d8 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelFeedView.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelFeedView.tsx
@@ -28,7 +28,6 @@ import {
PopoverContent,
PopoverTrigger,
Skeleton,
- Spinner,
Tabs,
TabsList,
TabsTrigger,
@@ -89,6 +88,7 @@ import {
import { useRenameTask } from "@posthog/ui/features/tasks/useTaskMutations";
import { FileIcon } from "@posthog/ui/primitives/FileIcon";
import { useInView } from "@posthog/ui/primitives/hooks/useInView";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { toast } from "@posthog/ui/primitives/toast";
import { openExternalUrl } from "@posthog/ui/shell/openExternal";
import { parseHttpsUrl } from "@posthog/ui/utils/posthogLinks";
@@ -127,7 +127,7 @@ const PR_STATE_LABELS: Record<
function statusBadge(status: TaskRunStatus) {
return (
<Badge variant={runStatusVariant(status)}>
- {status === "in_progress" && <Spinner className="size-2.5" />}
+ {status === "in_progress" && <Spinner size="xs" />}
{RUN_STATUS_LABELS[status]}
</Badge>
);
@@ -192,7 +192,7 @@ function useTaskStatusDisplay(task: Task): TaskStatusDisplay {
: "In progress";
base = (
<Badge variant="info">
- <Spinner className="size-2.5" />
+ <Spinner size="xs" />
{label}
</Badge>
);
@@ -590,7 +590,7 @@ function PrCiLine({ url }: { url: string }) {
if (!checks.isPending) return null;
return (
<div className="flex items-center gap-1.5 text-(--gray-9) text-xs">
- <Spinner className="size-3" />
+ <Spinner size="sm" />
Checking CI…
</div>
);
@@ -628,7 +628,7 @@ function PrPopoverContent({ url }: { url: string }) {
// The title resolves via gh after open; hold its line so the card
// doesn't jump when it lands.
<div className="flex h-5 items-center">
- <Spinner className="size-3" />
+ <Spinner size="sm" />
</div>
)}
<PrCiLine url={url} />
@@ -668,7 +668,7 @@ function PrPopoverRow({ url }: { url: string }) {
style={{ backgroundColor: ci.color }}
/>
) : (
- checks.isPending && <Spinner className="size-3 shrink-0" />
+ checks.isPending && <Spinner size="sm" className="shrink-0" />
)}
</button>
);
@@ -1211,7 +1211,7 @@ function PendingFeedRow({ pending }: { pending: PendingKickoff }) {
New task
</span>
<Badge variant="info">
- <Spinner className="size-2.5" />
+ <Spinner size="xs" />
Starting…
</Badge>
</div>
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelIntro.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelIntro.tsx
index 512e57692dcd..3b566a1a21e3 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelIntro.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelIntro.tsx
@@ -5,13 +5,13 @@ import {
ItemDescription,
ItemMedia,
ItemTitle,
- Spinner,
} from "@posthog/quill";
import { EXTERNAL_LINKS, getLocalDayDiff } from "@posthog/shared";
import type { TaskChannel } from "@posthog/shared/domain-types";
import { mentionChipClass } from "@posthog/ui/features/canvas/components/MentionText";
import { useChannelsLayout } from "@posthog/ui/features/canvas/hooks/useChannelsLayout";
import { userDisplayName } from "@posthog/ui/features/canvas/utils/userDisplay";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { openExternalUrl } from "@posthog/ui/shell/openExternal";
import { Heading, Text } from "@radix-ui/themes";
import { FileCheckCorner, FilePlusCorner, Info, X } from "lucide-react";
@@ -97,7 +97,7 @@ export function ChannelIntro({
{contextMdState === "building" && (
<Item className="w-full border-blue-6 bg-blue-2">
<ItemMedia variant="icon">
- <Spinner className="size-4" />
+ <Spinner size="md" />
</ItemMedia>
<ItemContent className="self-start">
<ItemTitle>Creating context.md</ItemTitle>
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelReportsSection.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelReportsSection.tsx
index 6b17bcdd2992..81cd5f0667dc 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelReportsSection.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelReportsSection.tsx
@@ -7,7 +7,6 @@ import {
EmptyMedia,
EmptyTitle,
Skeleton,
- Spinner,
} from "@posthog/quill";
import type { SignalReport } from "@posthog/shared/types";
import { ReportRow } from "@posthog/ui/features/canvas/components/ReportRow";
@@ -17,6 +16,7 @@ import {
} from "@posthog/ui/features/canvas/hooks/useChannelReports";
import { useOpenInboxReport } from "@posthog/ui/features/inbox/hooks/useOpenInboxReport";
import { useInView } from "@posthog/ui/primitives/hooks/useInView";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useEffect, useMemo } from "react";
/**
diff --git a/products/desktop/packages/ui/src/features/canvas/components/SpaceRepositories.tsx b/products/desktop/packages/ui/src/features/canvas/components/SpaceRepositories.tsx
index cba72d71cd7c..e538db7d1d37 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/SpaceRepositories.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/SpaceRepositories.tsx
@@ -1,10 +1,10 @@
-import { Spinner } from "@posthog/quill";
import type { TaskChannel } from "@posthog/shared/domain-types";
import { useOptionalAuthenticatedClient } from "@posthog/ui/features/auth/authClient";
import { useCurrentUser } from "@posthog/ui/features/auth/useCurrentUser";
import { useUpdateTaskChannelRepositories } from "@posthog/ui/features/canvas/hooks/useTaskChannels";
import { RepositoriesField } from "@posthog/ui/features/integrations/components/RepositoriesField";
import { SettingsCard } from "@posthog/ui/features/settings/components/SettingsCard";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
export function SpaceRepositories({ channel }: { channel: TaskChannel }) {
const update = useUpdateTaskChannelRepositories();
@@ -29,7 +29,7 @@ export function SpaceRepositories({ channel }: { channel: TaskChannel }) {
/>
{update.isPending && (
<span className="flex items-center gap-1.5 text-[12px] text-muted-foreground">
- <Spinner /> Saving…
+ <Spinner size="sm" aria-hidden="true" /> Saving…
</span>
)}
{update.error && (
diff --git a/products/desktop/packages/ui/src/features/canvas/components/TaskCommentsList.tsx b/products/desktop/packages/ui/src/features/canvas/components/TaskCommentsList.tsx
index 4cdacfa6c05c..ef3b42b228d0 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/TaskCommentsList.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/TaskCommentsList.tsx
@@ -19,7 +19,6 @@ import {
EmptyHeader,
EmptyMedia,
EmptyTitle,
- Spinner,
} from "@posthog/quill";
import type {
Task,
@@ -67,6 +66,7 @@ import {
useSetCommentResolved,
} from "@posthog/ui/features/sessions/components/useComments";
import { FileIcon } from "@posthog/ui/primitives/FileIcon";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
const EMPTY_COMMENTS: ResourceComment[] = [];
@@ -693,9 +693,7 @@ export function TaskCommentsList({
</EmptyHeader>
</Empty>
) : loading && threads.length === 0 ? (
- <div className="flex justify-center py-8">
- <Spinner />
- </div>
+ <LoadingState className="py-8" />
) : visibleThreads.length === 0 ? (
<Empty className="h-full border-0">
<EmptyHeader>
diff --git a/products/desktop/packages/ui/src/features/canvas/components/TaskFeedModal.tsx b/products/desktop/packages/ui/src/features/canvas/components/TaskFeedModal.tsx
index 7dfa995ebce3..91915f642b15 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/TaskFeedModal.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/TaskFeedModal.tsx
@@ -10,7 +10,6 @@ import {
DialogHeader,
DialogTitle,
Input,
- Spinner,
} from "@posthog/quill";
import { formatRelativeTimeShort } from "@posthog/shared";
import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";
@@ -29,6 +28,7 @@ import {
useTaskFeedsStore,
} from "@posthog/ui/features/canvas/stores/taskFeedsStore";
import { useDebouncedValue } from "@posthog/ui/primitives/hooks/useDebouncedValue";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { track } from "@posthog/ui/shell/analytics";
import { useEffect, useMemo, useRef, useState } from "react";
@@ -212,7 +212,7 @@ export function TaskFeedModal({
<span className="font-medium">Matches</span>
<span className="ml-auto flex items-center gap-1.5 tabular-nums">
{counting ? (
- <Spinner className="size-3" />
+ <Spinner size="sm" />
) : preview.error && preview.canRetry ? (
<Button
variant="link-muted"
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ThreadPanel.tsx b/products/desktop/packages/ui/src/features/canvas/components/ThreadPanel.tsx
index ff5eeec9a1fe..69c779bfaf88 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ThreadPanel.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ThreadPanel.tsx
@@ -29,7 +29,6 @@ import {
EmptyTitle,
InputGroupAddon,
InputGroupButton,
- Spinner,
ThreadItem,
ThreadItemAction,
ThreadItemActions,
@@ -58,6 +57,7 @@ import { userDisplayName } from "@posthog/ui/features/canvas/utils/userDisplay";
import { openPrInReview } from "@posthog/ui/features/code-review/openPrInReview";
import { usePrArtifact } from "@posthog/ui/features/git-interaction/usePrArtifact";
import { taskDetailQuery } from "@posthog/ui/features/tasks/queries";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { openExternalUrl } from "@posthog/ui/shell/openExternal";
import { useQuery } from "@tanstack/react-query";
@@ -155,7 +155,7 @@ export function AgentStatusLine({ status }: { status: ThreadAgentStatus }) {
className="flex items-center gap-1.5 px-3 py-1.5 text-muted-foreground text-xs"
>
{status.phase === "active" ? (
- <Spinner className="size-3" />
+ <Spinner size="sm" />
) : (
<RobotIcon size={12} />
)}
diff --git a/products/desktop/packages/ui/src/features/canvas/components/WebsiteContext.tsx b/products/desktop/packages/ui/src/features/canvas/components/WebsiteContext.tsx
index 2b18d313e057..cc492f552235 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/WebsiteContext.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/WebsiteContext.tsx
@@ -29,6 +29,7 @@ import { useChannelContextWikiPage } from "@posthog/ui/features/context-wiki/hoo
import { MarkdownRenderer } from "@posthog/ui/features/editor/components/MarkdownRenderer";
import { useContextLayerFlag } from "@posthog/ui/features/feature-flags/useContextLayerFlag";
import { useSetHeaderContent } from "@posthog/ui/hooks/useSetHeaderContent";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import {
PageHeader,
PageHeaderActions,
@@ -38,6 +39,7 @@ import {
PageHeaderTitle,
PageHeaderTitleRow,
} from "@posthog/ui/primitives/PageHeader";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { navigateToSpacesContext } from "@posthog/ui/router/navigationBridge";
import { track } from "@posthog/ui/shell/analytics";
import {
@@ -48,7 +50,6 @@ import {
ScrollArea,
SegmentedControl,
Select,
- Spinner,
Text,
TextArea,
} from "@radix-ui/themes";
@@ -69,11 +70,7 @@ export function WebsiteContext({ channelId }: WebsiteContextProps) {
const wikiPage = useChannelContextWikiPage(channelId, contextLayerEnabled);
if (contextLayerEnabled && wikiPage.isLoading) {
- return (
- <Flex align="center" justify="center" className="h-full">
- <Spinner size="2" />
- </Flex>
- );
+ return <LoadingState />;
}
if (contextLayerEnabled && wikiPage.data) {
@@ -229,11 +226,7 @@ function LegacyWebsiteContext({ channelId }: WebsiteContextProps) {
}, [selectedVersionNumber, versions]);
if (isLoadingLatest) {
- return (
- <Flex align="center" justify="center" className="h-full">
- <Spinner size="2" />
- </Flex>
- );
+ return <LoadingState />;
}
if (latestError) {
@@ -292,7 +285,7 @@ function LegacyWebsiteContext({ channelId }: WebsiteContextProps) {
live and not just stale cache. */}
{isFetchingLatest && !isLoadingLatest ? (
<Flex align="center" gap="1">
- <Spinner size="1" />
+ <Spinner size="sm" />
<Text className="text-[12px] text-gray-10">Refreshing…</Text>
</Flex>
) : null}
@@ -357,7 +350,7 @@ function LegacyWebsiteContext({ channelId }: WebsiteContextProps) {
(hasInstructions ? !hasDraft : draft.trim().length === 0)
}
>
- {isPublishing ? <Spinner size="1" /> : null}
+ {isPublishing ? <Spinner size="sm" /> : null}
Save new version
</Button>
</Flex>
diff --git a/products/desktop/packages/ui/src/features/canvas/freeform/CanvasBuildStatus.tsx b/products/desktop/packages/ui/src/features/canvas/freeform/CanvasBuildStatus.tsx
index 1d4e089e2a1c..f2292a65be6e 100644
--- a/products/desktop/packages/ui/src/features/canvas/freeform/CanvasBuildStatus.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/freeform/CanvasBuildStatus.tsx
@@ -2,7 +2,6 @@ import {
ArrowClockwiseIcon,
CheckCircleIcon,
PushPinIcon,
- SpinnerGapIcon,
WarningCircleIcon,
XIcon,
} from "@phosphor-icons/react";
@@ -21,7 +20,7 @@ import {
TooltipTrigger,
} from "@posthog/quill";
import type { CanvasDiagnostic } from "@posthog/shared";
-import { Spin } from "@posthog/ui/primitives/Spinner";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { toast } from "@posthog/ui/primitives/toast";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { useEffect, useState } from "react";
@@ -107,9 +106,7 @@ export function CanvasBuildStatus({
className="flex items-center gap-1"
data-testid="canvas-build-active"
>
- <Spin className="text-gray-9">
- <SpinnerGapIcon size={14} />
- </Spin>
+ <Spinner size="md" className="text-gray-9" />
<Text size="xs" variant="muted">
{active.buildStatus === "queued" ? "Queued" : "Building"} · {elapsed}
</Text>
diff --git a/products/desktop/packages/ui/src/features/canvas/freeform/CanvasSidePanel.tsx b/products/desktop/packages/ui/src/features/canvas/freeform/CanvasSidePanel.tsx
index e632c18be91b..995066564bf3 100644
--- a/products/desktop/packages/ui/src/features/canvas/freeform/CanvasSidePanel.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/freeform/CanvasSidePanel.tsx
@@ -1,8 +1,4 @@
-import {
- ChatCircleIcon,
- SidebarSimpleIcon,
- SpinnerGapIcon,
-} from "@phosphor-icons/react";
+import { ChatCircleIcon, SidebarSimpleIcon } from "@phosphor-icons/react";
import {
Button,
Empty,
@@ -25,7 +21,7 @@ import { useCanvasChatPanelStore } from "@posthog/ui/features/canvas/stores/canv
import type { EditorHandle } from "@posthog/ui/features/message-editor/types";
import { EmbeddedSessionView } from "@posthog/ui/features/sessions/components/EmbeddedSessionView";
import { taskDetailQuery } from "@posthog/ui/features/tasks/queries";
-import { Spin } from "@posthog/ui/primitives/Spinner";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { useQuery } from "@tanstack/react-query";
import { type Ref, useEffect, useRef } from "react";
@@ -173,13 +169,7 @@ function CanvasChatLoader({ taskId }: { taskId: string }) {
const { data: task } = useQuery(taskDetailQuery(taskId));
if (!task) {
- return (
- <div className="flex h-full items-center justify-center">
- <Spin className="text-gray-9">
- <SpinnerGapIcon size={18} />
- </Spin>
- </div>
- );
+ return <LoadingState />;
}
return <EmbeddedSessionView task={task} />;
@@ -203,13 +193,7 @@ function CanvasCommentsLoader({
const { data: task } = useQuery(taskDetailQuery(taskId));
if (!task) {
- return (
- <div className="flex h-full items-center justify-center">
- <Spin className="text-gray-9">
- <SpinnerGapIcon size={18} />
- </Spin>
- </div>
- );
+ return <LoadingState />;
}
return (
diff --git a/products/desktop/packages/ui/src/features/canvas/freeform/FreeformCanvasView.tsx b/products/desktop/packages/ui/src/features/canvas/freeform/FreeformCanvasView.tsx
index 9aef2281ebb8..f7fc10485f93 100644
--- a/products/desktop/packages/ui/src/features/canvas/freeform/FreeformCanvasView.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/freeform/FreeformCanvasView.tsx
@@ -6,7 +6,6 @@ import {
PencilSimpleIcon,
ShapesIcon,
SidebarSimpleIcon,
- SpinnerGapIcon,
WarningIcon,
} from "@phosphor-icons/react";
import {
@@ -85,8 +84,9 @@ import {
import { useCommentsQuery } from "@posthog/ui/features/sessions/components/useComments";
import { useSessionForTask } from "@posthog/ui/features/sessions/useSession";
import { taskDetailQuery } from "@posthog/ui/features/tasks/queries";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { ResizableSidebar } from "@posthog/ui/primitives/ResizableSidebar";
-import { Spin } from "@posthog/ui/primitives/Spinner";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { toast } from "@posthog/ui/primitives/toast";
import { track } from "@posthog/ui/shell/analytics";
import {
@@ -991,9 +991,7 @@ export function FreeformCanvasView({
{interactive &&
(isGenerating && effectiveTaskId ? (
<>
- <Spin className="text-accent-9">
- <SpinnerGapIcon size={14} />
- </Spin>
+ <Spinner size="md" className="text-accent-9" />
<Text size="1" className="text-gray-10">
Generating
</Text>
@@ -1152,7 +1150,7 @@ export function FreeformCanvasView({
</Flex>
) : buildsLoading ? (
<ScrollArea className="h-full">
- <LoadingState />
+ <LoadingState label="Loading canvas" />
</ScrollArea>
) : (
<ScrollArea className="h-full">
@@ -1251,7 +1249,10 @@ export function FreeformCanvasView({
taskId={effectiveTaskId ?? ""}
/>
) : dashboardLoading || buildsLoading || headSourceLoading ? (
- <LoadingState />
+ // Shown while the canvas record is still loading, so a canvas
+ // that actually has content doesn't flash the empty state
+ // before its source/builds resolve.
+ <LoadingState label="Loading canvas" />
) : hasSource ? (
// Source exists but nothing is renderable yet: a multi-file
// project whose build hasn't succeeded. The toolbar's build
@@ -1368,23 +1369,6 @@ export function FreeformCanvasView({
);
}
-// Shown while the canvas record is still loading, so a canvas that actually has
-// content doesn't flash the empty state before its source/builds resolve.
-function LoadingState() {
- return (
- <Empty className="h-full">
- <EmptyHeader>
- <EmptyMedia variant="icon">
- <Spin className="text-accent-9">
- <SpinnerGapIcon size={18} />
- </Spin>
- </EmptyMedia>
- <EmptyTitle>Loading canvas</EmptyTitle>
- </EmptyHeader>
- </Empty>
- );
-}
-
// Centered status shown while a generation task runs on an empty canvas, with a
// button to jump to the task doing the work.
function GeneratingState({
@@ -1398,9 +1382,7 @@ function GeneratingState({
<Empty className="h-full border-0">
<EmptyHeader>
<EmptyMedia variant="icon">
- <Spin className="text-accent-9">
- <SpinnerGapIcon size={18} />
- </Spin>
+ <Spinner size="md" className="text-accent-9" />
</EmptyMedia>
<EmptyTitle>Generating</EmptyTitle>
<EmptyDescription>An agent is building this canvas.</EmptyDescription>
diff --git a/products/desktop/packages/ui/src/features/canvas/grid/ComponentFrame.tsx b/products/desktop/packages/ui/src/features/canvas/grid/ComponentFrame.tsx
index dea10b04f703..a9fb19b68df5 100644
--- a/products/desktop/packages/ui/src/features/canvas/grid/ComponentFrame.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/grid/ComponentFrame.tsx
@@ -3,10 +3,11 @@ import {
type GridPlacement,
pinnedComponentVersion,
} from "@posthog/core/canvas/gridLayoutSchemas";
-import { Button, Spinner, Text } from "@posthog/quill";
+import { Button, Text } from "@posthog/quill";
import type { CanvasCapabilities } from "@posthog/shared";
import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";
import { useCanvasBuilds } from "@posthog/ui/features/canvas/hooks/useCanvasBuilds";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { track } from "@posthog/ui/shell/analytics";
import { useQueryClient } from "@tanstack/react-query";
import { useCallback, useMemo, useRef } from "react";
@@ -135,11 +136,7 @@ export function ComponentFrame({ placement }: { placement: GridPlacement }) {
</div>
);
}
- return (
- <div className="flex h-full w-full items-center justify-center">
- <Spinner />
- </div>
- );
+ return <LoadingState />;
}
return (
<BuiltCanvas
diff --git a/products/desktop/packages/ui/src/features/canvas/grid/GridCanvasView.tsx b/products/desktop/packages/ui/src/features/canvas/grid/GridCanvasView.tsx
index 902c1d777b0e..0a37a4520e8b 100644
--- a/products/desktop/packages/ui/src/features/canvas/grid/GridCanvasView.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/grid/GridCanvasView.tsx
@@ -3,7 +3,7 @@ import type {
GridPlacement,
LayoutOperation,
} from "@posthog/core/canvas/gridLayoutSchemas";
-import { Button, Spinner, Text } from "@posthog/quill";
+import { Button, Text } from "@posthog/quill";
import { canvasCommentTaskId } from "@posthog/ui/features/canvas/freeform/canvasCommentTask";
import { useChannels } from "@posthog/ui/features/canvas/hooks/useChannels";
import {
@@ -12,6 +12,7 @@ import {
} from "@posthog/ui/features/canvas/hooks/useDashboards";
import { useGenerateFreeformCanvas } from "@posthog/ui/features/canvas/hooks/useGenerateFreeformCanvas";
import { useCanvasChatPanelStore } from "@posthog/ui/features/canvas/stores/canvasChatPanelStore";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { ResizableSidebar } from "@posthog/ui/primitives/ResizableSidebar";
import { useCallback, useMemo, useState } from "react";
import { GridChatPanel, type GridChatTarget } from "./GridChatPanel";
@@ -201,11 +202,7 @@ export function GridCanvasView({
);
if (isLoading || !layout || !placements || !dashboard) {
- return (
- <div className="flex h-full items-center justify-center">
- <Spinner />
- </div>
- );
+ return <LoadingState />;
}
return (
<div className="flex h-full">
diff --git a/products/desktop/packages/ui/src/features/canvas/grid/GridChatPanel.tsx b/products/desktop/packages/ui/src/features/canvas/grid/GridChatPanel.tsx
index 99a7b83a5b72..68612b5130ed 100644
--- a/products/desktop/packages/ui/src/features/canvas/grid/GridChatPanel.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/grid/GridChatPanel.tsx
@@ -2,7 +2,6 @@ import { CaretLeftIcon, SidebarSimpleIcon } from "@phosphor-icons/react";
import {
Button,
Input,
- Spinner,
Tabs,
TabsList,
TabsTrigger,
@@ -15,6 +14,7 @@ import { useThreadConversation } from "@posthog/ui/features/canvas/hooks/useThre
import { useCanvasChatPanelStore } from "@posthog/ui/features/canvas/stores/canvasChatPanelStore";
import { EmbeddedSessionView } from "@posthog/ui/features/sessions/components/EmbeddedSessionView";
import { taskDetailQuery } from "@posthog/ui/features/tasks/queries";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { useQuery } from "@tanstack/react-query";
import { useState } from "react";
@@ -157,11 +157,7 @@ export function GridChatPanel({
function TaskChat({ taskId }: { taskId: string }) {
const { data: task } = useQuery(taskDetailQuery(taskId));
if (!task) {
- return (
- <div className="flex flex-1 items-center justify-center">
- <Spinner />
- </div>
- );
+ return <LoadingState className="flex-1" />;
}
// Constrain the chat body like the comments branch beside it: a shrinkable
// flex child below the fixed header needs min-h-0 so it fills the remaining
@@ -190,11 +186,7 @@ function CanvasComments({
}) {
const { data: task } = useQuery(taskDetailQuery(taskId));
if (!task) {
- return (
- <div className="flex flex-1 items-center justify-center">
- <Spinner />
- </div>
- );
+ return <LoadingState className="flex-1" />;
}
return (
<div className="min-h-0 flex-1">
diff --git a/products/desktop/packages/ui/src/features/canvas/grid/GridPlacementTile.tsx b/products/desktop/packages/ui/src/features/canvas/grid/GridPlacementTile.tsx
index 9f5e0195f380..adb3181304de 100644
--- a/products/desktop/packages/ui/src/features/canvas/grid/GridPlacementTile.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/grid/GridPlacementTile.tsx
@@ -1,9 +1,10 @@
import type { GridPlacement } from "@posthog/core/canvas/gridLayoutSchemas";
-import { Button, Spinner, Text } from "@posthog/quill";
+import { Button, Text } from "@posthog/quill";
import { isTerminalStatus } from "@posthog/shared/domain-types";
import { PromptInput } from "@posthog/ui/features/message-editor/components/PromptInput";
import { useSessionStore } from "@posthog/ui/features/sessions/sessionStore";
import { taskDetailQuery } from "@posthog/ui/features/tasks/queries";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useQuery } from "@tanstack/react-query";
import { useState } from "react";
import { ComponentFrame } from "./ComponentFrame";
@@ -142,7 +143,7 @@ function GeneratingTile({
return (
<div className="flex h-full w-full flex-col items-center justify-center gap-2 p-3 text-center">
- <Spinner />
+ <Spinner size="lg" className="text-gray-9" />
<Text size="sm" className="line-clamp-2">
{placement.prompt ?? "Building this widget…"}
</Text>
diff --git a/products/desktop/packages/ui/src/features/canvas/grid/HomeView.tsx b/products/desktop/packages/ui/src/features/canvas/grid/HomeView.tsx
index 9f4e18203fac..d7df4eed653e 100644
--- a/products/desktop/packages/ui/src/features/canvas/grid/HomeView.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/grid/HomeView.tsx
@@ -9,10 +9,10 @@ import {
EmptyMedia,
EmptyTitle,
Heading,
- Spinner,
} from "@posthog/quill";
import { AUTH_SCOPED_QUERY_META } from "@posthog/ui/features/auth/useCurrentUser";
import { useCanvasChatPanelStore } from "@posthog/ui/features/canvas/stores/canvasChatPanelStore";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { useQuery } from "@tanstack/react-query";
import { useState } from "react";
import { GridCanvasView } from "./GridCanvasView";
@@ -80,11 +80,7 @@ export function HomeView() {
}
if (!home) {
- return (
- <div className="flex h-full items-center justify-center">
- <Spinner />
- </div>
- );
+ return <LoadingState />;
}
return (
<div className="flex h-full flex-col">
diff --git a/products/desktop/packages/ui/src/features/code-review/components/CloudReviewPage.tsx b/products/desktop/packages/ui/src/features/code-review/components/CloudReviewPage.tsx
index 39e4a3694ece..9ece3ec3a59a 100644
--- a/products/desktop/packages/ui/src/features/code-review/components/CloudReviewPage.tsx
+++ b/products/desktop/packages/ui/src/features/code-review/components/CloudReviewPage.tsx
@@ -2,7 +2,7 @@ import { buildToolCallFallbacks } from "@posthog/core/code-review/buildToolCallF
import { buildGithubFileUrl } from "@posthog/core/code-review/reviewItemKeys";
import { extractCloudFileDiff } from "@posthog/core/task-detail/cloudToolChanges";
import type { Task } from "@posthog/shared/domain-types";
-import { Flex, Spinner, Text } from "@radix-ui/themes";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { useMemo } from "react";
import { useDiffViewerStore } from "../../code-editor/diffViewerStore";
import { usePrDetails } from "../../git-interaction/usePrDetails";
@@ -125,19 +125,7 @@ export function CloudReviewPage({ task }: CloudReviewPageProps) {
if (!prUrl && !effectiveBranch && reviewFiles.length === 0) {
if (isRunActive) {
- return (
- <Flex
- align="center"
- justify="center"
- height="100%"
- className="text-gray-10"
- >
- <Flex direction="column" align="center" gap="2">
- <Spinner size="2" />
- <Text className="text-sm">Waiting for changes...</Text>
- </Flex>
- </Flex>
- );
+ return <LoadingState label="Waiting for changes..." />;
}
return null;
}
diff --git a/products/desktop/packages/ui/src/features/code-review/components/LazyReviewPages.tsx b/products/desktop/packages/ui/src/features/code-review/components/LazyReviewPages.tsx
index 922b5c338e61..65c5ea9d549b 100644
--- a/products/desktop/packages/ui/src/features/code-review/components/LazyReviewPages.tsx
+++ b/products/desktop/packages/ui/src/features/code-review/components/LazyReviewPages.tsx
@@ -1,5 +1,5 @@
import type { Task } from "@posthog/shared/domain-types";
-import { DotsCircleSpinner } from "@posthog/ui/primitives/DotsCircleSpinner";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { lazy, type ReactNode, Suspense } from "react";
import { loadCloudReviewPage, loadReviewPage } from "./preloadReviewPages";
@@ -9,17 +9,9 @@ import { loadCloudReviewPage, loadReviewPage } from "./preloadReviewPages";
const ReviewPageLazy = lazy(loadReviewPage);
const CloudReviewPageLazy = lazy(loadCloudReviewPage);
-function ReviewFallback(): ReactNode {
- return (
- <div className="flex h-full items-center justify-center">
- <DotsCircleSpinner />
- </div>
- );
-}
-
export function LazyReviewPage({ task }: { task: Task }): ReactNode {
return (
- <Suspense fallback={<ReviewFallback />}>
+ <Suspense fallback={<LoadingState />}>
<ReviewPageLazy task={task} />
</Suspense>
);
@@ -27,7 +19,7 @@ export function LazyReviewPage({ task }: { task: Task }): ReactNode {
export function LazyCloudReviewPage({ task }: { task: Task }): ReactNode {
return (
- <Suspense fallback={<ReviewFallback />}>
+ <Suspense fallback={<LoadingState />}>
<CloudReviewPageLazy task={task} />
</Suspense>
);
diff --git a/products/desktop/packages/ui/src/features/code-review/components/ReviewShell.tsx b/products/desktop/packages/ui/src/features/code-review/components/ReviewShell.tsx
index 52caf0658512..24e02139e962 100644
--- a/products/desktop/packages/ui/src/features/code-review/components/ReviewShell.tsx
+++ b/products/desktop/packages/ui/src/features/code-review/components/ReviewShell.tsx
@@ -6,8 +6,9 @@ import { useArchivedTaskIds } from "@posthog/ui/features/archive/useArchivedTask
import { useCloudPrUrl } from "@posthog/ui/features/git-interaction/useCloudPrUrl";
import { useTaskPrStatus } from "@posthog/ui/features/sidebar/useTaskPrStatus";
import { useIsWiderThan } from "@posthog/ui/primitives/hooks/useObservedWidth";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { ResizeHandle } from "@posthog/ui/primitives/ResizeHandle";
-import { Flex, Spinner, Text } from "@radix-ui/themes";
+import { Flex, Text } from "@radix-ui/themes";
import {
type ReactNode,
useCallback,
@@ -365,11 +366,7 @@ export function ReviewShell({
let reviewContent: ReactNode;
if (isLoading) {
- reviewContent = (
- <Flex align="center" justify="center" className="min-h-0 flex-1">
- <Spinner size="2" />
- </Flex>
- );
+ reviewContent = <LoadingState className="min-h-0 flex-1" />;
} else if (isEmpty || filteredItems.length === 0) {
reviewContent = (
<Flex align="center" justify="center" className="min-h-0 flex-1">
diff --git a/products/desktop/packages/ui/src/features/command-center/components/CommandCenterPanel.tsx b/products/desktop/packages/ui/src/features/command-center/components/CommandCenterPanel.tsx
index 9c16f02859f3..e84de5ff193c 100644
--- a/products/desktop/packages/ui/src/features/command-center/components/CommandCenterPanel.tsx
+++ b/products/desktop/packages/ui/src/features/command-center/components/CommandCenterPanel.tsx
@@ -22,7 +22,6 @@ import {
EmptyHeader,
EmptyMedia,
EmptyTitle,
- Spinner as QuillSpinner,
Text as QuillText,
} from "@posthog/quill";
import { ANALYTICS_EVENTS, type WorkspaceMode } from "@posthog/shared";
@@ -33,6 +32,7 @@ import { useDashboard } from "@posthog/ui/features/canvas/hooks/useDashboards";
import { useSettingsStore } from "@posthog/ui/features/settings/settingsStore";
import { destroyShellTerminal } from "@posthog/ui/features/terminal/destroyShellTerminal";
import { ShellTerminal } from "@posthog/ui/features/terminal/ShellTerminal";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { openTask } from "@posthog/ui/router/useOpenTask";
import { track } from "@posthog/ui/shell/analytics";
import { useHostCapabilities } from "@posthog/ui/shell/useHostCapabilities";
@@ -454,11 +454,7 @@ function BrainrotCell({ cellIndex }: { cellIndex: number }) {
onLoad={handleLoad}
className="h-full w-full border-0"
/>
- {loading && (
- <div className="absolute inset-0 flex items-center justify-center text-gray-11">
- <QuillSpinner className="h-6 w-6" />
- </div>
- )}
+ {loading && <LoadingState className="absolute inset-0" />}
</div>
</div>
);
@@ -579,9 +575,7 @@ function CanvasCell({
</div>
<div className="min-h-0 flex-1">
{isLoading ? (
- <div className="flex h-full items-center justify-center">
- <QuillSpinner className="h-6 w-6" />
- </div>
+ <LoadingState />
) : dashboard?.kind === "grid" ? (
<GridCanvasView canvasId={canvasId} interactive={false} />
) : dashboard ? (
diff --git a/products/desktop/packages/ui/src/features/consent/ConsentStep.tsx b/products/desktop/packages/ui/src/features/consent/ConsentStep.tsx
index 200e398a8ad9..177c38a68a89 100644
--- a/products/desktop/packages/ui/src/features/consent/ConsentStep.tsx
+++ b/products/desktop/packages/ui/src/features/consent/ConsentStep.tsx
@@ -1,7 +1,8 @@
import { ArrowLeft, ArrowRight } from "@phosphor-icons/react";
-import { Button, Spinner } from "@posthog/quill";
+import { Button } from "@posthog/quill";
import { useIsOrgAdmin } from "@posthog/ui/features/auth/useOrgRole";
import { StepActions } from "@posthog/ui/features/onboarding/components/StepActions";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { AnimatePresence, motion } from "framer-motion";
import { useState } from "react";
import { ConsentErrorContent } from "./ConsentErrorContent";
@@ -44,9 +45,7 @@ export function ConsentStep({
transition={{ duration: 0.16 }}
>
{consent.status === "loading" ? (
- <div className="flex w-full justify-center">
- <Spinner />
- </div>
+ <LoadingState />
) : consent.status === "error" ? (
<ConsentErrorContent onRetry={consent.retry} />
) : (
diff --git a/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiDreamsPane.tsx b/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiDreamsPane.tsx
index 6bce20dcee80..689ea92f0b27 100644
--- a/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiDreamsPane.tsx
+++ b/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiDreamsPane.tsx
@@ -16,12 +16,13 @@ import {
EmptyHeader,
EmptyMedia,
EmptyTitle,
- Spinner,
Text,
} from "@posthog/quill";
import { MarkdownRenderer } from "@posthog/ui/features/editor/components/MarkdownRenderer";
import { DIFFS_HIGHLIGHTER_OPTIONS } from "@posthog/ui/features/sessions/diffHighlighterOptions";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { RelativeTimestamp } from "@posthog/ui/primitives/RelativeTimestamp";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useMemo, useState } from "react";
import type { Components } from "react-markdown";
import { useThemeStore } from "../../../shell/themeStore";
@@ -57,11 +58,7 @@ export function ContextWikiDreamsPane() {
const selectedRun = dreams.find((dream) => dream.sha === effectiveSha);
if (isLoading) {
- return (
- <div className="flex h-full items-center justify-center">
- <Spinner className="size-5" />
- </div>
- );
+ return <LoadingState />;
}
if (error) {
@@ -148,7 +145,7 @@ function ActiveDreamListItem({ run }: { run: ContextWikiActiveDreamRun }) {
<div className="flex flex-col gap-1 border-(--gray-5) border-b bg-(--gray-2) px-4 py-3">
<div className="flex items-center justify-between gap-2">
<div className="flex items-center gap-2">
- <Spinner className="size-3.5" />
+ <Spinner size="md" />
<Text size="sm" weight="medium">
{ACTIVE_DREAM_LABELS[run.run_status]}
</Text>
@@ -259,9 +256,7 @@ function DreamDetail({ run }: { run: ContextWikiDreamRun }) {
) : null}
<div className="flex flex-col gap-3 p-4">
{isLoading ? (
- <div className="flex items-center justify-center py-8">
- <Spinner className="size-5" />
- </div>
+ <LoadingState className="py-8" />
) : error ? (
<div className="flex flex-col items-center gap-2 py-8 text-[13px] text-gray-10">
<span>Couldn't load this run's changes: {error.message}</span>
diff --git a/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiHealthPane.tsx b/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiHealthPane.tsx
index 0b9565eeda83..9e52429a2816 100644
--- a/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiHealthPane.tsx
+++ b/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiHealthPane.tsx
@@ -8,9 +8,9 @@ import {
EmptyMedia,
EmptyTitle,
Heading,
- Spinner,
Text,
} from "@posthog/quill";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { useMemo } from "react";
import { useContextWikiHealthReport } from "../hooks/useContextWiki";
@@ -24,7 +24,7 @@ export function ContextWikiHealthPane({
const groups = useMemo(() => groupFindings(data?.findings ?? []), [data]);
if (isLoading) {
- return <Spinner className="m-auto" />;
+ return <LoadingState />;
}
if (error) {
return (
diff --git a/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiPagePane.tsx b/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiPagePane.tsx
index 95de3d4b47ec..3e48313b4fc8 100644
--- a/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiPagePane.tsx
+++ b/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiPagePane.tsx
@@ -5,13 +5,14 @@ import {
import {
Button,
cn,
- Spinner,
Textarea,
ToggleGroup,
ToggleGroupItem,
} from "@posthog/quill";
import { MarkdownRenderer } from "@posthog/ui/features/editor/components/MarkdownRenderer";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { RelativeTimestamp } from "@posthog/ui/primitives/RelativeTimestamp";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useState } from "react";
import type { Components } from "react-markdown";
import {
@@ -106,11 +107,7 @@ export function ContextWikiPagePane({
const baseHead = draft?.baseHead ?? page?.head_sha ?? null;
if (isLoading) {
- return (
- <div className="flex flex-1 items-center justify-center">
- <Spinner className="size-5" />
- </div>
- );
+ return <LoadingState className="flex-1" />;
}
if (error || !page) {
@@ -196,7 +193,7 @@ export function ContextWikiPagePane({
onClick={() => commit(baseHead)}
disabled={save.isPending || !hasDraft}
>
- {save.isPending ? <Spinner className="size-3.5" /> : null}
+ {save.isPending ? <Spinner /> : null}
Save
</Button>
</div>
diff --git a/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiView.tsx b/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiView.tsx
index e83efeddd1aa..5b32226d8b79 100644
--- a/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiView.tsx
+++ b/products/desktop/packages/ui/src/features/context-wiki/components/ContextWikiView.tsx
@@ -8,7 +8,6 @@ import {
EmptyHeader,
EmptyMedia,
EmptyTitle,
- Spinner,
Tabs,
TabsContent,
TabsList,
@@ -16,6 +15,7 @@ import {
} from "@posthog/quill";
import { useSetHeaderContent } from "@posthog/ui/hooks/useSetHeaderContent";
import { FileExplorer } from "@posthog/ui/primitives/FileExplorer";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import {
PageHeader,
PageHeaderDescription,
@@ -23,6 +23,7 @@ import {
PageHeaderTitle,
PageHeaderTitleRow,
} from "@posthog/ui/primitives/PageHeader";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useCallback, useEffect, useMemo, useState } from "react";
import {
useContextWikiTree,
@@ -127,11 +128,7 @@ function ContextWikiBody({ initialPath }: { initialPath?: string }) {
}, [tree, selectedPath]);
if (isLoading) {
- return (
- <div className="flex h-full items-center justify-center">
- <Spinner className="size-5" />
- </div>
- );
+ return <LoadingState />;
}
if (error instanceof ContextWikiUnavailableError) {
@@ -189,7 +186,7 @@ function ContextWikiBody({ initialPath }: { initialPath?: string }) {
onClick={() => enable.mutate()}
disabled={enable.isPending}
>
- {enable.isPending ? <Spinner className="size-4" /> : null}
+ {enable.isPending ? <Spinner /> : null}
Enable context wiki
</Button>
{enable.error ? (
diff --git a/products/desktop/packages/ui/src/features/folder-picker/FolderPicker.tsx b/products/desktop/packages/ui/src/features/folder-picker/FolderPicker.tsx
index 40cf21ae1fef..96e3e470f429 100644
--- a/products/desktop/packages/ui/src/features/folder-picker/FolderPicker.tsx
+++ b/products/desktop/packages/ui/src/features/folder-picker/FolderPicker.tsx
@@ -1,6 +1,5 @@
import {
CaretDown,
- CircleNotch,
Folder as FolderIcon,
FolderOpen,
GitBranch,
@@ -28,7 +27,7 @@ import {
} from "@posthog/quill";
import type { RegisteredFolder } from "@posthog/ui/features/folders/types";
import { useFolders } from "@posthog/ui/features/folders/useFolders";
-import { Spin } from "@posthog/ui/primitives/Spinner";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { toast } from "@posthog/ui/primitives/toast";
import { FIELD_TRIGGER_CLASS } from "@posthog/ui/styles/fieldTrigger";
import { Text } from "@radix-ui/themes";
@@ -179,9 +178,7 @@ export function FolderPicker({
</Text>
</div>
{isOpening ? (
- <Spin className="shrink-0 text-(--gray-9)">
- <CircleNotch size={14} />
- </Spin>
+ <Spinner size="md" className="shrink-0 text-(--gray-9)" />
) : (
<CaretDown size={14} className="shrink-0 text-(--gray-9)" />
)}
@@ -195,9 +192,7 @@ export function FolderPicker({
{isOpening ? "Opening..." : displayValue || placeholder}
</span>
{isOpening ? (
- <Spin className="text-muted-foreground">
- <CircleNotch size={10} />
- </Spin>
+ <Spinner size="xs" className="text-muted-foreground" />
) : (
<CaretDown size={10} weight="bold" className="text-muted-foreground" />
)}
diff --git a/products/desktop/packages/ui/src/features/folder-picker/GitHubRepoMultiPicker.tsx b/products/desktop/packages/ui/src/features/folder-picker/GitHubRepoMultiPicker.tsx
index 0f91782f702c..56e84b82bd5d 100644
--- a/products/desktop/packages/ui/src/features/folder-picker/GitHubRepoMultiPicker.tsx
+++ b/products/desktop/packages/ui/src/features/folder-picker/GitHubRepoMultiPicker.tsx
@@ -10,9 +10,9 @@ import {
ComboboxItem,
ComboboxList,
ComboboxValue,
- Spinner,
Text,
} from "@posthog/quill";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useRef } from "react";
interface GitHubRepoMultiPickerProps {
@@ -104,7 +104,7 @@ export function GitHubRepoMultiPicker({
>
{isLoading ? (
<>
- <Spinner className="size-4" />
+ <Spinner size="md" />
<Text size="sm" variant="muted">
Loading repositories
</Text>
diff --git a/products/desktop/packages/ui/src/features/folder-picker/GitHubRepoPicker.tsx b/products/desktop/packages/ui/src/features/folder-picker/GitHubRepoPicker.tsx
index 7ee6c7ee82cb..119730fc7429 100644
--- a/products/desktop/packages/ui/src/features/folder-picker/GitHubRepoPicker.tsx
+++ b/products/desktop/packages/ui/src/features/folder-picker/GitHubRepoPicker.tsx
@@ -15,10 +15,9 @@ import {
ComboboxTrigger,
InputGroupAddon,
InputGroupButton,
- Spinner,
Text,
} from "@posthog/quill";
-import { Spin } from "@posthog/ui/primitives/Spinner";
+import { Spin, Spinner } from "@posthog/ui/primitives/Spinner";
import { Tooltip } from "@posthog/ui/primitives/Tooltip";
import { FIELD_TRIGGER_CLASS } from "@posthog/ui/styles/fieldTrigger";
import { defaultFilter } from "cmdk";
@@ -308,7 +307,7 @@ export function GitHubRepoPicker({
>
{showInlineLoadingState ? (
<>
- <Spinner className="size-4" />
+ <Spinner size="md" />
<Text size="sm" variant="muted">
Loading repositories
</Text>
diff --git a/products/desktop/packages/ui/src/features/git-interaction/components/BranchSelector.tsx b/products/desktop/packages/ui/src/features/git-interaction/components/BranchSelector.tsx
index 0baf3c66cab6..2f4753edba1e 100644
--- a/products/desktop/packages/ui/src/features/git-interaction/components/BranchSelector.tsx
+++ b/products/desktop/packages/ui/src/features/git-interaction/components/BranchSelector.tsx
@@ -59,7 +59,7 @@ const USE_INPUT_BRANCH_ACTION = "__use_input_branch__";
function LoadingRow({ label }: { label: string }) {
return (
<div className="flex items-center gap-1 px-2 py-1.5 text-muted-foreground text-xs">
- <Spinner size={12} />
+ <Spinner size="sm" />
{label}
</div>
);
@@ -386,7 +386,7 @@ export function BranchSelector({
className="min-w-0 max-w-[250px] shrink"
>
{showSpinner ? (
- <Spinner size={14} className="shrink-0" />
+ <Spinner className="shrink-0" />
) : (
<GitBranch size={14} weight="regular" className="shrink-0" />
)}
@@ -585,7 +585,7 @@ export function BranchSelector({
>
{cloudBranchesFetchingMore ? (
<>
- <Spinner size={14} />
+ <Spinner size="md" />
Loading more…
</>
) : (
diff --git a/products/desktop/packages/ui/src/features/git-interaction/components/CreatePrDialog.tsx b/products/desktop/packages/ui/src/features/git-interaction/components/CreatePrDialog.tsx
index 63d2c1ea012f..7ff8a724536d 100644
--- a/products/desktop/packages/ui/src/features/git-interaction/components/CreatePrDialog.tsx
+++ b/products/desktop/packages/ui/src/features/git-interaction/components/CreatePrDialog.tsx
@@ -4,6 +4,7 @@ import {
formatFileCountLabel,
} from "@posthog/core/git-interaction/diffStats";
import { buildCreatePrFlowErrorPrompt } from "@posthog/core/git-interaction/errorPrompts";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import {
Button,
Checkbox,
@@ -240,12 +241,8 @@ export function CreatePrDialog({
Cancel
</Button>
</Dialog.Close>
- <Button
- size="1"
- disabled={isSubmitting}
- loading={isSubmitting}
- onClick={onSubmit}
- >
+ <Button size="1" disabled={isSubmitting} onClick={onSubmit}>
+ {isSubmitting && <Spinner size="sm" />}
Create PR
</Button>
</Flex>
diff --git a/products/desktop/packages/ui/src/features/git-interaction/components/GitInteractionDialogs.tsx b/products/desktop/packages/ui/src/features/git-interaction/components/GitInteractionDialogs.tsx
index 85d7fa0ab541..0d329f64ca21 100644
--- a/products/desktop/packages/ui/src/features/git-interaction/components/GitInteractionDialogs.tsx
+++ b/products/desktop/packages/ui/src/features/git-interaction/components/GitInteractionDialogs.tsx
@@ -11,6 +11,7 @@ import {
type DiffStats,
formatFileCountLabel,
} from "@posthog/core/git-interaction/diffStats";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { CheckIcon } from "@radix-ui/react-icons";
import {
Box,
@@ -19,7 +20,6 @@ import {
Dialog,
Flex,
IconButton,
- Spinner,
Text,
TextArea,
TextField,
@@ -105,7 +105,7 @@ export function GenerateButton({
onClick={onClick}
disabled={isGenerating || disabled}
>
- {isGenerating ? <Spinner size="1" /> : <Sparkle size={14} />}
+ {isGenerating ? <Spinner size="sm" /> : <Sparkle size={14} />}
</IconButton>
</Tooltip>
);
@@ -192,9 +192,9 @@ export function GitDialog({
<Button
size="1"
disabled={buttonDisabled || isSubmitting}
- loading={isSubmitting}
onClick={onSubmit}
>
+ {isSubmitting && <Spinner size="sm" />}
{buttonLabel}
</Button>
</Flex>
diff --git a/products/desktop/packages/ui/src/features/git-interaction/components/PRBadgeLink.tsx b/products/desktop/packages/ui/src/features/git-interaction/components/PRBadgeLink.tsx
index 72574d512e1d..f991ea469db6 100644
--- a/products/desktop/packages/ui/src/features/git-interaction/components/PRBadgeLink.tsx
+++ b/products/desktop/packages/ui/src/features/git-interaction/components/PRBadgeLink.tsx
@@ -2,7 +2,8 @@ import {
getPrVisualConfig,
parsePrNumber,
} from "@posthog/core/git-interaction/prStatus";
-import { Button, cn, Spinner } from "@posthog/quill";
+import { Button, cn } from "@posthog/quill";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { getPrVisualIcon } from "../prIcon";
import {
PR_TONE_BORDER,
@@ -64,7 +65,7 @@ export function PRBadgeLink({
className={`inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[10px] no-underline ${PR_TONE_FILL_COMPACT[config.color]}`}
>
{isPrPending ? (
- <Spinner className="size-2.5" />
+ <Spinner size="xs" />
) : (
<PrIcon size={10} weight="bold" />
)}
@@ -100,7 +101,7 @@ export function PRBadgeLink({
variant={tone.variant}
className={cn("no-underline", tone.className)}
>
- {isPrPending ? <Spinner className="size-3" /> : <PrIcon weight="bold" />}
+ {isPrPending ? <Spinner size="sm" /> : <PrIcon weight="bold" />}
<span>
{config.label}
{prNumber && ` #${prNumber}`}
diff --git a/products/desktop/packages/ui/src/features/git-interaction/components/TaskActionsMenu.tsx b/products/desktop/packages/ui/src/features/git-interaction/components/TaskActionsMenu.tsx
index 038993b785d1..3e05d63f1e21 100644
--- a/products/desktop/packages/ui/src/features/git-interaction/components/TaskActionsMenu.tsx
+++ b/products/desktop/packages/ui/src/features/git-interaction/components/TaskActionsMenu.tsx
@@ -23,12 +23,12 @@ import {
Button as QButton,
DropdownMenu as QDropdownMenu,
DropdownMenuItem as QDropdownMenuItem,
- Spinner,
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@posthog/quill";
import type { PrActionType } from "@posthog/shared";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { ChevronDown } from "lucide-react";
import type { ReactNode } from "react";
import { toast } from "../../../primitives/toast";
@@ -449,11 +449,7 @@ export function GitActionControl({
disabled={isPrimaryDisabled}
onClick={() => onSelect(primaryAction.id)}
>
- {isBusy ? (
- <Spinner className="size-3" />
- ) : (
- getGitActionIcon(primaryAction.id)
- )}
+ {isBusy ? <Spinner size="sm" /> : getGitActionIcon(primaryAction.id)}
{primaryAction.label}
</QButton>
);
diff --git a/products/desktop/packages/ui/src/features/inbox/components/DismissedReportDetail.tsx b/products/desktop/packages/ui/src/features/inbox/components/DismissedReportDetail.tsx
index b64c8edb1664..240508b36e59 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/DismissedReportDetail.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/DismissedReportDetail.tsx
@@ -4,7 +4,7 @@ import {
LinkIcon,
MagnifyingGlassIcon,
} from "@phosphor-icons/react";
-import { Button, Spinner } from "@posthog/quill";
+import { Button } from "@posthog/quill";
import type { SignalReport } from "@posthog/shared/types";
import { InboxDetailFrame } from "@posthog/ui/features/inbox/components/InboxDetailFrame";
import { InboxReportCopyLinkMenu } from "@posthog/ui/features/inbox/components/InboxReportCopyLinkMenu";
@@ -14,6 +14,7 @@ import {
useInboxBackTarget,
} from "@posthog/ui/features/inbox/hooks/useInboxBackTarget";
import { useInboxRestoreReport } from "@posthog/ui/features/inbox/hooks/useInboxRestoreReport";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useNavigate } from "@tanstack/react-router";
interface DismissedReportDetailProps {
@@ -122,7 +123,7 @@ function RestoreReportButton({ report }: { report: SignalReport }) {
}
>
{restore.isPending ? (
- <Spinner className="size-3.5" />
+ <Spinner size="sm" />
) : (
<ArrowCounterClockwiseIcon size={12} />
)}
diff --git a/products/desktop/packages/ui/src/features/inbox/components/InboxReportDetailGate.tsx b/products/desktop/packages/ui/src/features/inbox/components/InboxReportDetailGate.tsx
index a3a626a6c45c..f8a90120bbf9 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/InboxReportDetailGate.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/InboxReportDetailGate.tsx
@@ -4,7 +4,6 @@ import {
isPullRequestReport,
isReportTabReport,
} from "@posthog/core/inbox/reportMembership";
-import { Spinner } from "@posthog/quill";
import type { SignalReport } from "@posthog/shared/types";
import { DetailBackLink } from "@posthog/ui/features/inbox/components/DetailBackLink";
import {
@@ -17,6 +16,7 @@ import {
type InboxDetailTab,
useReportOpenTracker,
} from "@posthog/ui/features/inbox/hooks/useReportOpenTracker";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { Flex, Text } from "@radix-ui/themes";
import { useNavigate } from "@tanstack/react-router";
import { type ReactNode, useEffect } from "react";
@@ -152,21 +152,13 @@ export function InboxReportDetailGate({
}, [redirectTo, redirectReportId, navigate, backTo, backLabel, triageOrigin]);
if ((isLoading && !resolvedReport) || statusUnconfirmed) {
- return (
- <Flex align="center" justify="center" className="py-16">
- <Spinner />
- </Flex>
- );
+ return <LoadingState className="py-16" />;
}
if (redirectTo) {
// Redirecting across the dismissed↔pipeline boundary; render nothing
// meaningful for the frame we're leaving.
- return (
- <Flex align="center" justify="center" className="py-16">
- <Spinner />
- </Flex>
- );
+ return <LoadingState className="py-16" />;
}
if (!resolvedReport) {
diff --git a/products/desktop/packages/ui/src/features/inbox/components/InboxReportSection.tsx b/products/desktop/packages/ui/src/features/inbox/components/InboxReportSection.tsx
index fd47da0ad43c..598ef3e560f5 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/InboxReportSection.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/InboxReportSection.tsx
@@ -1,6 +1,7 @@
import { CaretDownIcon } from "@phosphor-icons/react";
-import { Button, Spinner } from "@posthog/quill";
+import { Button } from "@posthog/quill";
import type { SignalReport } from "@posthog/shared/types";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import type { ReactNode } from "react";
import { useState } from "react";
@@ -62,9 +63,7 @@ export function InboxReportSection({
</button>
{open &&
(isLoading ? (
- <div className="flex justify-center py-3">
- <Spinner />
- </div>
+ <LoadingState className="py-3" />
) : reports.length === 0 ? (
<p className="px-1 py-2 text-[13.5px] text-gray-10">{emptyNote}</p>
) : (
diff --git a/products/desktop/packages/ui/src/features/inbox/components/ReportChatSidebar.tsx b/products/desktop/packages/ui/src/features/inbox/components/ReportChatSidebar.tsx
index 22d0f1a61059..7d5d7d0801ea 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/ReportChatSidebar.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/ReportChatSidebar.tsx
@@ -7,7 +7,7 @@ import {
isContentEmpty,
textToContent,
} from "@posthog/core/message-editor/content";
-import { Button, Spinner, Textarea } from "@posthog/quill";
+import { Button, Textarea } from "@posthog/quill";
import type { InboxReportActionSurface } from "@posthog/shared";
import type { SignalReport } from "@posthog/shared/types";
import { useTaskChannels } from "@posthog/ui/features/canvas/hooks/useTaskChannels";
@@ -23,6 +23,7 @@ import { useReportChatPanelStore } from "@posthog/ui/features/inbox/stores/repor
import { useDraftStore } from "@posthog/ui/features/message-editor/draftStore";
import { EmbeddedSessionView } from "@posthog/ui/features/sessions/components/EmbeddedSessionView";
import { taskDetailQuery } from "@posthog/ui/features/tasks/queries";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { ResizableSidebar } from "@posthog/ui/primitives/ResizableSidebar";
import { useOpenTask } from "@posthog/ui/router/useOpenTask";
import { useQuery, useQueryClient } from "@tanstack/react-query";
@@ -122,9 +123,7 @@ export function ReportChatSidebar({
) : tasksLoading ? (
// Offering the starter before the task lookup resolves invites a
// duplicate conversation on a report that already has one.
- <div className="flex h-full items-center justify-center">
- <Spinner />
- </div>
+ <LoadingState />
) : (
<ReportChatStarter
report={report}
@@ -181,11 +180,7 @@ function ReportChatConversation({
]);
if (!task) {
- return (
- <div className="flex h-full items-center justify-center">
- <Spinner />
- </div>
- );
+ return <LoadingState />;
}
return <EmbeddedSessionView task={task} />;
diff --git a/products/desktop/packages/ui/src/features/inbox/components/ReportDetailActions.tsx b/products/desktop/packages/ui/src/features/inbox/components/ReportDetailActions.tsx
index 679021d8c047..911d7b6f59ae 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/ReportDetailActions.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/ReportDetailActions.tsx
@@ -21,7 +21,6 @@ import {
Popover,
PopoverContent,
PopoverTrigger,
- Spinner,
Textarea,
Tooltip,
TooltipContent,
@@ -40,6 +39,7 @@ import { useRefundReport } from "@posthog/ui/features/inbox/hooks/useRefundRepor
import { useReportActionTracker } from "@posthog/ui/features/inbox/hooks/useReportActionTracker";
import { useReportChatPanelStore } from "@posthog/ui/features/inbox/stores/reportChatPanelStore";
import { copyInboxReportLink } from "@posthog/ui/features/inbox/utils/copyInboxReportLink";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { openExternalUrl } from "@posthog/ui/shell/openExternal";
import { useCallback, useState } from "react";
diff --git a/products/desktop/packages/ui/src/features/inbox/components/ReportRestoreButton.tsx b/products/desktop/packages/ui/src/features/inbox/components/ReportRestoreButton.tsx
index 679fda643ee0..4b6bd6b9e973 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/ReportRestoreButton.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/ReportRestoreButton.tsx
@@ -3,7 +3,8 @@ import { isRestorableReport } from "@posthog/core/inbox/reportMembership";
import { Button } from "@posthog/quill";
import type { SignalReport } from "@posthog/shared/types";
import { useInboxRestoreReport } from "@posthog/ui/features/inbox/hooks/useInboxRestoreReport";
-import { Spinner, Tooltip } from "@radix-ui/themes";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
+import { Tooltip } from "@radix-ui/themes";
/**
* Restore for an archived report row — the Archive tab's action, now living on
@@ -28,7 +29,7 @@ export function ReportRestoreButton({ report }: { report: SignalReport }) {
}}
>
{isPending ? (
- <Spinner size="1" />
+ <Spinner size="sm" />
) : (
<ArrowCounterClockwiseIcon size={12} />
)}
diff --git a/products/desktop/packages/ui/src/features/inbox/components/ReportReviewersSection.tsx b/products/desktop/packages/ui/src/features/inbox/components/ReportReviewersSection.tsx
index e8e4c1ca7e03..be729aa3d9ad 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/ReportReviewersSection.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/ReportReviewersSection.tsx
@@ -9,7 +9,6 @@ import {
Popover,
PopoverContent,
PopoverTrigger,
- Spinner,
} from "@posthog/quill";
import type { SignalReport, SuggestedReviewer } from "@posthog/shared/types";
import { DetailSection } from "@posthog/ui/features/inbox/components/DetailSection";
@@ -23,6 +22,7 @@ import {
useReportActionResultTracker,
useReportActionTracker,
} from "@posthog/ui/features/inbox/hooks/useReportActionTracker";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useMemo, useState } from "react";
export function ReportReviewersSection({ report }: { report: SignalReport }) {
diff --git a/products/desktop/packages/ui/src/features/inbox/components/ReportVerdictBanner.tsx b/products/desktop/packages/ui/src/features/inbox/components/ReportVerdictBanner.tsx
index d93830037ba8..b2ef6480e0cb 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/ReportVerdictBanner.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/ReportVerdictBanner.tsx
@@ -25,7 +25,6 @@ import {
Popover,
PopoverContent,
PopoverTrigger,
- Spinner,
Textarea,
} from "@posthog/quill";
import type { InboxReportActionSurface } from "@posthog/shared/analytics-events";
@@ -46,6 +45,7 @@ import {
} from "@posthog/ui/features/inbox/hooks/useReportTasks";
import { useReportChatPanelStore } from "@posthog/ui/features/inbox/stores/reportChatPanelStore";
import { taskDetailQuery } from "@posthog/ui/features/tasks/queries";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { openTaskInput, useOpenTask } from "@posthog/ui/router/useOpenTask";
import { openExternalUrl } from "@posthog/ui/shell/openExternal";
import { useQueryClient } from "@tanstack/react-query";
diff --git a/products/desktop/packages/ui/src/features/inbox/components/ReportsInboxViewPresentation.tsx b/products/desktop/packages/ui/src/features/inbox/components/ReportsInboxViewPresentation.tsx
index 6f08e7162f65..5a04e6bb3a2e 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/ReportsInboxViewPresentation.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/ReportsInboxViewPresentation.tsx
@@ -13,7 +13,6 @@ import {
EmptyMedia,
EmptyTitle,
Skeleton,
- Spinner,
Tooltip,
TooltipContent,
TooltipTrigger,
@@ -27,6 +26,7 @@ import {
PageHeaderTitle,
PageHeaderTitleRow,
} from "@posthog/ui/primitives/PageHeader";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import type { ReactNode } from "react";
export interface ReportsInboxViewPresentationProps {
diff --git a/products/desktop/packages/ui/src/features/inbox/components/ResponderAgentRoster.tsx b/products/desktop/packages/ui/src/features/inbox/components/ResponderAgentRoster.tsx
index ea18ddd68cec..b8cbd4ab47ae 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/ResponderAgentRoster.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/ResponderAgentRoster.tsx
@@ -10,7 +10,8 @@ import type { SignalSourceValues } from "@posthog/ui/features/inbox/components/S
import { InboxBadge } from "@posthog/ui/features/inbox/components/utils/InboxBadge";
import { getSourceProductMeta } from "@posthog/ui/features/inbox/components/utils/source-product-icons";
import { Badge } from "@posthog/ui/primitives/Badge";
-import { Box, Flex, Spinner, Switch, Text } from "@radix-ui/themes";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
+import { Box, Flex, Switch, Text } from "@radix-ui/themes";
import { type ComponentType, memo, useCallback } from "react";
type AgentRosterStatus = "standby" | "watching" | "syncing" | "sync_failed";
@@ -198,7 +199,7 @@ const ResponderAgentCard = memo(function ResponderAgentCard({
{statusBadge.label}
</InboxBadge>
{loading ? (
- <Spinner size="2" />
+ <Spinner size="md" />
) : requiresSetup ? (
<Button
type="button"
diff --git a/products/desktop/packages/ui/src/features/inbox/components/ReviewerSearchList.tsx b/products/desktop/packages/ui/src/features/inbox/components/ReviewerSearchList.tsx
index 001b068ba231..1c3eff245de4 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/ReviewerSearchList.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/ReviewerSearchList.tsx
@@ -1,7 +1,7 @@
import { CheckIcon, MagnifyingGlassIcon } from "@phosphor-icons/react";
import { toSuggestedReviewerWriteContent } from "@posthog/core/inbox/artefacts";
import { selectSuggestedReviewersArtefact } from "@posthog/core/inbox/reportArtefacts";
-import { Button, Spinner } from "@posthog/quill";
+import { Button } from "@posthog/quill";
import type { InboxReportActionSurface } from "@posthog/shared/analytics-events";
import type {
AvailableSuggestedReviewer,
@@ -24,6 +24,7 @@ import {
useReportActionResultTracker,
useReportActionTracker,
} from "@posthog/ui/features/inbox/hooks/useReportActionTracker";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { useDeferredValue, useMemo, useState } from "react";
function reviewerMatchesAvailable(
@@ -187,9 +188,7 @@ export function ReviewerSearchList({
<div className="max-h-[280px] overflow-y-auto">
{artefactsLoading ||
(isFetching && !availableReviewers?.results.length) ? (
- <div className="flex items-center justify-center py-3">
- <Spinner />
- </div>
+ <LoadingState className="py-3" />
) : failedWithoutData ? (
<div className="flex flex-col items-start gap-2 px-1 py-2">
<span className="text-[13px] text-gray-10">
diff --git a/products/desktop/packages/ui/src/features/inbox/components/SignalSourceToggles.tsx b/products/desktop/packages/ui/src/features/inbox/components/SignalSourceToggles.tsx
index 20072996599e..e61c9d98f6dc 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/SignalSourceToggles.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/SignalSourceToggles.tsx
@@ -11,13 +11,14 @@ import type {
SignalSourceConfig,
} from "@posthog/api-client/posthog-client";
import { formatRepoPreview } from "@posthog/core/settings/githubRepoSummary";
-import { Button, Spinner, Switch } from "@posthog/quill";
+import { Button, Switch } from "@posthog/quill";
import {
EXTERNAL_INBOX_SOURCES,
type ToggleableSourceProduct,
} from "@posthog/shared";
import { GitHubSourceRepositoriesDialog } from "@posthog/ui/features/inbox/components/GitHubSourceRepositoriesDialog";
import { getSourceProductMeta } from "@posthog/ui/features/inbox/components/utils/source-product-icons";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { memo, useCallback, useState } from "react";
export type SignalSourceValues = Record<ToggleableSourceProduct, boolean>;
diff --git a/products/desktop/packages/ui/src/features/inbox/components/detail/ArtefactCommit.tsx b/products/desktop/packages/ui/src/features/inbox/components/detail/ArtefactCommit.tsx
index 47cbf8fe011d..6f97163790ce 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/detail/ArtefactCommit.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/detail/ArtefactCommit.tsx
@@ -3,7 +3,8 @@ import { inboxReportKeys } from "@posthog/core/inbox/inboxQuery";
import type { CommitContent } from "@posthog/shared/types";
import { DiffBlock } from "@posthog/ui/features/inbox/components/detail/DiffBlock";
import { useAuthenticatedQuery } from "@posthog/ui/hooks/useAuthenticatedQuery";
-import { Box, Flex, Spinner, Text } from "@radix-ui/themes";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
+import { Box, Flex, Text } from "@radix-ui/themes";
import { useState } from "react";
/**
@@ -71,7 +72,7 @@ export function ArtefactCommit({
gap="2"
className="text-(--gray-10) text-[12px]"
>
- <Spinner size="1" />
+ <Spinner size="sm" />
Fetching diff…
</Flex>
) : diffQuery.isError ? (
diff --git a/products/desktop/packages/ui/src/features/inbox/hooks/useInboxReportDismissAction.tsx b/products/desktop/packages/ui/src/features/inbox/hooks/useInboxReportDismissAction.tsx
index d84031468ace..ea779b4cb9f6 100644
--- a/products/desktop/packages/ui/src/features/inbox/hooks/useInboxReportDismissAction.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/hooks/useInboxReportDismissAction.tsx
@@ -1,7 +1,6 @@
import { ArchiveIcon } from "@phosphor-icons/react";
import {
Button,
- Spinner,
Tooltip,
TooltipContent,
TooltipTrigger,
@@ -18,6 +17,7 @@ import {
} from "@posthog/ui/features/inbox/components/DismissReportDialog";
import { useInboxBulkActions } from "@posthog/ui/features/inbox/hooks/useInboxBulkActions";
import { useInboxReportActionDraftStore } from "@posthog/ui/features/inbox/stores/inboxReportActionDraftStore";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import {
type ReactElement,
useCallback,
diff --git a/products/desktop/packages/ui/src/features/integrations/components/GithubRepoSummary.tsx b/products/desktop/packages/ui/src/features/integrations/components/GithubRepoSummary.tsx
index 64f9ac467308..638394b518c0 100644
--- a/products/desktop/packages/ui/src/features/integrations/components/GithubRepoSummary.tsx
+++ b/products/desktop/packages/ui/src/features/integrations/components/GithubRepoSummary.tsx
@@ -7,7 +7,8 @@ import {
} from "@phosphor-icons/react";
import type { GithubRepoAccessSummary } from "@posthog/core/settings/githubRepoSummary";
import { formatRepoPreview } from "@posthog/core/settings/githubRepoSummary";
-import { Button, Spinner, Text } from "@posthog/quill";
+import { Button, Text } from "@posthog/quill";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import type { ReactNode } from "react";
import { useState } from "react";
@@ -117,7 +118,7 @@ export function GithubRepoSummary({
) : null}
</div>
<div className="flex min-w-0 items-center gap-1 text-[12px] text-muted-foreground leading-snug">
- {status === "loading" ? <Spinner /> : descriptionLine}
+ {status === "loading" ? <Spinner size="sm" /> : descriptionLine}
</div>
</div>
</div>
diff --git a/products/desktop/packages/ui/src/features/loops/components/LoopRunRow.tsx b/products/desktop/packages/ui/src/features/loops/components/LoopRunRow.tsx
index 216fd0215980..ad3cd2120211 100644
--- a/products/desktop/packages/ui/src/features/loops/components/LoopRunRow.tsx
+++ b/products/desktop/packages/ui/src/features/loops/components/LoopRunRow.tsx
@@ -1,6 +1,5 @@
import {
Check,
- CircleNotch,
Clock,
GitBranch,
type Icon,
@@ -16,7 +15,7 @@ import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";
import { StopCloudRunDialog } from "@posthog/ui/features/sessions/components/StopCloudRunDialog";
import { Badge } from "@posthog/ui/primitives/Badge";
import { Button } from "@posthog/ui/primitives/Button";
-import { Spin } from "@posthog/ui/primitives/Spinner";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { toast } from "@posthog/ui/primitives/toast";
import { navigateToTaskDetail } from "@posthog/ui/router/navigationBridge";
import { track } from "@posthog/ui/shell/analytics";
@@ -47,8 +46,6 @@ function statusIcon(status: LoopSchemas.LoopRunStatusEnum): Icon {
case "failed":
case "cancelled":
return X;
- case "in_progress":
- return CircleNotch;
default:
return Clock;
}
@@ -146,9 +143,11 @@ export function LoopRunRow({
<Flex direction="column" className="min-w-0 gap-1.5">
<Flex align="center" gap="2" wrap="wrap">
<Badge color={statusColor(run.status)}>
- <Spin spinning={run.status === "in_progress"}>
+ {run.status === "in_progress" ? (
+ <Spinner size="xs" />
+ ) : (
<StatusIcon size={10} weight="bold" />
- </Spin>
+ )}
{run.status.replaceAll("_", " ")}
</Badge>
<Text
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAddServer.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAddServer.tsx
index af522bc0f66e..377fd1b795ea 100644
--- a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAddServer.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAddServer.tsx
@@ -9,12 +9,12 @@ import { isValidMcpUrl } from "@posthog/core/mcp-servers/customServerForm";
import { AgentScopeToggle } from "@posthog/ui/features/mcp-gateway/components/parts/AgentScopeToggle";
import type { GatewayRoute } from "@posthog/ui/features/mcp-gateway/gatewayRoute";
import { useRegisterGatewayServer } from "@posthog/ui/features/mcp-gateway/hooks/useRegisterGatewayServer";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import {
Button,
Flex,
Heading,
Select,
- Spinner,
Switch,
Text,
TextArea,
@@ -282,7 +282,7 @@ export function GatewayAddServer({
</Button>
<Button type="submit" disabled={!canSave || registerPending}>
{registerPending ? (
- <Spinner size="1" />
+ <Spinner size="sm" />
) : (
<Check size={12} weight="bold" />
)}{" "}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAgentDetail.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAgentDetail.tsx
index b8b4f4dd734b..2f30e0be6022 100644
--- a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAgentDetail.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAgentDetail.tsx
@@ -24,15 +24,8 @@ import { useAgentRecentCalls } from "@posthog/ui/features/mcp-gateway/hooks/useG
import { useGatewayServers } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayServers";
import { useServiceAccounts } from "@posthog/ui/features/mcp-gateway/hooks/useServiceAccounts";
import { ServerIcon } from "@posthog/ui/features/mcp-servers/components/parts/icons";
-import {
- Badge,
- Button,
- Flex,
- Separator,
- Spinner,
- Switch,
- Text,
-} from "@radix-ui/themes";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
+import { Badge, Button, Flex, Separator, Switch, Text } from "@radix-ui/themes";
import { useState } from "react";
const DECISION_COLORS: Record<
@@ -68,15 +61,15 @@ export function GatewayAgentDetail({
return (
<Flex direction="column" gap="4">
<BackButton onNavigate={onNavigate} />
- <Flex align="center" justify="center" py="6">
- {serviceAccounts.accountsLoading ? (
- <Spinner size="2" />
- ) : (
+ {serviceAccounts.accountsLoading ? (
+ <LoadingState className="py-6" />
+ ) : (
+ <div className="flex items-center justify-center py-6">
<Text color="gray" className="text-sm">
Agent not found.
</Text>
- )}
- </Flex>
+ </div>
+ )}
</Flex>
);
}
@@ -243,9 +236,7 @@ export function GatewayAgentDetail({
</Text>
</div>
{eventsLoading && events.length === 0 ? (
- <Flex align="center" justify="center" py="4">
- <Spinner size="1" />
- </Flex>
+ <LoadingState className="py-4" />
) : events.length === 0 ? (
<Text color="gray" className="block px-3 py-3 text-[13px] italic">
No tool calls from this agent yet.
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAuditLog.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAuditLog.tsx
index 1c0c0fc79956..67b24c91bf49 100644
--- a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAuditLog.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayAuditLog.tsx
@@ -18,15 +18,8 @@ import {
} from "@posthog/ui/features/mcp-gateway/hooks/useGatewayAudit";
import { useGatewayConfig } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayConfig";
import { useServiceAccounts } from "@posthog/ui/features/mcp-gateway/hooks/useServiceAccounts";
-import {
- Badge,
- Button,
- Flex,
- Heading,
- Select,
- Spinner,
- Text,
-} from "@radix-ui/themes";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
+import { Badge, Button, Flex, Heading, Select, Text } from "@radix-ui/themes";
import { useState } from "react";
const FILTERS: { id: McpAuditQuickFilter; label: string }[] = [
@@ -184,9 +177,7 @@ export function GatewayAuditLog() {
</Text>
</div>
{auditLoading && events.length === 0 ? (
- <Flex align="center" justify="center" py="6">
- <Spinner size="2" />
- </Flex>
+ <LoadingState className="py-6" />
) : events.length === 0 ? (
<Text
color="gray"
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayDeleteServerDialog.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayDeleteServerDialog.tsx
index bc2de7a8b8db..6ffda95813ba 100644
--- a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayDeleteServerDialog.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayDeleteServerDialog.tsx
@@ -1,4 +1,5 @@
-import { AlertDialog, Button, Flex, Spinner, Text } from "@radix-ui/themes";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
+import { AlertDialog, Button, Flex, Text } from "@radix-ui/themes";
interface GatewayDeleteServerDialogProps {
open: boolean;
@@ -49,7 +50,7 @@ export function GatewayDeleteServerDialog({
disabled={pending}
onClick={onConfirm}
>
- {pending ? <Spinner size="1" /> : null}
+ {pending ? <Spinner size="sm" /> : null}
Delete
</Button>
</AlertDialog.Action>
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayMemberDetail.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayMemberDetail.tsx
index 192bd8756485..bc3b1ee9de3a 100644
--- a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayMemberDetail.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayMemberDetail.tsx
@@ -6,15 +6,8 @@ import type { GatewayRoute } from "@posthog/ui/features/mcp-gateway/gatewayRoute
import { useGatewayMembers } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayMembers";
import { useGatewayServers } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayServers";
import { ServerIcon } from "@posthog/ui/features/mcp-servers/components/parts/icons";
-import {
- Badge,
- Button,
- Flex,
- Separator,
- Spinner,
- Switch,
- Text,
-} from "@radix-ui/themes";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
+import { Badge, Button, Flex, Separator, Switch, Text } from "@radix-ui/themes";
/** Admin view of one member: which servers they can reach, per-server revoke. */
export function GatewayMemberDetail({
@@ -35,15 +28,15 @@ export function GatewayMemberDetail({
return (
<Flex direction="column" gap="4">
<BackButton onNavigate={onNavigate} />
- <Flex align="center" justify="center" py="6">
- {membersLoading ? (
- <Spinner size="2" />
- ) : (
+ {membersLoading ? (
+ <LoadingState className="py-6" />
+ ) : (
+ <div className="flex items-center justify-center py-6">
<Text color="gray" className="text-sm">
Member not found.
</Text>
- )}
- </Flex>
+ </div>
+ )}
</Flex>
);
}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServerDetail.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServerDetail.tsx
index a0f6485be3de..2b5cc28bf785 100644
--- a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServerDetail.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServerDetail.tsx
@@ -54,6 +54,8 @@ import { useGatewayServers } from "@posthog/ui/features/mcp-gateway/hooks/useGat
import { useGatewayToolPolicies } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayToolPolicies";
import { useServiceAccounts } from "@posthog/ui/features/mcp-gateway/hooks/useServiceAccounts";
import { ServerIcon } from "@posthog/ui/features/mcp-servers/components/parts/icons";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { toast } from "@posthog/ui/primitives/toast";
import {
Badge,
@@ -61,7 +63,6 @@ import {
Flex,
IconButton,
Separator,
- Spinner,
Switch,
Text,
TextField,
@@ -166,15 +167,15 @@ export function GatewayServerDetail({
return (
<Flex direction="column" gap="4">
<BackButton onNavigate={onNavigate} />
- <Flex align="center" justify="center" py="6">
- {gateway.serversLoading ? (
- <Spinner size="2" />
- ) : (
+ {gateway.serversLoading ? (
+ <LoadingState className="py-6" />
+ ) : (
+ <div className="flex items-center justify-center py-6">
<Text color="gray" className="text-sm">
Server not found.
</Text>
- )}
- </Flex>
+ </div>
+ )}
</Flex>
);
}
@@ -231,7 +232,7 @@ export function GatewayServerDetail({
const connectButton = connecting ? (
<Button variant="solid" size="2" disabled>
- <Spinner size="1" /> Authorizing…
+ <Spinner size="sm" /> Authorizing…
</Button>
) : needsReconnect ? (
<Button
@@ -571,9 +572,7 @@ export function GatewayServerDetail({
)}
{tools.policiesLoading && tools.policies.length === 0 ? (
- <Flex align="center" justify="center" py="6">
- <Spinner size="2" />
- </Flex>
+ <LoadingState className="py-6" />
) : tools.policies.length === 0 ? (
<Flex
direction="column"
@@ -733,7 +732,7 @@ function RefreshToolsButton({
onClick={onRefresh}
>
{pending ? (
- <Spinner size="1" />
+ <Spinner size="sm" />
) : (
<ArrowClockwise size={11} weight="bold" />
)}
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServersHome.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServersHome.tsx
index 470c35a0ae58..f7350e12c2fc 100644
--- a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServersHome.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GatewayServersHome.tsx
@@ -37,13 +37,14 @@ import type { GatewayRoute } from "@posthog/ui/features/mcp-gateway/gatewayRoute
import { useGatewayConfig } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayConfig";
import { useGatewayServers } from "@posthog/ui/features/mcp-gateway/hooks/useGatewayServers";
import { ServerIcon } from "@posthog/ui/features/mcp-servers/components/parts/icons";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import {
Badge,
Button,
Flex,
Heading,
IconButton,
- Spinner,
Text,
TextField,
Tooltip,
@@ -212,9 +213,7 @@ export function GatewayServersHome({
</Flex>
{serversLoading && servers.length === 0 ? (
- <Flex align="center" justify="center" py="6">
- <Spinner size="2" />
- </Flex>
+ <LoadingState className="py-6" />
) : totalCount === 0 ? (
<Empty className="rounded border border-gray-6 border-dashed py-8">
<EmptyHeader>
@@ -355,7 +354,7 @@ function GatewayServerCard({
{off ? null : needsAuth ? (
connecting ? (
<Button variant="solid" size="1" disabled>
- <Spinner size="1" /> Authorizing…
+ <Spinner size="sm" /> Authorizing…
</Button>
) : (
<Button variant="solid" size="1" onClick={onConnect}>
@@ -437,7 +436,7 @@ function RecommendedTemplateCard({
<div className="absolute top-4 right-4">
{disabled ? null : connecting ? (
<Button variant="solid" size="1" disabled>
- <Spinner size="1" /> Authorizing…
+ <Spinner size="sm" /> Authorizing…
</Button>
) : (
<Button variant="solid" size="1" onClick={onConnect}>
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GiveAccessDialog.test.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GiveAccessDialog.test.tsx
index 1e26255d1e1f..afa34c4aa50a 100644
--- a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GiveAccessDialog.test.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GiveAccessDialog.test.tsx
@@ -285,9 +285,9 @@ describe("GiveAccessDialog", () => {
</Theme>,
);
- const shareButton = screen.getByRole("button", { name: "Share access" });
+ const shareButton = screen.getByRole("button", { name: /Share access/ });
expect(shareButton).toBeDisabled();
- expect(shareButton.querySelector(".rt-Spinner")).toBeInTheDocument();
+ expect(shareButton.querySelector('[role="status"]')).toBeInTheDocument();
expect(screen.getByRole("button", { name: "Cancel" })).toBeDisabled();
fireEvent.keyDown(document, { key: "Escape" });
diff --git a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GiveAccessDialog.tsx b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GiveAccessDialog.tsx
index 772df95c43b5..3f34297edb7f 100644
--- a/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GiveAccessDialog.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-gateway/components/parts/GiveAccessDialog.tsx
@@ -15,6 +15,7 @@ import {
import { AgentScopeToggle } from "@posthog/ui/features/mcp-gateway/components/parts/AgentScopeToggle";
import { RobotAvatar } from "@posthog/ui/features/mcp-gateway/components/parts/avatars";
import { ToolPolicyToggle } from "@posthog/ui/features/mcp-servers/components/parts/ToolPolicyToggle";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import {
Badge,
Button,
@@ -255,10 +256,14 @@ function GiveAccessDialogDraft({
<Button
variant="solid"
disabled={!selected || pending}
- loading={pending}
onClick={grant}
>
- <Check size={12} weight="bold" /> Share access
+ {pending ? (
+ <Spinner size="sm" />
+ ) : (
+ <Check size={12} weight="bold" />
+ )}{" "}
+ Share access
</Button>
</Flex>
</Dialog.Content>
diff --git a/products/desktop/packages/ui/src/features/mcp-server-manager/AddCustomServerForm.tsx b/products/desktop/packages/ui/src/features/mcp-server-manager/AddCustomServerForm.tsx
index 0f21ed9e38c7..37ebf29af889 100644
--- a/products/desktop/packages/ui/src/features/mcp-server-manager/AddCustomServerForm.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-server-manager/AddCustomServerForm.tsx
@@ -4,14 +4,8 @@ import {
buildCustomServerRequest,
canSubmitCustomServer,
} from "@posthog/core/mcp-servers/customServerForm";
-import {
- Button,
- Flex,
- Select,
- Spinner,
- Text,
- TextField,
-} from "@radix-ui/themes";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
+import { Button, Flex, Select, Text, TextField } from "@radix-ui/themes";
import { useCallback, useState } from "react";
interface AddCustomServerFormProps {
@@ -244,7 +238,7 @@ export function AddCustomServerForm({
Cancel
</Button>
<Button type="submit" disabled={!canSubmit}>
- {pending ? <Spinner size="1" /> : <Plus size={12} />}
+ {pending ? <Spinner size="sm" /> : <Plus size={12} />}
Add server
</Button>
</Flex>
diff --git a/products/desktop/packages/ui/src/features/mcp-servers/components/McpServersView.tsx b/products/desktop/packages/ui/src/features/mcp-servers/components/McpServersView.tsx
index 784e2b966f9f..97019825e3f8 100644
--- a/products/desktop/packages/ui/src/features/mcp-servers/components/McpServersView.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-servers/components/McpServersView.tsx
@@ -10,13 +10,14 @@ import { AddCustomServerForm } from "@posthog/ui/features/mcp-server-manager/Add
import { MarketplaceView } from "@posthog/ui/features/mcp-servers/components/parts/MarketplaceView";
import { McpInstalledRail } from "@posthog/ui/features/mcp-servers/components/parts/McpInstalledRail";
import { useMcpServers } from "@posthog/ui/features/mcp-servers/hooks/useMcpServers";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import {
AlertDialog,
Box,
Button,
Flex,
ScrollArea,
- Spinner,
Text,
} from "@radix-ui/themes";
import { useQueryClient } from "@tanstack/react-query";
@@ -205,16 +206,14 @@ function McpMarketplaceView() {
const template = selectedTemplate;
if (!install && !template) {
- return (
- <Flex align="center" justify="center" py="6">
- {installationsLoading || serversLoading ? (
- <Spinner size="2" />
- ) : (
- <Text color="gray" className="text-sm">
- Server not found.
- </Text>
- )}
- </Flex>
+ return installationsLoading || serversLoading ? (
+ <LoadingState className="py-6" />
+ ) : (
+ <div className="flex items-center justify-center py-6">
+ <Text color="gray" className="text-sm">
+ Server not found.
+ </Text>
+ </div>
);
}
@@ -337,7 +336,7 @@ function UninstallConfirmDialog({
onClick={onConfirm}
disabled={isPending}
>
- {isPending ? <Spinner size="1" /> : null}
+ {isPending ? <Spinner size="sm" /> : null}
Remove
</Button>
</AlertDialog.Action>
diff --git a/products/desktop/packages/ui/src/features/mcp-servers/components/parts/MarketplaceView.tsx b/products/desktop/packages/ui/src/features/mcp-servers/components/parts/MarketplaceView.tsx
index 9abd7226387e..53eba5c553e0 100644
--- a/products/desktop/packages/ui/src/features/mcp-servers/components/parts/MarketplaceView.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-servers/components/parts/MarketplaceView.tsx
@@ -9,12 +9,12 @@ import {
filterServersByCategory,
filterServersByQuery,
} from "@posthog/core/mcp-servers/filters";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import {
Button,
Flex,
Heading,
IconButton,
- Spinner,
Text,
TextField,
} from "@radix-ui/themes";
@@ -148,9 +148,7 @@ export function MarketplaceView({
</Flex>
{serversLoading ? (
- <Flex align="center" justify="center" py="6">
- <Spinner size="2" />
- </Flex>
+ <LoadingState className="py-6" />
) : visibleServers.length === 0 ? (
<Flex
align="center"
diff --git a/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ServerCard.tsx b/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ServerCard.tsx
index d67af93a0c7a..c401a791dfb5 100644
--- a/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ServerCard.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ServerCard.tsx
@@ -3,7 +3,8 @@ import {
MCP_CATEGORIES,
type McpRecommendedServer,
} from "@posthog/api-client/posthog-client";
-import { Badge, Button, Flex, Spinner, Text } from "@radix-ui/themes";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
+import { Badge, Button, Flex, Text } from "@radix-ui/themes";
import { ServerIcon } from "./icons";
interface ServerCardProps {
@@ -94,7 +95,7 @@ export function ServerCard({
onClick={onConnect}
disabled={isInstalling}
>
- {isInstalling ? <Spinner size="1" /> : null}
+ {isInstalling ? <Spinner size="sm" /> : null}
Connect
</Button>
)}
diff --git a/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ServerDetailView.tsx b/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ServerDetailView.tsx
index 7ccbf544bb80..8df5c0ae89db 100644
--- a/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ServerDetailView.tsx
+++ b/products/desktop/packages/ui/src/features/mcp-servers/components/parts/ServerDetailView.tsx
@@ -30,13 +30,14 @@ import {
} from "@posthog/ui/features/mcp-servers/components/parts/statusBadge";
import { ToolRow } from "@posthog/ui/features/mcp-servers/components/parts/ToolRow";
import { useMcpInstallationTools } from "@posthog/ui/features/mcp-servers/hooks/useMcpInstallationTools";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import {
Badge,
Button,
Flex,
IconButton,
Separator,
- Spinner,
Switch,
Text,
TextField,
@@ -160,7 +161,7 @@ export function ServerDetailView({
onClick={onReauthorize}
disabled={isReauthorizing}
>
- {isReauthorizing ? <Spinner size="1" /> : null}
+ {isReauthorizing ? <Spinner size="sm" /> : null}
Reconnect
</Button>
) : null
@@ -172,7 +173,7 @@ export function ServerDetailView({
disabled={isInstalling}
>
{isInstalling ? (
- <Spinner size="1" />
+ <Spinner size="sm" />
) : (
<DownloadSimple size={12} />
)}
@@ -303,7 +304,7 @@ export function ServerDetailView({
onClick={refresh}
>
{refreshPending ? (
- <Spinner size="1" />
+ <Spinner size="sm" />
) : (
<ArrowClockwise size={12} weight="bold" />
)}
@@ -313,9 +314,7 @@ export function ServerDetailView({
</Flex>
{isLoading ? (
- <Flex align="center" justify="center" py="6">
- <Spinner size="2" />
- </Flex>
+ <LoadingState className="py-6" />
) : visibleTools.length === 0 ? (
<Flex
align="center"
@@ -326,7 +325,7 @@ export function ServerDetailView({
className="rounded border border-gray-6 border-dashed"
>
{refreshPending ? (
- <Spinner size="1" />
+ <Spinner size="sm" />
) : (
<>
<Text className="font-medium text-sm">
diff --git a/products/desktop/packages/ui/src/features/message-editor/components/Attachment.tsx b/products/desktop/packages/ui/src/features/message-editor/components/Attachment.tsx
index 88c9ba0bec6c..c1f5be58138c 100644
--- a/products/desktop/packages/ui/src/features/message-editor/components/Attachment.tsx
+++ b/products/desktop/packages/ui/src/features/message-editor/components/Attachment.tsx
@@ -2,12 +2,12 @@ import { FileIcon, WarningCircle, X } from "@phosphor-icons/react";
import {
Button,
cn,
- Spinner,
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@posthog/quill";
import { fileExtensionLabel } from "@posthog/ui/features/message-editor/fileKind";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import type { ReactNode } from "react";
export type AttachmentUploadStatus = "uploading" | "error";
@@ -88,10 +88,7 @@ export function Attachment({
{status && (
<span className="absolute inset-0 flex items-center justify-center bg-[var(--gray-a5)]">
{status === "uploading" ? (
- <Spinner
- className="size-3.5"
- aria-label="Uploading attachment"
- />
+ <Spinner size="md" label="Uploading attachment" />
) : (
<WarningCircle
size={14}
diff --git a/products/desktop/packages/ui/src/features/message-editor/components/SuggestionStatus.tsx b/products/desktop/packages/ui/src/features/message-editor/components/SuggestionStatus.tsx
index a11bf95e55e7..538a220b162a 100644
--- a/products/desktop/packages/ui/src/features/message-editor/components/SuggestionStatus.tsx
+++ b/products/desktop/packages/ui/src/features/message-editor/components/SuggestionStatus.tsx
@@ -1,4 +1,4 @@
-import { Spinner } from "@posthog/quill";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
interface SuggestionStatusProps {
loading: boolean;
@@ -16,7 +16,7 @@ export function SuggestionStatus({
if (loading) {
return (
<span className={className}>
- <Spinner className="h-3.5 w-3.5" />
+ <Spinner size="md" />
<span>{loadingMessage}</span>
</span>
);
diff --git a/products/desktop/packages/ui/src/features/onboarding/components/CliCheckPanel.tsx b/products/desktop/packages/ui/src/features/onboarding/components/CliCheckPanel.tsx
index 25505f38c892..86b2840b4382 100644
--- a/products/desktop/packages/ui/src/features/onboarding/components/CliCheckPanel.tsx
+++ b/products/desktop/packages/ui/src/features/onboarding/components/CliCheckPanel.tsx
@@ -1,6 +1,6 @@
-import { CheckCircle, CircleNotch } from "@phosphor-icons/react";
+import { CheckCircle } from "@phosphor-icons/react";
import { PANEL_SHADOW } from "@posthog/ui/features/onboarding/components/onboardingStyles";
-import { Spin } from "@posthog/ui/primitives/Spinner";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { Box, Flex, Text } from "@radix-ui/themes";
import type { ReactNode } from "react";
@@ -34,9 +34,7 @@ export function CliCheckPanel({
</Text>
</Flex>
{isLoading ? (
- <Spin className="text-(--gray-9)">
- <CircleNotch size={14} />
- </Spin>
+ <Spinner size="md" className="text-(--gray-9)" />
) : (
statusBadge
)}
diff --git a/products/desktop/packages/ui/src/features/onboarding/components/GitHubConnectPanel.tsx b/products/desktop/packages/ui/src/features/onboarding/components/GitHubConnectPanel.tsx
index 73858e2b889d..81a0827a6a5e 100644
--- a/products/desktop/packages/ui/src/features/onboarding/components/GitHubConnectPanel.tsx
+++ b/products/desktop/packages/ui/src/features/onboarding/components/GitHubConnectPanel.tsx
@@ -44,6 +44,7 @@ import {
} from "@posthog/ui/features/integrations/useIntegrations";
import { useProjectsWithIntegrations } from "@posthog/ui/features/onboarding/hooks/useProjectsWithIntegrations";
import { useOnboardingStore } from "@posthog/ui/features/onboarding/onboardingStore";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { Tooltip } from "@posthog/ui/primitives/Tooltip";
import { track } from "@posthog/ui/shell/analytics";
import { openExternalUrl } from "@posthog/ui/shell/openExternal";
@@ -53,7 +54,6 @@ import {
Flex,
IconButton,
Skeleton,
- Spinner,
Text,
} from "@radix-ui/themes";
import { useQueryClient } from "@tanstack/react-query";
@@ -396,10 +396,7 @@ export function GitHubConnectPanel() {
<Button
size="1"
variant="solid"
- loading={isReconnecting}
- disabled={
- reconnectingInstallationId !== null && !isReconnecting
- }
+ disabled={reconnectingInstallationId !== null}
onClick={async () => {
markConnectStarted("user_new", true);
setReconnectingInstallationId(installationId);
@@ -418,6 +415,7 @@ export function GitHubConnectPanel() {
}
}}
>
+ {isReconnecting && <Spinner size="sm" />}
Reconnect
<ArrowSquareOut size={12} />
</Button>
@@ -431,10 +429,14 @@ export function GitHubConnectPanel() {
size="1"
variant="soft"
color="gray"
- loading={isRefreshing}
+ disabled={isRefreshing}
onClick={() => void refreshGithubState()}
>
- <ArrowsClockwise size={12} />
+ {isRefreshing ? (
+ <Spinner size="sm" />
+ ) : (
+ <ArrowsClockwise size={12} />
+ )}
Refresh
</Button>
<Button
@@ -442,9 +444,9 @@ export function GitHubConnectPanel() {
variant="ghost"
color="gray"
onClick={() => initiateConnect("user_new")}
- loading={isConnecting}
+ disabled={isConnecting}
>
- <Plus size={12} />
+ {isConnecting ? <Spinner size="sm" /> : <Plus size={12} />}
Add another GitHub org
</Button>
</Flex>
@@ -455,10 +457,14 @@ export function GitHubConnectPanel() {
variant="soft"
color="gray"
className="self-start"
- loading={isRefreshing}
+ disabled={isRefreshing}
onClick={() => void refreshGithubState()}
>
- <ArrowsClockwise size={12} />
+ {isRefreshing ? (
+ <Spinner size="sm" />
+ ) : (
+ <ArrowsClockwise size={12} />
+ )}
Check again
</Button>
) : isApprovedNotLinked ? (
@@ -497,9 +503,10 @@ export function GitHubConnectPanel() {
if (shouldReset) resetConnect();
initiateConnect("user_new", isRetry);
}}
- loading={isConnecting}
+ disabled={isConnecting}
className="w-full"
>
+ {isConnecting && <Spinner size="md" />}
{
deriveConnectButtonState({
isConnecting,
@@ -558,7 +565,7 @@ export function GitHubConnectPanel() {
}}
disabled={isDisconnecting}
>
- {isDisconnecting ? <Spinner size="1" /> : null}
+ {isDisconnecting ? <Spinner size="sm" /> : null}
Disconnect
</Button>
</Flex>
diff --git a/products/desktop/packages/ui/src/features/onboarding/components/InstallCliStep.tsx b/products/desktop/packages/ui/src/features/onboarding/components/InstallCliStep.tsx
index 8fe1927c9c97..a16fb52959fe 100644
--- a/products/desktop/packages/ui/src/features/onboarding/components/InstallCliStep.tsx
+++ b/products/desktop/packages/ui/src/features/onboarding/components/InstallCliStep.tsx
@@ -26,6 +26,7 @@ import { StepActions } from "@posthog/ui/features/onboarding/components/StepActi
import { Terminal } from "@posthog/ui/features/terminal/Terminal";
import { terminalManager } from "@posthog/ui/features/terminal/TerminalManager";
import { OnboardingHogTip } from "@posthog/ui/primitives/OnboardingHogTip";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { Tooltip } from "@posthog/ui/primitives/Tooltip";
import { track } from "@posthog/ui/shell/analytics";
import { openExternalUrl } from "@posthog/ui/shell/openExternal";
@@ -156,8 +157,12 @@ function RunnableCommand({
</Flex>
<Flex align="center" gap="2" className="shrink-0">
{isMac && (
- <Button size="1" onClick={handleRun} loading={isRunning}>
- <Play size={14} weight="fill" />
+ <Button size="1" onClick={handleRun} disabled={isRunning}>
+ {isRunning ? (
+ <Spinner size="sm" />
+ ) : (
+ <Play size={14} weight="fill" />
+ )}
Run
</Button>
)}
@@ -337,9 +342,13 @@ export function InstallCliStep({ onNext, onBack }: InstallCliStepProps) {
variant="soft"
color="gray"
onClick={() => void handleCheckGit()}
- loading={isCheckingGit}
+ disabled={isCheckingGit}
>
- <ArrowsClockwise size={12} />
+ {isCheckingGit ? (
+ <Spinner size="sm" />
+ ) : (
+ <ArrowsClockwise size={12} />
+ )}
Check again
</Button>
</Flex>
@@ -408,9 +417,13 @@ export function InstallCliStep({ onNext, onBack }: InstallCliStepProps) {
variant="soft"
color="gray"
onClick={() => void handleCheckGh()}
- loading={isCheckingGh}
+ disabled={isCheckingGh}
>
- <ArrowsClockwise size={12} />
+ {isCheckingGh ? (
+ <Spinner size="sm" />
+ ) : (
+ <ArrowsClockwise size={12} />
+ )}
Check again
</Button>
</Flex>
@@ -434,9 +447,13 @@ export function InstallCliStep({ onNext, onBack }: InstallCliStepProps) {
variant="soft"
color="gray"
onClick={() => void handleCheckGh()}
- loading={isCheckingGh}
+ disabled={isCheckingGh}
>
- <ArrowsClockwise size={12} />
+ {isCheckingGh ? (
+ <Spinner size="sm" />
+ ) : (
+ <ArrowsClockwise size={12} />
+ )}
Check again
</Button>
</Flex>
diff --git a/products/desktop/packages/ui/src/features/onboarding/components/ProjectSelectStep.tsx b/products/desktop/packages/ui/src/features/onboarding/components/ProjectSelectStep.tsx
index ffbf3530b781..9d538be1c441 100644
--- a/products/desktop/packages/ui/src/features/onboarding/components/ProjectSelectStep.tsx
+++ b/products/desktop/packages/ui/src/features/onboarding/components/ProjectSelectStep.tsx
@@ -31,14 +31,16 @@ import {
type ProjectInfo,
useProjects,
} from "@posthog/ui/features/projects/useProjects";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { ProductWordmark } from "@posthog/ui/primitives/ProductWordmark";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { track } from "@posthog/ui/shell/analytics";
import { logger } from "@posthog/ui/shell/logger";
import {
FIELD_CONTENT_CLASS,
FIELD_TRIGGER_CLASS,
} from "@posthog/ui/styles/fieldTrigger";
-import { Button, Flex, Spinner, Text } from "@radix-ui/themes";
+import { Button, Flex, Text } from "@radix-ui/themes";
import { AnimatePresence, motion } from "framer-motion";
import { useMemo, useRef, useState } from "react";
@@ -175,9 +177,7 @@ export function ProjectSelectStep({ onNext, onBack }: ProjectSelectStepProps) {
</AnimatePresence>
{isAuthenticated && isLoading && (
- <Flex align="center" justify="center" className="h-[80px]">
- <Spinner size="3" />
- </Flex>
+ <LoadingState className="h-[80px]" />
)}
{isAuthenticated && !isLoading && (
@@ -299,11 +299,11 @@ export function ProjectSelectStep({ onNext, onBack }: ProjectSelectStepProps) {
});
onNext();
}}
- loading={selectProjectMutation.isPending}
disabled={
currentProjectId == null || selectProjectMutation.isPending
}
>
+ {selectProjectMutation.isPending && <Spinner size="md" />}
Continue
<ArrowRight size={16} weight="bold" />
</Button>
diff --git a/products/desktop/packages/ui/src/features/onboarding/components/SelectRepoStep.tsx b/products/desktop/packages/ui/src/features/onboarding/components/SelectRepoStep.tsx
index da56a684a915..5257de7d6311 100644
--- a/products/desktop/packages/ui/src/features/onboarding/components/SelectRepoStep.tsx
+++ b/products/desktop/packages/ui/src/features/onboarding/components/SelectRepoStep.tsx
@@ -1,12 +1,7 @@
-import {
- ArrowLeft,
- ArrowRight,
- CheckCircle,
- CircleNotch,
-} from "@phosphor-icons/react";
+import { ArrowLeft, ArrowRight, CheckCircle } from "@phosphor-icons/react";
import { repoMatchesGitHubRepos } from "@posthog/core/onboarding/repoProvider";
import { cn } from "@posthog/quill";
-import { Spin } from "@posthog/ui/primitives/Spinner";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useHostCapabilities } from "@posthog/ui/shell/useHostCapabilities";
import { Button, Flex, Text } from "@radix-ui/themes";
import { AnimatePresence, motion } from "framer-motion";
@@ -150,9 +145,7 @@ export function SelectRepoStep({
transition={{ duration: 0.15 }}
>
<Flex align="center" gap="2">
- <Spin className="text-(--gray-9)">
- <CircleNotch size={14} />
- </Spin>
+ <Spinner size="md" className="text-(--gray-9)" />
<Text className="text-(--gray-9) text-[13px]">
Detecting repository...
</Text>
diff --git a/products/desktop/packages/ui/src/features/pi-sessions/PiSessionControls.tsx b/products/desktop/packages/ui/src/features/pi-sessions/PiSessionControls.tsx
index c6e85aaebba6..3a36d708cf3e 100644
--- a/products/desktop/packages/ui/src/features/pi-sessions/PiSessionControls.tsx
+++ b/products/desktop/packages/ui/src/features/pi-sessions/PiSessionControls.tsx
@@ -109,7 +109,7 @@ export function PiModelSelector({
<span className="text-muted-foreground">
<PiIcon size={14} weight="bold" className="translate-y-px" />
</span>
- <Spinner size={12} />
+ <Spinner size="sm" />
Loading...
</Button>
}
@@ -121,7 +121,7 @@ export function PiModelSelector({
className="min-w-[230px]"
>
<DropdownMenuItem disabled>
- <Spinner size={12} />
+ <Spinner size="sm" />
Loading models...
</DropdownMenuItem>
{onHarnessChange && (
diff --git a/products/desktop/packages/ui/src/features/pr-review/PrChecksSection.tsx b/products/desktop/packages/ui/src/features/pr-review/PrChecksSection.tsx
index 5fec6ab82da8..94203cbd89d3 100644
--- a/products/desktop/packages/ui/src/features/pr-review/PrChecksSection.tsx
+++ b/products/desktop/packages/ui/src/features/pr-review/PrChecksSection.tsx
@@ -2,15 +2,13 @@ import {
ArrowSquareOutIcon,
CheckCircleIcon,
ChecksIcon,
- CircleNotchIcon,
MinusCircleIcon,
ProhibitIcon,
XCircleIcon,
} from "@phosphor-icons/react";
import type { PrCheck, PrCheckBucket } from "@posthog/core/git/router-schemas";
-import { Spinner } from "@posthog/quill";
import { DetailSection } from "@posthog/ui/features/inbox/components/DetailSection";
-import { Spin } from "@posthog/ui/primitives/Spinner";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useMemo } from "react";
import { openExternalUrl } from "../../shell/openExternal";
import { usePrChecks } from "./usePrChecks";
@@ -75,7 +73,7 @@ export function PrChecksSection({ prUrl }: PrChecksSectionProps) {
return (
<DetailSection Icon={ChecksIcon} title="Checks">
<div className="flex items-center gap-2 py-1 text-[12px] text-gray-10">
- <Spinner />
+ <Spinner size="sm" />
Loading checks…
</div>
</DetailSection>
@@ -178,11 +176,7 @@ function CheckBucketIcon({ bucket }: { bucket: PrCheckBucket }) {
case "cancel":
return <ProhibitIcon size={14} className="shrink-0 text-(--gray-9)" />;
case "pending":
- return (
- <Spin className="shrink-0 text-(--amber-9)">
- <CircleNotchIcon size={14} />
- </Spin>
- );
+ return <Spinner size="md" className="shrink-0 text-(--amber-9)" />;
case "pass":
return (
<CheckCircleIcon
diff --git a/products/desktop/packages/ui/src/features/pr-review/PrCommentsSection.tsx b/products/desktop/packages/ui/src/features/pr-review/PrCommentsSection.tsx
index 69b267e307b9..cd6b742584e5 100644
--- a/products/desktop/packages/ui/src/features/pr-review/PrCommentsSection.tsx
+++ b/products/desktop/packages/ui/src/features/pr-review/PrCommentsSection.tsx
@@ -1,8 +1,8 @@
import { ArrowSquareOutIcon, ChatCircleIcon } from "@phosphor-icons/react";
-import { Spinner } from "@posthog/quill";
import { MarkdownRenderer } from "@posthog/ui/features/editor/components/MarkdownRenderer";
import { NestedButton } from "@posthog/ui/primitives/NestedButton";
import { RelativeTimestamp } from "@posthog/ui/primitives/RelativeTimestamp";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { cachedImageUrl } from "@posthog/ui/shell/cachedImageUrl";
import { useMemo, useState } from "react";
import { openExternalUrl } from "../../shell/openExternal";
@@ -78,7 +78,7 @@ export function PrCommentsSection({ prUrl }: PrCommentsSectionProps) {
onToggle={() => {}}
summary={
<span className="inline-flex items-center gap-2 text-[11px] text-gray-10">
- <Spinner />
+ <Spinner size="sm" />
Loading…
</span>
}
diff --git a/products/desktop/packages/ui/src/features/pr-review/PrDecisionBlock.tsx b/products/desktop/packages/ui/src/features/pr-review/PrDecisionBlock.tsx
index bcde8c65fc23..0d1263360e6b 100644
--- a/products/desktop/packages/ui/src/features/pr-review/PrDecisionBlock.tsx
+++ b/products/desktop/packages/ui/src/features/pr-review/PrDecisionBlock.tsx
@@ -2,7 +2,6 @@ import {
CaretDownIcon,
CheckCircleIcon,
CheckIcon,
- CircleNotchIcon,
GitMergeIcon,
MinusCircleIcon,
XCircleIcon,
@@ -15,9 +14,8 @@ import {
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
- Spinner,
} from "@posthog/quill";
-import { Spin } from "@posthog/ui/primitives/Spinner";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useState } from "react";
import { PrChecksSection } from "./PrChecksSection";
import { useApprovePr } from "./useApprovePr";
@@ -116,9 +114,7 @@ export function PrDecisionBlock({ prUrl }: PrDecisionBlockProps) {
</span>
) : gate.pendingChecks > 0 ? (
<span className="flex items-center gap-1.5 text-(--amber-11)">
- <Spin>
- <CircleNotchIcon size={14} />
- </Spin>
+ <Spinner size="md" />
Checks running
</span>
) : gate.totalChecks === 0 ? (
diff --git a/products/desktop/packages/ui/src/features/pr-review/PrFilesChangedSection.tsx b/products/desktop/packages/ui/src/features/pr-review/PrFilesChangedSection.tsx
index 04da35e3423d..8ba4425d693e 100644
--- a/products/desktop/packages/ui/src/features/pr-review/PrFilesChangedSection.tsx
+++ b/products/desktop/packages/ui/src/features/pr-review/PrFilesChangedSection.tsx
@@ -1,5 +1,5 @@
import { CheckIcon, GitBranchIcon, GitDiffIcon } from "@phosphor-icons/react";
-import { Button, Spinner, ToggleGroup, ToggleGroupItem } from "@posthog/quill";
+import { Button, ToggleGroup, ToggleGroupItem } from "@posthog/quill";
import {
useDiffViewerStore,
type ViewMode,
@@ -9,6 +9,7 @@ import { useDiffOptions } from "@posthog/ui/features/code-review/reviewShellPart
import { usePrChangedFiles } from "@posthog/ui/features/git-interaction/useGitQueries";
import { DetailSection } from "@posthog/ui/features/inbox/components/DetailSection";
import { NestedButton } from "@posthog/ui/primitives/NestedButton";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { openExternalUrl } from "@posthog/ui/shell/openExternal";
import { type ReactNode, useMemo, useRef, useState } from "react";
import {
diff --git a/products/desktop/packages/ui/src/features/pr-review/PrReviewActions.tsx b/products/desktop/packages/ui/src/features/pr-review/PrReviewActions.tsx
index 10445c47f79b..ae6b0e89c8e1 100644
--- a/products/desktop/packages/ui/src/features/pr-review/PrReviewActions.tsx
+++ b/products/desktop/packages/ui/src/features/pr-review/PrReviewActions.tsx
@@ -13,8 +13,8 @@ import {
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
- Spinner,
} from "@posthog/quill";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useState } from "react";
import { useApprovePr } from "./useApprovePr";
import { useMarkPrReady } from "./useMarkPrReady";
diff --git a/products/desktop/packages/ui/src/features/pr-review/PullRequestView.tsx b/products/desktop/packages/ui/src/features/pr-review/PullRequestView.tsx
index a060a39b397c..b7dc8ed1cc28 100644
--- a/products/desktop/packages/ui/src/features/pr-review/PullRequestView.tsx
+++ b/products/desktop/packages/ui/src/features/pr-review/PullRequestView.tsx
@@ -11,10 +11,10 @@ import {
EmptyHeader,
EmptyMedia,
EmptyTitle,
- Spinner,
} from "@posthog/quill";
import { MarkdownRenderer } from "@posthog/ui/features/editor/components/MarkdownRenderer";
import { DetailSection } from "@posthog/ui/features/inbox/components/DetailSection";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useMemo } from "react";
import { openExternalUrl } from "../../shell/openExternal";
import { PrChecksSection } from "./PrChecksSection";
diff --git a/products/desktop/packages/ui/src/features/provisioning/ProvisioningView.tsx b/products/desktop/packages/ui/src/features/provisioning/ProvisioningView.tsx
index 3953e30d80f1..ccd2d69abe7c 100644
--- a/products/desktop/packages/ui/src/features/provisioning/ProvisioningView.tsx
+++ b/products/desktop/packages/ui/src/features/provisioning/ProvisioningView.tsx
@@ -23,7 +23,7 @@ export function ProvisioningView({ taskId }: ProvisioningViewProps) {
<div className="h-full">
<div className="flex h-full flex-col gap-2 p-3">
<div className="flex items-center gap-2">
- <Spinner size={14} />
+ <Spinner size="sm" />
<span className="font-medium text-[13px]">Loading</span>
</div>
<div className="min-h-0 flex-1 rounded-(--radius-2) border border-(--gray-a5) bg-(--color-surface)">
diff --git a/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingDiscussButton.tsx b/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingDiscussButton.tsx
index fb83bf8c96ba..06861bf73b65 100644
--- a/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingDiscussButton.tsx
+++ b/products/desktop/packages/ui/src/features/scouts/components/ScoutFindingDiscussButton.tsx
@@ -3,7 +3,8 @@ import type { ScoutEmission } from "@posthog/api-client/posthog-client";
import { prettifyScoutSkillName } from "@posthog/core/scouts/scoutPresentation";
import { buildScoutFindingDiscussPrompt } from "@posthog/core/scouts/scoutPrompts";
import { Button } from "@posthog/quill";
-import { Flex, Popover, Spinner, Text, TextArea } from "@radix-ui/themes";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
+import { Flex, Popover, Text, TextArea } from "@radix-ui/themes";
import { useCallback, useMemo, useState } from "react";
import { useScoutChatTask } from "../hooks/useScoutChatTask";
@@ -88,7 +89,7 @@ export function ScoutFindingDiscussButton({
title="Discuss this signal with your agent"
className="inline-flex shrink-0 items-center gap-1 text-[11px] text-accent-11 no-underline transition-colors hover:text-accent-12 disabled:cursor-default disabled:opacity-60"
>
- {isRunning ? <Spinner size="1" /> : <ChatCircleIcon size={11} />}
+ {isRunning ? <Spinner size="sm" /> : <ChatCircleIcon size={11} />}
Discuss
</button>
</Popover.Trigger>
diff --git a/products/desktop/packages/ui/src/features/sessions/components/ArtifactPreview.tsx b/products/desktop/packages/ui/src/features/sessions/components/ArtifactPreview.tsx
index 543c362548a5..1d160b8ea457 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/ArtifactPreview.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/ArtifactPreview.tsx
@@ -16,7 +16,7 @@ import {
type SessionService,
} from "@posthog/core/sessions/sessionService";
import { useService } from "@posthog/di/react";
-import { Button, Spinner } from "@posthog/quill";
+import { Button } from "@posthog/quill";
import type { TaskRun, TaskRunArtifact } from "@posthog/shared";
import {
getAuthIdentity,
@@ -28,6 +28,7 @@ import { usePanelLayoutStore } from "@posthog/ui/features/panels/panelLayoutStor
import { PostHogObjectPage } from "@posthog/ui/features/posthog-objects/PostHogObjectPage";
import { useCommentNavigationStore } from "@posthog/ui/features/sessions/commentNavigationStore";
import { useSessionSelector } from "@posthog/ui/features/sessions/sessionStore";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import {
type ReactElement,
useCallback,
@@ -333,11 +334,7 @@ export function ArtifactPreview({
) : null;
if (isLoading) {
- return (
- <div className="flex h-full items-center justify-center">
- <Spinner />
- </div>
- );
+ return <LoadingState />;
}
if (isError || imageError) return <ArtifactPreviewError />;
diff --git a/products/desktop/packages/ui/src/features/sessions/components/ArtifactPreviewContent.tsx b/products/desktop/packages/ui/src/features/sessions/components/ArtifactPreviewContent.tsx
index 88d9a48f7ff3..b49998c5eb03 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/ArtifactPreviewContent.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/ArtifactPreviewContent.tsx
@@ -6,13 +6,13 @@ import type {
} from "@posthog/core/comments/anchors";
import {
Button,
- Spinner,
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@posthog/quill";
import { isAllowedImageMimeType } from "@posthog/shared";
import type { UserBasic } from "@posthog/shared/domain-types";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import type {
Dispatch,
ReactElement,
@@ -221,11 +221,7 @@ export function ArtifactPreviewContent({
if (!previewData) return <ArtifactPreviewError />;
if (previewData instanceof Blob && !previewUrl) {
- return (
- <div className="flex h-full items-center justify-center">
- <Spinner />
- </div>
- );
+ return <LoadingState />;
}
if (!previewUrl) return <ArtifactPreviewError />;
diff --git a/products/desktop/packages/ui/src/features/sessions/components/CloudSessionLifecycle.tsx b/products/desktop/packages/ui/src/features/sessions/components/CloudSessionLifecycle.tsx
index 1fd80c3729b6..43088d67ee14 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/CloudSessionLifecycle.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/CloudSessionLifecycle.tsx
@@ -56,7 +56,7 @@ export function CloudStreamDisconnectedBanner({
export function ConnectingToAgent({ spinning = true }: { spinning?: boolean }) {
return (
<>
- <Spinner size={28} spinning={spinning} className="text-gray-9" />
+ <Spinner size="lg" spinning={spinning} className="text-gray-9" />
<Text color="gray" className="text-base">
Connecting to agent...
</Text>
diff --git a/products/desktop/packages/ui/src/features/sessions/components/ImageBuilderBuildButton.tsx b/products/desktop/packages/ui/src/features/sessions/components/ImageBuilderBuildButton.tsx
index 301dcd19697a..eb9329c1ae97 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/ImageBuilderBuildButton.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/ImageBuilderBuildButton.tsx
@@ -5,6 +5,7 @@ import {
} from "@posthog/shared/domain-types";
import { imageFailureDetail } from "@posthog/ui/features/settings/sections/environments/imageBuildWatcher";
import { useSandboxCustomImages } from "@posthog/ui/features/settings/sections/environments/useSandboxCustomImages";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { Tooltip } from "@posthog/ui/primitives/Tooltip";
import { Button, Flex, IconButton, Text } from "@radix-ui/themes";
@@ -58,9 +59,9 @@ export function ImageBuilderBuildButton({ taskId }: { taskId: string }) {
size="1"
variant="soft"
onClick={() => buildMutation.mutate({ id: image.id })}
- loading={buildMutation.isPending}
disabled={inProgress || buildMutation.isPending}
>
+ {buildMutation.isPending && <Spinner size="sm" />}
Save & build
</Button>
</Flex>
diff --git a/products/desktop/packages/ui/src/features/sessions/components/PendingChatView.tsx b/products/desktop/packages/ui/src/features/sessions/components/PendingChatView.tsx
index 31343fbf8a72..1b2c28b26703 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/PendingChatView.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/PendingChatView.tsx
@@ -57,7 +57,7 @@ export function PendingChatView({
className="mx-auto flex w-full items-center gap-2 px-2.5"
style={{ maxWidth: CHAT_CONTENT_MAX_WIDTH }}
>
- <Spinner size={12} className="text-accent-11" />
+ <Spinner size="sm" className="text-accent-11" />
<span className="text-[13px] text-accent-11">Loading</span>
</div>
</div>
diff --git a/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.tsx b/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.tsx
index 61a9c7c39da3..363694bd6c0d 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/ReasoningLevelSelector.tsx
@@ -228,7 +228,7 @@ export function ReasoningLevelSelector({
<DropdownMenuTrigger
render={
<Button type="button" variant="default" size="sm">
- <Spinner size={12} />
+ <Spinner size="sm" aria-hidden="true" />
Loading...
</Button>
}
@@ -241,7 +241,7 @@ export function ReasoningLevelSelector({
className="min-w-[230px]"
>
<DropdownMenuItem disabled>
- <Spinner size={12} />
+ <Spinner size="sm" />
Loading models...
</DropdownMenuItem>
{showHarnessSubmenu && adapter && (
diff --git a/products/desktop/packages/ui/src/features/sessions/components/SessionInitializingView.tsx b/products/desktop/packages/ui/src/features/sessions/components/SessionInitializingView.tsx
index ac848960bb84..851a642183cc 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/SessionInitializingView.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/SessionInitializingView.tsx
@@ -25,7 +25,7 @@ export function SessionInitializingView({
if (!revealed) {
return (
<div className="absolute inset-0 flex items-center justify-center gap-2 bg-background">
- <Spinner size={16} className="text-gray-9" />
+ <Spinner size="md" className="text-gray-9" />
<span className="font-medium text-base">Loading</span>
</div>
);
@@ -38,7 +38,7 @@ export function SessionInitializingView({
</div>
<div className="flex flex-col items-center gap-2">
<div className="flex items-center gap-2">
- <Spinner size={16} className="text-gray-9" />
+ <Spinner size="md" className="text-gray-9" />
<span className="font-medium text-base">Loading</span>
</div>
<span className="text-gray-11 text-sm">{subtitle}</span>
diff --git a/products/desktop/packages/ui/src/features/sessions/components/SessionSummaryPanelView.tsx b/products/desktop/packages/ui/src/features/sessions/components/SessionSummaryPanelView.tsx
index 8465347c7902..64fa46852150 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/SessionSummaryPanelView.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/SessionSummaryPanelView.tsx
@@ -72,8 +72,9 @@ export function SessionSummaryPanelView({
{state.status === "pending" && (
<div className="flex items-start gap-2">
<Spinner
- size={13}
- className="mt-0.5 shrink-0 text-muted-foreground"
+ size="sm"
+ aria-hidden="true"
+ className="mt-0.5 text-muted-foreground"
/>
<Text className="text-[12.5px] text-muted-foreground">
Writing the summary. About 30 seconds. You can keep working, and
diff --git a/products/desktop/packages/ui/src/features/sessions/components/SessionView.tsx b/products/desktop/packages/ui/src/features/sessions/components/SessionView.tsx
index 5ba1a0b7ac41..325c0e706fa8 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/SessionView.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/SessionView.tsx
@@ -665,7 +665,7 @@ export function SessionView({
>
{isRestoring ? (
<>
- <Spinner size={14} />
+ <Spinner size="md" />
Restoring...
</>
) : (
diff --git a/products/desktop/packages/ui/src/features/sessions/components/SideQuestionCard.tsx b/products/desktop/packages/ui/src/features/sessions/components/SideQuestionCard.tsx
index dff13b298183..da25398ee324 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/SideQuestionCard.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/SideQuestionCard.tsx
@@ -61,7 +61,7 @@ export function SideQuestionCard({ taskId, taskRunId }: SideQuestionCardProps) {
<output className="mt-1 block pl-6">
{entry.status === "pending" && (
<div className="flex items-center gap-2">
- <Spinner size={14} className="text-muted-foreground" />
+ <Spinner size="md" className="text-muted-foreground" />
<Text className="text-[13px] text-muted-foreground">
Answering…
</Text>
diff --git a/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatMarkdown.tsx b/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatMarkdown.tsx
index 0c1cf3e8474f..0e31285552fc 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatMarkdown.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ChatMarkdown.tsx
@@ -1,4 +1,4 @@
-import { Check, CircleNotch, Copy } from "@phosphor-icons/react";
+import { Check, Copy } from "@phosphor-icons/react";
import {
Heading,
Separator,
@@ -27,7 +27,7 @@ import {
} from "@posthog/ui/features/sessions/components/session-update/fileLinkChips";
import { HighlightedCode } from "@posthog/ui/primitives/HighlightedCode";
import { MermaidDiagram } from "@posthog/ui/primitives/MermaidDiagram";
-import { Spin } from "@posthog/ui/primitives/Spinner";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useCopy } from "@posthog/ui/primitives/useCopy";
import { parseArtifactLink } from "@posthog/ui/utils/artifactLinks";
import {
@@ -94,9 +94,7 @@ const components: Components = {
aria-label="Link loading"
>
{children}
- <Spin>
- <CircleNotch size={12} aria-hidden="true" />
- </Spin>
+ <Spinner size="sm" aria-hidden="true" />
</output>
);
}
diff --git a/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ToolGroup.tsx b/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ToolGroup.tsx
index 6a35c051f9f6..5d91d00b5979 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ToolGroup.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/chat-thread/ToolGroup.tsx
@@ -3,10 +3,10 @@ import {
ChatMarkerContent,
ChatMarkerIcon,
cn,
- Spinner,
} from "@posthog/quill";
import { readAgentToolName } from "@posthog/shared";
import type { ToolCall } from "@posthog/ui/features/sessions/types";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { AnimatePresence, motion, useReducedMotion } from "framer-motion";
import { memo, useMemo } from "react";
import type { ConversationItem } from "../buildConversationItems";
diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/InlineArtifactCard.tsx b/products/desktop/packages/ui/src/features/sessions/components/session-update/InlineArtifactCard.tsx
index d759c185dde1..b55e636e6924 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/session-update/InlineArtifactCard.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/InlineArtifactCard.tsx
@@ -1,6 +1,6 @@
import { ArrowSquareOutIcon } from "@phosphor-icons/react";
import { groupRunArtifactVersions } from "@posthog/core/canvas/runArtifactSchemas";
-import { Button, Spinner } from "@posthog/quill";
+import { Button } from "@posthog/quill";
import { openPrInReview } from "@posthog/ui/features/code-review/openPrInReview";
import { usePrArtifact } from "@posthog/ui/features/git-interaction/usePrArtifact";
import { openRightPanelSide } from "@posthog/ui/features/navigation/rightPanelSide";
@@ -18,6 +18,7 @@ import {
stopCardOpen,
} from "@posthog/ui/primitives/ArtifactCard";
import { FileIcon } from "@posthog/ui/primitives/FileIcon";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { openExternalUrl } from "@posthog/ui/shell/openExternal";
import { formatFileSize } from "@posthog/ui/utils/formatFileSize";
import { useMemo } from "react";
diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/StatusNotificationView.tsx b/products/desktop/packages/ui/src/features/sessions/components/session-update/StatusNotificationView.tsx
index 2432b2d84a00..294f4ecaf1bb 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/session-update/StatusNotificationView.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/StatusNotificationView.tsx
@@ -287,7 +287,7 @@ function CompactingStatusView({
return (
<Box className="my-1 border-blue-6 border-l-2 px-3 py-1 dark:border-blue-8">
<Flex align="center" gap="2">
- <Spinner size={14} className="text-blue-9" />
+ <Spinner size="md" className="text-blue-9" />
<Text className="text-[13px] text-gray-11">{label}</Text>
<Text className="text-[13px] text-gray-10 tabular-nums">
{formatDuration(elapsed, 1)}
diff --git a/products/desktop/packages/ui/src/features/sessions/components/session-update/ToolRow.tsx b/products/desktop/packages/ui/src/features/sessions/components/session-update/ToolRow.tsx
index e3d4bcdda503..2b14a2701f48 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/session-update/ToolRow.tsx
+++ b/products/desktop/packages/ui/src/features/sessions/components/session-update/ToolRow.tsx
@@ -5,8 +5,8 @@ import {
ChatMarkerContent,
ChatMarkerIcon,
cn,
- Spinner,
} from "@posthog/quill";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { type ReactNode, useState } from "react";
import { useChatThreadChrome } from "../chat-thread/chatThreadChrome";
import {
diff --git a/products/desktop/packages/ui/src/features/settings/sections/GitHubIntegrationSection.tsx b/products/desktop/packages/ui/src/features/settings/sections/GitHubIntegrationSection.tsx
index 52d435d22abc..f8d30dd5058c 100644
--- a/products/desktop/packages/ui/src/features/settings/sections/GitHubIntegrationSection.tsx
+++ b/products/desktop/packages/ui/src/features/settings/sections/GitHubIntegrationSection.tsx
@@ -11,7 +11,7 @@ import {
describeGithubRepoAccess,
formatGithubAccountLabel,
} from "@posthog/core/settings/githubRepoSummary";
-import { Button, Spinner, Text } from "@posthog/quill";
+import { Button, Text } from "@posthog/quill";
import { useAuthStateValue } from "@posthog/ui/features/auth/store";
import { useIsOrgAdmin } from "@posthog/ui/features/auth/useOrgRole";
import { GithubInstallRequestsBanner } from "@posthog/ui/features/integrations/components/GithubInstallRequestsBanner";
@@ -20,6 +20,7 @@ import { useIntegrationSelectors } from "@posthog/ui/features/integrations/store
import { useGithubConnect } from "@posthog/ui/features/integrations/useGithubUserConnect";
import { useRepositoryIntegration } from "@posthog/ui/features/integrations/useIntegrations";
import { openSettings } from "@posthog/ui/features/settings/hooks/useOpenSettings";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { Tooltip } from "@posthog/ui/primitives/Tooltip";
interface GitHubIntegrationSectionProps {
diff --git a/products/desktop/packages/ui/src/features/settings/sections/PersonalGithubInstallationsSection.tsx b/products/desktop/packages/ui/src/features/settings/sections/PersonalGithubInstallationsSection.tsx
index 172b779842a7..c6442871dba6 100644
--- a/products/desktop/packages/ui/src/features/settings/sections/PersonalGithubInstallationsSection.tsx
+++ b/products/desktop/packages/ui/src/features/settings/sections/PersonalGithubInstallationsSection.tsx
@@ -7,7 +7,7 @@ import {
formatGithubAccountLabel,
githubInstallationSettingsUrl,
} from "@posthog/core/settings/githubRepoSummary";
-import { Button, Spinner, Text } from "@posthog/quill";
+import { Button, Text } from "@posthog/quill";
import { formatRelativeTimeLong } from "@posthog/shared";
import { useOptionalAuthenticatedClient } from "@posthog/ui/features/auth/authClient";
import { useAuthStateValue } from "@posthog/ui/features/auth/store";
@@ -26,6 +26,7 @@ import {
SettingsCard,
SettingsSection,
} from "@posthog/ui/features/settings/components/SettingsCard";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { toast } from "@posthog/ui/primitives/toast";
import { openUrlInBrowser } from "@posthog/ui/utils/browser";
import { useMutation, useQueryClient } from "@tanstack/react-query";
@@ -89,7 +90,7 @@ export function PersonalGithubInstallationsSection() {
<SettingsCard>
{isLoading ? (
<div className="flex items-center gap-2 px-3.5 py-3">
- <Spinner />
+ <Spinner size="sm" />
<Text size="xs" variant="muted">
Loading…
</Text>
diff --git a/products/desktop/packages/ui/src/features/settings/sections/PlanUsageSettings.tsx b/products/desktop/packages/ui/src/features/settings/sections/PlanUsageSettings.tsx
index 3db3ad13e6ce..8ce7179aa4d0 100644
--- a/products/desktop/packages/ui/src/features/settings/sections/PlanUsageSettings.tsx
+++ b/products/desktop/packages/ui/src/features/settings/sections/PlanUsageSettings.tsx
@@ -22,9 +22,10 @@ import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFla
import { SettingsSubsection } from "@posthog/ui/features/settings/components/SettingsSubsection";
import { SpendAnalysisSection } from "@posthog/ui/features/usage/components/SpendAnalysisSection";
import { useTrackUsageViewed } from "@posthog/ui/features/usage/useTrackUsageViewed";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { track } from "@posthog/ui/shell/analytics";
import { getBillingUrl } from "@posthog/ui/utils/urls";
-import { Button, Callout, Flex, Spinner, Text } from "@radix-ui/themes";
+import { Button, Callout, Flex, Text } from "@radix-ui/themes";
import { type ReactNode, useEffect, useState } from "react";
export function PlanUsageSettings() {
@@ -144,14 +145,7 @@ export function PlanUsageContent({
)}
{usageLoading ? (
- <Flex
- align="center"
- justify="center"
- p="4"
- className="rounded-(--radius-3) border border-border bg-card"
- >
- <Spinner size="2" />
- </Flex>
+ <LoadingState className="rounded-(--radius-3) border border-border bg-card p-4" />
) : meter.kind === "dollars" ? (
<UsageMeter
label={freeTier ? "Monthly free usage" : "Usage this period"}
diff --git a/products/desktop/packages/ui/src/features/settings/sections/ProjectGithubConnectionSection.tsx b/products/desktop/packages/ui/src/features/settings/sections/ProjectGithubConnectionSection.tsx
index 5fa9307781b2..b8ff1cb518e4 100644
--- a/products/desktop/packages/ui/src/features/settings/sections/ProjectGithubConnectionSection.tsx
+++ b/products/desktop/packages/ui/src/features/settings/sections/ProjectGithubConnectionSection.tsx
@@ -11,7 +11,7 @@ import {
formatGithubAccountLabel,
githubInstallationSettingsUrl,
} from "@posthog/core/settings/githubRepoSummary";
-import { Button, Spinner, Text } from "@posthog/quill";
+import { Button, Text } from "@posthog/quill";
import { formatRelativeTimeLong } from "@posthog/shared";
import { useOptionalAuthenticatedClient } from "@posthog/ui/features/auth/authClient";
import { useAuthStateValue } from "@posthog/ui/features/auth/store";
@@ -35,6 +35,7 @@ import {
SettingsCardRow,
SettingsSection,
} from "@posthog/ui/features/settings/components/SettingsCard";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { toast } from "@posthog/ui/primitives/toast";
import { openUrlInBrowser } from "@posthog/ui/utils/browser";
import { useMutation, useQueryClient } from "@tanstack/react-query";
@@ -91,7 +92,7 @@ export function ProjectGithubConnectionSection() {
<SettingsCard>
{isLoading ? (
<div className="flex items-center gap-2 px-3.5 py-3">
- <Spinner />
+ <Spinner size="sm" />
<Text size="xs" variant="muted">
Loading…
</Text>
diff --git a/products/desktop/packages/ui/src/features/settings/sections/SlackSettings.tsx b/products/desktop/packages/ui/src/features/settings/sections/SlackSettings.tsx
index 18bc082168cd..245d83a45947 100644
--- a/products/desktop/packages/ui/src/features/settings/sections/SlackSettings.tsx
+++ b/products/desktop/packages/ui/src/features/settings/sections/SlackSettings.tsx
@@ -1,11 +1,12 @@
import { ArrowSquareOutIcon } from "@phosphor-icons/react";
-import { Button, Spinner } from "@posthog/quill";
+import { Button } from "@posthog/quill";
import { useAuthStateValue } from "@posthog/ui/features/auth/store";
import { useIntegrationSelectors } from "@posthog/ui/features/integrations/store";
import { useIntegrations } from "@posthog/ui/features/integrations/useIntegrations";
import { useSlackConnect } from "@posthog/ui/features/integrations/useSlackConnect";
import { SettingsSection } from "@posthog/ui/features/settings/components/SettingsCard";
import { SlackCommentNotificationsSettings } from "@posthog/ui/features/settings/sections/SlackCommentNotificationsSettings";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { openUrlInBrowser } from "@posthog/ui/utils/browser";
import { getPostHogUrl } from "@posthog/ui/utils/urls";
import { SlackInboxNotificationsSettings } from "./SlackInboxNotificationsSettings";
diff --git a/products/desktop/packages/ui/src/features/settings/sections/SlackWorkspaceConnection.tsx b/products/desktop/packages/ui/src/features/settings/sections/SlackWorkspaceConnection.tsx
index b558e23c5b02..1678fa7575c9 100644
--- a/products/desktop/packages/ui/src/features/settings/sections/SlackWorkspaceConnection.tsx
+++ b/products/desktop/packages/ui/src/features/settings/sections/SlackWorkspaceConnection.tsx
@@ -5,7 +5,7 @@ import {
} from "@posthog/core/integrations/connectErrors";
import { slackInvalidationKeys } from "@posthog/core/integrations/connectMachine";
import { SLACK_DISCONNECT_DESCRIPTION } from "@posthog/core/integrations/disconnectCopy";
-import { Button, Spinner, Text } from "@posthog/quill";
+import { Button, Text } from "@posthog/quill";
import { formatRelativeTimeLong } from "@posthog/shared";
import { useOptionalAuthenticatedClient } from "@posthog/ui/features/auth/authClient";
import { useAuthStateValue } from "@posthog/ui/features/auth/store";
@@ -19,6 +19,7 @@ import {
type SlackConnectResult,
useSlackConnect,
} from "@posthog/ui/features/integrations/useSlackConnect";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { toast } from "@posthog/ui/primitives/toast";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { useState } from "react";
@@ -41,7 +42,7 @@ export function SlackWorkspaceConnection({
if (isLoading) {
return (
<div className="flex items-center gap-2 rounded-(--radius-3) border border-border bg-card px-3.5 py-3">
- <Spinner />
+ <Spinner size="sm" />
<Text size="xs" variant="muted">
Loading Slack…
</Text>
diff --git a/products/desktop/packages/ui/src/features/settings/sections/UpdatesSettings.tsx b/products/desktop/packages/ui/src/features/settings/sections/UpdatesSettings.tsx
index 5b88e347dc8d..e2b4cf621be1 100644
--- a/products/desktop/packages/ui/src/features/settings/sections/UpdatesSettings.tsx
+++ b/products/desktop/packages/ui/src/features/settings/sections/UpdatesSettings.tsx
@@ -4,7 +4,7 @@ import {
resolveCheckResultAction,
} from "@posthog/core/settings/updateStatus";
import { useHostTRPC } from "@posthog/host-router/react";
-import { Button, Spinner, Switch } from "@posthog/quill";
+import { Button, Switch } from "@posthog/quill";
import { ANALYTICS_EVENTS } from "@posthog/shared";
import {
SettingsCard,
@@ -13,6 +13,7 @@ import {
} from "@posthog/ui/features/settings/components/SettingsCard";
import { useSettingsStore } from "@posthog/ui/features/settings/settingsStore";
import { useWhatsNewStore } from "@posthog/ui/features/updates/whatsNewStore";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { track } from "@posthog/ui/shell/analytics";
import { logger } from "@posthog/ui/shell/logger";
import { useMutation, useQuery } from "@tanstack/react-query";
@@ -126,7 +127,7 @@ export function UpdatesSection() {
const statusLine = updateStatus.message && (
<span className="inline-flex items-center gap-1">
{updateStatus.type === "info" && checkingForUpdates && (
- <Spinner className="size-3" />
+ <Spinner size="sm" />
)}
{updateStatus.type === "success" && (
<CheckCircle size={13} weight="fill" className="text-green-9" />
diff --git a/products/desktop/packages/ui/src/features/settings/sections/environments/setup/EnvironmentEditPage.tsx b/products/desktop/packages/ui/src/features/settings/sections/environments/setup/EnvironmentEditPage.tsx
index 3fce30a45f4c..50ecd5e311b6 100644
--- a/products/desktop/packages/ui/src/features/settings/sections/environments/setup/EnvironmentEditPage.tsx
+++ b/products/desktop/packages/ui/src/features/settings/sections/environments/setup/EnvironmentEditPage.tsx
@@ -4,7 +4,6 @@ import {
planEnvironmentInput,
planFromEnvironment,
} from "@posthog/core/settings/environmentSetup";
-import { Spinner } from "@posthog/quill";
import type {
SandboxCustomImage,
SandboxEnvironment,
@@ -12,6 +11,7 @@ import type {
import { EnvironmentEditForm } from "@posthog/ui/features/settings/sections/environments/setup/EnvironmentEditForm";
import { useSandboxCustomImages } from "@posthog/ui/features/settings/sections/environments/useSandboxCustomImages";
import { useSandboxEnvironments } from "@posthog/ui/features/settings/sections/environments/useSandboxEnvironments";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { useState } from "react";
interface EnvironmentEditPageProps {
@@ -38,11 +38,7 @@ export function EnvironmentEditPage({
useSandboxCustomImages();
if (isLoading) {
- return (
- <div className="flex h-40 items-center justify-center">
- <Spinner />
- </div>
- );
+ return <LoadingState className="h-40" />;
}
return (
diff --git a/products/desktop/packages/ui/src/features/settings/sections/environments/setup/EnvironmentSetupFlow.tsx b/products/desktop/packages/ui/src/features/settings/sections/environments/setup/EnvironmentSetupFlow.tsx
index 8d8f7fe4b5b0..41b45be92fc3 100644
--- a/products/desktop/packages/ui/src/features/settings/sections/environments/setup/EnvironmentSetupFlow.tsx
+++ b/products/desktop/packages/ui/src/features/settings/sections/environments/setup/EnvironmentSetupFlow.tsx
@@ -5,7 +5,6 @@ import {
planEnvironmentInput,
type SetupScope,
} from "@posthog/core/settings/environmentSetup";
-import { Spinner } from "@posthog/quill";
import type { SandboxCustomImage } from "@posthog/shared/domain-types";
import { useHandleOpenTask } from "@posthog/ui/features/deep-links/useHandleOpenTask";
import {
@@ -16,6 +15,7 @@ import { submitEnvironmentPlan } from "@posthog/ui/features/settings/sections/en
import { useImageFromPlan } from "@posthog/ui/features/settings/sections/environments/setup/useImageFromPlan";
import { useSandboxCustomImages } from "@posthog/ui/features/settings/sections/environments/useSandboxCustomImages";
import { useSandboxEnvironments } from "@posthog/ui/features/settings/sections/environments/useSandboxEnvironments";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { useRef, useState } from "react";
interface EnvironmentSetupFlowProps {
@@ -55,11 +55,7 @@ export function EnvironmentSetupFlow({
useSandboxEnvironments();
if (imagesLoading || environmentsLoading) {
- return (
- <div className="flex h-40 items-center justify-center">
- <Spinner />
- </div>
- );
+ return <LoadingState className="h-40" />;
}
return (
diff --git a/products/desktop/packages/ui/src/features/settings/sections/worktrees/WorktreeRow.tsx b/products/desktop/packages/ui/src/features/settings/sections/worktrees/WorktreeRow.tsx
index 4ab7d3acb992..2e7556dadb25 100644
--- a/products/desktop/packages/ui/src/features/settings/sections/worktrees/WorktreeRow.tsx
+++ b/products/desktop/packages/ui/src/features/settings/sections/worktrees/WorktreeRow.tsx
@@ -1,9 +1,9 @@
import { Trash } from "@phosphor-icons/react";
import type { Task } from "@posthog/shared/domain-types";
import { closeSettings } from "@posthog/ui/features/settings/hooks/useOpenSettings";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { openTask } from "@posthog/ui/router/useOpenTask";
import { Button, Flex, Text } from "@radix-ui/themes";
-import { DotsCircleSpinner } from "../../../../primitives/DotsCircleSpinner";
import { WorktreeSize } from "./WorktreeSize";
export interface WorktreeEntry {
@@ -96,7 +96,7 @@ export function WorktreeRow({
)
}
>
- {isDeleting ? <DotsCircleSpinner size={12} /> : <Trash size={12} />}
+ {isDeleting ? <Spinner size="sm" /> : <Trash size={12} />}
Delete
</Button>
</Flex>
diff --git a/products/desktop/packages/ui/src/features/sidebar/components/ArchiveRunningTaskDialog.tsx b/products/desktop/packages/ui/src/features/sidebar/components/ArchiveRunningTaskDialog.tsx
index 38e91fe4f956..74f76e925186 100644
--- a/products/desktop/packages/ui/src/features/sidebar/components/ArchiveRunningTaskDialog.tsx
+++ b/products/desktop/packages/ui/src/features/sidebar/components/ArchiveRunningTaskDialog.tsx
@@ -1,4 +1,5 @@
import { Warning } from "@phosphor-icons/react";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { AlertDialog, Button, Flex, Text } from "@radix-ui/themes";
import { useState } from "react";
@@ -84,10 +85,10 @@ export function ArchiveRunningTaskDialog({
<Button
variant="solid"
size="1"
- loading={isSubmitting}
disabled={isSubmitting}
onClick={handleConfirm}
>
+ {isSubmitting && <Spinner size="sm" />}
Archive
</Button>
</AlertDialog.Action>
diff --git a/products/desktop/packages/ui/src/features/sidebar/components/GroupWorktreesSection.tsx b/products/desktop/packages/ui/src/features/sidebar/components/GroupWorktreesSection.tsx
index d3404452593a..cbaa6388e242 100644
--- a/products/desktop/packages/ui/src/features/sidebar/components/GroupWorktreesSection.tsx
+++ b/products/desktop/packages/ui/src/features/sidebar/components/GroupWorktreesSection.tsx
@@ -51,7 +51,7 @@ export function GroupWorktreesSection({
disabled={isStarting}
endContent={
isStarting ? (
- <Spinner size={12} className="text-gray-10" />
+ <Spinner size="sm" className="text-gray-10" />
) : undefined
}
onClick={() => void startTask(worktree.branch)}
diff --git a/products/desktop/packages/ui/src/features/sidebar/components/SidebarMenu.tsx b/products/desktop/packages/ui/src/features/sidebar/components/SidebarMenu.tsx
index a2532f6bdff2..e44f51a372f8 100644
--- a/products/desktop/packages/ui/src/features/sidebar/components/SidebarMenu.tsx
+++ b/products/desktop/packages/ui/src/features/sidebar/components/SidebarMenu.tsx
@@ -40,7 +40,7 @@ import { useTaskContextMenu } from "@posthog/ui/features/tasks/useTaskContextMen
import { useRenameTask } from "@posthog/ui/features/tasks/useTaskMutations";
import { useTasks } from "@posthog/ui/features/tasks/useTasks";
import { useWorkspaces } from "@posthog/ui/features/workspace/useWorkspace";
-import { DotsCircleSpinner } from "@posthog/ui/primitives/DotsCircleSpinner";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { toast } from "@posthog/ui/primitives/toast";
import { useAppView } from "@posthog/ui/router/useAppView";
import { logger } from "@posthog/ui/shell/logger";
@@ -502,7 +502,7 @@ function SidebarMenuComponent() {
{sidebarData.isLoading ? (
<SidebarItem
depth={0}
- icon={<DotsCircleSpinner size={12} className="text-gray-10" />}
+ icon={<Spinner size="sm" className="text-gray-10" />}
label="Loading tasks..."
disabled
/>
diff --git a/products/desktop/packages/ui/src/features/sidebar/components/UpdateBanner.tsx b/products/desktop/packages/ui/src/features/sidebar/components/UpdateBanner.tsx
index 2fb8aaec27ff..e495c53f457d 100644
--- a/products/desktop/packages/ui/src/features/sidebar/components/UpdateBanner.tsx
+++ b/products/desktop/packages/ui/src/features/sidebar/components/UpdateBanner.tsx
@@ -72,7 +72,7 @@ export function UpdateBanner({ variant = "sidebar" }: UpdateBannerProps) {
className="flex items-center gap-1.5 text-(--green-11) text-[13px] opacity-70"
onClick={openModal}
>
- <Spinner size={14} />
+ <Spinner size="md" />
<span>Downloading update... {percent}%</span>
</button>
)}
diff --git a/products/desktop/packages/ui/src/features/sidebar/components/items/TaskStatusDot.tsx b/products/desktop/packages/ui/src/features/sidebar/components/items/TaskStatusDot.tsx
index 871e63f8a551..dfb961418ab5 100644
--- a/products/desktop/packages/ui/src/features/sidebar/components/items/TaskStatusDot.tsx
+++ b/products/desktop/packages/ui/src/features/sidebar/components/items/TaskStatusDot.tsx
@@ -20,7 +20,6 @@ import { Spinner } from "@posthog/ui/primitives/Spinner";
import type { ReactElement, ReactNode } from "react";
const DOT_SIZE = 8;
-const SPINNER_SIZE = 12;
// Keep the status column stable when a dot changes to a larger spinner.
const SPINNER_BOX = DOT_SIZE;
// Enough to still find the dot if you look for it, not enough to count as one of
@@ -82,7 +81,7 @@ function dotMark(dot: TaskDot, decorative = false): ReactElement {
}}
>
<Spinner
- size={SPINNER_SIZE}
+ size="sm"
className="-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/2"
/>
</span>
diff --git a/products/desktop/packages/ui/src/features/task-detail/BranchMismatchDialog.tsx b/products/desktop/packages/ui/src/features/task-detail/BranchMismatchDialog.tsx
index ad868d7eebec..2198c028ebab 100644
--- a/products/desktop/packages/ui/src/features/task-detail/BranchMismatchDialog.tsx
+++ b/products/desktop/packages/ui/src/features/task-detail/BranchMismatchDialog.tsx
@@ -1,4 +1,5 @@
import { GitBranch, Warning } from "@phosphor-icons/react";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import {
AlertDialog,
Button,
@@ -120,8 +121,9 @@ export function BranchMismatchDialog({
variant="solid"
size="1"
onClick={onSwitch}
- loading={isSwitching}
+ disabled={isSwitching}
>
+ {isSwitching && <Spinner size="sm" />}
Switch branch
</Button>
</Flex>
diff --git a/products/desktop/packages/ui/src/features/task-detail/components/ChangesPanel.tsx b/products/desktop/packages/ui/src/features/task-detail/components/ChangesPanel.tsx
index d266ab9bff8c..0007985561a9 100644
--- a/products/desktop/packages/ui/src/features/task-detail/components/ChangesPanel.tsx
+++ b/products/desktop/packages/ui/src/features/task-detail/components/ChangesPanel.tsx
@@ -13,6 +13,7 @@ import {
type FileChangeType,
} from "@posthog/shared/analytics-events";
import type { ChangedFile, Task } from "@posthog/shared/domain-types";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import {
Badge,
Box,
@@ -20,7 +21,6 @@ import {
DropdownMenu,
Flex,
IconButton,
- Spinner,
Text,
} from "@radix-ui/themes";
import { Fragment, useCallback, useMemo, useState } from "react";
@@ -348,7 +348,7 @@ function CloudChangesPanel({ taskId, task }: ChangesPanelProps) {
return (
<PanelMessage detail="Changes will appear once the agent starts writing code">
<Flex align="center" gap="2">
- <Spinner size="1" />
+ <Spinner size="sm" />
<Text className="text-sm">Waiting for changes...</Text>
</Flex>
</PanelMessage>
@@ -383,7 +383,7 @@ function CloudChangesPanel({ taskId, task }: ChangesPanelProps) {
return (
<PanelMessage detail="Changes will appear as the agent modifies files">
<Flex align="center" gap="2">
- <Spinner size="1" />
+ <Spinner size="sm" />
<Text className="text-sm">Waiting for changes...</Text>
</Flex>
</PanelMessage>
@@ -398,7 +398,7 @@ function CloudChangesPanel({ taskId, task }: ChangesPanelProps) {
<ChangesTreeView files={effectiveFiles} renderFile={renderFile} />
{isRunActive && (
<Flex align="center" gap="2" px="3" py="2">
- <Spinner size="1" />
+ <Spinner size="sm" />
<Text color="gray" className="text-[13px]">
Agent is still running...
</Text>
diff --git a/products/desktop/packages/ui/src/features/task-detail/components/CloudGithubSetupDialog.tsx b/products/desktop/packages/ui/src/features/task-detail/components/CloudGithubSetupDialog.tsx
index d27aea0090f4..d11569043aa9 100644
--- a/products/desktop/packages/ui/src/features/task-detail/components/CloudGithubSetupDialog.tsx
+++ b/products/desktop/packages/ui/src/features/task-detail/components/CloudGithubSetupDialog.tsx
@@ -19,12 +19,12 @@ import {
EmptyHeader,
EmptyMedia,
EmptyTitle,
- Spinner,
} from "@posthog/quill";
import { useAuthStateValue } from "@posthog/ui/features/auth/store";
import { useGithubConnect } from "@posthog/ui/features/integrations/useGithubUserConnect";
import { useRepositoryIntegration } from "@posthog/ui/features/integrations/useIntegrations";
import Logo from "@posthog/ui/primitives/Logo";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useRendererWindowFocusStore } from "@posthog/ui/shell/rendererWindowFocusStore";
import { openUrlInBrowser } from "@posthog/ui/utils/browser";
import { domAnimation, LazyMotion, m, useReducedMotion } from "framer-motion";
diff --git a/products/desktop/packages/ui/src/features/task-detail/components/ContinueCliSessions.tsx b/products/desktop/packages/ui/src/features/task-detail/components/ContinueCliSessions.tsx
index c4f4bfc07e22..27455c1b955a 100644
--- a/products/desktop/packages/ui/src/features/task-detail/components/ContinueCliSessions.tsx
+++ b/products/desktop/packages/ui/src/features/task-detail/components/ContinueCliSessions.tsx
@@ -10,16 +10,10 @@ import {
formatRelativeTimeShort,
type WorkspaceMode,
} from "@posthog/shared";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { openTask } from "@posthog/ui/router/useOpenTask";
import { track } from "@posthog/ui/shell/analytics";
-import {
- Dialog,
- Flex,
- ScrollArea,
- Spinner,
- Text,
- TextField,
-} from "@radix-ui/themes";
+import { Dialog, Flex, ScrollArea, Text, TextField } from "@radix-ui/themes";
import { useEffect, useState } from "react";
import claudeMark from "../../../assets/services/claude.svg";
import { toastError } from "../../notifications/errorDetails";
@@ -86,7 +80,7 @@ function SessionCard({
style={{ backgroundColor: "var(--orange-3)" }}
>
{running ? (
- <Spinner size="1" />
+ <Spinner size="sm" />
) : (
<img src={claudeMark} alt="" className="h-3.5 w-3.5" />
)}
diff --git a/products/desktop/packages/ui/src/features/task-detail/components/FileTreePanel.tsx b/products/desktop/packages/ui/src/features/task-detail/components/FileTreePanel.tsx
index 9f8da0a6483f..1e8f90b862b5 100644
--- a/products/desktop/packages/ui/src/features/task-detail/components/FileTreePanel.tsx
+++ b/products/desktop/packages/ui/src/features/task-detail/components/FileTreePanel.tsx
@@ -1,8 +1,9 @@
import { Cloud } from "@phosphor-icons/react";
import { toRelativePath } from "@posthog/shared";
import type { Task } from "@posthog/shared/domain-types";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { useWorkspaceTRPC } from "@posthog/workspace-client/trpc";
-import { Box, Button, Flex, Spinner, Text } from "@radix-ui/themes";
+import { Box, Button, Flex, Text } from "@radix-ui/themes";
import { useQuery, useQueryClient } from "@tanstack/react-query";
import { PanelMessage } from "../../../primitives/PanelMessage";
import {
@@ -150,7 +151,7 @@ function CloudFileTreePanel({ taskId, task }: FileTreePanelProps) {
return (
<PanelMessage detail="Files are in the cloud sandbox">
<Flex align="center" gap="2">
- <Spinner size="1" />
+ <Spinner size="sm" />
<Text className="text-sm">Running in cloud...</Text>
</Flex>
</PanelMessage>
diff --git a/products/desktop/packages/ui/src/features/task-detail/components/TaskShellPanel.tsx b/products/desktop/packages/ui/src/features/task-detail/components/TaskShellPanel.tsx
index 0b9ab3c1265b..95c60e82dbfc 100644
--- a/products/desktop/packages/ui/src/features/task-detail/components/TaskShellPanel.tsx
+++ b/products/desktop/packages/ui/src/features/task-detail/components/TaskShellPanel.tsx
@@ -5,9 +5,9 @@ import {
EmptyHeader,
EmptyMedia,
EmptyTitle,
- Spinner,
} from "@posthog/quill";
import type { Task } from "@posthog/shared/domain-types";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { type ReactNode, useEffect } from "react";
import { usePanelLayoutStore } from "../../panels/panelLayoutStore";
import { useSessionSelector } from "../../sessions/sessionStore";
@@ -88,11 +88,7 @@ export function TaskShellPanel({ taskId, task, shellId }: TaskShellPanelProps) {
}
if (!workspacePath || !sessionStatus || sessionStatus === "connecting") {
- return (
- <div className="flex h-full items-center justify-center">
- <Spinner className="size-5 text-(--gray-9)" />
- </div>
- );
+ return <LoadingState />;
}
return (
diff --git a/products/desktop/packages/ui/src/features/task-detail/components/WorkspaceSetupPrompt.tsx b/products/desktop/packages/ui/src/features/task-detail/components/WorkspaceSetupPrompt.tsx
index de75dd5844da..54753f9fc695 100644
--- a/products/desktop/packages/ui/src/features/task-detail/components/WorkspaceSetupPrompt.tsx
+++ b/products/desktop/packages/ui/src/features/task-detail/components/WorkspaceSetupPrompt.tsx
@@ -8,7 +8,8 @@ import type { WorkspaceSetupService } from "@posthog/core/workspace/WorkspaceSet
import { useService } from "@posthog/di/react";
import { getTaskRepository } from "@posthog/shared";
import type { Task } from "@posthog/shared/domain-types";
-import { Box, Button, Code, Flex, Spinner, Text } from "@radix-ui/themes";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
+import { Box, Button, Code, Flex, Text } from "@radix-ui/themes";
import { useCallback, useMemo, useState } from "react";
import { FolderPicker } from "../../folder-picker/FolderPicker";
import { useFolders } from "../../folders/useFolders";
@@ -96,10 +97,7 @@ export function WorkspaceSetupPrompt({
className="absolute inset-0"
>
{isSettingUp ? (
- <>
- <Spinner size="3" />
- <Text className="text-gray-11 text-sm">Setting up workspace...</Text>
- </>
+ <LoadingState label="Setting up workspace..." />
) : pendingPath ? (
<>
<Warning size={32} weight="duotone" className="text-amber-9" />
diff --git a/products/desktop/packages/ui/src/features/usage/components/SpendAnalysisSection.tsx b/products/desktop/packages/ui/src/features/usage/components/SpendAnalysisSection.tsx
index b2f88104711e..c563d879a6a0 100644
--- a/products/desktop/packages/ui/src/features/usage/components/SpendAnalysisSection.tsx
+++ b/products/desktop/packages/ui/src/features/usage/components/SpendAnalysisSection.tsx
@@ -3,7 +3,8 @@ import {
fillSpendDays,
type SpendAnalysisWindow,
} from "@posthog/core/billing/spendAnalysisFormat";
-import { Button, Callout, Flex, Spinner, Text } from "@radix-ui/themes";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
+import { Button, Callout, Flex, Text } from "@radix-ui/themes";
import { useMemo, useState } from "react";
import { useSpendAnalysis } from "../useSpendAnalysis";
import { ModelBreakdownCards } from "./ModelBreakdownCards";
@@ -47,7 +48,7 @@ export function SpendAnalysisSection() {
disabled={isFetching}
onClick={refetch}
>
- {isFetching && !isLoading ? <Spinner size="1" /> : "Refresh"}
+ {isFetching && !isLoading ? <Spinner size="sm" /> : "Refresh"}
</Button>
</Flex>
</Flex>
diff --git a/products/desktop/packages/ui/src/primitives/LoadingState.stories.tsx b/products/desktop/packages/ui/src/primitives/LoadingState.stories.tsx
new file mode 100644
index 000000000000..7b401c9cb26e
--- /dev/null
+++ b/products/desktop/packages/ui/src/primitives/LoadingState.stories.tsx
@@ -0,0 +1,23 @@
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
+import type { Meta, StoryObj } from "@storybook/react-vite";
+
+const meta = {
+ title: "Primitives/LoadingState",
+ component: LoadingState,
+ decorators: [
+ (Story) => (
+ <div className="h-64 w-96 rounded-md border border-gray-6">
+ <Story />
+ </div>
+ ),
+ ],
+} satisfies Meta<typeof LoadingState>;
+
+export default meta;
+type Story = StoryObj<typeof meta>;
+
+export const Default: Story = {};
+
+export const WithLabel: Story = {
+ args: { label: "Loading archived tasks..." },
+};
diff --git a/products/desktop/packages/ui/src/primitives/LoadingState.tsx b/products/desktop/packages/ui/src/primitives/LoadingState.tsx
new file mode 100644
index 000000000000..d941086f249e
--- /dev/null
+++ b/products/desktop/packages/ui/src/primitives/LoadingState.tsx
@@ -0,0 +1,30 @@
+import { cn } from "@posthog/quill";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
+import type { ComponentProps } from "react";
+
+interface LoadingStateProps extends Omit<ComponentProps<"div">, "children"> {
+ label?: string;
+}
+
+export function LoadingState({
+ label,
+ className,
+ ...props
+}: LoadingStateProps) {
+ return (
+ <div
+ className={cn(
+ "flex h-full w-full flex-col items-center justify-center gap-3 text-gray-9",
+ className,
+ )}
+ {...props}
+ >
+ <Spinner size="lg" label={label} />
+ {label && (
+ <span aria-hidden="true" className="text-gray-11 text-sm">
+ {label}
+ </span>
+ )}
+ </div>
+ );
+}
diff --git a/products/desktop/packages/ui/src/primitives/MermaidDiagram.tsx b/products/desktop/packages/ui/src/primitives/MermaidDiagram.tsx
index 45ab8372b0d1..21e52976d376 100644
--- a/products/desktop/packages/ui/src/primitives/MermaidDiagram.tsx
+++ b/products/desktop/packages/ui/src/primitives/MermaidDiagram.tsx
@@ -1,5 +1,6 @@
-import { cn, Spinner } from "@posthog/quill";
+import { cn } from "@posthog/quill";
import { CodeBlock } from "@posthog/ui/primitives/CodeBlock";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
import { useThemeStore } from "@posthog/ui/shell/themeStore";
import type { Mermaid } from "mermaid";
import { useEffect, useId, useState } from "react";
@@ -122,12 +123,10 @@ export function MermaidDiagram({ code, className }: MermaidDiagramProps) {
if (state.status === "loading") {
return (
- <div
- className={cn("mb-3 flex justify-center py-4", className)}
+ <LoadingState
+ className={cn("mb-3 py-4", className)}
data-testid="mermaid-loading"
- >
- <Spinner />
- </div>
+ />
);
}
diff --git a/products/desktop/packages/ui/src/primitives/Spinner.stories.tsx b/products/desktop/packages/ui/src/primitives/Spinner.stories.tsx
new file mode 100644
index 000000000000..37216cb34bd1
--- /dev/null
+++ b/products/desktop/packages/ui/src/primitives/Spinner.stories.tsx
@@ -0,0 +1,48 @@
+import { Button } from "@posthog/quill";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
+import type { Meta, StoryObj } from "@storybook/react-vite";
+
+const meta = {
+ title: "Primitives/Spinner",
+ component: Spinner,
+ parameters: { layout: "centered" },
+} satisfies Meta<typeof Spinner>;
+
+export default meta;
+type Story = StoryObj<typeof meta>;
+
+export const Default: Story = {};
+
+export const Sizes: Story = {
+ render: () => (
+ <div className="flex items-center gap-4 text-gray-11">
+ <Spinner size="xs" />
+ <Spinner size="sm" />
+ <Spinner size="md" />
+ <Spinner size="lg" />
+ </div>
+ ),
+};
+
+export const InButtons: Story = {
+ render: () => (
+ <div className="flex items-center gap-2">
+ <Button size="xs">
+ <Spinner /> Saving
+ </Button>
+ <Button size="sm">
+ <Spinner /> Saving
+ </Button>
+ <Button>
+ <Spinner /> Saving
+ </Button>
+ <Button size="lg">
+ <Spinner /> Saving
+ </Button>
+ </div>
+ ),
+};
+
+export const Stopped: Story = {
+ args: { size: "lg", spinning: false },
+};
diff --git a/products/desktop/packages/ui/src/primitives/Spinner.test.tsx b/products/desktop/packages/ui/src/primitives/Spinner.test.tsx
new file mode 100644
index 000000000000..81e09b312cc0
--- /dev/null
+++ b/products/desktop/packages/ui/src/primitives/Spinner.test.tsx
@@ -0,0 +1,31 @@
+import { render, screen } from "@testing-library/react";
+import { describe, expect, it } from "vitest";
+import { Spinner } from "./Spinner";
+
+describe("Spinner", () => {
+ it.each([
+ ["xs", "size-2.5"],
+ ["sm", "size-3"],
+ ["md", "size-4"],
+ ["lg", "size-6"],
+ ] as const)("sizes the icon for %s with %s", (size, sizeClass) => {
+ render(<Spinner size={size} />);
+ const status = screen.getByRole("status", { name: "Loading" });
+ expect(status).toHaveClass("animate-spin", "motion-reduce:animate-none");
+ expect(status.querySelector("svg")).toHaveClass(sizeClass);
+ });
+
+ it("leaves the icon unclassed by default so quill containers can size it", () => {
+ render(<Spinner />);
+ const icon = screen.getByRole("status").querySelector("svg");
+ expect(icon).toHaveAttribute("width", "16");
+ expect(icon?.getAttribute("class")).not.toMatch(/size-/);
+ });
+
+ it("holds still when spinning is off", () => {
+ render(<Spinner spinning={false} label="Connecting" />);
+ expect(screen.getByRole("status", { name: "Connecting" })).not.toHaveClass(
+ "animate-spin",
+ );
+ });
+});
diff --git a/products/desktop/packages/ui/src/primitives/Spinner.tsx b/products/desktop/packages/ui/src/primitives/Spinner.tsx
index cd93cf04e4b4..30ebd148463c 100644
--- a/products/desktop/packages/ui/src/primitives/Spinner.tsx
+++ b/products/desktop/packages/ui/src/primitives/Spinner.tsx
@@ -1,37 +1,64 @@
-import { type IconProps, Spinner as SpinnerIcon } from "@phosphor-icons/react";
import { cn } from "@posthog/quill";
-import type { ReactNode } from "react";
+import { LoaderCircle } from "lucide-react";
+import type { ComponentProps } from "react";
-interface SpinProps {
+interface SpinProps extends ComponentProps<"span"> {
spinning?: boolean;
- className?: string;
- children: ReactNode;
}
// Chromium animates transforms on <svg> elements on the main thread, which costs a style
// recalc and layerize pass every frame; on an HTML wrapper the compositor runs it for free.
-export function Spin({ spinning = true, className, children }: SpinProps) {
+export function Spin({
+ spinning = true,
+ className,
+ children,
+ ...props
+}: SpinProps) {
return (
<span
className={cn(
"inline-flex shrink-0",
- spinning && "animate-spin",
+ spinning && "animate-spin motion-reduce:animate-none",
className,
)}
+ {...props}
>
{children}
</span>
);
}
-interface SpinnerProps extends IconProps {
+export type SpinnerSize = "xs" | "sm" | "md" | "lg";
+
+const SIZE_CLASS: Record<SpinnerSize, string> = {
+ xs: "size-2.5",
+ sm: "size-3",
+ md: "size-4",
+ lg: "size-6",
+};
+
+interface SpinnerProps extends Omit<ComponentProps<"span">, "children"> {
+ size?: SpinnerSize;
spinning?: boolean;
+ label?: string;
}
-export function Spinner({ spinning, className, ...iconProps }: SpinnerProps) {
+// Quill buttons and media slots size an svg that has no `size-*` class to match the
+// icons beside it, so the default leaves the class off and falls back to 16px through
+// the width and height attributes.
+export function Spinner({
+ size,
+ spinning,
+ label = "Loading",
+ ...props
+}: SpinnerProps) {
return (
- <Spin spinning={spinning} className={className}>
- <SpinnerIcon {...iconProps} />
+ <Spin spinning={spinning} role="status" aria-label={label} {...props}>
+ <LoaderCircle
+ size={16}
+ aria-hidden="true"
+ className={size && SIZE_CLASS[size]}
+ />
</Spin>
);
}
diff --git a/products/desktop/packages/ui/src/primitives/StepList.tsx b/products/desktop/packages/ui/src/primitives/StepList.tsx
index f7829cf0601f..d753bd525302 100644
--- a/products/desktop/packages/ui/src/primitives/StepList.tsx
+++ b/products/desktop/packages/ui/src/primitives/StepList.tsx
@@ -2,11 +2,10 @@ import {
ArrowSquareOut,
CheckCircle,
Circle,
- CircleNotch,
XCircle,
} from "@phosphor-icons/react";
import { Button, Text } from "@posthog/quill";
-import { Spin } from "@posthog/ui/primitives/Spinner";
+import { Spinner } from "@posthog/ui/primitives/Spinner";
import { openExternalUrl } from "@posthog/ui/shell/openExternal";
export type StepStatus = "pending" | "in_progress" | "completed" | "failed";
@@ -18,25 +17,16 @@ export interface Step {
detail?: string;
}
-interface StepIconProps {
- status: StepStatus;
- size?: number;
-}
-
-export function StepIcon({ status, size = 14 }: StepIconProps) {
+export function StepIcon({ status }: { status: StepStatus }) {
switch (status) {
case "in_progress":
- return (
- <Spin className="text-blue-9">
- <CircleNotch size={size} />
- </Spin>
- );
+ return <Spinner size="md" className="text-blue-9" />;
case "completed":
- return <CheckCircle size={size} weight="fill" className="text-green-9" />;
+ return <CheckCircle size={14} weight="fill" className="text-green-9" />;
case "failed":
- return <XCircle size={size} weight="fill" className="text-red-9" />;
+ return <XCircle size={14} weight="fill" className="text-red-9" />;
default:
- return <Circle size={size} className="text-gray-8" />;
+ return <Circle size={14} className="text-gray-8" />;
}
}
diff --git a/products/desktop/packages/ui/src/router/RoutePending.tsx b/products/desktop/packages/ui/src/router/RoutePending.tsx
index e917a272d095..fea5ad39917d 100644
--- a/products/desktop/packages/ui/src/router/RoutePending.tsx
+++ b/products/desktop/packages/ui/src/router/RoutePending.tsx
@@ -1,4 +1,4 @@
-import { Flex, Spinner } from "@radix-ui/themes";
+import { LoadingState } from "@posthog/ui/primitives/LoadingState";
// Default per-route pending UI. TanStack Router renders a route's
// `pendingComponent` (falling back to this) the moment its loader is pending,
@@ -10,9 +10,5 @@ import { Flex, Spinner } from "@radix-ui/themes";
// inset-0`: the Outlet's container isn't positioned, so an absolute overlay
// would escape to the viewport and flash over the sidebar/header.
export function RoutePending() {
- return (
- <Flex align="center" justify="center" height="100%" width="100%">
- <Spinner size="3" />
- </Flex>
- );
+ return <LoadingState />;
}