diff --git a/app/(dashboard)/bookkeeping/[id]/page.tsx b/app/(dashboard)/bookkeeping/[id]/page.tsx index 5197e28b..388945da 100644 --- a/app/(dashboard)/bookkeeping/[id]/page.tsx +++ b/app/(dashboard)/bookkeeping/[id]/page.tsx @@ -936,7 +936,6 @@ export default function JournalEntryDetailPage({ params }: { params: Promise<{ i

{t('references_title')}

-

{t('references_subtitle')}

- {(!description || !selectedPeriod || isUploading || periodMismatch || incompleteLineCount > 0 || (!isBalanced && submittableLines.length < 2)) && ( -
+ {showValidationHints && (!description || !selectedPeriod || isUploading || periodMismatch || incompleteLineCount > 0 || (!isBalanced && submittableLines.length < 2)) && ( +
{!description &&

{t('validation_description')}

} {!selectedPeriod &&

{t('validation_period')}

} {periodMismatch === 'no_period' &&

{t('validation_no_matching_period')}

} diff --git a/components/bookkeeping/JournalEntryList.tsx b/components/bookkeeping/JournalEntryList.tsx index 75190922..e235c360 100644 --- a/components/bookkeeping/JournalEntryList.tsx +++ b/components/bookkeeping/JournalEntryList.tsx @@ -1066,7 +1066,6 @@ export default function JournalEntryList() { {t('sort_description_desc')} -

{t('sort_stack_hint')}

{/* Verifikationsserie */} diff --git a/components/invoices/InvoiceEditor.tsx b/components/invoices/InvoiceEditor.tsx index 83c5f1ed..56ad31c8 100644 --- a/components/invoices/InvoiceEditor.tsx +++ b/components/invoices/InvoiceEditor.tsx @@ -1565,7 +1565,6 @@ export default function InvoiceEditor(props: InvoiceEditorProps = { mode: 'creat {t('items_card_title')} - {t('items_card_description')}
@@ -2386,9 +2385,6 @@ export default function InvoiceEditor(props: InvoiceEditorProps = { mode: 'creat onChange={setDefaultDimension} inputClassName="h-9" /> -

- {t('dimensions_default_hint')} -

)} diff --git a/components/reconciliation/MatchVerifikationPicker.tsx b/components/reconciliation/MatchVerifikationPicker.tsx index ee6d8d9d..7a416f7d 100644 --- a/components/reconciliation/MatchVerifikationPicker.tsx +++ b/components/reconciliation/MatchVerifikationPicker.tsx @@ -10,15 +10,19 @@ import { formatVoucher } from '@/lib/bookkeeping/voucher-series-resolver' /** * Map the endpoint's 0-1 match confidence (attached only when candidates are - * ranked for a specific transaction) to a labelled strength badge, so the user - * can tell an exact-amount hit from a fuzzy guess before vouching for an - * immutable verifikat. Returns null when no confidence was attached. + * ranked for a specific transaction) to a strength label, so the user can tell + * an exact-amount hit from a fuzzy guess before vouching for an immutable + * verifikat. Returns null when no confidence was attached. + * + * Chips mark exceptions (convention 5): a strong hit is the normal, + * auto-selected case and renders as muted text; only the fuzzy guesses that + * deserve a second look get a chip. */ -function confidenceBadge( +function confidenceMark( confidence: number | undefined, -): { label: string; variant: 'success' | 'secondary' | 'outline' } | null { +): { label: string; variant: 'secondary' | 'outline' | null } | null { if (confidence == null) return null - if (confidence >= 0.85) return { label: 'Stark träff', variant: 'success' } + if (confidence >= 0.85) return { label: 'Stark träff', variant: null } if (confidence >= 0.6) return { label: 'Trolig träff', variant: 'secondary' } return { label: 'Svag träff', variant: 'outline' } } @@ -132,7 +136,7 @@ export function MatchVerifikationPicker({ // green "Stark träff" can't visually encourage an accidental double-match: // "Redan matchad" is the signal that matters there (N:1 stays opt-in). const strength = - (selected.linked_transaction_count ?? 0) > 0 ? null : confidenceBadge(selected.confidence) + (selected.linked_transaction_count ?? 0) > 0 ? null : confidenceMark(selected.confidence) return (
{formatVoucher(selected)} @@ -140,9 +144,13 @@ export function MatchVerifikationPicker({ {formatCurrency(amount)} {selected.entry_description} {strength && ( - - {strength.label} - + strength.variant ? ( + + {strength.label} + + ) : ( + {strength.label} + ) )} {(selected.linked_transaction_count ?? 0) > 0 && ( @@ -175,7 +183,7 @@ export function MatchVerifikationPicker({ {filtered.map((line) => { const amount = line.debit_amount > 0 ? line.debit_amount : -line.credit_amount const strength = - (line.linked_transaction_count ?? 0) > 0 ? null : confidenceBadge(line.confidence) + (line.linked_transaction_count ?? 0) > 0 ? null : confidenceMark(line.confidence) return (
-

{t('dimensions_default_hint')}

)} diff --git a/components/transactions/MatchVoucherDialog.tsx b/components/transactions/MatchVoucherDialog.tsx index 9f966a4b..518b4c5b 100644 --- a/components/transactions/MatchVoucherDialog.tsx +++ b/components/transactions/MatchVoucherDialog.tsx @@ -6,11 +6,10 @@ import { DialogContent, DialogHeader, DialogTitle, - DialogDescription, DialogFooter, } from '@/components/ui/dialog' import { Button } from '@/components/ui/button' -import { Switch } from '@/components/ui/switch' +import { HelpPopover } from '@/components/ui/help-popover' import { MatchVerifikationPicker, type UnlinkedGLLine, @@ -188,11 +187,23 @@ export function MatchVoucherDialog({ - Matcha mot befintlig verifikation - - Koppla bankhändelsen till en verifikation som redan är bokförd (t.ex. en - lön eller en post importerad från Fortnox). Ingen ny bokföring skapas. - + {/* Convention 7: the how-it-works copy lives behind the "?", not in + the dialog flow. */} +
+ Matcha mot befintlig verifikation + +

+ Kopplar bankhändelsen till en verifikation som redan är bokförd, + t.ex. en lön eller en post importerad från Fortnox. Ingen ny + bokföring skapas. +

+

+ Med "Visa även matchade" kan flera bankhändelser kopplas + till samma verifikation, t.ex. en lön utbetald i flera + överföringar. +

+
+
{/* Transaction summary */} @@ -240,26 +251,26 @@ export function MatchVoucherDialog({ {(selectedLine?.linked_transaction_count ?? 0) > 0 && (

- Verifikationen är redan matchad mot {selectedLine?.linked_transaction_count}{' '} - transaktion{(selectedLine?.linked_transaction_count ?? 0) === 1 ? '' : 'er'}. - Kopplingen lägger till den här transaktionen också: t.ex. en lön utbetald i - flera överföringar. + Redan matchad mot {selectedLine?.linked_transaction_count}{' '} + transaktion{(selectedLine?.linked_transaction_count ?? 0) === 1 ? '' : 'er'}; + den här läggs till.

)} )} {/* Discovery affordances: widen the date window, and surface vouchers - already matched so another transaction can be attached (N:1). */} + already matched so another transaction can be attached (N:1). + Quiet links, not switches: these are list filters, and the switch + idiom belongs to settings (convention 15). */}
- + {!wideRange && (