feat: arcim migration wizard UX, import fixes, Sentry setup (#22)

* feat: import system improvements, INK2 fix, and Swedish text corrections

- SIE parser: Windows-1252 and CP437 encoding detection and decoding
- Bank file parser: add Nordea Business (Företag) CSV format
- Bank file parser: improve format detection for SEB, Länsförsäkringar, generic CSV
- INK2 engine: calculate årets resultat (7222) from income statement for open fiscal years
- Dashboard: parallel Supabase queries, simplified dashboard page
- Fix Swedish characters (å, ä, ö) in BAS data descriptions, validation messages, AI consent disclosures
- Import wizard UI improvements across all steps
- Migration: add 'bas_range' match type to sie_account_mappings constraint
- Extensive new tests for SIE parser encoding and bank file parser

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: arcim migration wizard UX fixes, Sentry setup, and extension scaffolding

Arcim migration wizard improvements:
- Progress bar now excludes non-interactive steps (migrating/result)
- Fix OAuth text to match target="_blank" behavior (new tab, not redirect)
- Display month names instead of "Månad X" in preview
- Fix Swedish typo "förifylla" in no-company-info message
- Replace native checkboxes with shadcn Switch in options step
- Add ConfirmationDialog before starting migration
- Show progress percentage during migration
- Add "Nästa steg" guidance and navigation links in result step
- Add "Försök igen" button in error state (returns to options)
- Add Bokio company ID help text (GUID from URL)
- Add Fortnox integration add-on hint on connection failure

Also includes: SIE import system improvements, INK2 fixes, Swedish text
corrections, Sentry error tracking setup, and arcim-migration extension
scaffolding.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: address PR review feedback

- Fix OAuth error recovery blank page (restore provider from URL params)
- Pass real userId to MigrationWizard instead of empty string
- Remove ~50 debug console.log statements from sie-import.ts
- Fix comment referencing account 3740 → 3741

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-03-13 16:24:54 +01:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 82ad630448
commit 2ad8731dc9
44 changed files with 5108 additions and 122 deletions
+21
View File
@@ -0,0 +1,21 @@
"use client";
import * as Sentry from "@sentry/nextjs";
import { useEffect } from "react";
export function SentryIdentify({
userId,
email,
}: {
userId: string;
email?: string;
}) {
useEffect(() => {
Sentry.setUser({ id: userId, email });
return () => {
Sentry.setUser(null);
};
}, [userId, email]);
return null;
}
@@ -252,7 +252,6 @@ export default function DashboardContent({ firstName, settings, summary, onboard
hasCustomers={onboardingProgress.hasCustomers}
hasInvoices={onboardingProgress.hasInvoices}
hasBankConnected={onboardingProgress.hasBankConnected}
hasReceipts={onboardingProgress.hasReceipts}
/>
</section>
)}
File diff suppressed because it is too large Load Diff
+11
View File
@@ -13,6 +13,7 @@ import {
XCircle,
ArrowRight,
BarChart3,
Info,
} from 'lucide-react'
import type { ImportPreview, ParseIssue } from '@/lib/import/types'
@@ -226,6 +227,16 @@ export default function SIEPreviewStep({
</CardContent>
</Card>
{/* Excluded system accounts info */}
{preview.excludedSystemAccounts.length > 0 && (
<div className="flex items-start gap-2 rounded-lg border bg-muted/50 px-4 py-3 text-sm text-muted-foreground">
<Info className="h-4 w-4 mt-0.5 flex-shrink-0" />
<span>
{preview.excludedSystemAccounts.length} internt systemkonto från källsystemet exkluderades ({preview.excludedSystemAccounts.map((a) => a.number).join(', ')}) — inte bokföringskonton
</span>
</div>
)}
{/* Create missing accounts */}
{missingAccounts.length > 0 && (
<Card className="border-primary/50">
@@ -25,7 +25,6 @@ interface NewUserChecklistProps {
hasCustomers: boolean
hasInvoices: boolean
hasBankConnected: boolean
hasReceipts: boolean
onDismiss?: () => void
className?: string
}
@@ -36,7 +35,6 @@ export default function NewUserChecklist({
hasCustomers,
hasInvoices,
hasBankConnected,
hasReceipts,
onDismiss,
className,
}: NewUserChecklistProps) {
@@ -78,13 +76,6 @@ export default function NewUserChecklist({
href: '/import',
completed: hasBankConnected,
},
{
id: 'receipt',
label: 'Skanna ditt första kvitto',
description: 'Fotografera för automatisk bokföring',
href: '/receipts/scan',
completed: hasReceipts,
},
]
const completedCount = items.filter((item) => item.completed).length