Skip to content

feat(web): add network switcher#472

Merged
SgtPooki merged 3 commits into
mainfrom
feat/web/network-switch
Apr 27, 2026
Merged

feat(web): add network switcher#472
SgtPooki merged 3 commits into
mainfrom
feat/web/network-switch

Conversation

@silent-cipher
Copy link
Copy Markdown
Collaborator

closes #371

Copilot AI review requested due to automatic review settings April 23, 2026 19:32
@FilOzzy FilOzzy added this to FOC Apr 23, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Apr 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a UI indicator and switcher to make it clear which Filecoin network a DealBot deployment is monitoring, and provides a way to jump to the sibling deployment for the other network (per #371).

Changes:

  • Add /api/config client + useNetworkConfig() hook and network config types.
  • Introduce NetworkBadge (current network) and NetworkSwitcher (link to other deployment) and wire them into the landing page/header.
  • Extend Vitest/MSW setup to support mocking /api/config, plus small responsive tweaks to header/UI toggle.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
apps/web/tsconfig.json Adds project reference for Vitest tsconfig.
apps/web/tsconfig.app.json Includes test/mocks in app typecheck inputs.
apps/web/test/setup-env.ts Sets runtime config for tests and overrides import.meta.env.
apps/web/test/mocks/handlers/index.ts Registers new MSW handler for /api/config.
apps/web/test/mocks/handlers/config.ts Adds MSW mock response for app config endpoint.
apps/web/src/types/config.ts Introduces Network + AppConfigResponse types.
apps/web/src/api/client.ts Adds fetchAppConfig() for /api/config.
apps/web/src/hooks/useNetworkConfig.ts New hook to fetch/expose monitored network.
apps/web/src/components/shared/Network/constants.ts Defines labels/colors/deployment URLs per network.
apps/web/src/components/shared/Network/NetworkBadge.tsx Renders “Network: …” badge based on config.
apps/web/src/components/shared/Network/NetworkSwitcher.tsx Adds switch action linking to other deployment.
apps/web/src/components/shared/Network/NetworkSwitcher.test.tsx Adds unit tests for switcher behavior.
apps/web/src/components/shared/index.ts Exports new shared network components.
apps/web/src/components/shared/Header/index.tsx Adds the NetworkSwitcher into the header layout.
apps/web/src/pages/Landing.tsx Displays the NetworkBadge on the landing hero.
apps/web/src/components/shared/UIVersionToggle/index.tsx Hides “New UI” label on small screens.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/web/test/setup-env.ts Outdated
Comment thread apps/web/src/hooks/useNetworkConfig.ts
Comment thread apps/web/test/mocks/handlers/config.ts
Comment thread apps/web/src/components/shared/Network/NetworkSwitcher.test.tsx
Comment thread apps/web/src/components/shared/Network/NetworkSwitcher.tsx Outdated
@rjan90 rjan90 requested a review from SgtPooki April 24, 2026 07:30
@rjan90 rjan90 moved this from 📌 Triage to 🔎 Awaiting review in FOC Apr 24, 2026
@rjan90 rjan90 added this to the M4.2: mainnet GA milestone Apr 24, 2026
Copy link
Copy Markdown
Collaborator

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

we should switch network in current tab.. thats the only change I would recommend.

@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to ⌨️ In Progress in FOC Apr 24, 2026
@silent-cipher silent-cipher requested a review from SgtPooki April 24, 2026 14:52
@SgtPooki SgtPooki moved this from ⌨️ In Progress to 🐱 Todo in FOC Apr 24, 2026
@rjan90 rjan90 moved this from 🐱 Todo to 🔎 Awaiting review in FOC Apr 27, 2026
@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC Apr 27, 2026
@SgtPooki SgtPooki merged commit 742c951 into main Apr 27, 2026
7 checks passed
@SgtPooki SgtPooki deleted the feat/web/network-switch branch April 27, 2026 13:00
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

UI: list what network is monitored and provide option to switch

5 participants