feat(web): add network switcher#472
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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/configclient +useNetworkConfig()hook and network config types. - Introduce
NetworkBadge(current network) andNetworkSwitcher(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.
SgtPooki
requested changes
Apr 24, 2026
Collaborator
SgtPooki
left a comment
There was a problem hiding this comment.
we should switch network in current tab.. thats the only change I would recommend.
SgtPooki
approved these changes
Apr 27, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #371