diff --git a/components/transactions/TransactionInboxCard.tsx b/components/transactions/TransactionInboxCard.tsx index b36cadd9..7c647c23 100644 --- a/components/transactions/TransactionInboxCard.tsx +++ b/components/transactions/TransactionInboxCard.tsx @@ -226,14 +226,23 @@ export default function TransactionInboxCard({ const showOverflowMenu = showInvoiceMatchButton || showMatchVoucherItem || showAttachDocumentItem || showSplitItem || showEditItem || showMoveAccountItem || showIgnoreItem || showDeleteItem + // Pre-migration history row (ISO dates compare lexically): most likely + // corresponds to an already-imported verifikat, so it carries a quiet + // marker steering toward matching rather than re-booking. + const isPreMigration = !!preMigrationCutoff && transaction.date <= preMigrationCutoff + // The foldout carries row detail only (actions live on the row: pill + ⋯). // Rows with nothing to show don't expand at all; classified imported rows // always have at least the payment-method line. const hasFoldoutContent = Boolean(transaction.transaction_method) || (transaction.currency !== 'SEK' && transaction.amount_sek != null) || - Boolean(transaction.title_edited_at && originalName) || + // No originalName requirement: below md the inline "redigerad" marker is + // hidden, so the foldout is the only place the edited state survives; it + // must open even when the original bank name is missing. + Boolean(transaction.title_edited_at) || Boolean(skvCounterpartDate) || + isPreMigration || (HAS_AI_EXTRACTION && (extraction.status === 'running' || extraction.status === 'failed')) const canExpand = hasFoldoutContent // An exiting row's foldout closes with it: the foldout has no exit @@ -299,28 +308,35 @@ export default function TransactionInboxCard({ {formatDate(transaction.date)} - + {/* overflow-hidden: the shrink-0 markers below don't truncate, so on + a viewport too narrow for them the cell must clip instead of + painting over the Belopp column. */} + {transaction.description} + {/* The markers below are desktop-only (hidden md:*): on mobile + they overflowed the cell into Belopp; their info stays + reachable in the foldout (TransactionHistoryList gates its + markers the same way). */} {transaction.title_edited_at && ( {t('edited_badge')} )} {skvCounterpartDate && ( - + Möjlig 1930↔1630 )} {/* Quiet pre-migration marker (muted text, not a chip: it is - context, not an exception state). ISO dates compare lexically. */} - {preMigrationCutoff && transaction.date <= preMigrationCutoff && ( - + context, not an exception state). */} + {isPreMigration && ( + {t('pre_migration_marker')} )} @@ -485,7 +501,8 @@ export default function TransactionInboxCard({ {transaction.transaction_method || (transaction.currency !== 'SEK' && transaction.amount_sek != null) || transaction.title_edited_at || - skvCounterpartDate ? ( + skvCounterpartDate || + isPreMigration ? (
{transaction.transaction_method && (

@@ -501,8 +518,12 @@ export default function TransactionInboxCard({ {formatCurrency(transaction.amount_sek)}

)} - {transaction.title_edited_at && originalName && ( -

{t('original_name_tooltip', { name: originalName })}

+ {transaction.title_edited_at && ( +

+ {originalName + ? t('original_name_tooltip', { name: originalName }) + : t('edited_no_original')} +

)} {skvCounterpartDate && (

@@ -510,6 +531,7 @@ export default function TransactionInboxCard({ {t('skv_counterpart_body', { date: skvCounterpartDate })}

)} + {isPreMigration &&

{t('pre_migration_foldout')}

}
) : null} diff --git a/messages/en.json b/messages/en.json index e2d1d83e..5b12b322 100644 --- a/messages/en.json +++ b/messages/en.json @@ -3018,7 +3018,9 @@ "delete_aria": "Delete transaction", "edit_title_aria": "Edit title", "edited_badge": "edited", + "edited_no_original": "The title has been edited from the bank's original name.", "pre_migration_marker": "from the period before your migration", + "pre_migration_foldout": "This transaction is from the period before your migration: it most likely corresponds to an already imported voucher, so match it to an existing voucher rather than booking it again.", "original_name_tooltip": "Original bank name: {name}", "edit_title_dialog_title": "Edit transaction title", "edit_title_warning": "Are you sure you want to edit the title of this transaction?", diff --git a/messages/sv.json b/messages/sv.json index c16fa43e..d836e15a 100644 --- a/messages/sv.json +++ b/messages/sv.json @@ -3018,7 +3018,9 @@ "delete_aria": "Ta bort transaktion", "edit_title_aria": "Ändra titel", "edited_badge": "redigerad", + "edited_no_original": "Titeln har redigerats från bankens originalnamn.", "pre_migration_marker": "från perioden före din migrering", + "pre_migration_foldout": "Transaktionen är från perioden före din migrering: den motsvarar troligen ett redan importerat verifikat, så matcha den hellre mot en befintlig verifikation än att bokföra på nytt.", "original_name_tooltip": "Bankens originalnamn: {name}", "edit_title_dialog_title": "Ändra transaktionens titel", "edit_title_warning": "Är du säker på att du vill ändra titeln på den här transaktionen?",