Skip to content

feat(builder): disable mainnet networks on hosted deployments#396

Merged
pasevin merged 4 commits into
mainfrom
feat/disable-hosted-mainnet-networks
Jun 18, 2026
Merged

feat(builder): disable mainnet networks on hosted deployments#396
pasevin merged 4 commits into
mainfrom
feat/disable-hosted-mainnet-networks

Conversation

@pasevin

@pasevin pasevin commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Disable mainnet network selection on hosted UI Builder deployments while keeping networks visible with a self-host notice.
  • Reject deep links and saved configs that target disabled mainnet networks; gate dev mock mainnet seeding behind show_dev_tools.
  • Enable the policy in Docker/CI via VITE_APP_CFG_FEATURE_FLAG_MAINNET_NETWORKS_DISABLED=true.
  • Bump @openzeppelin/ui-* packages to consume the hosted network availability policy (ui-types@3.1.1, ui-components@3.0.1, ui-utils@3.0.1).
  • Sync export adapter versions to latest npm releases and fix adapter patch loading to use node_modules only (avoids Vitest failures when a sibling openzeppelin-adapters checkout is present).

Test plan

  • Hosted build shows mainnet networks as disabled with notice
  • Deep links to mainnet networks are rejected with user-facing message
  • Local dev with show_dev_tools can seed mock mainnet contract UI
  • Export snapshot tests pass
  • pnpm test and typecheck pass in CI

pasevin added 2 commits June 17, 2026 23:16
Show mainnets as disabled with a self-host notice, reject deep links and
saved configs on blocked networks, and bump to published @OpenZeppelin/ui-* packages.
Sync export adapter versions to latest npm releases and refresh snapshots.
Avoid eager sibling openzeppelin-adapters globs that break Vitest when a local
adapters checkout is present.
@pasevin pasevin requested a review from a team as a code owner June 17, 2026 21:23
Reconcile main's pnpm-workspace overrides migration and adapter bumps with
the hosted mainnet network policy changes and ui package updates.

Copilot AI 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.

Pull request overview

Implements a “hosted deployments” policy that prevents selecting mainnet networks while keeping them visible with a self-host notice, and enforces that policy when loading deep links or saved configurations. Also updates UI kit package versions and stabilizes adapter patch loading by only sourcing patches from node_modules.

Changes:

  • Add hosted mainnet-disable UX in network selection UI + reject deep links / saved configs targeting disabled mainnets.
  • Enable the policy in Docker + staging/production GitHub Actions builds via VITE_APP_CFG_FEATURE_FLAG_MAINNET_NETWORKS_DISABLED=true.
  • Bump @openzeppelin/ui-* and react-hook-form versions and simplify adapter patch loading to use node_modules only (plus related export template/version updates).

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm-workspace.yaml Pins/overrides updated UI kit packages and react-hook-form.
pnpm-lock.yaml Lockfile updated to reflect new UI kit + dependency resolutions.
package.json Bumps @openzeppelin/ui-dev-cli to ^0.6.1.
docs/LOCAL_DEVELOPMENT.md Documents local testing for hosted mainnet-disable behavior + updated mode switching guidance.
Dockerfile Adds build arg/env for VITE_APP_CFG_FEATURE_FLAG_MAINNET_NETWORKS_DISABLED.
apps/builder/tsconfig.typecheck.json Forces declaration emit off during typecheck config.
apps/builder/src/export/versions.ts Syncs exported package version map to new UI kit versions.
apps/builder/src/export/templates/typescript-react-vite/package.json Updates export template deps to ui-components/ui-utils ^3.0.1.
apps/builder/src/export/shared/adapterPackageSources.json Updates patch-source descriptions (now primarily node_modules-based).
apps/builder/src/export/assemblers/copyAdapterPatchFiles.ts Removes sibling repo patch loading; reads patches from node_modules/@openzeppelin/adapter-* only.
apps/builder/src/export/assemblers/tests/generateAndAddAppConfig.test.ts Adds assertion that hosted-only flags aren’t included in exported example config.
apps/builder/src/export/tests/snapshots/ExportSnapshotTests.test.ts.snap Updates snapshots for new UI kit dependency versions.
apps/builder/src/dev/seedMockMainnetContractUI.ts Adds dev-only helper to seed a saved mainnet config for hosted-disable testing.
apps/builder/src/components/UIBuilder/StepChainSelection/components/NetworkSelectionPanel.tsx Shows availability notice; disables non-selectable networks; blocks clicks on disabled networks.
apps/builder/src/components/UIBuilder/StepChainSelection/components/NetworkRow.tsx Adds disabled state + label rendering for non-selectable networks.
apps/builder/src/components/UIBuilder/hooks/builder/useBuilderLifecycle.ts Rejects deep links and saved configs targeting disabled networks (with toast + URL cleanup).
apps/builder/src/components/UIBuilder/hooks/builder/tests/useBuilderLifecycle.deeplink.test.ts Adds test coverage for rejecting saved-config load on disabled network.
apps/builder/src/components/Common/DevToolsDropdown.tsx Adds dev-tools action to seed a saved mainnet config.
apps/builder/package.json Bumps UI kit packages and react-hook-form in the builder app.
.github/workflows/docker-stg.yaml Enables hosted mainnet-disable flag in staging docker build args; normalizes quoting.
.github/workflows/docker-prod.yaml Enables hosted mainnet-disable flag in production docker build args; normalizes quoting.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

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

Comment thread apps/builder/src/export/shared/adapterPackageSources.json
Set aria-selected false for disabled network rows, remove stale patch
source description, and add deep-link rejection test for disabled networks.
@pasevin pasevin merged commit 41bf157 into main Jun 18, 2026
13 checks passed
@pasevin pasevin deleted the feat/disable-hosted-mainnet-networks branch June 18, 2026 09:19
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