Skip to content
Merged
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
36 changes: 36 additions & 0 deletions app/(shell)/onboarding/StarterOnboardingWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
type IntegrationStatus,
} from "@/components/integrations/ConnectToolsWizard";
import { cn } from "@/lib/utils/cn";
import { persistScrapeInputs } from "./intake/actions";
import { getOutcomeLabelWithFallback } from "@/lib/data/vertical-outcomes";
import {
mapBusinessTypeToVertical,
Expand Down Expand Up @@ -185,6 +186,7 @@ export function StarterOnboardingWizard({
const router = useRouter();
const [step, setStep] = useState<StepIndex>(initialStep);
const [businessType, setBusinessType] = useState<BusinessTypeId | null>(null);
const [companyUrl, setCompanyUrl] = useState("");
const [quickWins, setQuickWins] = useState<QuickWinId[]>([]);
const [actionError, setActionError] = useState<string | null>(null);
const [workspacePending, setWorkspacePending] = useState(false);
Expand Down Expand Up @@ -293,6 +295,19 @@ export function StarterOnboardingWizard({
if (!response.ok) {
throw new Error("We could not finish Starter setup yet. Please try again.");
}

// P1-S1: if the owner gave their website, persist it so /focus drafts the first
// brief FROM their own business (the BriefBuildingState on /focus auto-fires the
// bootstrap). Non-fatal by design: an empty/invalid URL just lands on the honest
// sample brief (persistScrapeInputs validates SSRF + returns {ok:false} quietly).
const trimmedUrl = companyUrl.trim();
if (trimmedUrl) {
try {
await persistScrapeInputs({ companyUrl: trimmedUrl });
} catch {
// never block onboarding on the optional scrape
}
}
};

const provisionTenant = async (): Promise<"ready" | "pending"> => {
Expand Down Expand Up @@ -428,6 +443,7 @@ export function StarterOnboardingWizard({

<div className="space-y-6 px-5 py-6 sm:px-7 sm:py-7">
{step === 1 && (
<div className="space-y-5">
<div className="grid grid-cols-2 gap-3 lg:grid-cols-3">
{BUSINESS_OPTIONS.map(({ id, icon: Icon, label, hint }) => {
const selected = businessType === id;
Expand Down Expand Up @@ -462,6 +478,26 @@ export function StarterOnboardingWizard({
);
})}
</div>
<div className="space-y-2">
<label htmlFor="company-url" className="block text-sm font-medium text-stone-300">
Your website{" "}
<span className="font-normal text-stone-500">(optional, we draft your first brief from it)</span>
</label>
<input
id="company-url"
type="url"
inputMode="url"
autoComplete="url"
value={companyUrl}
onChange={(event) => setCompanyUrl(event.target.value)}
placeholder="yourbusiness.com"
className="w-full rounded-lg border border-stone-700 bg-stone-950/70 px-3.5 py-2.5 text-sm text-stone-100 placeholder:text-stone-500 focus-visible:border-amber-400/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/30"
/>
<p className="text-xs text-stone-500">
We only read your public website to draft a first brief, nothing is sent to your clients.
</p>
</div>
</div>
)}

{step === 2 && (
Expand Down