Skip to content

feat(widget): per-tab navigation config and per-tab sdkConfig routing#781

Draft
effie-ms wants to merge 2 commits into
mainfrom
feat/private-tab-mode
Draft

feat(widget): per-tab navigation config and per-tab sdkConfig routing#781
effie-ms wants to merge 2 commits into
mainfrom
feat/private-tab-mode

Conversation

@effie-ms

@effie-ms effie-ms commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Which Linear task is linked to this PR?

N/A

Why was it implemented this way?

Two related changes that let a header navigation tab carry its own widget config.

1. Per-tab config on _navigationTabs. Changed from NavigationTabKey[] to { tabKey, config: Partial<WidgetConfig> }[]. The widget-side preset table (navigationTabsByKey) is removed — each tab's variant/mode/modeOptions (and now any config field) is supplied by the integrator and merged onto the widget config when the tab is active. This keeps tab behaviour out of the widget and in config rather than storing presets on the widget side.

2. Active-tab sdkConfig reaches the SDK client. The per-tab merge happens in NavigationTabsStoreProvider, which previously sat inside StoreProvider — below SDKClientProvider — so a per-tab sdkConfig.apiUrl never reached the client. The provider is relocated above SDKClientProvider (between ThemeProvider and the SDK client), so the merged config (including sdkConfig.apiUrl) drives the client, which recreates on tab switch. A tab can now route all SDK calls to a dedicated backend endpoint purely via config:

_navigationTabs: [
  { tabKey: 'default', config: {} },
  { tabKey: 'private', config: {
      sdkConfig: { apiUrl: '…/private/v1' },
      requiredUI: { toAddress: true },
      useRelayerRoutes: true,
      keyPrefix: 'private', // mandatory: isolates the React Query cache per endpoint
  } },
]

Tab switching is locked while a route is executing (useRouteExecutionIndicator().active) so the SDK client/apiUrl can't be swapped out from under an in-flight execution. I18nProvider/ThemeProvider stay above the relocated provider and keep reading base config, so theme/appearance/languages are not tab-overridable (documented trade-off; not needed here).

Visual showcase (Screenshots or Videos)

N/A

Checklist before requesting a review

  • I have performed a self-review and testing of my code.
  • This pull request is focused and addresses a single problem.
  • If this PR modifies the Widget API or adds new features that require documentation, I have updated the documentation in the public-docs repository.

@changeset-bot

changeset-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: dc8bbac

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@lifi/widget Minor
connectkit Patch
deposit-flow Patch
dynamic Patch
nextjs Patch
nextjs15 Patch
nft-checkout Patch
privy-ethers-example Patch
privy Patch
rainbowkit Patch
reown Patch
svelte Patch
tanstack-router-example Patch
vite-project Patch
vue Patch
zustand-widget-config Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@effie-ms effie-ms changed the base branch from main to feat/amount-input-cards June 12, 2026 15:14
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

E2E Examples — all passed

All examples passed in the latest run.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

E2E Playground results

passed  158 passed

Details

stats  158 tests across 10 suites
duration  2 minutes, 9 seconds
commit  dc8bbac

📥 Download full HTML report (open the run → Artifacts → playwright-report)

@effie-ms effie-ms force-pushed the feat/amount-input-cards branch from 53fa01e to 9f97fb1 Compare June 17, 2026 11:22
@effie-ms effie-ms force-pushed the feat/private-tab-mode branch 2 times, most recently from 572513c to a80d82f Compare June 18, 2026 08:45
@effie-ms effie-ms self-assigned this Jun 18, 2026
@effie-ms effie-ms force-pushed the feat/amount-input-cards branch 2 times, most recently from 9c39a0a to 6ae7bef Compare June 22, 2026 08:27
@effie-ms effie-ms force-pushed the feat/private-tab-mode branch from a80d82f to 65f2d16 Compare June 22, 2026 11:20
@effie-ms effie-ms changed the base branch from feat/amount-input-cards to feat/header-tabs-store June 22, 2026 11:21
Base automatically changed from feat/header-tabs-store to main June 22, 2026 13:18
@effie-ms effie-ms changed the title feat(widget): add private mode requiring send-to-wallet address feat(widget): per-tab navigation config and per-tab sdkConfig routing Jun 22, 2026
@effie-ms effie-ms force-pushed the feat/private-tab-mode branch from 5b24746 to dc8bbac Compare June 22, 2026 15:31
@github-actions

Copy link
Copy Markdown

✅ E2E Dev Smoke — passing

Check Result
Dev server start (pnpm dev) ✅ started
Smoke tests ✅ passed

4 passed · 0 failed · 0 skipped · 21s

View run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant