Skip to content

explorer: hide testnet network while it's temporarily offline (#0340)#2

Merged
trevormil merged 1 commit intomasterfrom
feat/testnet-offline-hide
Apr 25, 2026
Merged

explorer: hide testnet network while it's temporarily offline (#0340)#2
trevormil merged 1 commit intomasterfrom
feat/testnet-offline-hide

Conversation

@trevormil
Copy link
Copy Markdown
Collaborator

Summary

  • BitBadges testnet is being temporarily shut down to save infra costs. Once it goes offline, the testnet entry would otherwise show "disconnected" forever in the network dropdown.
  • The deployed Ping.pub UI auto-discovers chains via import.meta.glob('../../chains/mainnet/*.json') in src/stores/useDashboard.ts. Moving bitbadges-testnet.json out of chains/mainnet/ is enough to hide the network from the switcher.
  • The chain config is preserved at chains/disabled/bitbadges-testnet.json (via git mv, history preserved) so reviving testnet later is just a git mv back.

Notes

  • The runtime hostname check in useDashboard.ts (window.location.hostname.search('testnet') > -1) is intentionally left alone — it's not the user-visible network switcher, and removing the chain config file is enough to hide the network from the dropdown. Touching useDashboard.ts risks breaking the testnet host detection logic for when the testnet host eventually comes back.
  • No code changes — only a file move.

Tracked as ticket ping-pub#340 in the autopilot repo.

Test plan

  • Build the deployed Vue app locally: npm run build-only and confirm no build errors
  • Run dev server and confirm bitbadges-testnet no longer appears in the network dropdown
  • Confirm bitbadges-mainnet still works normally
  • After merge + deploy, verify https://explorer.bitbadges.io shows only mainnet in the switcher
  • When testnet returns: git mv chains/disabled/bitbadges-testnet.json chains/mainnet/bitbadges-testnet.json and redeploy

🤖 Generated with Claude Code

Testnet is being temporarily shut down to save infra costs. The deployed
Ping.pub-based explorer auto-discovers chains via
`import.meta.glob('../../chains/mainnet/*.json')` in
`src/stores/useDashboard.ts`, so any file under `chains/mainnet/` shows
up in the network dropdown.

Move `bitbadges-testnet.json` out of `chains/mainnet/` and into a new
`chains/disabled/` directory so the testnet entry stops appearing in
the UI once testnet goes offline. Reviving testnet later is a one-line
`git mv` back.

The runtime hostname check in `useDashboard.ts`
(`window.location.hostname.search('testnet') > -1`) is intentionally
left alone — it's not the user-visible network switcher, and removing
the chain config file is enough to hide the network from the dropdown.

Tracked as ticket ping-pub#340 in the autopilot repo.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@trevormil trevormil merged commit 79c554b into master Apr 25, 2026
1 check passed
@trevormil trevormil deleted the feat/testnet-offline-hide branch April 25, 2026 12:29
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.

1 participant