Skip to content

Add remote enable/disable of gift card providers via info server#6032

Open
j0ntz wants to merge 2 commits into
developfrom
jon/edgespend-info-config
Open

Add remote enable/disable of gift card providers via info server#6032
j0ntz wants to merge 2 commits into
developfrom
jon/edgespend-info-config

Conversation

@j0ntz

@j0ntz j0ntz commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

Requires edge-info-server to publish the new giftCardInfo rollup field (edge-info-server#154). This GUI PR reads giftCardInfo forward-compatibly, so it is backward compatible and inert against the currently published info server: with no giftCardInfo in the rollup, nothing is disabled. The feature activates once edge-info-server publishes the field and the edge-info-server dependency is bumped.

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Description

Asana task

Adds remote enable/disable of gift card providers, mirroring the existing exchange-plugins (exchangeInfo) pattern.

A new giftCardInfo config is read from the info server rollup and cached in redux (state.ui.giftCardInfo). It carries a generic disablePlugins NestedDisableMap keyed by providerId, so it works for any present or future gift card provider:

  • { phaze: true } disables the entire Phaze provider.
  • { phaze: { "<productId>": true } } disables individual Phaze brands by productId.
  • { bitrefill: true } disables Bitrefill (a webview, so whole-provider only).

The Gift Card Marketplace scene filters disabled Phaze brands out of the grid and gates the Bitrefill option, via isGiftCardBrandDisabled / isGiftCardProviderDisabled helpers. The NestedDisableMap cleaner is reused from ExchangeInfoActions.

Changes:

  • GiftCardInfoActions.ts: asGiftCardInfo cleaner, updateGiftCardInfo() thunk, and gating helpers.
  • GiftCardInfoReducer.ts wired into uiReducer (state.ui.giftCardInfo); UPDATE_GIFT_CARD_INFO action.
  • Services.tsx: dispatch updateGiftCardInfo() in the existing info-server refresher.
  • GiftCardMarketScene.tsx: apply per-brand and per-provider gating.
  • Unit tests for the cleaner and gating helpers.

Note

Low Risk
Backward-compatible when the rollup field is absent; changes only marketplace visibility, not purchase or payment flows.

Overview
Adds remote gift card gating from the info server rollup (giftCardInfo), following the same pattern as exchangeInfo. A new thunk loads and validates disablePlugins into state.ui.giftCardInfo, refreshed on the existing info-server interval in Services.

The marketplace applies that config: Phaze brands are hidden when the whole provider or their productId is disabled; Bitrefill is omitted when the provider is disabled. Category chips and selection are derived from enabled items only, with a fallback to “All” if the current category becomes empty after a refresh.

asNestedDisableMap is exported from ExchangeInfoActions for reuse. Unit tests cover parsing and the provider/brand helper semantics.

Reviewed by Cursor Bugbot for commit a938e1e. Bugbot is set up for automated code reviews on this repo. Configure here.

@j0ntz

j0ntz commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

📸 Test evidence (iOS sim — spendInfo disable map injected to simulate server config)

agent proof 1215731967028387 01 market baseline

agent proof 1215731967028387 01 market baseline

agent proof 1215731967028387 02 market gated

agent proof 1215731967028387 02 market gated

Captured by the agent's in-app test run (build-and-test).

Comment thread src/components/scenes/GiftCardMarketScene.tsx
@j0ntz

j0ntz commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

📸 Test evidence — blanket disable of the entire Phaze provider ({ phaze: true }): all 536 brands removed, only Bitrefill remains

agent proof 1215731967028387 03 phaze disabled

agent proof 1215731967028387 03 phaze disabled

Captured by the agent's in-app test run (build-and-test).

@j0ntz j0ntz force-pushed the jon/edgespend-info-config branch from ed30d64 to 364b5c0 Compare June 16, 2026 18:16

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 364b5c0. Configure here.

Comment thread src/components/scenes/GiftCardMarketScene.tsx
@j0ntz j0ntz force-pushed the jon/edgespend-info-config branch from 364b5c0 to dbc2747 Compare June 16, 2026 18:19
@j0ntz

j0ntz commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

📸 Test evidence — info-server category gating (sim, maestro)

agent proof 1215731967028387 01 giftcard categories baseline

agent proof 1215731967028387 01 giftcard categories baseline

agent proof 1215731967028387 02 giftcard categories apparel disabled

agent proof 1215731967028387 02 giftcard categories apparel disabled

agent proof 1215731967028387 03 giftcard marketplace flow pass

agent proof 1215731967028387 03 giftcard marketplace flow pass

Captured by the agent's in-app test run (build-and-test).

@peachbits peachbits left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot of duplicated functionality here that seems unnecessary. We could just add 'spend' as a key to the exchangeInfo object and avoid the new redux value and info server document entirely.

@peachbits

Copy link
Copy Markdown
Contributor

Also, the term spendInfo is a poor choice since that term is already broadly used across the app

@j0ntz j0ntz changed the title Add remote enable/disable of spend providers via info server Add remote enable/disable of gift card providers via info server Jun 19, 2026
@j0ntz j0ntz force-pushed the jon/edgespend-info-config branch from dbc2747 to 94442cc Compare June 19, 2026 22:38
j0ntz added 2 commits June 19, 2026 16:05
Consume a new spendInfo config from the info server, mirroring the
exchangeInfo pattern. A generic disablePlugins NestedDisableMap keyed by
providerId gates the gift-card market: an entire provider (Phaze or Bitrefill)
or individual Phaze brands by productId can be disabled remotely. Reuses the
NestedDisableMap cleaner from ExchangeInfoActions.
@j0ntz j0ntz force-pushed the jon/edgespend-info-config branch from 94442cc to a938e1e Compare June 19, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants