feat(dashboard): unified "Att göra" worklist section on Hem (#674)

* feat(dashboard): unified "Att göra" worklist section on Hem

The pilot's core complaint: pending work was scattered across
Transaktioner, Underlag and Ny verifikation with no single starting
point. Hem now carries one flat Att göra ledger — three bands by
session intent (Bokför / Granska & komplettera / Bevaka), every count
read from lib/worklist (the same source as the sidebar badges, so the
numbers can never disagree), and an "Allt klart!" empty state.

Suggested transaction↔invoice matches render inline with one-click
Bekräfta posting to the existing match endpoints; rows fade out
optimistically and counts re-sync from /api/worklist/counts.

Replaces the "Att hantera" alert-card grid — whose warning/destructive
chrome borders violated the design system — with neutral hairline rows;
urgency is now carried by Badge variants only. The "Att göra" KPI tile
switches to the worklist total, and the home page drops eight inline
pending-work queries (incl. the legacy receipts queue, superseded by
the inbox category) in favour of getWorklistCounts().

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(dashboard): address PR #674 review — count/visibility consistency

greptile found two real contradictions in the Att göra section:
- Expiring bank connections rendered a Bevaka row without counting
  toward the header total — a user with only an expiring consent read
  "0 kvar" next to a visible action row. The section header and the
  KPI tile now both show worklist.total + expiring connections.
- deadline_action counted toward the total but had no row, so
  deadline-only users saw "Allt klart!" under a non-zero tile. Bevaka
  gains a "Moms- och skattedeadlines" row linking to /deadlines.

Invariant after this commit: every count that feeds a displayed total
has a visible row, and the tile and section header always agree.

Also per compliance review: a failed counts refetch after a confirmed
match now logs via console.error (Sentry-observable) instead of being
silently swallowed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-06-05 10:44:16 +02:00
committed by GitHub
co-authored by Claude Opus 4.8
parent f59da07fc0
commit 076bb169f8
5 changed files with 470 additions and 256 deletions
+24 -1
View File
@@ -3704,7 +3704,30 @@
"anomalies_detail": "{count} to address",
"bank_consent_expiring": "Bank consent expiring",
"bank_consent_detail_one": "{bank} — {days} day left",
"bank_consent_detail_other": "{bank} — {days} days left"
"bank_consent_detail_other": "{bank} — {days} days left",
"att_gora_title": "To do",
"att_gora_left": "{count} left",
"att_gora_empty_title": "All caught up!",
"att_gora_empty_body": "No transactions to record and no documents to handle.",
"band_bokfor": "Record",
"band_granska": "Review & complete",
"band_bevaka": "Monitor",
"row_book_transactions": "Transactions to record",
"row_book_transactions_stale": "{count} older than 14 days",
"row_inbox_documents": "Documents to handle",
"row_inbox_documents_detail": "Match to a transaction or record directly",
"row_supplier_approval": "Supplier invoices to approve",
"row_missing_underlag": "Vouchers missing documents",
"row_pending_ops": "To review",
"row_overdue_invoices": "Overdue customer invoices",
"suggested_title": "Suggested matches",
"suggested_kind_invoice": "Invoice",
"suggested_kind_supplier_invoice": "Supplier invoice",
"suggested_confirm": "Confirm",
"suggested_view": "View transaction",
"suggested_confirmed_toast": "Match recorded",
"suggested_failed_toast": "Match failed",
"row_deadlines": "VAT and tax deadlines"
},
"reports": {
"title": "Reports",
+24 -1
View File
@@ -3704,7 +3704,30 @@
"anomalies_detail": "{count} att åtgärda",
"bank_consent_expiring": "Banksamtycke löper ut",
"bank_consent_detail_one": "{bank} — {days} dag kvar",
"bank_consent_detail_other": "{bank} — {days} dagar kvar"
"bank_consent_detail_other": "{bank} — {days} dagar kvar",
"att_gora_title": "Att göra",
"att_gora_left": "{count} kvar",
"att_gora_empty_title": "Allt klart!",
"att_gora_empty_body": "Inga transaktioner att bokföra och inga underlag att hantera.",
"band_bokfor": "Bokför",
"band_granska": "Granska & komplettera",
"band_bevaka": "Bevaka",
"row_book_transactions": "Bokföra transaktioner",
"row_book_transactions_stale": "{count} äldre än 14 dagar",
"row_inbox_documents": "Underlag att hantera",
"row_inbox_documents_detail": "Matcha mot transaktion eller bokför direkt",
"row_supplier_approval": "Leverantörsfakturor att attestera",
"row_missing_underlag": "Verifikat utan underlag",
"row_pending_ops": "Att granska",
"row_overdue_invoices": "Förfallna kundfakturor",
"suggested_title": "Föreslagna matchningar",
"suggested_kind_invoice": "Faktura",
"suggested_kind_supplier_invoice": "Leverantörsfaktura",
"suggested_confirm": "Bekräfta",
"suggested_view": "Visa transaktionen",
"suggested_confirmed_toast": "Matchning bokförd",
"suggested_failed_toast": "Matchningen misslyckades",
"row_deadlines": "Moms- och skattedeadlines"
},
"reports": {
"title": "Rapporter",