Render the Lunch Flow setup page through AccountSetupComponent

Merged
JA
1d ago
+3145-135

Summary

Provider kit Track B, B7f: Lunch Flow's account setup page (lunchflow_items/setup_accounts, with _subtype_select inlined) renders through ProviderItem::AccountSetupComponent, as Brex's does since B5b. A pure move, proven against snapshots recorded from the old view. The HTML changes only where jaysbeekay/sure#724's DS commit (16badcc9e) restyled the shared page: the account-type hint and the fetch error are now DS::Alerts and the all-linked state is DS::EmptyState. The three snapshots were re-recorded in 72cb0c91f. This completes moving Lunch Flow's views onto the provider kit.

Part of #5003 (Track B, step 7: the Lunch Flow conversion, views; option (c), kit variants and hooks that reproduce each provider's HTML).

Stacked on #5259. Fork pre-flight: jaysbeekay/sure#752 (same branch, same commit; its CI, Gatekeeper review and screenshot history live there).

Before / after

Before (Lunch Flow's own view)After
Setup page105-line view plus 24-line _subtype_selectAccountSetupComponent with defaults: and variant: :classic; the partial goes
Page titlelunchflow_items.setup_accounts.page_titleunchanged: the view keeps its content_for :title
Default account type"Skip" for every accountthe same, as defaults: data from lunchflow_account_setup_defaults
Default depository subtypefrom the name (checking, savings, money market), else nonethe same, from lunchflow_depository_subtype (Brex's falls back to checking; Lunch Flow's doesn't)
Account-type list@account_type_options without "skip"the same expression, passed as displayable_account_type_options:
Hidden subtype selectsstyle="display: none;"the same, from :classic (Brex keeps the hidden class)
Rendered HTMLunchanged (snapshots), except the hint, fetch error and all-linked blocks (DS primitives, from jaysbeekay/sure#724)

What changed

  • ProviderItem::AccountSetupComponent: variant: (:kit by default, :classic), which only decides how each subtype select starts hidden. account_type_selector_controller.js removes both the class and the inline style, so either works on screen.
  • LunchflowItemsHelper: lunchflow_account_setup_defaults and lunchflow_depository_subtype, the logic _subtype_select and the view computed inline.
  • lunchflow_items/setup_accounts keeps its title and ivars and renders the component; lunchflow_items/_subtype_select is deleted (the setup page was its only caller). No locale changes: the placeholder keys the partial read (lunchflow_items.subtype_select.placeholder.*) are the ones the component reads.

Screenshots

The move changes nothing else visible. jaysbeekay/sure#724's DS commit (16badcc9e) restyles three blocks: the account-type hint is an info DS::Alert, the fetch error an error DS::Alert, and the all-linked state a DS::EmptyState (its check icon is now neutral rather than green). Before is the base branch up/lunchflow-kit-select (eb5d5d6c1); after is this head (09b89ee5b). Desktop 1280px; phone at Chrome's 500px minimum window width.

BeforeAfter
Accounts to set up (hint), desktop
Accounts to set up (hint), phone
Fetch error, desktop
Fetch error, phone
All linked, desktop
All linked, phone

Demo data

No demo data needed.

Migration notes

No migration.

Verification

  • Snapshots recorded first: three renders of the old view were written (PROVIDER_ITEM_SNAPSHOTS=write) before anything changed:

    • four accounts: "Everyday Checking", "Joint Savings", "Money Market Reserve" and the fixture's "Test Investment Account", covering each name-based subtype and the no-match case;
    • an API error;
    • every account linked.

    "The Lunch Flow setup page renders through ProviderItem::AccountSetupComponent" failed then (expected exactly once, invoked never), and passes after. Brex's three setup snapshots still match.

  • Snapshot provenance (checked 2026-11-17): this slice's three snapshot tests were run against the old lunchflow_items/setup_accounts on up/lunchflow-kit-select (edcef0002), before this slice.

    • With the snapshots as first recorded (c1c493b91): 3 runs, 0 failures. So the recordings are the old view's output.
    • With the current snapshots: 3 failures. Each differs only in the DS blocks: the hint (old bordered box against an info DS::Alert), the fetch error (old centred text against an error DS::Alert) and the all-linked state (old markup against DS::EmptyState). That is the deliberate DS change re-recorded in 72cb0c91f.
  • Existing tests unedited: LunchflowItemsControllerTest (which renders the setup page) and the Brex setup tests pass.

  • Mutations, each caught (8): the classic selects hidden by class; Brex's hidden by style; Lunch Flow's accounts defaulting to Depository; an unmatched name defaulting to checking; savings not detected; money market not detected; the account-type list keeping "skip"; Lunch Flow rendered without :classic.

  • bin/rails test (full, at this commit): 16,509 runs; the same 8 ReleaseNotesWorkflowTest errors (no node in the test image) and one failure, Settings::HostingsControllerTest#test_can_update_market_data_sync_settings_when_self_hosting_is_enabled ("Expected the market data cron job to be (re)created"), which this change does not touch; that file passes on three reruns (99 runs, 0 failures each), so it is a parallel-run flake.

  • bin/rubocop, erb_lint on the changed files: no offenses. bin/brakeman: no warnings.

  • Size (git diff -C): non-test +43 / -129.

  • Checked against upstream AGENTS.md (blob 1a5dbebd, 2026-11-17): no deviations.

Blast radius

Who else hits these lines, and what do they pass?

  • ProviderItemsController#setup_accounts renders lunchflow_items/setup_accounts with the same ivars as before.
  • AccountSetupComponent is also rendered by Brex's setup page, which passes no variant:; Brex's snapshots pin its output.
  • Siblings: Mercury's setup page moves in its own slice; the other providers keep their templates.

Summary by cubic

Renders Lunch Flow's account setup page through ProviderItem::AccountSetupComponent and deletes the dedicated _subtype_select partial, matching how Brex's setup page works.

  • Adds variant: :classic to AccountSetupComponent so subtype selects hide by inline style instead of the hidden class; the account-type selector clears both.
  • Moves default account type and depository subtype logic into LunchflowItemsHelper as lunchflow_account_setup_defaults and lunchflow_depository_subtype.
  • The account-type hint and fetch error are DS::Alerts, the all-linked state is DS::EmptyState, and the dropdowns are DS::Selects.
  • Snapshot tests cover the three renders; controller tests look up dropdown options by role=option instead of option.