Render the Brex setup page through ProviderItem::AccountSetupComponent
Summary
Provider kit Track B, B5b: Brex's account setup page (brex_items/setup_accounts, with _subtype_select inlined) renders through a shared ProviderItem::AccountSetupComponent. The move itself leaves the HTML unchanged, checked against snapshots taken before the change. A separate commit then switches the page's hand-built alerts and empty state to DS primitives (see Screenshots). This completes moving Brex's views onto the provider kit.
Part of jaysbeekay/sure#670 (Track B, item 5, second of two slices: B5a selection pages, B5b setup page). Stacked on B5a (jaysbeekay/sure#723) in fork stack #687.
Upstream draft PR: https://github.com/we-promise/sure/pull/5235 (same branch, same commit), in native stack we-promise/sure#5268 on refactor/provider-kit.
What changed
ProviderItem::AccountSetupComponent: the setup dialog moved from the Brex view, including the per-account subtype selects from_subtype_select(its only caller, so the partial goes). Messages come from the provider's existingsetup_accounts.*andsubtype_select.*keys; the form posts tocomplete_account_setup_<key>_item_path.- The provider's account-specific defaults are data:
defaults:maps each provider account to its default account type and depository subtype. Brex computes it in a newbrex_account_setup_defaultshelper, from its existingcard?check anddefault_brex_depository_subtype. brex_items/setup_accountskeeps its title and ivars and renders the component.
Screenshots
The move (first commit) changes nothing visible. The DS commit (16badcc9e) renders the account-type hint as an info DS::Alert, the fetch error as an error DS::Alert and the all-linked state as DS::EmptyState. Before is this branch without that commit; after is with it. 1400px and 390px wide.
| Before | After | |
|---|---|---|
| Setup page, desktop | ![]() | ![]() |
| Setup page, phone | ![]() | ![]() |
| API error, desktop | ![]() | ![]() |
| API error, phone | ![]() | ![]() |
| All linked, desktop | ![]() | ![]() |
| All linked, phone | ![]() | ![]() |
Demo data
No demo data needed: no new records.
Migration notes
No migration.
Verification
-
Snapshots: three renders of the original view, recorded before the change, with the same normalisation as B4:
- a cash and a card account, exercising both default types and both name-based subtypes;
- an API error;
- every account linked.
ProviderItem::AccountSetupComponentTestasserts the view still renders each one, and that it renders through the component; the latter fails without the change (uninitialized constant ProviderItem::AccountSetupComponent). -
Snapshot provenance (re-checked 2026-11-17): the three snapshot tests were run against the old Brex setup view on
up/provider-kit-select, before this slice: 3 runs, 0 failures. -
DS commit (2026-11-17): the three setup snapshots were re-recorded on purpose; each diff is the replaced block only. Lunch Flow's and Mercury's setup snapshots were re-recorded the same way when this merged up (#752, #753).
-
Existing tests unchanged:
BrexItemsControllerTest,BrexItemsProviderKitTestand the helper tests pass unedited. -
Mutations, each caught: every account defaulting to Depository; no default subtype; the submit enabled after an API error or with nothing to set up; the API error hidden; Brex's card default lost; another provider's messages.
-
bin/rails test(full, at the B5b commit): 16,304 runs, 0 failures; the same 8ReleaseNotesWorkflowTesterrors (nonodein the test image). -
bin/rubocop,erb_linton the changed templates andbin/brakeman: no offenses or warnings. -
Diff with copy detection (
git diff -Cagainst B5a): non-test +171 / -120. -
Checked against upstream AGENTS.md (blob 1a5dbebd, 2026-11-17): no deviations.
Blast radius
ProviderItemsController#setup_accountsrendersbrex_items/setup_accountswith the same ivars; unchanged.- Siblings: the other providers' setup pages keep their own templates for now.











