Derive the /accounts empty state from the declared connections
Summary
Provider kit Track A, A9 (the last derived list): the /accounts empty state is decided by AccountsController#accounts_index_empty?, from the declared connections, instead of a hand-kept chain of 29 .empty? checks in accounts/index.html.erb.
Part of jaysbeekay/sure#670. Stacked on jaysbeekay/sure#693 (A8); built on the fork first and sent upstream as part of Track A's native stack on top of we-promise/sure#5005.
Upstream: we-promise/sure#5086 (same commits), in Track A's native stack we-promise/sure#5087.
What changed
accounts_index_empty?(private, exposed withhelper_method): no manual accounts, no Apple Wallet accounts, and no visible connections for anyINDEX_CONNECTIONSprovider. The view calls it; the logic leaves the ERB.- The
provider:familygenerator no longer gsubs the new provider into the old chain. Its pattern (@coinstats_items.empty? %>) had already stopped matching, so generated providers were missing from the empty check; they are now counted through their declaration. The generator still adds the provider's section. - Diff: non-test +11 / −9.
No visible change.
Demo data
No demo data needed.
Migration notes
No migration.
Verification
- Old vs new (Rails runner evaluating the removed ERB condition against the new method): 30 cases (everything empty; each of the 29 lists non-empty alone), 0 differences, the same 29 lists on both sides.
- Fail-first: "the index is empty only when no account or connection is listed" failed before the change (no predicate). "index shows the empty state for a family with nothing to list, and not once it has a connection" clears the
emptyfixture family's IBKR, Indexa Capital and SnapTrade connections first, then adds one Brex connection. - Mutations, each caught: drop the Apple Wallet check; drop the manual-accounts check;
any?instead ofall?; ignore connections; negate the view condition. bin/rails test(full): 15,885 runs, 0 failures; 8 errors inReleaseNotesWorkflowTestfromnodemissing in the test image.bin/rubocopanderb_linton changed files: no offenses.bin/brakeman: no warnings.
Blast radius
- Only
AccountsController#indexrendersaccounts/index, after setting every variable the method reads; the item controllers' turbo streams renderaccounts/index/manual_accounts, which does not use the condition. - The generator's "already has" check now matches only the provider's section, which is what it should detect.
- Track A's derived lists are complete with this slice; the
Familyincludes and the/accountsindex sections stay hand-kept until Track B.
Screenshots
Fixture family empty with every connection and account removed, so /accounts shows its empty state. Base is we-promise/sure#5085's head; both render the same empty state, as expected for a change that only moves the condition out of the view.
| Light | Dark | |
|---|---|---|
| Before (we-promise/sure#5085 head) | ![]() | ![]() |
| After (this PR) | ![]() | ![]() |



