feat: add dev environment shutdown warning modal (CPL-245)#280
Conversation
When users visit dashboard.dev.litprotocol.com, show a non-dismissible modal explaining the DEV site has been shut down and directing them to the production dashboard at dashboard.chipotle.litprotocol.com. The warning short-circuits init() so no dashboard logic, API calls, or billing retries execute behind the overlay. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a non-dismissible shutdown warning for the DEV dashboard domain and prevents the dashboard from initializing when the warning is shown, avoiding background API/billing traffic to the shut-down DEV environment.
Changes:
- Add a new
#dev-warning-overlaymodal in the dashboard HTML with production links and support info. - Add
showDevWarning()to detect the DEV hostname and short-circuitinit()when on DEV.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| lit-static/dapps/dashboard/index.html | Adds the DEV shutdown warning overlay modal content. |
| lit-static/dapps/dashboard/app.js | Adds hostname check + early return in init() to stop dashboard initialization on DEV. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function showDevWarning() { | ||
| if (location.hostname === 'dashboard.dev.litprotocol.com') { | ||
| const overlay = document.getElementById('dev-warning-overlay'); | ||
| if (overlay) { | ||
| overlay.classList.add('is-open'); | ||
| overlay.setAttribute('aria-hidden', 'false'); | ||
| } | ||
| return true; | ||
| } | ||
| return false; |
There was a problem hiding this comment.
The dev-warning is only shown when location.hostname exactly equals dashboard.dev.litprotocol.com. This makes the shutdown banner easy to bypass if the same build is reachable via other hostnames (e.g., the Cloudflare Pages default *.pages.dev domain for the lit-static-dev project). Consider switching to an allowlist/denylist approach (e.g., show the warning on a set of known dev hostnames, or only skip the warning on the known production hostname).
| const overlay = document.getElementById('dev-warning-overlay'); | ||
| if (overlay) { | ||
| overlay.classList.add('is-open'); | ||
| overlay.setAttribute('aria-hidden', 'false'); | ||
| } |
There was a problem hiding this comment.
When opening the non-dismissible alertdialog, focus isn’t moved into the dialog (and there’s no focus trap), so keyboard/screen-reader users may remain focused on underlying page controls. Consider mirroring the existing showActionProgress() pattern: store previous focus, focus the dialog (or the primary link/button), and ensure the dialog element is programmatically focusable.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
When users visit
dashboard.dev.litprotocol.com, a non-dismissible warning modal appears explaining that the free DEV site has been shut down. Users are directed to the production dashboard atdashboard.chipotle.litprotocol.comand API atapi.chipotle.litprotocol.com, with links to support channels.The warning short-circuits
init()so no dashboard logic, API calls, or billing retries execute behind the overlay. This prevents background traffic to the shut-down dev API and ensures users can't bypass the warning to use the dashboard.Changes:
#dev-warning-overlaymodal with shutdown message, production links, and support contact infoshowDevWarning()checkslocation.hostnameand returns early frominit()when on the dev domainPre-Landing Review
Pre-Landing Review: 1 issue (1 critical, 0 informational)
AUTO-FIXED:
init()now bails early when dev warning is shown.Adversarial review (Claude + Codex): Both models confirmed the init short-circuit as the key fix. Codex additionally flagged that
lit-static-dev.pages.dev(Cloudflare Pages default domain) could bypass the hostname check if still active.Test plan
dashboard.dev.litprotocol.comdashboard.chipotle.litprotocol.com(production)🤖 Generated with Claude Code