Skip to content

feat: add dev environment shutdown warning modal (CPL-245)#280

Merged
GTC6244 merged 2 commits intomainfrom
feature/cpl-245-warning-screen-for-dev
Apr 13, 2026
Merged

feat: add dev environment shutdown warning modal (CPL-245)#280
GTC6244 merged 2 commits intomainfrom
feature/cpl-245-warning-screen-for-dev

Conversation

@GTC6244
Copy link
Copy Markdown
Contributor

@GTC6244 GTC6244 commented Apr 13, 2026

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 at dashboard.chipotle.litprotocol.com and API at api.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:

  • index.html: New #dev-warning-overlay modal with shutdown message, production links, and support contact info
  • app.js: showDevWarning() checks location.hostname and returns early from init() when on the dev domain

Pre-Landing Review

Pre-Landing Review: 1 issue (1 critical, 0 informational)

AUTO-FIXED:

  • [app.js:1611] Dashboard fully initialized behind warning overlay, enabling background API calls and DevTools bypass. 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

  • Deploy to dev environment and verify modal appears on dashboard.dev.litprotocol.com
  • Verify modal does NOT appear on dashboard.chipotle.litprotocol.com (production)
  • Verify "Go to Production Dashboard" link works
  • Verify no API calls are made when warning is shown (check Network tab)
  • Verify dashboard does not initialize behind the overlay (no sidebar, no tables)

🤖 Generated with Claude Code

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>
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 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-overlay modal in the dashboard HTML with production links and support info.
  • Add showDevWarning() to detect the DEV hostname and short-circuit init() 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.

Comment on lines +1599 to +1608
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;
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
Comment on lines +1601 to +1605
const overlay = document.getElementById('dev-warning-overlay');
if (overlay) {
overlay.classList.add('is-open');
overlay.setAttribute('aria-hidden', 'false');
}
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment thread lit-static/dapps/dashboard/index.html Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@GTC6244 GTC6244 merged commit 54ff846 into main Apr 13, 2026
3 checks passed
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