Skip to content

Gate debug control UI behind runtime env flag#2

Merged
becktothefuture merged 1 commit into
mainfrom
codex/add-debug-ui-flag-and-guards
Apr 19, 2026
Merged

Gate debug control UI behind runtime env flag#2
becktothefuture merged 1 commit into
mainfrom
codex/add-debug-ui-flag-and-guards

Conversation

@becktothefuture
Copy link
Copy Markdown
Owner

Motivation

  • Prevent debug-only controls and routes from appearing in production by gating them behind a runtime toggle.
  • Give developers an easy way to re-enable the controls locally for debugging without changing code or shipping debug affordances to users.

Description

  • Added a runtime flag isDebugUIEnabled in src/App.jsx using import.meta.env.DEV || import.meta.env.VITE_ENABLE_DEBUG_UI === 'true' and used it when initializing and reading app view state.
  • Guarded all control entry points so they are no-ops or hidden when the flag is false: the floating launcher, inline control dock, external portal mount, / key handler, and the quick navigation actions between Depth Lab and Typography Lab.
  • Hardened routing so readAppView and runtime view changes ignore debug-only views when debug UI is disabled, and the app will force the view back to home if needed.
  • Added a root attribute sync (document.documentElement.dataset.debugUi) and a CSS safety net in src/styles.css that keeps .eli5-control-launcher and .eli5-control-dock hidden unless html[data-debug-ui='true'] is set.
  • Added docs/development.md documenting the env switch and the local command to enable debug UI (VITE_ENABLE_DEBUG_UI=true).

Testing

  • Ran a production build with npm run build and it completed successfully.

Codex Task

@becktothefuture becktothefuture merged commit 76ec9a0 into main Apr 19, 2026
2 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c1f85c3c41

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/styles.css
Comment on lines +264 to 268
display: none;
}

html[data-debug-ui='true'] .eli5-control-dock {
width: min(390px, calc(100vw - 24px));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Re-enable control dock when debug UI is active

This change hides .eli5-control-dock by default, but the debug override only restores width and never restores display, so the inline dock remains invisible even when debug UI is enabled. In practice, that breaks the fallback path where controls should appear in-page (for example when the popup window cannot open), leaving debug controls inaccessible in dev/debug sessions.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant