From 3d02a741478ef5e3fc32b0c6c8566e208558241f Mon Sep 17 00:00:00 2001 From: Jakob Wennberg <149234542+jakobwennberg@users.noreply.github.com> Date: Wed, 29 Jul 2026 12:33:40 +0200 Subject: [PATCH] refactor(ui): system hygiene sweep from the UI craft audit (#1281) Raw palette: SalaryCalendar was the only file in the salary cluster still on bg-red-100 / text-amber-800 style classes, with zero dark: variants, so every absence pill rendered paper-white on a near-black page. All 30 are now alpha-over-token on the semantic scale, which needs no dark: variant (the approach badge.tsx already takes). Eight absence types share four tones, so fill carries a second axis: filled vs outlined separates the types whose Lucide icon is identical (Heart is parental, pregnancy and care_relative; Activity is study and other_leave). Primitives: - select and dropdown-menu now scale from their trigger via the Radix transform-origin variables instead of from their own middle. Dialog stays centred: modals are not anchored to a trigger. - toast used fade-out-80, the one animate-* class with no @utility in globals.css, so --tw-exit-opacity fell back to 1 and the toast slid away at full opacity. Enter and exit now also share one path per breakpoint (top on mobile where the viewport is a full-width bar, right on desktop where it is a corner card) using max-sm:/sm: rather than stacking both, which would have produced a diagonal. - slide-over exited on ease-in, which delays the moment the user has already decided to leave; it enters on the drawer curve and now leaves on it too. - progress animated transition-all where only transform changes. - One app-wide TooltipProvider in the root layout. skipDelayDuration is provider-scoped, so a provider per instance meant the grace window could never fire and every account number in a huvudbok re-paid the full 200ms. Also: nine hand-rolled animate-pulse placeholders in three different greys to the Skeleton primitive, 25 CardTitle text-lg to the locked text-base, two always-on chips to muted text (a chip on every row is not an exception), the three extensions titles onto the display face, the help filter chips onto pill geometry, and the dead border-border/60 on the /import row. Co-authored-by: Claude Opus 5 (1M context) --- app/(dashboard)/articles/[id]/page.tsx | 10 ++-- .../extensions/[sector]/[extension]/page.tsx | 2 +- app/(dashboard)/extensions/[sector]/page.tsx | 2 +- app/(dashboard)/extensions/page.tsx | 2 +- app/(dashboard)/help/page.tsx | 12 ++--- app/(dashboard)/import/page.tsx | 2 +- app/(dashboard)/invoices/recurring/page.tsx | 4 +- .../KassaflodesanalysClient.tsx | 3 -- .../supplier-invoices/[id]/page.tsx | 16 +++--- app/(dashboard)/suppliers/[id]/page.tsx | 10 ++-- app/layout.tsx | 11 ++-- components/agent/AgentChat.tsx | 7 +-- components/agent/AgentSheetProvider.tsx | 5 +- .../extensions/general/CalendarWorkspace.tsx | 7 +-- components/reports/BankReconciliationView.tsx | 8 +-- components/reports/views/index.tsx | 10 ++-- components/salary/SalaryCalendar.tsx | 50 ++++++++++++------- .../NewSupplierInvoiceForm.tsx | 6 +-- .../transactions/BankSyncStatusChip.tsx | 3 -- components/ui/account-number.tsx | 3 -- components/ui/dropdown-menu.tsx | 2 +- components/ui/info-tooltip.tsx | 2 - components/ui/progress.tsx | 2 +- components/ui/select.tsx | 2 +- components/ui/slide-over.tsx | 2 +- components/ui/toast.tsx | 2 +- components/ui/tooltip-provider.tsx | 22 ++++++++ 27 files changed, 119 insertions(+), 88 deletions(-) create mode 100644 components/ui/tooltip-provider.tsx diff --git a/app/(dashboard)/articles/[id]/page.tsx b/app/(dashboard)/articles/[id]/page.tsx index e0389f86..15cef32e 100644 --- a/app/(dashboard)/articles/[id]/page.tsx +++ b/app/(dashboard)/articles/[id]/page.tsx @@ -242,9 +242,13 @@ export default function ArticleDetailPage({

{article.name}

- - {article.active ? t('status_active') : t('status_inactive')} - + {article.active ? ( + {t('status_active')} + ) : ( + + {t('status_inactive')} + + )} {t(ARTICLE_TYPE_KEY[article.type])} {article.article_number ? ` · #${article.article_number}` : ''} diff --git a/app/(dashboard)/extensions/[sector]/[extension]/page.tsx b/app/(dashboard)/extensions/[sector]/[extension]/page.tsx index dee52627..e256fe59 100644 --- a/app/(dashboard)/extensions/[sector]/[extension]/page.tsx +++ b/app/(dashboard)/extensions/[sector]/[extension]/page.tsx @@ -76,7 +76,7 @@ export default async function ExtensionDetailPage({
-

{extensionName}

+

{extensionName}

{extensionDescription}

diff --git a/app/(dashboard)/extensions/[sector]/page.tsx b/app/(dashboard)/extensions/[sector]/page.tsx index db683142..ef339fab 100644 --- a/app/(dashboard)/extensions/[sector]/page.tsx +++ b/app/(dashboard)/extensions/[sector]/page.tsx @@ -44,7 +44,7 @@ export default async function SectorExtensionsPage({
-

{sectorName}

+

{sectorName}

{sectorDescription}

diff --git a/app/(dashboard)/extensions/page.tsx b/app/(dashboard)/extensions/page.tsx index 3d43646a..93357d68 100644 --- a/app/(dashboard)/extensions/page.tsx +++ b/app/(dashboard)/extensions/page.tsx @@ -18,7 +18,7 @@ export default async function ExtensionsPage() { return (
-

{t('page_title')}

+

{t('page_title')}

{t('page_description')}

diff --git a/app/(dashboard)/help/page.tsx b/app/(dashboard)/help/page.tsx index 95267788..4a1b9410 100644 --- a/app/(dashboard)/help/page.tsx +++ b/app/(dashboard)/help/page.tsx @@ -350,10 +350,10 @@ export default function HelpPage() { - @@ -205,7 +203,6 @@ export function KassaflodesanalysClient() { Snart tillgänglig -
diff --git a/app/(dashboard)/supplier-invoices/[id]/page.tsx b/app/(dashboard)/supplier-invoices/[id]/page.tsx index b685de19..bff93c5e 100644 --- a/app/(dashboard)/supplier-invoices/[id]/page.tsx +++ b/app/(dashboard)/supplier-invoices/[id]/page.tsx @@ -588,7 +588,7 @@ export default function SupplierInvoiceDetailPage() {
- {t('invoice_info_title')} + {t('invoice_info_title')}
@@ -629,7 +629,7 @@ export default function SupplierInvoiceDetailPage() { - {t('amounts_title')} + {t('amounts_title')}
@@ -666,7 +666,7 @@ export default function SupplierInvoiceDetailPage() { {invoice.supplier && ( - {t('supplier_section_title')} + {t('supplier_section_title')} @@ -683,7 +683,7 @@ export default function SupplierInvoiceDetailPage() { {/* Line items */} - {t('rows_title')} + {t('rows_title')} {/* Desktop table */} @@ -766,7 +766,7 @@ export default function SupplierInvoiceDetailPage() { {payments.length > 0 && ( - {t('payment_history_title')} + {t('payment_history_title')} {/* Desktop table */} @@ -824,7 +824,7 @@ export default function SupplierInvoiceDetailPage() { {invoice.document_id && ( - {t('document_title')} + {t('document_title')}
@@ -844,7 +844,7 @@ export default function SupplierInvoiceDetailPage() { {/* Journal entries (sambandskrav) */} - {t('vouchers_title')} + {t('vouchers_title')} {invoice.registration_journal_entry_id ? ( @@ -895,7 +895,7 @@ export default function SupplierInvoiceDetailPage() { {invoice.notes && ( - {t('notes_title')} + {t('notes_title')}

{invoice.notes}

diff --git a/app/(dashboard)/suppliers/[id]/page.tsx b/app/(dashboard)/suppliers/[id]/page.tsx index 21bbed32..4823e491 100644 --- a/app/(dashboard)/suppliers/[id]/page.tsx +++ b/app/(dashboard)/suppliers/[id]/page.tsx @@ -126,9 +126,7 @@ export default function SupplierDetailPage() { return (
- - - +
) } @@ -240,7 +238,7 @@ export default function SupplierDetailPage() {
- {t('contact_section_title')} + {t('contact_section_title')} {supplier.email &&

{t('email_inline', { email: supplier.email })}

} @@ -252,7 +250,7 @@ export default function SupplierDetailPage() {
- {t('payment_section_title')} + {t('payment_section_title')} {supplier.bankgiro &&

{t('bankgiro_inline', { value: supplier.bankgiro })}

} @@ -269,7 +267,7 @@ export default function SupplierDetailPage() { {/* Invoices */} - {t('invoices_section_title')} + {t('invoices_section_title')}