fix(dashboard): offer bank connection in the all-clear Att gora state (#2049)

* fix(dashboard): offer bank connection in the all-clear Att gora state

When the Att gora worklist is all-clear but the company has no active
bank connection, the plain "Allt klart!" praised silence that was really
a setup gap: nothing flows in automatically. The empty state now says so
and offers "Anslut bank" linking to /settings/banking. Fetch errors
degrade to the ordinary all-clear copy, mirroring the emptyLedger rule.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oUS7VoKWMj3jqQmdnop6R

* fix(dashboard): reword no-bank hint so it holds for automatic non-bank feeds

Skeptic finding: a company on the Stripe transaction feed (nightly cron
into transactions) with no PSD2 connection would read "inga nya
transaktioner kommer in automatiskt" as a false statement. Reworded to
an invitation that is true for every cohort.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oUS7VoKWMj3jqQmdnop6R

* fix(dashboard): scope the no-bank hint to bank transactions

CodeRabbit: "nya transaktioner" could still read as covering non-bank
feeds; say "banktransaktioner" / "bank transactions".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oUS7VoKWMj3jqQmdnop6R

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Mattsson
2026-08-31 00:10:28 +02:00
committed by GitHub
co-authored by Claude Fable 5
parent 516e8b62ff
commit dd8c06a8fa
4 changed files with 32 additions and 2 deletions
+7 -1
View File
@@ -190,7 +190,7 @@ export async function HemPanesSection({
// the worklist count is the list's length (it used to scan the same rows
// twice). Everything else runs in the same wave.
const suggestedMatchesPromise = listSuggestedMatches(supabase, companyId, SUGGESTED_MATCH_SCAN_CAP)
const [worklist, suggestedMatches, resumeItems, { data: bankConnections }, postedEntries] =
const [worklist, suggestedMatches, resumeItems, bankConnectionsRes, postedEntries] =
await Promise.all([
// Pending-work counts come from lib/worklist: the same source as the
// sidebar badges, so the numbers can never diverge.
@@ -210,6 +210,11 @@ export async function HemPanesSection({
// bookkeeping that its ledger is blank, so errors degrade to the normal copy.
const emptyLedger = setupOpen && !postedEntries.error && (postedEntries.count || 0) === 0
const bankConnections = bankConnectionsRes.data
// Same degrade-on-error rule as emptyLedger: a failed fetch must NOT tell a
// connected company that no bank is connected, so errors read as connected.
const hasActiveBankConnection = !!bankConnectionsRes.error || (bankConnections ?? []).length > 0
// Same day-math as the bank_connection_expiring notice predicate
// (lib/notices/categories.ts): the Bevaka row and the notice can never
// disagree on the threshold.
@@ -225,6 +230,7 @@ export async function HemPanesSection({
suggestedMatches={suggestedMatches.slice(0, 5)}
expiringBankConnections={expiringBankConnections}
emptyLedger={emptyLedger}
hasActiveBankConnection={hasActiveBankConnection}
/>
<ResumePane items={resumeItems} />
</div>