Render the Lunch Flow card through ProviderItem::CardComponent
Summary
Provider kit Track B, B7c: Lunch Flow's connection card renders ProviderItem::CardComponent, as Brex's does since B4a. A pure move: the card's HTML is unchanged, proven against snapshots recorded from the old partial.
Part of #5003 (Track B, step 7: the Lunch Flow conversion, card).
Stacked on #5248. Fork pre-flight: jaysbeekay/sure#738 (same branch, same commit; its CI, Gatekeeper review and screenshot history live there).
What changed
app/views/lunchflow_items/_lunchflow_item.html.erb: 6 lines (from 129), rendering the component with the accounts page's@lunchflow_sync_stats_map. Lunch Flow passes no count maps; the component then asks the connection, as the partial did.test/components/provider_item/lunchflow_card_component_test.rband sevenlunchflow_card_*.htmlsnapshots: Brex's seven card cases (admin; admin with a linked account; member with accounts; member shown one of two; member with none; scheduled for deletion; sync error), each asserting the partial and the component both render the snapshot.
Screenshots
Rendering unchanged: this PR moves the Lunch Flow card onto a shared component, and the snapshot tests show the HTML matches the partial's. After only, at this PR's head: /accounts, the Lunch Flow connection from the test fixtures (lunchflow_items(:one)) with one linked account, "Everyday (linked)", added for the shot.
| Light | Dark | |
|---|---|---|
| After | ![]() | ![]() |
Demo data
No demo data needed.
Migration notes
No migration.
Verification
- Snapshots recorded first: the seven snapshots were written from the old partial (
PROVIDER_ITEM_SNAPSHOTS=write, partial cases only) before the partial changed. The component matched them then, and both match after. - Existing tests unedited: the accounts controller, views and Lunch Flow controller tests pass.
- Mutation, caught: the card handed every account instead of the viewer's visible ones ("member shown one of two").
bin/rails test(full, at the B7c commit): 16,416 runs, 0 failures; the same 8ReleaseNotesWorkflowTesterrors (nonodein the test image).erb_lint,bin/rubocopon changed files: no offenses.bin/brakeman: no warnings.- Size: non-test +5 / -128.
- Checked against upstream AGENTS.md (blob 1a5dbebd, 2026-11-17): no deviations.
Blast radius
- The partial is rendered by
accounts/indexand byProviderItemsController#complete_account_setup's Turbo stream, both withvisible_accounts:(ProviderItemCardsTestchecks every render site). - The sync-stats map: the accounts page builds it for every Lunch Flow connection it lists, so the component's fallback to the connection's latest sync, used when an item is missing from the map, isn't reached there.
Summary by cubic
The Lunch Flow connection card now renders through the shared ProviderItem::CardComponent, replacing a 129-line partial with a 6-line component call. Rendered HTML is unchanged, proven by seven snapshot pairs recorded from the old partial before it changed.
The component receives the accounts page's sync-stats map when available, otherwise falling back to the connection's latest sync as the partial did.
- A new test file covers seven card cases (admin; admin with linked account; member with accounts; member shown one of two; member with none; scheduled for deletion; sync error), each asserting the partial and component render identical snapshots.
- Three snapshots showing the setup prompt were re-recorded because the shared card's setup prompt now renders through
DS::EmptyState.

