From aff29b2b057b51a146b39539ca590d32bed42cb8 Mon Sep 17 00:00:00 2001 From: Mattsson <111893710+mattssonn@users.noreply.github.com> Date: Wed, 12 Aug 2026 23:48:52 +0200 Subject: [PATCH] feat(inbox): show extracted fakturadatum on inbox cards (#1542) * feat(inbox): show extracted fakturadatum on inbox cards Users with many invoices from the same supplier could not tell the cards apart: the list only showed supplier name, arrival time, and amount. Append the extracted invoice date (formatDate, tabular-nums) after the arrival time on each card when extraction found one. Co-Authored-By: Claude Fable 5 * refactor(inbox): deduplicate the card timestamp span The timeAgo + fakturadatum span was rendered verbatim in both branches of the second-line conditional. Compute it once per row instead (PR Agent review note on #1542). Co-Authored-By: Claude Fable 5 --------- Co-authored-by: Claude Fable 5 --- .../general/InvoiceInboxWorkspace.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/components/extensions/general/InvoiceInboxWorkspace.tsx b/components/extensions/general/InvoiceInboxWorkspace.tsx index c5fc2963..fa60cb9c 100644 --- a/components/extensions/general/InvoiceInboxWorkspace.tsx +++ b/components/extensions/general/InvoiceInboxWorkspace.tsx @@ -158,6 +158,10 @@ function pickSupplierName(item: InboxItem): string | null { return item.extracted_data?.supplier?.name ?? null } +function pickInvoiceDate(item: InboxItem): string | null { + return item.extracted_data?.invoice?.invoiceDate ?? null +} + // True when extraction produced at least one usable field. Distinguishes a // deterministically-parsed underlag (fields present: render the editable // list) from an item whose extracted_data is null/empty (AI never ran, or ran @@ -1926,6 +1930,7 @@ function InboxRow({ const t = useTranslations('inbox_workspace') const amount = pickAmount(item) const supplierName = pickSupplierName(item) + const invoiceDate = pickInvoiceDate(item) const isPlaceholder = !!item.isPlaceholder const status = deriveInboxStatus(item) const isErrored = status === 'error' @@ -1937,6 +1942,15 @@ function InboxRow({ const hasUnansweredQuestion = !isBooked && item.channel_context?.pending_question?.status === 'moved_to_app' + const receivedMeta = ( + + {timeAgo(item.email_received_at ?? item.created_at)} + {invoiceDate && ( + <> ยท {formatDate(invoiceDate)} + )} + + ) + return (
  • )} - {timeAgo(item.email_received_at ?? item.created_at)} + {receivedMeta} ) : ( - {timeAgo(item.email_received_at ?? item.created_at)} + receivedMeta )} {!isPlaceholder && amount != null && (