Render the Lunch Flow panel through ProviderItem::PanelComponent
Summary
Provider kit Track B, B7d: Lunch Flow's Settings > Providers panel (settings/providers/_lunchflow_panel) renders through ProviderItem::PanelComponent, as Brex's does since B4b. A pure move: the panel's HTML is unchanged, proven against snapshots recorded from the old partial.
Lunch Flow's panel is a single connection form, not a list of connections, so the kit gains the single-connection panel shape that #670 lists among the declaration fields.
Part of jaysbeekay/sure#670 (Track B, step 7: the Lunch Flow conversion, views; option (c), kit variants that reproduce each provider's HTML). Stacked on the Lunch Flow secret-field fix (jaysbeekay/sure#749) in fork stack #687.
Upstream draft PR: https://github.com/we-promise/sure/pull/5258 (same branch, same commit), in native stack we-promise/sure#5268 on refactor/provider-kit.
Before / after
| Before | After | |
|---|---|---|
| Lunch Flow panel | its own 50-line partial: setup steps, error alert, one form for first_or_initialize | ProviderItem::PanelComponent with the setup steps slot, item: and i18n_scope: |
| Lunch Flow's declaration | panel: true | panel: { shape: :single } |
PanelComponent | list of connections plus an add form | also a single-connection shape: one form that posts a new connection or patches the existing one, no name field, "Save and connect" / "Update connection" |
| Lunch Flow credential fields | inline in the panel | lunchflow_items/_credential_fields (API key with value: nil, base URL, import start date), the partial hook B4b introduced |
| Rendered HTML | unchanged (snapshots) |
What changed
Provider::Base.declares_connection: a panel Hash may setshape:; the panel declaration carries it (omitted when unset, so every other provider's declaration is unchanged, including Brex's exact-hash test).ProviderItem::PanelComponent:item:for the single shape;items:defaults to[]andnew_item:tonil.- The bottom form now reads
form_item/form_url/form_method/form_submit_label. For a list (Brex) these are the new connection, the collection path, POST andadd_connection, exactly as before; for a single connection, the given connection, POST or PATCH by whether it is saved, andsave_and_connect/update_connection. The name field is list-only, andediting:is whether the form's connection is saved. i18n_scope:(default<key>_items.provider_panel), because Lunch Flow's panel messages live undersettings.providers.lunchflow_panel.*. No locale file changes.
settings/providers/_lunchflow_panel: keepserror_message:/@error_messageand still picksCurrent.family.lunchflow_items.first_or_initialize(...), then renders the component.
Screenshots
Rendering unchanged: this PR moves the Lunch Flow panel onto a shared component, and the snapshot tests show the HTML matches the partial's. After only, at this PR's head: Settings > Providers, the Lunch Flow connection from the test fixtures (lunchflow_items(:one)).
| Light | Dark | |
|---|---|---|
| After | ![]() | ![]() |
Demo data
No demo data needed.
Migration notes
No migration.
Verification
- Snapshots recorded first:
lunchflow_panel_without_connection,_with_connection(saved base URL and import start date) and_with_errorwere written from the old partial (PROVIDER_ITEM_SNAPSHOTS=write) before anything changed. "The Lunch Flow panel renders through ProviderItem::PanelComponent" failed then (expected exactly once, invoked never), and passes after. Brex's three panel snapshots still match. - Snapshot provenance (checked 2026-11-17): this slice's three panel snapshot tests were run against the old
settings/providers/_lunchflow_panelonup/lunchflow-secret-field(d980e8ceb), before this slice: 3 runs, 0 failures. So the snapshots are the old partial's output, not the component's. - Existing tests unedited:
LunchflowItemsControllerTest(including #749's tests that the re-rendered panel and the drawer do not echo the key),Settings::ProvidersControllerTestand the Brex panel tests pass. - Mutations, each caught (11): the name field shown on the single form;
editing:always false; the form always POSTing; the form always posting to the collection; the two submit labels swapped;i18n_scopeignored; Lunch Flow declared withoutshape:;declares_connectiondroppingshape:; the API key echoed (caught by #749's controller tests and the snapshots); the import start date's value dropped; Brex's add form handed an existing connection. bin/rails test(full, at this commit): 16,499 runs, 0 failures; the same 8ReleaseNotesWorkflowTesterrors (nonodein the test image). Six further errors in that run were ActiveStorage variant tests failing for want of libvips in a fresh container; after installing it they pass (76 runs, 0 failures) and the slices after this one ran with it.bin/rubocop,erb_linton the changed files: no offenses.bin/brakeman: no warnings.- Size (
git diff -C): non-test +86 / -70. - Checked against upstream AGENTS.md (blob 1a5dbebd, 2026-11-17): no deviations.
Blast radius
Who else hits these lines, and what do they pass?
PanelComponentis rendered by Brex's panel (items:,new_item:, no shape) and now Lunch Flow's (item:,shape: :single). Brex's snapshots pin that its path is unchanged.- The panel declaration is read through
FAMILY_PANELSbybuild_provider_entries(readskey,title,turbo_id,partial,auto_openonly),render_provider_panelandPANEL_SYNCABLE_TYPES; none readsshape, and only Lunch Flow sets it. render_provider_panel("lunchflow", …)and the Bank sync page render the partial with the same locals and the samelunchflow-providers-panelTurbo target.- Siblings: Mercury's panel moves in its own slice; the other providers keep their partials.

