From fb8e5425c3cae840fc9e1e66d4f0d00c9dc1c0e0 Mon Sep 17 00:00:00 2001 From: minimus7 Date: Wed, 11 Nov 2026 10:07:02 -0600 Subject: [PATCH] Add accounts: link a bank without Plaid keys points to Setup; delete test data right there - With no Plaid keys, the page said bank linking "isn't available in United States yet". It is: the keys are missing. It now shows Link a bank or card, which opens Setup to add the free Plaid keys. - Test banks: the Delete test data link went to Settings. It's now a button on this page, with a confirm, that removes the test bank and its transactions. Co-Authored-By: Claude Opus 5.5 --- src/app/(app)/accounts/add/page.tsx | 2 +- src/components/AddAccounts.tsx | 1 + src/components/ClearTestData.tsx | 4 ++-- src/components/LinkedNow.tsx | 6 ++++-- src/lib/providers/index.ts | 2 ++ 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/(app)/accounts/add/page.tsx b/src/app/(app)/accounts/add/page.tsx index dce4ea4..d5644d8 100644 --- a/src/app/(app)/accounts/add/page.tsx +++ b/src/app/(app)/accounts/add/page.tsx @@ -20,7 +20,7 @@ export default async function AddAccountsPage({ searchParams }: { searchParams: {connect === "done" &&

Your bank is connected. Its transactions are on the way.

} {connect === "cancelled" &&

The connection was cancelled. Nothing changed.

} {connect === "failed" &&

That bank didn't connect. Try again, or import a statement instead.

} - {!choices.bank && !choices.feeds.length && !choices.akahuMissing && !choices.alsoAkahu &&

Automatic bank linking isn't available in {country.name} yet. Import a statement from your bank instead: it takes a minute and works with any bank.

} + {!choices.bank && !choices.plaidMissing && !choices.feeds.length && !choices.akahuMissing && !choices.alsoAkahu &&

Automatic bank linking isn't available in {country.name} yet. Import a statement from your bank instead: it takes a minute and works with any bank.

} {choices.akahuMissing && (

To sync NZ banks automatically, add Akahu keys on the Setup page. Until then, import a statement from your bank.

diff --git a/src/components/AddAccounts.tsx b/src/components/AddAccounts.tsx index eced3c6..c30999f 100644 --- a/src/components/AddAccounts.tsx +++ b/src/components/AddAccounts.tsx @@ -211,6 +211,7 @@ export function AddAccounts({ choices, accounts, locale, currency, country }: { {choices.feeds.map((f) => )}
{choices.bank === "plaid" && } + {choices.plaidMissing && window.location.assign("/setup")} />} {(choices.bank === "akahu" || choices.alsoAkahu) && } {choices.investments && } ( diff --git a/src/components/ClearTestData.tsx b/src/components/ClearTestData.tsx index 8d673c2..badd024 100644 --- a/src/components/ClearTestData.tsx +++ b/src/components/ClearTestData.tsx @@ -11,7 +11,7 @@ export function RemoveTest({ items, intro }: { items: { id: string; name: string const [busy, setBusy] = useState(false); const [left, setLeft] = useState(items); const [err, setErr] = useState(""); - if (!left.length) return Test connections removed.; + if (!left.length) return Test data deleted.; async function remove() { setBusy(true); setErr(""); @@ -37,7 +37,7 @@ export function RemoveTest({ items, intro }: { items: { id: string; name: string
) : ( - + )} {err &&

{err}

} diff --git a/src/components/LinkedNow.tsx b/src/components/LinkedNow.tsx index e984183..42f61dc 100644 --- a/src/components/LinkedNow.tsx +++ b/src/components/LinkedNow.tsx @@ -1,6 +1,6 @@ -import Link from "next/link"; import { Merchant } from "@/components/Merchant"; import { RemoveCopy } from "@/components/PlaidButtons"; +import { RemoveTest } from "@/components/ClearTestData"; import { duplicateItems } from "@/lib/links"; import { fmtFor, fmtWith } from "@/lib/format"; import { historyPending } from "@/lib/sync"; @@ -76,7 +76,9 @@ export async function LinkedNow({ userId, profile }: { userId: string; profile?: )} {conns.some((c) => c.test) && ( -

Test banks count in your totals. Delete test data

+
+ c.test).map((c) => ({ id: c.id, name: c.name }))} intro="Test banks count in your totals." /> +
)} ); diff --git a/src/lib/providers/index.ts b/src/lib/providers/index.ts index 75eb360..3d2f7a1 100644 --- a/src/lib/providers/index.ts +++ b/src/lib/providers/index.ts @@ -38,6 +38,8 @@ export function addChoices(country?: string | null, alsoNz = false) { sandbox: plaid && process.env.PLAID_ENV === "sandbox", // No Plaid keys at all: a made-up bank instead (api/demo-bank), so broke can be tried with only a database. demo: !configured("plaid"), + // The country has Plaid banks but this copy has no Plaid keys yet: offer the bank card anyway, pointing at Setup. + plaidMissing: countryOf(code).providers.includes("plaid") && !configured("plaid"), // NZ without Akahu keys: say where to add them. akahuMissing: (countryOf(code).providers.includes("akahu") || alsoNz) && !configured("akahu"), // Lives elsewhere but also banks in NZ (Settings, money profile): the NZ option beside their own.