Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ See [docs/conventions.md](./docs/conventions.md).
- TanStack Query, TanStack Router
- Zustand, InversifyJS (with `@inversifyjs/strongly-typed`), Zod
- xterm.js, CodeMirror, Tiptap
- Sonner

## Testing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
} from "@posthog/ui/features/settings/settingsStore";
import { useCreateTask } from "@posthog/ui/features/tasks/useTaskCrudMutations";
import { Badge } from "@posthog/ui/primitives/Badge";
import { toast as sonnerToast, toast } from "@posthog/ui/primitives/toast";
import { toast } from "@posthog/ui/primitives/toast";
import { openTask } from "@posthog/ui/router/useOpenTask";
import { track } from "@posthog/ui/shell/analytics";
import { logger } from "@posthog/ui/shell/logger";
Expand Down Expand Up @@ -314,7 +314,7 @@ function SetupTaskSection() {
const model = resolvedModel ?? settings.lastUsedModel;

if (!model) {
sonnerToast.dismiss(toastId);
toast.dismiss(toastId);
trackSetupFailure();
toast.error("Failed to start Self-driving setup", {
description:
Expand Down Expand Up @@ -349,7 +349,7 @@ function SetupTaskSection() {
void openTask(output.task);
});

sonnerToast.dismiss(toastId);
toast.dismiss(toastId);
track(ANALYTICS_EVENTS.AGENTS_ACTION, {
action_type: "run_setup_agent",
success: result.success,
Expand All @@ -375,7 +375,7 @@ function SetupTaskSection() {
});
}
} catch (error) {
sonnerToast.dismiss(toastId);
toast.dismiss(toastId);
track(ANALYTICS_EVENTS.AGENTS_ACTION, {
action_type: "run_setup_agent",
success: false,
Expand Down
10 changes: 5 additions & 5 deletions packages/ui/src/features/inbox/hooks/useInboxCloudTaskRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { resolveDefaultModel } from "@posthog/ui/features/inbox/hooks/resolveDef
import { useUserRepositoryIntegration } from "@posthog/ui/features/integrations/useIntegrations";
import { useSettingsStore } from "@posthog/ui/features/settings/settingsStore";
import { useCreateTask } from "@posthog/ui/features/tasks/useTaskCrudMutations";
import { toast as sonnerToast, toast } from "@posthog/ui/primitives/toast";
import { toast } from "@posthog/ui/primitives/toast";
import { openTask } from "@posthog/ui/router/useOpenTask";
import { track } from "@posthog/ui/shell/analytics";
import { logger } from "@posthog/ui/shell/logger";
Expand Down Expand Up @@ -150,7 +150,7 @@ export function useInboxCloudTaskRunner({
const model = resolvedModel ?? settings.lastUsedModel;

if (!model) {
sonnerToast.dismiss(toastId);
toast.dismiss(toastId);
toast.error(copy.errorTitle, { description: copy.missingModel });
setIsRunning(false);
return;
Expand Down Expand Up @@ -186,7 +186,7 @@ export function useInboxCloudTaskRunner({
});

if (result.success) {
sonnerToast.dismiss(toastId);
toast.dismiss(toastId);
if (!redirectOnSuccess) {
const task = createdTask;
toast.success(copy.successTitle ?? "Task started", {
Expand Down Expand Up @@ -217,7 +217,7 @@ export function useInboxCloudTaskRunner({
...analyticsExtras,
});
} else {
sonnerToast.dismiss(toastId);
toast.dismiss(toastId);
// Usage-limit blocks already show the upgrade modal; don't double-toast.
if (!isUsageLimitResult(result)) {
toast.error(copy.errorTitle, { description: result.error });
Expand All @@ -230,7 +230,7 @@ export function useInboxCloudTaskRunner({
}
}
} catch (error) {
sonnerToast.dismiss(toastId);
toast.dismiss(toastId);
const description =
error instanceof Error ? error.message : "Unknown error";
toast.error(copy.errorTitle, { description });
Expand Down
8 changes: 4 additions & 4 deletions packages/ui/src/primitives/toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { toast as quillToast } from "@posthog/quill";
// Thin wrapper over quill's toast so the whole app shares one import and a
// stable `(title, options)` signature. Quill (base-ui under the hood) owns
// rendering, stacking, auto-dismiss, hover-to-pause, and the close button —
// which is why this exists instead of a hand-rolled sonner custom toast.
// which is why this exists instead of a hand-rolled custom toast.

export interface ToastAction {
label: string;
Expand All @@ -13,7 +13,7 @@ export interface ToastAction {
export interface ToastOptions {
description?: string;
// A caller-chosen stable id: upserts (creates or replaces) the toast with
// that id so it never stacks — matching sonner's `{ id }`. quill itself can't
// that id so it never stacks. quill itself can't
// pick an id at create time, so the wrapper maps it (see idRegistry).
id?: string;
action?: ToastAction;
Expand All @@ -22,8 +22,8 @@ export interface ToastOptions {
duration?: number;
}

// The second argument may be a bare description string (sonner-style shorthand)
// or the full options object.
// The second argument may be a bare description string (shorthand) or the full
// options object.
type Detail = string | ToastOptions;

type Level = "success" | "error" | "info" | "warning" | "loading";
Expand Down
Loading