Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

ui improvements

Pedro Ladeira21205f122418
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/configure-tracking-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/configure-tracking-section.tsx
index f9b63f5644..bbafc8ea7f 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/configure-tracking-section.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/configure-tracking-section.tsx
@@ -176,10 +176,11 @@ export function ConfigureTrackingSection() {
await setConnectionComplete(true);
const selectedGuideTypes = new Set(
- data.stack.flatMap(
- (stackId) =>
- stackItems.find((item) => item.id === stackId)?.guideKeys ?? [],
- )
+ data.stack
+ .flatMap(
+ (stackId) =>
+ stackItems.find((item) => item.id === stackId)?.guideKeys ?? [],
+ )
.map((key) => guides.find((guide) => guide.key === key)?.type)
.filter(Boolean),
);
@@ -298,9 +299,6 @@ export function ConfigureTrackingSection() {
<TrackingSettingsRow
heading="Site visit tracking"
description={SITE_VISIT_DESCRIPTION}
- align={
- watch("siteVisitTrackingEnabled") ? "start" : "center"
- }
>
<SiteVisitTrackingField
enabled={watch("siteVisitTrackingEnabled")}
@@ -351,8 +349,7 @@ export function ConfigureTrackingSection() {
loading={isSubmitting}
disabled={!isDirty || loading}
disabledTooltip={
- disabledTooltip ||
- (!isDirty ? "No unsaved changes" : undefined)
+ disabledTooltip || (!isDirty ? "No unsaved changes" : undefined)
}
/>
</div>
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/empty-tracking-card.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/empty-tracking-card.tsx
index 9a5c6ff7d5..78f6500439 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/empty-tracking-card.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/empty-tracking-card.tsx
@@ -8,11 +8,27 @@ export function EmptyTrackingCard({
icon,
text,
action,
+ variant = "row",
}: {
icon: ReactNode;
text: string;
action: ReactNode;
+ variant?: "row" | "stack";
}) {
+ if (variant === "stack") {
+ return (
+ <div className="flex h-[138px] w-full flex-col items-center justify-center gap-4 rounded-xl bg-neutral-50 py-6">
+ <div className="flex flex-col items-center gap-2">
+ {icon}
+ <span className="text-content-subtle text-center text-sm font-medium leading-5 tracking-[-0.02em]">
+ {text}
+ </span>
+ </div>
+ {action}
+ </div>
+ );
+ }
+
return (
<div className="flex h-16 w-full items-center justify-between gap-4 rounded-xl bg-neutral-50 py-4 pl-6 pr-4">
<div className="flex min-w-0 items-center gap-2">
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/hostname-menu.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/hostname-menu.tsx
index 92512bbd03..a3126c6c39 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/hostname-menu.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/hostname-menu.tsx
@@ -37,12 +37,12 @@ function HostnameMenu({
>
<Button
variant="outline"
- className="h-8 w-fit shrink-0 px-1.5 outline-none transition-all duration-200 border-transparent data-[state=open]:border-neutral-500"
+ className="size-7 shrink-0 border-transparent p-0 outline-none transition-all duration-200 data-[state=open]:border-neutral-500"
icon={
loading ? (
- <LoadingSpinner className="size-4 shrink-0" />
+ <LoadingSpinner className="size-3 shrink-0" />
) : (
- <ThreeDots className="size-5 shrink-0 rotate-90" />
+ <ThreeDots className="size-4 shrink-0 rotate-90" />
)
}
onClick={() => {
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/installation-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/installation-section.tsx
index 687967a83b..95290c7368 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/installation-section.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/installation-section.tsx
@@ -28,13 +28,14 @@ export function InstallationSection() {
heading="Setup instructions"
description="Use the prompts and instructions to install Dub."
leftExtra={ready ? <DeveloperGuides /> : undefined}
+ leftExtraAlign="end"
>
<SetupInstructions stack={stack} hasHostname={hostnames.length > 0} />
</TrackingSettingsRow>
<TrackingSettingsRow
heading="Verify installation"
- description="To make sure it's all working!"
+ description="Select your hostname to verify the Dub installation."
align="center"
>
<VerifyInstall hostnames={hostnames} />
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/publishable-key-field.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/publishable-key-field.tsx
index 2195e0b401..8e5e52add1 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/publishable-key-field.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/publishable-key-field.tsx
@@ -46,24 +46,28 @@ export function PublishableKeyField({
return (
<>
{publishableKey ? (
- <div className="flex flex-col gap-3 rounded-xl border border-neutral-200 bg-white p-3 sm:flex-row sm:items-center sm:justify-between sm:gap-2">
- <div className="flex min-w-0 items-center gap-2">
+ <div className="flex items-center justify-between gap-3 rounded-xl border border-neutral-200 bg-white px-3 py-2.5">
+ <div className="flex min-w-0 items-center gap-2.5">
<div className="flex size-7 shrink-0 items-center justify-center rounded-md bg-neutral-100">
<Key className="size-4 text-neutral-800" />
</div>
<code className="min-w-0 truncate font-mono text-sm text-neutral-800">
{publishableKey}
</code>
- <CopyButton value={publishableKey} className="shrink-0" />
</div>
- <div className="flex w-fit items-center gap-2 sm:shrink-0">
+ <div className="flex shrink-0 items-center gap-2">
+ <CopyButton
+ value={publishableKey}
+ className="flex size-7 items-center justify-center rounded-lg border border-neutral-200 p-0 hover:bg-neutral-50 [&_svg]:size-3.5"
+ />
<Button
text="Regenerate"
variant="secondary"
onClick={() => setShowGenerateModal(true)}
disabled={disabled}
disabledTooltip={disabledTooltip}
- className="h-7 w-fit px-2 text-xs"
+ className="h-7 w-fit shrink-0 px-2.5"
+ textWrapperClassName="overflow-visible"
/>
<PublishableKeyMenu
onRevoke={() => setShowRevokeModal(true)}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/publishable-key-menu.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/publishable-key-menu.tsx
index c63e8af4f2..aee9f14598 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/publishable-key-menu.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/publishable-key-menu.tsx
@@ -38,8 +38,8 @@ function PublishableKeyMenu({
>
<Button
variant="outline"
- className="h-8 w-fit shrink-0 px-1.5 outline-none transition-all duration-200 border-transparent data-[state=open]:border-neutral-500"
- icon={<ThreeDots className="size-5 shrink-0 rotate-90" />}
+ className="size-7 shrink-0 border-transparent p-0 outline-none transition-all duration-200 data-[state=open]:border-neutral-500"
+ icon={<ThreeDots className="size-4 shrink-0 rotate-90" />}
onClick={() => {
setOpenPopover(!openPopover);
}}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/setup-instructions.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/setup-instructions.tsx
index 6aac3637d3..24735d85e2 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/setup-instructions.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/setup-instructions.tsx
@@ -1,17 +1,19 @@
"use client";
-import { GuideActionButton } from "@/ui/guides/guide-action-button";
-import {
- guides,
- IntegrationGuide,
- stackItems,
-} from "@/ui/guides/integrations";
+import { guides, IntegrationGuide, stackItems } from "@/ui/guides/integrations";
import { GuidesMarkdown } from "@/ui/guides/markdown";
-import { Button, CircleDotted } from "@dub/ui";
+import { BookOpen, Button, CopyButton, Tooltip } from "@dub/ui";
+import {
+ ChatGPTIcon,
+ ChatTask,
+ CircleDashed,
+ Claude,
+ Cursor,
+ Grok,
+} from "@dub/ui/icons";
import { cn } from "@dub/utils";
-import { ArrowUpRight } from "lucide-react";
import Link from "next/link";
-import { useMemo, useState } from "react";
+import { useState } from "react";
import { useDynamicGuide } from "./use-dynamic-guide";
const DEVELOPER_GUIDES = [
@@ -29,16 +31,74 @@ const DEVELOPER_GUIDES = [
},
];
-function extractFirstCodeBlock(markdown: string) {
- const match = markdown.match(/```(\w+)?\n([\s\S]*?)```/);
- if (!match) {
- return null;
- }
+const OPEN_IN_APPS = [
+ {
+ id: "claude",
+ name: "Claude",
+ icon: Claude,
+ href: (prompt: string) =>
+ `https://claude.ai/new?q=${encodeURIComponent(prompt)}`,
+ },
+ {
+ id: "chatgpt",
+ name: "ChatGPT",
+ icon: ChatGPTIcon,
+ href: (prompt: string) =>
+ `https://chatgpt.com/?hints=search&q=${encodeURIComponent(prompt)}`,
+ },
+ {
+ id: "cursor",
+ name: "Cursor",
+ icon: Cursor,
+ href: (prompt: string) =>
+ `https://cursor.com/link/prompt?text=${encodeURIComponent(prompt)}`,
+ },
+ {
+ id: "grok",
+ name: "Grok",
+ icon: Grok,
+ href: (prompt: string) =>
+ `https://grok.com/?q=${encodeURIComponent(prompt)}`,
+ },
+] as const;
- return {
- language: match[1] ?? "text",
- code: match[2].trim(),
- };
+function getInstallPrompt(url: string) {
+ return `Read from ${url} and implement it.`;
+}
+
+function OpenInApps({ prompt }: { prompt: string }) {
+ return (
+ <div className="flex items-center gap-2">
+ <span className="text-xs font-medium leading-4 tracking-[-0.02em] text-neutral-500">
+ Open in
+ </span>
+ <div className="flex items-center">
+ {OPEN_IN_APPS.map((app) => {
+ const Icon = app.icon;
+
+ return (
+ <Tooltip key={app.id} content={`Open in ${app.name}`}>
+ <button
+ type="button"
+ aria-label={`Open in ${app.name}`}
+ onClick={() =>
+ window.open(app.href(prompt), "_blank", "noopener,noreferrer")
+ }
+ className={cn(
+ "flex size-6 items-center justify-center rounded-lg text-neutral-900",
+ "transition-[transform,background-color] duration-150 ease-out",
+ "hover:bg-neutral-100 active:scale-[0.97]",
+ "motion-reduce:transition-none motion-reduce:active:scale-100",
+ )}
+ >
+ <Icon className="size-3.5" />
+ </button>
+ </Tooltip>
+ );
+ })}
+ </div>
+ </div>
+ );
}
function getSelectedStackItems(stackIds: string[]) {
@@ -69,21 +129,21 @@ export function isSetupInstructionsReady(
export function DeveloperGuides() {
return (
- <div className="mt-4 flex flex-col gap-2">
- <h4 className="text-content-emphasis text-sm font-semibold">
+ <div className="flex flex-col gap-1.5">
+ <h4 className="text-xs font-semibold leading-4 tracking-[-0.02em] text-neutral-600">
Read developer guides
</h4>
- <div className="flex flex-col">
+ <div className="flex flex-col gap-1.5">
{DEVELOPER_GUIDES.map((guide) => (
<Link
key={guide.href}
href={guide.href}
target="_blank"
rel="noopener noreferrer"
- className="text-content-default flex items-center justify-between gap-2 rounded-lg py-2 text-sm font-medium transition-colors duration-150 hover:bg-neutral-50"
+ className="flex w-fit items-center gap-1.5 text-xs font-medium leading-4 tracking-[-0.02em] text-neutral-500 transition-colors duration-150 hover:text-neutral-700"
>
- {guide.title}
- <ArrowUpRight className="size-3.5 shrink-0 text-neutral-400" />
+ <BookOpen className="size-3.5 shrink-0" />
+ {guide.title} ↗
</Link>
))}
</div>
@@ -106,9 +166,9 @@ export function SetupInstructions({
if (!ready) {
return (
- <div className="flex flex-col items-center justify-center rounded-xl border border-dashed border-neutral-200 bg-neutral-50 px-6 py-16 text-center">
- <CircleDotted className="size-8 text-neutral-300" />
- <p className="text-content-subtle mt-3 max-w-sm text-sm font-medium">
+ <div className="flex h-[114px] w-full flex-col items-center justify-center gap-2 rounded-xl bg-neutral-50 py-6">
+ <CircleDashed className="size-[18px] shrink-0 text-neutral-500" />
+ <p className="text-center text-sm font-medium leading-5 tracking-[-0.02em] text-neutral-500">
Select your stack, add at least one hostname to generate install
instructions
</p>
@@ -117,7 +177,7 @@ export function SetupInstructions({
}
return (
- <div className="flex flex-col gap-5">
+ <div className="flex flex-col gap-3">
{primaryGuide && <MainPromptCard guide={primaryGuide} />}
{clientSdkItems.length > 0 && (
@@ -133,18 +193,18 @@ export function SetupInstructions({
return (
<div
key={item.id}
- className="flex items-center justify-between gap-3 rounded-xl border border-neutral-200 bg-white px-3 py-2.5"
+ className="flex h-[52px] w-full items-center justify-between gap-3 rounded-[10px] bg-neutral-50 p-3"
>
<div className="flex min-w-0 items-center gap-2.5">
<Icon className="size-5 shrink-0" />
- <span className="text-sm font-medium text-neutral-800">
+ <span className="truncate text-sm font-medium text-neutral-800">
{item.title}
</span>
</div>
<Button
text="Read install guide"
variant="secondary"
- className="h-8 w-fit px-2.5"
+ className="h-8 w-fit shrink-0 px-2.5"
onClick={() =>
window.open(guide.url, "_blank", "noopener,noreferrer")
}
@@ -161,54 +221,67 @@ export function SetupInstructions({
function MainPromptCard({ guide }: { guide: IntegrationGuide }) {
const { loading, guideMarkdown } = useDynamicGuide({ guide: guide.key });
const [expanded, setExpanded] = useState(false);
-
- const snippet = useMemo(
- () => (guideMarkdown ? extractFirstCodeBlock(guideMarkdown) : null),
- [guideMarkdown],
- );
+ const prompt = getInstallPrompt(guide.url);
return (
- <div className="overflow-hidden rounded-xl border border-neutral-200 bg-neutral-50">
- <div className="flex items-center justify-between gap-2 px-3 py-2.5">
- <h4 className="text-content-emphasis text-sm font-semibold">
- Main prompt
- </h4>
- {guideMarkdown && (
- <GuideActionButton guide={guide} markdown={guideMarkdown} />
- )}
+ <div className="flex flex-col gap-3">
+ <div className="flex items-center justify-between gap-2">
+ <div className="flex items-center gap-2">
+ <ChatTask className="size-5 shrink-0 text-neutral-800" />
+ <h4 className="text-sm font-semibold leading-5 tracking-[-0.02em] text-neutral-800">
+ Main prompt
+ </h4>
+ </div>
+ <OpenInApps prompt={prompt} />
</div>
- <div className="rounded-t-xl border-t border-neutral-200 bg-white p-4">
- {loading ? (
- <div className="space-y-3">
- <div className="h-4 w-1/2 animate-pulse rounded bg-neutral-200" />
- <div className="h-4 w-full animate-pulse rounded bg-neutral-100" />
- <div className="h-4 w-5/6 animate-pulse rounded bg-neutral-100" />
- </div>
- ) : expanded && guideMarkdown ? (
- <GuidesMarkdown>{guideMarkdown}</GuidesMarkdown>
- ) : snippet ? (
- <pre
- className={cn(
- "overflow-x-auto font-mono text-[13px] leading-6 text-neutral-800",
- )}
- >
- <code>{snippet.code}</code>
- </pre>
- ) : (
- <p className="text-content-subtle text-sm">
- Failed to load install instructions.
- </p>
- )}
-
- {guideMarkdown && (
+ <div className="relative overflow-hidden rounded-xl border border-neutral-200 bg-white">
+ <CopyButton
+ value={prompt}
+ className="absolute right-3 top-3 z-10 flex size-6 items-center justify-center rounded-lg border border-neutral-200 p-0 hover:bg-neutral-50 [&_svg]:size-3.5"
+ successMessage="Prompt copied to clipboard"
+ />
+
+ <div className="p-4 pb-0">
+ {expanded && loading ? (
+ <div className="space-y-3 pr-8">
+ <div className="h-4 w-1/2 animate-pulse rounded bg-neutral-200" />
+ <div className="h-4 w-full animate-pulse rounded bg-neutral-100" />
+ <div className="h-4 w-5/6 animate-pulse rounded bg-neutral-100" />
+ </div>
+ ) : expanded && guideMarkdown ? (
+ <div className="pr-8">
+ <GuidesMarkdown>{guideMarkdown}</GuidesMarkdown>
+ </div>
+ ) : (
+ <p className="pr-8 font-mono text-[13px] leading-6 text-neutral-800">
+ {prompt}
+ </p>
+ )}
+ </div>
+
+ <div
+ className={cn(
+ "pointer-events-none relative flex justify-center px-4 pb-4",
+ expanded ? "pt-4" : "pt-5",
+ )}
+ style={
+ expanded
+ ? undefined
+ : {
+ background:
+ "linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #FFFFFF 100%)",
+ }
+ }
+ >
<Button
text={expanded ? "Show less" : "View all"}
variant="secondary"
- className="mt-4 h-8 w-fit px-2.5"
+ className="pointer-events-auto h-8 w-fit px-2.5"
+ disabled={!expanded && loading && !guideMarkdown}
onClick={() => setExpanded((current) => !current)}
/>
- )}
+ </div>
</div>
</div>
);
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/site-visit-tracking-field.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/site-visit-tracking-field.tsx
index 4a8492e927..4d210cb47d 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/site-visit-tracking-field.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/site-visit-tracking-field.tsx
@@ -3,13 +3,22 @@
import { MAX_TRACKED_SITEMAPS_PER_WORKSPACE } from "@/lib/zod/schemas/site-visit-tracking";
import { DomainSelector } from "@/ui/domains/domain-selector";
import { ThreeDots } from "@/ui/shared/icons";
-import { Button, InfoTooltip, LoadingSpinner, Popover, Sitemap } from "@dub/ui";
+import {
+ AnimatedSizeContainer,
+ Button,
+ InfoTooltip,
+ LoadingSpinner,
+ Popover,
+ Sitemap,
+} from "@dub/ui";
import { Trash } from "@dub/ui/icons";
import { cn, formatDate } from "@dub/utils";
import { RefreshCw } from "lucide-react";
+import { useReducedMotion } from "motion/react";
import { useState } from "react";
import { toast } from "sonner";
import { useAddSitemapModal } from "./add-sitemap-modal";
+import { EmptyTrackingCard } from "./empty-tracking-card";
import { EnableSwitch } from "./enable-switch";
import { TrackedSitemapDraft } from "./tracking-form";
@@ -38,6 +47,8 @@ export function SiteVisitTrackingField({
disabled?: boolean;
disabledTooltip?: string;
}) {
+ const shouldReduceMotion = useReducedMotion();
+ const [shouldAnimateHeight, setShouldAnimateHeight] = useState(false);
const [refreshingSitemapUrl, setRefreshingSitemapUrl] = useState<
string | null
>(null);
@@ -123,95 +134,129 @@ export function SiteVisitTrackingField({
return (
<>
- <div className="flex flex-col gap-4">
+ <div className="flex flex-col">
<EnableSwitch
checked={enabled}
- onChange={onEnabledChange}
+ onChange={(next) => {
+ setShouldAnimateHeight(true);
+ onEnabledChange(next);
+ }}
disabled={disabled}
disabledTooltip={disabledTooltip}
/>
- {enabled && (
- <div className="flex flex-col gap-4">
- <div className="flex flex-col gap-2">
- <label className="text-content-emphasis text-sm font-semibold">
- Domain for sitemap imports
- </label>
- <DomainSelector
- selectedDomain={siteDomainSlug}
- setSelectedDomain={onSiteDomainSlugChange}
- disabled={disabled}
- disabledTooltip={disabledTooltip}
- />
- <p className="text-content-subtle text-xs font-medium">
- This domain will be used for links we create when importing
- pages from the sitemaps you add.
- </p>
- </div>
+ <AnimatedSizeContainer
+ height
+ transition={
+ shouldReduceMotion || !shouldAnimateHeight
+ ? { duration: 0 }
+ : { duration: 0.18, ease: [0.23, 1, 0.32, 1] }
+ }
+ >
+ {enabled && (
+ <div className="flex flex-col gap-4 pt-4">
+ <div className="flex flex-col gap-2">
+ <label className="text-content-emphasis text-sm font-semibold">
+ Domain for sitemap imports
+ </label>
+ <DomainSelector
+ selectedDomain={siteDomainSlug}
+ setSelectedDomain={onSiteDomainSlugChange}
+ disabled={disabled}
+ disabledTooltip={disabledTooltip}
+ />
+ <p className="text-content-subtle text-xs font-medium">
+ This domain will be used for links we create when importing
+ pages from the sitemaps you add.
+ </p>
+ </div>
- <div className="flex flex-col gap-2">
- <h4 className="text-content-emphasis flex items-center gap-1 text-sm font-semibold">
- Sitemaps
- <InfoTooltip content="Add sitemap URLs we should crawl to create links for site visit tracking." />
- </h4>
+ <div className="flex flex-col gap-2">
+ <h4 className="text-content-emphasis flex items-center gap-1 text-sm font-semibold">
+ Sitemaps
+ <InfoTooltip content="Add sitemap URLs we should crawl to create links for site visit tracking." />
+ </h4>
- {sitemaps.length > 0 && (
- <div className="flex flex-col gap-2">
- {sitemaps.map((sitemap) => (
- <div
- key={sitemap.url}
- className="flex items-center justify-between gap-4 rounded-xl border border-neutral-200 bg-white p-3"
- >
- <div className="flex min-w-0 items-center gap-2">
- <div className="flex size-7 items-center justify-center rounded-md bg-neutral-100">
- <Sitemap className="size-4 text-neutral-800" />
- </div>
- <div className="flex min-w-0 flex-col">
- <span className="text-content-emphasis min-w-0 truncate text-sm font-semibold">
- {sitemap.url.replace(/^https?:\/\//, "")}
- </span>
- <span className="text-content-subtle text-xs font-medium">
- {sitemap.lastCrawledAt
- ? `Last crawled ${formatDate(sitemap.lastCrawledAt, { month: "short" })}`
- : "Not crawled yet"}
- {typeof sitemap.lastUrlCount === "number"
- ? ` • ${sitemap.lastUrlCount} URLs found`
- : ""}
- </span>
- </div>
- </div>
- {!disabled && (
- <SitemapRowMenu
- canRefresh={persistedSitemapUrls.includes(
- sitemap.url,
+ {sitemaps.length === 0 ? (
+ <EmptyTrackingCard
+ variant="stack"
+ icon={
+ <Sitemap className="size-[18px] text-neutral-500" />
+ }
+ text="No site maps added"
+ action={
+ <Button
+ text="Add sitemap"
+ variant="secondary"
+ className="h-8 w-fit px-2.5 active:scale-[0.97]"
+ onClick={() => setShowAddSitemapModal(true)}
+ disabled={
+ disabled || Boolean(addSitemapDisabledReason)
+ }
+ disabledTooltip={addSitemapDisabledReason}
+ />
+ }
+ />
+ ) : (
+ <>
+ <div className="flex flex-col gap-2">
+ {sitemaps.map((sitemap) => (
+ <div
+ key={sitemap.url}
+ className="flex items-center justify-between gap-4 rounded-xl border border-neutral-200 bg-white p-3"
+ >
+ <div className="flex min-w-0 items-center gap-2">
+ <div className="flex size-7 items-center justify-center rounded-md bg-neutral-100">
+ <Sitemap className="size-4 text-neutral-800" />
+ </div>
+ <div className="flex min-w-0 flex-col">
+ <span className="text-content-emphasis min-w-0 truncate text-sm font-semibold">
+ {sitemap.url.replace(/^https?:\/\//, "")}
+ </span>
+ <span className="text-content-subtle text-xs font-medium">
+ {sitemap.lastCrawledAt
+ ? `Last crawled ${formatDate(sitemap.lastCrawledAt, { month: "short" })}`
+ : "Not crawled yet"}
+ {typeof sitemap.lastUrlCount === "number"
+ ? ` • ${sitemap.lastUrlCount} URLs found`
+ : ""}
+ </span>
+ </div>
+ </div>
+ {!disabled && (
+ <SitemapRowMenu
+ canRefresh={persistedSitemapUrls.includes(
+ sitemap.url,
+ )}
+ onRefresh={() => refreshSitemap(sitemap.url)}
+ onDelete={() =>
+ onSitemapsChange(
+ sitemaps.filter(
+ (item) => item.url !== sitemap.url,
+ ),
+ )
+ }
+ loading={refreshingSitemapUrl === sitemap.url}
+ />
)}
- onRefresh={() => refreshSitemap(sitemap.url)}
- onDelete={() =>
- onSitemapsChange(
- sitemaps.filter(
- (item) => item.url !== sitemap.url,
- ),
- )
- }
- loading={refreshingSitemapUrl === sitemap.url}
- />
- )}
+ </div>
+ ))}
</div>
- ))}
- </div>
- )}
- <Button
- text="Add sitemap"
- variant="secondary"
- className="h-8 w-fit px-2.5"
- onClick={() => setShowAddSitemapModal(true)}
- disabled={disabled || Boolean(addSitemapDisabledReason)}
- disabledTooltip={addSitemapDisabledReason}
- />
+ <Button
+ text="Add sitemap"
+ variant="secondary"
+ className="h-8 w-fit px-2.5 active:scale-[0.97]"
+ onClick={() => setShowAddSitemapModal(true)}
+ disabled={disabled || Boolean(addSitemapDisabledReason)}
+ disabledTooltip={addSitemapDisabledReason}
+ />
+ </>
+ )}
+ </div>
</div>
- </div>
- )}
+ )}
+ </AnimatedSizeContainer>
</div>
<AddSitemapModal />
</>
@@ -273,14 +318,14 @@ function SitemapRowMenu({
<Button
variant="outline"
className={cn(
- "h-8 w-fit px-1.5 outline-none transition-all duration-200",
+ "size-7 shrink-0 p-0 outline-none transition-all duration-200",
"border-transparent data-[state=open]:border-neutral-500",
)}
icon={
loading ? (
- <LoadingSpinner className="size-4 shrink-0" />
+ <LoadingSpinner className="size-3 shrink-0" />
) : (
- <ThreeDots className="size-5 shrink-0 rotate-90" />
+ <ThreeDots className="size-4 shrink-0 rotate-90" />
)
}
onClick={() => setOpenPopover(!openPopover)}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/verify-install.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/verify-install.tsx
index 73c24a3470..e59d261f1c 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/verify-install.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/tracking/verify-install.tsx
@@ -1,24 +1,52 @@
"use client";
import { verifyWorkspaceSetup } from "@/lib/actions/verify-workspace-setup";
+import {
+ getVerifyErrorHeadline,
+ toVerifySiteUrl,
+ VERIFY_DOCS_HREF,
+ VERIFY_SUPPORT_HREF,
+ type VerifyInstallationResult,
+} from "@/lib/analytics/verify-installation";
import useWorkspace from "@/lib/swr/use-workspace";
+import { UserAvatar } from "@/ui/users/user-avatar";
import { Button, Combobox, Globe } from "@dub/ui";
+import { cn, OG_AVATAR_URL, timeAgo } from "@dub/utils";
import { useAction } from "next-safe-action/hooks";
-import { useMemo, useState } from "react";
+import { type ReactNode, useMemo, useState } from "react";
import { toast } from "sonner";
const HOSTNAME_REQUIRED_MESSAGE =
"A hostname is required in order to verify installation.";
+type LastVerified = {
+ hostname: string;
+ verifiedAt: string;
+ user: {
+ id: string;
+ name: string | null;
+ image: string | null;
+ };
+};
+
+type HelperTone = "success" | "error" | "neutral";
+
export function VerifyInstall({ hostnames }: { hostnames: string[] }) {
- const { id: workspaceId } = useWorkspace();
+ const { id: workspaceId, store, mutate } = useWorkspace();
const [selectedHostname, setSelectedHostname] = useState<string | null>(null);
+ const [result, setResult] = useState<VerifyInstallationResult | null>(null);
+
+ const lastVerified = store?.analyticsSettingsInstallationVerified as
+ | LastVerified
+ | undefined;
const hostnameOptions = useMemo(
() =>
hostnames.map((hostname) => ({
value: hostname,
- label: hostname,
+ label: hostname.startsWith("*.")
+ ? hostname
+ : toVerifySiteUrl(hostname),
icon: <Globe className="size-4 text-neutral-600" />,
})),
[hostnames],
@@ -27,49 +55,172 @@ export function VerifyInstall({ hostnames }: { hostnames: string[] }) {
const selectedOption =
hostnameOptions.find((option) => option.value === selectedHostname) ?? null;
+ const persistedForHostname =
+ selectedHostname && lastVerified?.hostname === selectedHostname
+ ? lastVerified
+ : null;
+
+ const showSuccess = result?.status === "success";
+ const showError = result?.status === "error";
+ const showLastVerified = !result && Boolean(persistedForHostname);
+ const showButton = !showSuccess && !showLastVerified;
+
+ const helperTone: HelperTone | null = showSuccess
+ ? "success"
+ : showError
+ ? "error"
+ : showLastVerified
+ ? "neutral"
+ : null;
+
const { executeAsync, isPending } = useAction(verifyWorkspaceSetup, {
- onSuccess() {
- toast.success("Installation verified.");
+ onSuccess({ data }) {
+ if (!data) {
+ return;
+ }
+
+ setResult(data);
+
+ if (data.status === "success") {
+ void mutate();
+ }
},
onError({ error }) {
+ setResult({
+ status: "error",
+ hostname: selectedHostname ?? "",
+ error: "unreachable",
+ });
toast.error(error.serverError || "Failed to verify installation.");
},
});
return (
<div className="flex w-full flex-col gap-3">
- <Combobox
- options={hostnameOptions}
- selected={selectedOption}
- setSelected={(option) => setSelectedHostname(option?.value ?? null)}
- placeholder="Select hostname"
- searchPlaceholder="Search hostnames..."
- buttonProps={{
- className: "w-full",
- disabled: hostnames.length === 0,
- disabledTooltip:
- hostnames.length === 0 ? HOSTNAME_REQUIRED_MESSAGE : undefined,
- }}
- matchTriggerWidth
- />
- <Button
- text="Verify installation"
- className="h-9 w-full"
- loading={isPending}
- disabled={!workspaceId}
- onClick={() => {
- if (!workspaceId) {
- return;
- }
-
- if (!selectedHostname) {
- toast.error(HOSTNAME_REQUIRED_MESSAGE);
- return;
- }
-
- void executeAsync({ workspaceId });
- }}
- />
+ <div
+ className={cn(
+ "flex w-full flex-col",
+ helperTone && "gap-1.5 rounded-[10px] px-0.5 pb-1.5 pt-0.5",
+ helperTone === "success" && "bg-[#DCFCE7]",
+ helperTone === "error" && "bg-[#FFE2E2]",
+ helperTone === "neutral" && "bg-neutral-100",
+ )}
+ >
+ <Combobox
+ caret
+ options={hostnameOptions}
+ selected={selectedOption}
+ setSelected={(option) => {
+ setSelectedHostname(option?.value ?? null);
+ setResult(null);
+ }}
+ placeholder="Select hostname"
+ searchPlaceholder="Search hostnames..."
+ buttonProps={{
+ className: cn("h-10 w-full", helperTone && "bg-bg-default"),
+ disabled: hostnames.length === 0,
+ disabledTooltip:
+ hostnames.length === 0 ? HOSTNAME_REQUIRED_MESSAGE : undefined,
+ }}
+ matchTriggerWidth
+ />
+
+ {showSuccess && (
+ <HelperText tone="success">
+ Successfully connected and ready to use.
+ </HelperText>
+ )}
+
+ {showError && result.status === "error" && (
+ <HelperText tone="error">
+ {getVerifyErrorHeadline(result.error)} After correcting, try
+ verifying again and if the issue still persists, check out our{" "}
+ <a
+ href={VERIFY_DOCS_HREF}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline underline-offset-2"
+ >
+ docs
+ </a>{" "}
+ or{" "}
+ <a
+ href={VERIFY_SUPPORT_HREF}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline underline-offset-2"
+ >
+ contact support
+ </a>
+ .
+ </HelperText>
+ )}
+
+ {showLastVerified && persistedForHostname && (
+ <HelperText tone="neutral" inline>
+ Last verified by
+ <UserAvatar
+ user={{
+ id: persistedForHostname.user.id,
+ name: persistedForHostname.user.name,
+ image:
+ persistedForHostname.user.image ??
+ `${OG_AVATAR_URL}${persistedForHostname.user.id}`,
+ }}
+ className="size-4 border-neutral-200"
+ />
+ <span className="font-medium">{persistedForHostname.user.name}</span>
+ {timeAgo(new Date(persistedForHostname.verifiedAt), {
+ withAgo: true,
+ })}
+ </HelperText>
+ )}
+ </div>
+
+ {showButton && (
+ <Button
+ text="Verify installation"
+ className="h-7 w-fit bg-bg-inverted px-2.5 text-sm font-medium tracking-[-0.02em] active:scale-[0.97]"
+ loading={isPending}
+ disabled={!workspaceId}
+ onClick={() => {
+ if (!workspaceId) {
+ return;
+ }
+
+ if (!selectedHostname) {
+ toast.error(HOSTNAME_REQUIRED_MESSAGE);
+ return;
+ }
+
+ void executeAsync({ workspaceId, hostname: selectedHostname });
+ }}
+ />
+ )}
</div>
);
}
+
+function HelperText({
+ tone,
+ inline = false,
+ children,
+}: {
+ tone: HelperTone;
+ inline?: boolean;
+ children: ReactNode;
+}) {
+ return (
+ <p
+ className={cn(
+ "min-h-5 px-3 text-sm leading-5",
+ inline && "flex flex-wrap items-center gap-2",
+ tone === "success" && "text-[#0D542B]",
+ tone === "error" && "text-[#82181A]",
+ tone === "neutral" && "text-content-subtle",
+ )}
+ >
+ {children}
+ </p>
+ );
+}
diff --git a/apps/web/lib/actions/verify-workspace-setup.ts b/apps/web/lib/actions/verify-workspace-setup.ts
index ff2e5523b5..d898b751df 100644
--- a/apps/web/lib/actions/verify-workspace-setup.ts
+++ b/apps/web/lib/actions/verify-workspace-setup.ts
@@ -1,68 +1,51 @@
"use server";
+import {
+ analyzeDubAnalyticsScript,
+ toVerifySiteUrl,
+ type VerifyInstallationResult,
+} from "@/lib/analytics/verify-installation";
import { prisma } from "@/lib/prisma";
import FirecrawlApp from "@mendable/firecrawl-js";
import * as z from "zod/v4";
import { authActionClient } from "./safe-action";
import { throwIfNoPermission } from "./throw-if-no-permission";
-const getExpectedScriptForWorkspace = (store: Record<string, any>) => {
- const {
- analyticsSettingsConversionTrackingEnabled: conversionTrackingEnabled,
- analyticsSettingsSiteVisitTrackingEnabled: siteVisitEnabled,
- analyticsSettingsOutboundDomainTrackingEnabled: outboundDomainsEnabled,
- } = store;
-
- const components = [
- "script",
- siteVisitEnabled ? "site-visit" : null,
- outboundDomainsEnabled ? "outbound-domains" : null,
- conversionTrackingEnabled ? "conversion-tracking" : null,
- ].filter(Boolean);
-
- return `${components.join(".")}.js`;
-};
-
const schema = z.object({
workspaceId: z.string(),
+ hostname: z.string().min(1),
});
-// Attempt to verify the workspace setup
export const verifyWorkspaceSetup = authActionClient
.inputSchema(schema)
- .action(async ({ ctx }) => {
- const { workspace } = ctx;
+ .action(async ({ ctx, parsedInput }): Promise<VerifyInstallationResult> => {
+ const { workspace, user } = ctx;
+ const { hostname } = parsedInput;
throwIfNoPermission({
role: workspace.role,
requiredPermissions: ["workspaces.read"],
});
- const domains = await prisma.domain.findMany({
- where: { projectId: workspace.id },
- select: { slug: true },
- });
-
- const domain = domains[0];
+ const hostnames = (workspace.allowedHostnames as string[]) || [];
- if (!domain) {
- throw new Error(`Please setup a domain`);
+ if (!hostnames.includes(hostname)) {
+ throw new Error("Select a hostname from your allowlist.");
}
- // const siteUrl = domain.slug;
- const siteUrl = "https://dub.co/home";
-
- const hostnames = (workspace.allowedHostnames as string[]) || [];
-
- if (!hostnames.length) {
- throw new Error(`Add a hostname for your domain`);
+ if (hostname.startsWith("*.")) {
+ return {
+ status: "error",
+ hostname,
+ error: "unreachable",
+ };
}
const firecrawl = new FirecrawlApp({
apiKey: process.env.FIRECRAWL_API_KEY,
});
- const scrapeResult = await firecrawl.scrapeUrl(siteUrl, {
+ const scrapeResult = await firecrawl.scrapeUrl(toVerifySiteUrl(hostname), {
formats: ["rawHtml"],
onlyMainContent: false,
parsePDF: false,
@@ -71,23 +54,51 @@ export const verifyWorkspaceSetup = authActionClient
waitFor: 5000,
});
- if (!scrapeResult.success) {
- throw new Error("Failed to verify site");
+ if (!scrapeResult.success || !scrapeResult.rawHtml) {
+ return {
+ status: "error",
+ hostname,
+ error: "unreachable",
+ };
+ }
+
+ const analysis = analyzeDubAnalyticsScript(scrapeResult.rawHtml);
+
+ if (analysis !== "ok") {
+ return {
+ status: "error",
+ hostname,
+ error: analysis,
+ };
}
- //console.log("RAW HTML: ", scrapeResult.rawHtml);
+ const verifiedAt = new Date().toISOString();
+ const verifiedUser = {
+ id: user.id,
+ name: user.name ?? user.email ?? "Unknown",
+ image: user.image ?? null,
+ };
- console.log(`result: `, {
- hasDataAttribute: scrapeResult.rawHtml?.includes(
- `data-sdkn="@dub/analytics"`,
- ),
- hasExpectedScript: scrapeResult.rawHtml?.includes(
- getExpectedScriptForWorkspace(workspace.store as Record<string, any>),
- ),
+ const store = (workspace.store as Record<string, unknown> | null) ?? {};
+
+ await prisma.project.update({
+ where: { id: workspace.id },
+ data: {
+ store: {
+ ...store,
+ analyticsSettingsInstallationVerified: {
+ hostname,
+ verifiedAt,
+ user: verifiedUser,
+ },
+ },
+ },
});
return {
- verifiedAt: new Date().toISOString(),
- // analyticsScriptSrc: scriptTag,
+ status: "success",
+ hostname,
+ verifiedAt,
+ user: verifiedUser,
};
});
diff --git a/apps/web/lib/analytics/verify-installation.ts b/apps/web/lib/analytics/verify-installation.ts
new file mode 100644
index 0000000000..2d6020be31
--- /dev/null
+++ b/apps/web/lib/analytics/verify-installation.ts
@@ -0,0 +1,89 @@
+export const VERIFY_ERROR_CODES = [
+ "not_installed",
+ "missing_attributes",
+ "duplicate",
+ "malformed",
+] as const;
+
+export type VerifyErrorCode = (typeof VERIFY_ERROR_CODES)[number];
+
+export type VerifyInstallationResult =
+ | {
+ status: "success";
+ hostname: string;
+ verifiedAt: string;
+ user: {
+ id: string;
+ name: string | null;
+ image: string | null;
+ };
+ }
+ | {
+ status: "error";
+ hostname: string;
+ error: VerifyErrorCode | "unreachable";
+ };
+
+const ERROR_HEADLINE: Record<VerifyErrorCode | "unreachable", string> = {
+ not_installed: "Script is not installed.",
+ missing_attributes: "Script missing attributes.",
+ duplicate: "Duplicate script.",
+ malformed: "Malformed script.",
+ unreachable: "We couldn’t reach this hostname.",
+};
+
+export const VERIFY_DOCS_HREF = "https://dub.co/docs/sdks/client-side";
+export const VERIFY_SUPPORT_HREF = "https://dub.co/support";
+
+export function getVerifyErrorHeadline(
+ error: VerifyErrorCode | "unreachable",
+) {
+ return ERROR_HEADLINE[error];
+}
+
+const SCRIPT_TAG_RE = /<script\b[^>]*>/gi;
+const DUB_SCRIPT_RE =
+ /dubcdn\.com\/analytics|data-sdkn=["']@dub\/analytics["']|@dub\/analytics/i;
+const DUB_SRC_RE = /src=["'][^"']*dubcdn\.com\/analytics[^"']*["']/i;
+const SDK_NAME_RE = /data-sdkn=["']@dub\/analytics["']/i;
+
+export function analyzeDubAnalyticsScript(
+ html: string,
+): "ok" | VerifyErrorCode {
+ const scriptTags = html.match(SCRIPT_TAG_RE) ?? [];
+ const dubScripts = scriptTags.filter((tag) => DUB_SCRIPT_RE.test(tag));
+
+ if (dubScripts.length === 0) {
+ if (DUB_SCRIPT_RE.test(html)) {
+ return "malformed";
+ }
+
+ return "not_installed";
+ }
+
+ if (dubScripts.length > 1) {
+ return "duplicate";
+ }
+
+ const tag = dubScripts[0];
+ const hasSrc = DUB_SRC_RE.test(tag);
+ const hasSdkName = SDK_NAME_RE.test(tag);
+
+ if (!hasSrc && !hasSdkName) {
+ return "malformed";
+ }
+
+ if (!hasSdkName) {
+ return "missing_attributes";
+ }
+
+ return "ok";
+}
+
+export function toVerifySiteUrl(hostname: string) {
+ if (hostname.startsWith("http://") || hostname.startsWith("https://")) {
+ return hostname;
+ }
+
+ return `https://${hostname}`;
+}
diff --git a/apps/web/lib/zod/schemas/workspaces.ts b/apps/web/lib/zod/schemas/workspaces.ts
index 8d06af158f..5827e3f142 100644
--- a/apps/web/lib/zod/schemas/workspaces.ts
+++ b/apps/web/lib/zod/schemas/workspaces.ts
@@ -247,6 +247,7 @@ export const workspaceStoreKeys = z.enum([
"analyticsSettingsConnectionSetupComplete", // boolean
"analyticsSettingsLeadTrackingSetupComplete", // boolean
"analyticsSettingsSaleTrackingSetupComplete", // boolean
+ "analyticsSettingsInstallationVerified", // { hostname, verifiedAt, user }
]);
export const getWorkspaceUsersQuerySchema = z.object({
diff --git a/packages/ui/src/icons/chatgpt-icon.tsx b/packages/ui/src/icons/chatgpt-icon.tsx
new file mode 100644
index 0000000000..056700a4de
--- /dev/null
+++ b/packages/ui/src/icons/chatgpt-icon.tsx
@@ -0,0 +1,20 @@
+import { SVGProps } from "react";
+
+export function ChatGPTIcon({ className, ...props }: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ className={className}
+ width="14"
+ height="14"
+ viewBox="0 0 14 14"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <path
+ d="M5.36963 5.09598V3.76597C5.36963 3.65396 5.4113 3.56992 5.50837 3.51399L8.15859 1.97399C8.51933 1.764 8.94948 1.66605 9.39341 1.66605C11.0584 1.66605 12.113 2.96808 12.113 4.35402C12.113 4.452 12.113 4.56401 12.0991 4.67602L9.35177 3.05199C9.1853 2.95404 9.01873 2.95404 8.85225 3.05199L5.36963 5.09598ZM11.5579 10.276V7.09795C11.5579 6.9019 11.4746 6.76191 11.3081 6.66393L7.82552 4.61994L8.96327 3.9619C9.06037 3.90596 9.14365 3.90596 9.24076 3.9619L11.8909 5.5019C12.6541 5.94995 13.1674 6.9019 13.1674 7.82585C13.1674 8.88981 12.5431 9.86986 11.5579 10.2759V10.276ZM4.55101 7.47604L3.41326 6.80407C3.31618 6.74814 3.27451 6.66408 3.27451 6.55206V3.47209C3.27451 1.97414 4.41226 0.840056 5.95243 0.840056C6.53526 0.840056 7.07627 1.0361 7.53426 1.38609L4.80088 2.98214C4.63443 3.08009 4.55115 3.22008 4.55115 3.41616V7.47615L4.55101 7.47604ZM6.99999 8.90399L5.36963 7.98002V6.02009L6.99999 5.09612L8.63023 6.02009V7.98002L6.99999 8.90399ZM8.04754 13.1601C7.46474 13.1601 6.92373 12.964 6.46574 12.6141L9.19909 11.018C9.36557 10.92 9.44885 10.78 9.44885 10.584V6.52397L10.6005 7.19593C10.6976 7.25186 10.7393 7.33589 10.7393 7.44794V10.5279C10.7393 12.0259 9.58759 13.1599 8.04754 13.1599V13.1601ZM4.75913 10.0381L2.10891 8.4981C1.34572 8.05002 0.832414 7.0981 0.832414 6.17412C0.832414 5.09612 1.47068 4.13014 2.45575 3.7241V6.91608C2.45575 7.11213 2.53906 7.25212 2.7055 7.3501L6.17434 9.38003L5.03659 10.0381C4.93951 10.094 4.8562 10.094 4.75913 10.0381ZM4.60659 12.3341C3.03869 12.3341 1.88703 11.1441 1.88703 9.67405C1.88703 9.56204 1.90094 9.45003 1.91473 9.33801L4.64811 10.9341C4.81456 11.032 4.98115 11.032 5.1476 10.9341L8.63023 8.90414V10.2341C8.63023 10.3462 8.58859 10.4302 8.49148 10.4861L5.8413 12.0261C5.48053 12.2361 5.05038 12.3341 4.60644 12.3341H4.60659ZM8.04754 14C9.72645 14 11.1278 12.796 11.447 11.2C13.001 10.794 14 9.32395 14 7.82599C14 6.84594 13.5838 5.89402 12.8345 5.20799C12.9039 4.91397 12.9455 4.61994 12.9455 4.32607C12.9455 2.32409 11.336 0.825992 9.4767 0.825992C9.10216 0.825992 8.74139 0.881926 8.38061 1.008C7.75614 0.391974 6.89588 0 5.95243 0C4.27355 0 2.87224 1.20393 2.55299 2.79998C0.999007 3.20602 0 4.67602 0 6.17398C0 7.15403 0.416207 8.10595 1.16548 8.79198C1.09611 9.086 1.05447 9.38003 1.05447 9.67393C1.05447 11.6759 2.66401 13.174 4.52328 13.174C4.89784 13.174 5.25861 13.118 5.61939 12.992C6.24371 13.608 7.10397 14 8.04754 14Z"
+ fill="currentColor"
+ />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/claude.tsx b/packages/ui/src/icons/claude.tsx
new file mode 100644
index 0000000000..d95d66a1e1
--- /dev/null
+++ b/packages/ui/src/icons/claude.tsx
@@ -0,0 +1,20 @@
+import { SVGProps } from "react";
+
+export function Claude({ className, ...props }: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ className={className}
+ width="14"
+ height="14"
+ viewBox="0 0 14 14"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <path
+ d="M2.74703 9.30994L5.50162 7.7653L5.54703 7.63L5.50162 7.55468H5.36541L4.90379 7.52657L3.32973 7.48446L1.96757 7.42829L0.643244 7.35806L0.31027 7.28784L0 6.87361L0.0302703 6.66999L0.31027 6.48043L0.711351 6.51554L1.59676 6.57871L2.92865 6.66999L3.88973 6.72616L5.32 6.87361H5.54703L5.5773 6.78233L5.50162 6.72616L5.44108 6.66999L4.06379 5.73619L2.57297 4.75326L1.79351 4.18456L1.3773 3.89669L1.1654 3.62989L1.0746 3.04012L1.45297 2.61886L1.96757 2.65396L2.09621 2.68907L2.61838 3.08927L3.73081 3.95286L5.18379 5.02006L5.39568 5.19558L5.481 5.138L5.49405 5.09729L5.39568 4.93581L4.60865 3.51053L3.76865 2.05717L3.39027 1.45336L3.29189 1.09529C3.25378 0.945017 3.23135 0.820697 3.23135 0.666999L3.6627 0.0772318L3.90486 0L4.48757 0.0772318L4.72973 0.287864L5.09297 1.11635L5.67566 2.41525L6.58381 4.18456L6.84863 4.71113L6.99244 5.19558L7.04542 5.34303H7.13619V5.25878L7.2119 4.26179L7.3481 3.04012L7.48434 1.4674L7.5297 1.02507L7.74917 0.491475L8.1881 0.203611L8.52863 0.365095L8.80863 0.765296L8.77083 1.02507L8.60434 2.10632L8.27893 3.7984L8.06702 4.93581H8.1881L8.3319 4.78836L8.90702 4.03009L9.8681 2.82247L10.2919 2.34503L10.7914 1.81845L11.1092 1.5657H11.7146L12.1535 2.22568L11.9568 2.90672L11.3362 3.69308L10.8216 4.36008L10.0838 5.34862L9.62595 6.14342L9.667 6.209L9.77732 6.19959L11.4421 5.84153L12.3427 5.68002L13.4173 5.49749L13.9016 5.72219L13.9546 5.95386L13.7654 6.42426L12.6151 6.7051L11.2681 6.97894L9.26223 7.45114L9.24 7.469L9.26621 7.50786L10.1708 7.58979L10.5568 7.61085H11.5027L13.266 7.74424L13.7276 8.04614L14 8.41826L13.9546 8.7061L13.2432 9.06422L12.2897 8.83954L10.0573 8.30592L9.29298 8.11636H9.18702V8.17953L9.82268 8.80443L10.9957 9.85757L12.4562 11.2197L12.5319 11.5567L12.3427 11.8234L12.146 11.7954L10.8595 10.8265L10.36 10.3912L9.24 9.44334H9.16434V9.54162L9.42161 9.92074L10.7914 11.978L10.8595 12.6099L10.7611 12.8134L10.4054 12.9398L10.0195 12.8696L9.2097 11.7392L8.38488 10.4754L7.71893 9.338L7.63851 9.38879L7.24214 13.6209L7.06054 13.8385L6.63678 14L6.28107 13.7332L6.0919 13.2979L6.28107 12.4343L6.5081 11.3109L6.6897 10.4192L6.85619 9.30994L6.95789 8.93934L6.94893 8.91453L6.86767 8.92819L6.03137 10.0752L4.76 11.7954L3.75351 12.8696L3.51135 12.9679L3.09514 12.7502L3.13297 12.3641L3.36757 12.0201L4.76 10.2507L5.6 9.14844L6.14141 8.5157L6.13609 8.42419L6.10624 8.42162L2.40649 10.8335L1.74811 10.9178L1.46054 10.651L1.49838 10.2156L1.6346 10.0752L2.74703 9.30994Z"
+ fill="#D97757"
+ />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/cursor.tsx b/packages/ui/src/icons/cursor.tsx
new file mode 100644
index 0000000000..244e4f7ff4
--- /dev/null
+++ b/packages/ui/src/icons/cursor.tsx
@@ -0,0 +1,36 @@
+import { SVGProps } from "react";
+
+export function Cursor({ className, ...props }: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ className={className}
+ width="14"
+ height="14"
+ viewBox="515 5 14 14"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <path
+ d="M522 12L528.102 15.5034C528.065 15.568 528.01 15.6231 527.943 15.6617L522.24 18.9362C522.092 19.0213 521.909 19.0213 521.761 18.9362L516.058 15.6617C515.99 15.6231 515.936 15.568 515.898 15.5034L522 12Z"
+ fill="#72716D"
+ />
+ <path
+ d="M522 5V12L515.899 15.5034C515.861 15.4388 515.84 15.3643 515.84 15.2871V8.71289C515.84 8.55828 515.923 8.41574 516.058 8.3383L521.761 5.06379C521.835 5.02126 521.918 5 522 5H522Z"
+ fill="#55544F"
+ />
+ <path
+ d="M528.102 8.49659C528.065 8.43201 528.01 8.37688 527.943 8.3383L522.24 5.06379C522.166 5.02126 522.083 5 522 5V12L528.102 15.5034C528.14 15.4388 528.161 15.3643 528.161 15.2871V8.71289C528.161 8.63545 528.14 8.56143 528.102 8.49659H528.102Z"
+ fill="#43413C"
+ />
+ <path
+ d="M527.675 8.74172C527.709 8.80104 527.714 8.87717 527.675 8.9449L522.136 18.4849C522.099 18.5495 522 18.523 522 18.4487V12.1622C522 12.112 521.986 12.0637 521.962 12.0215L527.675 8.74146H527.675V8.74172Z"
+ fill="#D6D5D2"
+ />
+ <path
+ d="M527.675 8.74173L521.962 12.0217C521.938 11.9797 521.903 11.944 521.859 11.9188L516.384 8.77559C516.319 8.73858 516.346 8.64014 516.421 8.64014H527.498C527.577 8.64014 527.641 8.6824 527.675 8.74173Z"
+ fill="white"
+ />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/grok.tsx b/packages/ui/src/icons/grok.tsx
new file mode 100644
index 0000000000..96a7c02d07
--- /dev/null
+++ b/packages/ui/src/icons/grok.tsx
@@ -0,0 +1,24 @@
+import { SVGProps } from "react";
+
+export function Grok({ className, ...props }: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ className={className}
+ width="14"
+ height="14"
+ viewBox="0 0 14 14"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <path
+ d="M5.44911 8.92664L10.1503 5.45205C10.3808 5.28172 10.7103 5.34815 10.8201 5.61275C11.3981 7.00813 11.1399 8.68503 9.98986 9.83638C8.83991 10.9877 7.23983 11.2402 5.77734 10.6651L4.17969 11.4057C6.47119 12.9739 9.2538 12.5861 10.9926 10.844C12.3719 9.46305 12.7991 7.58077 12.3996 5.88338L12.4032 5.88698C11.824 3.39341 12.5457 2.3967 14.0239 0.358586C14.0588 0.310261 14.0938 0.261936 14.1288 0.212402L12.1836 2.15991V2.15387L5.44792 8.92787"
+ fill="currentColor"
+ />
+ <path
+ d="M4.47813 9.77072C2.83339 8.19772 3.11697 5.76333 4.52034 4.35951C5.55808 3.32051 7.25832 2.89646 8.74253 3.51985L10.3366 2.78289C10.0494 2.57509 9.68133 2.35159 9.259 2.19453C7.35004 1.40804 5.06456 1.79947 3.51276 3.35192C2.02009 4.84637 1.55068 7.14424 2.35675 9.10504C2.95889 10.5705 1.97182 11.6071 0.977507 12.6533C0.625153 13.0242 0.271593 13.3951 -0.0131836 13.7877L4.4769 9.77191"
+ fill="currentColor"
+ />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/index.tsx b/packages/ui/src/icons/index.tsx
index bfeca84912..c11143997c 100644
--- a/packages/ui/src/icons/index.tsx
+++ b/packages/ui/src/icons/index.tsx
@@ -37,10 +37,14 @@ export * from "./loading-spinner";
export * from "./anthropic";
export * from "./beehiiv";
export * from "./bing";
+export * from "./chatgpt-icon";
+export * from "./claude";
export * from "./cloudflare";
+export * from "./cursor";
export * from "./facebook";
export * from "./github";
export * from "./google";
+export * from "./grok";
export * from "./instagram";
export * from "./linkedin";
export * from "./openai";
diff --git a/packages/ui/src/icons/nucleo/chat-task.tsx b/packages/ui/src/icons/nucleo/chat-task.tsx
new file mode 100644
index 0000000000..fa5c8a0704
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/chat-task.tsx
@@ -0,0 +1,43 @@
+import { SVGProps } from "react";
+
+export function ChatTask(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ height="18"
+ width="18"
+ viewBox="0 0 18 18"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <g fill="currentColor">
+ <line
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ x1="9.75"
+ x2="12.25"
+ y1="11.75"
+ y2="11.75"
+ />
+ <polyline
+ fill="none"
+ points="5.75 11.75 8.25 9.25 5.75 6.75"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ <path
+ d="m9,1.75C4.996,1.75,1.75,4.996,1.75,9c0,1.319.358,2.552.973,3.617.43.806-.053,2.712-.973,3.633,1.25.068,2.897-.497,3.633-.973.489.282,1.264.656,2.279.848.433.082.881.125,1.338.125,4.004,0,7.25-3.246,7.25-7.25S13.004,1.75,9,1.75Z"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ </g>
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/nucleo/circle-dashed.tsx b/packages/ui/src/icons/nucleo/circle-dashed.tsx
new file mode 100644
index 0000000000..190d0ebd3e
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/circle-dashed.tsx
@@ -0,0 +1,48 @@
+import { SVGProps } from "react";
+
+export function CircleDashed(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ height="18"
+ width="18"
+ viewBox="0 0 18 18"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <g fill="currentColor">
+ <path
+ d="M4.988,3.711c-.243,0-.48-.117-.625-.334-.229-.345-.137-.811,.208-1.04,.88-.586,1.851-.986,2.884-1.187,.406-.079,.801,.186,.88,.593,.079,.407-.187,.8-.593,.879-.838,.163-1.625,.487-2.339,.962-.128,.085-.272,.126-.415,.126Z"
+ fill="currentColor"
+ />
+ <path
+ d="M1.88,8.381c-.047,0-.095-.004-.143-.013-.406-.078-.673-.471-.595-.878,.201-1.053,.606-2.04,1.204-2.933,.229-.344,.694-.437,1.04-.207,.345,.23,.437,.696,.206,1.041-.484,.725-.813,1.526-.978,2.381-.068,.359-.383,.609-.735,.609Z"
+ fill="currentColor"
+ />
+ <path
+ d="M7.6,16.864c-.048,0-.096-.004-.145-.014-1.033-.201-2.004-.601-2.884-1.187-.345-.229-.438-.695-.208-1.04,.229-.344,.694-.439,1.04-.208,.714,.476,1.501,.8,2.339,.962,.406,.079,.672,.473,.593,.879-.069,.358-.384,.607-.735,.607Z"
+ fill="currentColor"
+ />
+ <path
+ d="M2.971,13.776c-.242,0-.479-.117-.624-.333-.598-.893-1.003-1.879-1.204-2.933-.078-.407,.188-.8,.595-.878,.408-.076,.801,.188,.878,.596,.164,.855,.493,1.656,.978,2.381,.23,.344,.139,.81-.206,1.041-.128,.085-.273,.126-.416,.126Z"
+ fill="currentColor"
+ />
+ <path
+ d="M13.012,3.711c-.143,0-.287-.041-.415-.126-.714-.476-1.501-.8-2.339-.962-.406-.079-.672-.473-.593-.879s.475-.668,.88-.593c1.033,.201,2.004,.601,2.884,1.187,.345,.229,.438,.695,.208,1.04-.145,.217-.382,.334-.625,.334Z"
+ fill="currentColor"
+ />
+ <path
+ d="M16.12,8.381c-.353,0-.667-.25-.735-.609-.164-.855-.493-1.656-.978-2.381-.23-.344-.139-.81,.206-1.041s.811-.137,1.04,.207c.598,.893,1.003,1.879,1.204,2.933,.078,.407-.188,.8-.595,.878-.048,.009-.096,.013-.143,.013Z"
+ fill="currentColor"
+ />
+ <path
+ d="M10.4,16.864c-.352,0-.666-.249-.735-.607-.079-.407,.187-.8,.593-.879,.838-.163,1.625-.487,2.339-.962,.346-.231,.811-.136,1.04,.208,.229,.345,.137,.811-.208,1.04-.88,.586-1.851,.986-2.884,1.187-.049,.009-.097,.014-.145,.014Z"
+ fill="currentColor"
+ />
+ <path
+ d="M15.029,13.776c-.143,0-.288-.041-.416-.126-.345-.23-.437-.696-.206-1.041,.484-.725,.813-1.526,.978-2.381,.077-.407,.47-.671,.878-.596,.406,.078,.673,.471,.595,.878-.201,1.053-.606,2.04-1.204,2.933-.145,.216-.382,.333-.624,.333Z"
+ fill="currentColor"
+ />
+ </g>
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/nucleo/index.ts b/packages/ui/src/icons/nucleo/index.ts
index 117f1f97e2..a3c8dcc192 100644
--- a/packages/ui/src/icons/nucleo/index.ts
+++ b/packages/ui/src/icons/nucleo/index.ts
@@ -31,6 +31,7 @@ export * from "./calendar-refresh";
export * from "./calendar6";
export * from "./cards";
export * from "./caret-up";
+export * from "./chat-task";
export * from "./chart-activity2";
export * from "./chart-area2";
export * from "./chart-line";
@@ -42,6 +43,7 @@ export * from "./chevron-right";
export * from "./chevron-up";
export * from "./circle-arrow-right";
export * from "./circle-check";
+export * from "./circle-dashed";
export * from "./circle-dollar";
export * from "./circle-dollar-out";
export * from "./circle-dollar3";