chore(onboarding): delete the dead first-run components and their orphaned strings (#1488)
The activation analysis (2026-08-07) verified these have zero importers or triggers; the new stepped checklist and its PostHog funnel replaced their roles: - SuccessAnimation (confetti variant): never mounted, and the completion moment is now the quiet check-morph signature, so it will stay unused - AgentSetupBanner, ConsultantEmptyState: never mounted - EmptyReceipts + its Camera import: only consumer of the preset_receipts_* strings and of a /receipts/scan route that does not exist - new_user_checklist i18n namespace (24 keys x 2 locales): the old wizard copy; the live checklist reads initial_setup The onboarding.empty agent intent stays: it is registered in the intent table and reachable via /api/agent/invoke, so removing it is a product decision, not dead-code removal. Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Jakob Wennberg
Claude Fable 5
parent
51bf1b77bf
commit
d1b938d869
@@ -1,38 +0,0 @@
|
||||
import Link from 'next/link'
|
||||
import { MessageCircle, ArrowRight } from 'lucide-react'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
|
||||
interface Props {
|
||||
companyName: string
|
||||
}
|
||||
|
||||
// Renders above the dashboard when the active company has no verified
|
||||
// agent_profile yet. Mounted from the dashboard server component which
|
||||
// already does the existence check, so this component itself doesn't fetch.
|
||||
//
|
||||
// Single CTA, no dismiss: building the agent is part of onboarding and
|
||||
// once verified it disappears on its own.
|
||||
export default function AgentSetupBanner({ companyName }: Props) {
|
||||
return (
|
||||
<Link
|
||||
href="/onboarding/agent"
|
||||
className="group block rounded-lg border border-border bg-card hover:bg-secondary/60 transition-colors duration-150 mb-8"
|
||||
>
|
||||
<div className="flex items-center gap-4 p-6">
|
||||
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-foreground text-background shrink-0">
|
||||
<MessageCircle className="h-4 w-4" />
|
||||
</div>
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<p className="font-display text-lg tracking-tight">Bygg din bokföringsassistent</p>
|
||||
<Badge variant="secondary" className="uppercase tracking-wider">Beta</Badge>
|
||||
</div>
|
||||
<p className="text-sm text-muted-foreground mt-1">
|
||||
Skräddarsy en hjälp som kan ditt företag: laddas på under en halv minut för {companyName}.
|
||||
</p>
|
||||
</div>
|
||||
<ArrowRight className="h-4 w-4 text-muted-foreground group-hover:text-foreground transition-colors shrink-0" />
|
||||
</div>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import Link from 'next/link'
|
||||
import { Building2, Plus } from 'lucide-react'
|
||||
|
||||
interface ConsultantEmptyStateProps {
|
||||
firstName?: string | null
|
||||
}
|
||||
|
||||
export default function ConsultantEmptyState({ firstName }: ConsultantEmptyStateProps) {
|
||||
const hour = new Date().getHours()
|
||||
const greeting = hour < 5 ? 'God natt' : hour < 10 ? 'Godmorgon' : hour < 14 ? 'Hej' : hour < 18 ? 'God eftermiddag' : 'God kväll'
|
||||
|
||||
return (
|
||||
<div className="stagger-enter">
|
||||
<header className="mb-16">
|
||||
<h1 className="font-display text-2xl leading-8 tracking-tight">
|
||||
{greeting}{firstName ? `, ${firstName}` : ''}
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
<div className="flex flex-col items-center text-center max-w-md mx-auto">
|
||||
<div className="w-12 h-12 rounded-xl bg-muted/60 flex items-center justify-center mb-5">
|
||||
<Building2 className="h-5 w-5 text-muted-foreground" />
|
||||
</div>
|
||||
|
||||
<h2 className="font-display text-lg mb-2">
|
||||
Inga företag ännu
|
||||
</h2>
|
||||
<p className="text-sm text-muted-foreground mb-8">
|
||||
Lägg till ditt första kundföretag för att komma igång med bokföringen.
|
||||
</p>
|
||||
|
||||
<Link
|
||||
href="/onboarding"
|
||||
className="inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 transition-colors"
|
||||
>
|
||||
<Plus className="h-4 w-4" />
|
||||
Lägg till företag
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
ReceiptText,
|
||||
Users,
|
||||
ArrowLeftRight,
|
||||
Camera,
|
||||
Building2,
|
||||
FileText,
|
||||
Calendar,
|
||||
@@ -141,19 +140,6 @@ export function EmptyTransactions() {
|
||||
)
|
||||
}
|
||||
|
||||
export function EmptyReceipts() {
|
||||
const t = useTranslations('empty')
|
||||
return (
|
||||
<EmptyState
|
||||
icon={Camera}
|
||||
title={t('preset_receipts_title')}
|
||||
description={t('preset_receipts_description')}
|
||||
actionLabel={t('preset_receipts_action')}
|
||||
actionHref="/receipts/scan"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export function EmptyDeadlines() {
|
||||
const t = useTranslations('empty')
|
||||
return (
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Check } from 'lucide-react'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
interface SuccessAnimationProps {
|
||||
show: boolean
|
||||
title?: string
|
||||
description?: string
|
||||
onComplete?: () => void
|
||||
variant?: 'default' | 'celebration'
|
||||
}
|
||||
|
||||
export function SuccessAnimation({
|
||||
show,
|
||||
title = 'Klart!',
|
||||
description,
|
||||
onComplete,
|
||||
variant = 'default',
|
||||
}: SuccessAnimationProps) {
|
||||
const [visible, setVisible] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
if (show) {
|
||||
setVisible(true)
|
||||
const timer = setTimeout(() => {
|
||||
setVisible(false)
|
||||
onComplete?.()
|
||||
}, 2000)
|
||||
return () => clearTimeout(timer)
|
||||
}
|
||||
}, [show, onComplete])
|
||||
|
||||
if (!visible) return null
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 z-[100] flex items-center justify-center bg-background/80 backdrop-blur-sm animate-fade-in">
|
||||
<div className="flex flex-col items-center gap-4 animate-scale-in">
|
||||
{/* Animated checkmark */}
|
||||
<div className="relative">
|
||||
<div className={cn(
|
||||
"w-20 h-20 rounded-full flex items-center justify-center",
|
||||
"bg-success/10 ring-4 ring-success/20"
|
||||
)}>
|
||||
<Check className="h-10 w-10 text-success animate-scale-in" style={{ animationDelay: '200ms' }} />
|
||||
</div>
|
||||
{/* Pulse ring */}
|
||||
<div className="absolute inset-0 rounded-full bg-success/10 animate-ping" style={{ animationDuration: '1s', animationIterationCount: '1' }} />
|
||||
</div>
|
||||
|
||||
{/* Text */}
|
||||
<div className="text-center animate-slide-up" style={{ animationDelay: '300ms' }}>
|
||||
<p className="text-lg font-display">{title}</p>
|
||||
{description && (
|
||||
<p className="text-sm text-muted-foreground mt-1">{description}</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Celebration particles */}
|
||||
{variant === 'celebration' && (
|
||||
<div className="absolute inset-0 pointer-events-none overflow-hidden">
|
||||
{Array.from({ length: 12 }).map((_, i) => (
|
||||
<div
|
||||
key={i}
|
||||
className="absolute w-2 h-2 rounded-full"
|
||||
style={{
|
||||
left: `${50 + Math.cos((i * 30 * Math.PI) / 180) * 40}%`,
|
||||
top: `${50 + Math.sin((i * 30 * Math.PI) / 180) * 40}%`,
|
||||
backgroundColor: ['hsl(145, 20%, 36%)', 'hsl(18, 45%, 55%)', 'hsl(38, 70%, 55%)', 'hsl(150, 30%, 40%)'][i % 4],
|
||||
animation: `fadeIn 0.3s ${i * 50}ms both`,
|
||||
opacity: 0.8,
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1335,30 +1335,6 @@
|
||||
"toast_status_updated_description": "Marked as {status}",
|
||||
"toast_status_update_failed": "Could not update status"
|
||||
},
|
||||
"new_user_checklist": {
|
||||
"welcome": "Welcome to {appName}",
|
||||
"intro": "Start by importing your bookkeeping, then connect your bank. Nothing changes in your current system.",
|
||||
"step1_title": "Import your bookkeeping",
|
||||
"step1_done_title": "Bookkeeping imported",
|
||||
"step1_done_description": "Done. You can import more periods later from the Import view.",
|
||||
"migrate_title": "Import from another system",
|
||||
"migrate_description": "Nothing changes in your existing system.",
|
||||
"sie_title": "Import SIE file",
|
||||
"sie_description": "Export a SIE4 file from your current bookkeeping software and upload it here.",
|
||||
"step2_title": "Connect your bank",
|
||||
"bank_title": "Connect your bank account",
|
||||
"bank_description_psd2": "Connect via PSD2: transactions sync automatically every day.",
|
||||
"bank_description_file": "Import bank statements from your bank: CSV, OFX and most Swedish banks.",
|
||||
"step3_title": "Connect Skatteverket",
|
||||
"optional_suffix": ": optional",
|
||||
"skatteverket_connected_title": "Skatteverket connected",
|
||||
"skatteverket_connected_description": "You can now submit momsdeklaration and AGI directly, and see the balance on your skattekonto.",
|
||||
"skatteverket_connect_title": "Connect to Skatteverket with BankID",
|
||||
"skatteverket_connect_description": "Submit momsdeklaration and arbetsgivardeklaration directly, and fetch the balance on your skattekonto, without leaving {appName}.",
|
||||
"or_separator": "or",
|
||||
"fresh_start": "I'm starting a new business with no prior bookkeeping",
|
||||
"security_note": "Your data is encrypted and stored securely in Sweden"
|
||||
},
|
||||
"initial_setup": {
|
||||
"title": "{count} steps and your bookkeeping is running",
|
||||
"step_books_title": "Get your books in",
|
||||
@@ -6647,9 +6623,6 @@
|
||||
"preset_transactions_title": "No transactions",
|
||||
"preset_transactions_description": "Import bank statements to automatically post entries and stay on top of your finances.",
|
||||
"preset_transactions_action": "Import transactions",
|
||||
"preset_receipts_title": "No receipts",
|
||||
"preset_receipts_description": "Snap a photo of a receipt for automatic reading and posting. We handle the rest!",
|
||||
"preset_receipts_action": "Scan receipt",
|
||||
"preset_deadlines_title": "No upcoming deadlines",
|
||||
"preset_deadlines_description": "Great work! You have no immediate deadlines to handle.",
|
||||
"preset_no_bank_title": "No transactions imported",
|
||||
|
||||
@@ -1335,30 +1335,6 @@
|
||||
"toast_status_updated_description": "Markerad som {status}",
|
||||
"toast_status_update_failed": "Kunde inte uppdatera status"
|
||||
},
|
||||
"new_user_checklist": {
|
||||
"welcome": "Välkommen till {appName}",
|
||||
"intro": "Börja med att hämta din bokföring, sedan kopplar du banken. Ingenting ändras i ditt nuvarande system.",
|
||||
"step1_title": "Hämta din bokföring",
|
||||
"step1_done_title": "Bokföring importerad",
|
||||
"step1_done_description": "Klart. Du kan importera fler perioder senare från Importera-vyn.",
|
||||
"migrate_title": "Hämta från annat system",
|
||||
"migrate_description": "Inget ändras i ditt befintliga system.",
|
||||
"sie_title": "Importera SIE-fil",
|
||||
"sie_description": "Exportera en SIE4-fil från ditt nuvarande bokföringsprogram och ladda upp den här.",
|
||||
"step2_title": "Koppla din bank",
|
||||
"bank_title": "Anslut ditt bankkonto",
|
||||
"bank_description_psd2": "Koppla via PSD2: transaktioner synkas automatiskt varje dag.",
|
||||
"bank_description_file": "Importera kontoutdrag från din bank: CSV, OFX och de flesta svenska banker.",
|
||||
"step3_title": "Anslut Skatteverket",
|
||||
"optional_suffix": ": valfritt",
|
||||
"skatteverket_connected_title": "Skatteverket anslutet",
|
||||
"skatteverket_connected_description": "Du kan nu skicka momsdeklaration och AGI direkt, samt se saldot på skattekontot.",
|
||||
"skatteverket_connect_title": "Anslut till Skatteverket med BankID",
|
||||
"skatteverket_connect_description": "Skicka momsdeklaration och arbetsgivardeklaration direkt, och hämta saldot på skattekontot, utan att lämna {appName}.",
|
||||
"or_separator": "eller",
|
||||
"fresh_start": "Jag startar en ny verksamhet utan tidigare bokföring",
|
||||
"security_note": "Din data är krypterad och lagras säkert i Sverige"
|
||||
},
|
||||
"initial_setup": {
|
||||
"title": "{count} steg så är bokföringen igång",
|
||||
"step_books_title": "Få in din bokföring",
|
||||
@@ -6647,9 +6623,6 @@
|
||||
"preset_transactions_title": "Inga transaktioner",
|
||||
"preset_transactions_description": "Importera kontoutdrag från din bank för att automatiskt bokföra och få koll på ekonomin.",
|
||||
"preset_transactions_action": "Importera transaktioner",
|
||||
"preset_receipts_title": "Inga kvitton",
|
||||
"preset_receipts_description": "Ta en bild på ett kvitto för automatisk avläsning och bokföring. Vi sköter resten!",
|
||||
"preset_receipts_action": "Skanna kvitto",
|
||||
"preset_deadlines_title": "Inga kommande deadlines",
|
||||
"preset_deadlines_description": "Bra jobbat! Du har inga omedelbara deadlines att ta hand om.",
|
||||
"preset_no_bank_title": "Inga transaktioner importerade",
|
||||
|
||||
Reference in New Issue
Block a user