Skip to content

Invite beta testers into debug mode; keep everyone else out of SuperDebug - #1065

Open
boomzero wants to merge 7 commits into
devfrom
friendly-debug-mode
Open

boomzero wants to merge 7 commits into
devfrom
friendly-debug-mode

Conversation

@boomzero

@boomzero boomzero commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

What does this PR aim to accomplish?:

Make debug mode inviting instead of scary, so we get more beta testers. Debug mode is how users receive pre-releases, and analytics show many users already turn it on anyway. But the setting said "仅供开发者使用", and every error popped up an English "XMOJ-Script internal error!" alert that users report reading as gibberish.

How does this PR accomplish the above?:

  • Settings label: 调试模式(仅供开发者使用) → 调试模式(抢先体验测试版,并在出错时弹窗提示,欢迎开启帮我们找 bug), which says what the option actually does.
  • Error alert (all 73 copies): now in Chinese. It thanks the user for testing, asks them to file a GitHub issue with console logs and reproduction steps, and mentions they can turn debug mode off if the popups annoy them.
  • SuperDebug is the opposite case: it points the script at a local backend (127.0.0.1:8787) and breaks most features, yet users still turn it on and file bug reports about the breakage. So:
    • While it's on, a red banner is pinned to the bottom of every page (attached to <html> so legacy body.innerHTML rewrites can't remove it). It says this is not a bug and has a "关闭本地调试模式" button that turns it off and reloads.
    • Enabling it from settings asks the user to type 我是开发者, and points beta testers to 调试模式 instead.
    • It no longer takes part in cloud sync, in either direction, so one mistaken click can't spread to every device (and a value already in the cloud is ignored).

Does this PR need a documentation update?:

No


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributor's guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against. (dev for XMOJ-Script, master for everything else).
  2. I have commented on my proposed changes within the code.
  3. I have tested my changes.
  4. I am willing to help maintain this change if there are issues with it later.
  5. It is compatible with the GNU General Public License v3.0
  6. I have squashed any insignificant commits. (git rebase)
  7. I have checked that another pull request for this purpose does not exist.
  8. I have considered and confirmed that this submission will be valuable to others.
  9. I accept that this submission may not be used, and the pull request can be closed at the will of the maintainer.
  10. I give this submission freely and claim no ownership to its content.
  11. I have verified that my changes work correctly in all four UI combinations:
    • the script's monochrome UI on XMOJ's new UI (/web pages)
    • the script's monochrome UI on XMOJ's old/classic pages
    • the script's classic UI on XMOJ's new UI (/web pages)
    • the script's classic UI on XMOJ's old/classic pages

⚠️ Item 11 only partly verified. node --check passes, and tests/userscript-harness.cjs ran with {"MonochromeUI":true|false,"DebugMode":true} and {"MonochromeUI":true|false,"SuperDebug":true} with no page errors or dialogs; the screenshots show the SuperDebug banner rendering in both the monochrome and classic UI. However, it ran logged out (no credentials available), so every page redirected to the login page. A human should, logged in, check the new labels and the SuperDebug confirmation on the settings page, and the banner on a /web page before ticking the box below.


  • I have read the above and my PR is ready for review. Check this box to confirm

🤖 Generated with Claude Code

https://claude.ai/code/session_017dqWu3YgeVRGwBt5pXDq4A

Summary by Sourcery

Make DebugMode welcoming for beta testers while clearly isolating and restricting SuperDebug to local development use.

New Features:

  • Make DebugMode a user-friendly opt-in for pre-release testing with Chinese error guidance and feedback instructions.
  • Add a persistent warning and one-click disable action when SuperDebug is enabled.
  • Require explicit developer confirmation before enabling SuperDebug.

Bug Fixes:

  • Prevent SuperDebug from propagating through cloud settings synchronization.

Enhancements:

  • Improve the settings description for DebugMode and isolate local development settings from shared cloud preferences.

Build:

  • Bump the userscript and package versions to 4.0.5.

Debug mode is how users get pre-releases, and analytics show many already
use it, yet its label said developers only and every error popped up an
English alert that users read as gibberish. Say what it does and welcome
testers in the label, and show the error alert in Chinese with a thank-you
and where to report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dqWu3YgeVRGwBt5pXDq4A
@sourcery-ai

sourcery-ai Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Sorry @boomzero, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 16 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@hendragon-bot hendragon-bot Bot added the user-script This issue or pull request is related to the main user script label Oct 7, 2026
@sourcery-ai

sourcery-ai Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This text-only change makes debug mode more approachable for beta testers by updating its settings label and consistently replacing English internal-error alerts with friendly Chinese guidance, without changing runtime behavior.

File-Level Changes

Change Details Files
Reframed debug mode as an inviting beta-testing option in the settings UI.
  • Replaced the developer-only warning with text explaining pre-release access and bug-reporting benefits.
  • Kept the existing setting identifier and behavior unchanged.
XMOJ.user.js
Localized and softened debug-mode internal error alerts while preserving diagnostic guidance.
  • Updated all 73 debug-gated alert copies from English to Chinese.
  • Added thanks for testing, GitHub issue instructions, console-log and reproduction-step guidance, and an option to disable debug mode.
  • Left error logging, alert gating, and underlying recovery behavior unchanged.
XMOJ.user.js

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T14:07:41.519175Z 47b9dbb PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Deploying xmoj-script-dev-channel with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0902fee
Status: ✅  Deploy successful!
Preview URL: https://a07b6639.xmoj-script-dev-channel.pages.dev
Branch Preview URL: https://friendly-debug-mode.xmoj-script-dev-channel.pages.dev

View logs

sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Oct 7, 2026

@sourcery-ai sourcery-ai Bot 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.

Sourcery assessment

Approved.

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread XMOJ.user.js Outdated
@boomzero boomzero changed the title Invite beta testers into debug mode instead of scaring them off Invite beta testers into debug mode; keep everyone else out of SuperDebug Oct 7, 2026
boomzero and others added 2 commits October 7, 2026 22:08
Users still turn on SuperDebug and file bug reports about the features it
breaks. While it is on, show a banner on every page saying the script talks
to a local server, that this is not a bug, with a button to turn it off.
Ask for a typed confirmation before enabling it, and keep it out of cloud
sync so one mistaken click doesn't spread to every device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dqWu3YgeVRGwBt5pXDq4A

@cubic-dev-ai cubic-dev-ai Bot 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.

0 issues found across 3 files (changes from recent commits).

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

View guided diff | Turn on auto-fix | Re-trigger cubic

@sourcery-ai
sourcery-ai Bot dismissed their stale review October 7, 2026 14:10

Sourcery withdrew this approval because the latest commits introduced blocking findings.

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread XMOJ.user.js Outdated
boomzero and others added 2 commits October 7, 2026 22:23
…machine

The debug alert text was copied into 73 catch blocks; move it into a
DebugAlert(e) helper next to SmartAlert so the wording lives in one place.
The SuperDebug banner and prompt said it connects to the developer's
machine, but 127.0.0.1 is the user's own computer; say that instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dqWu3YgeVRGwBt5pXDq4A

@cubic-dev-ai cubic-dev-ai Bot 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.

0 issues found across 2 files (changes from recent commits).

Requires human review: Rewrites debug-mode error alerts and the settings label to recruit beta testers and adds claimed SuperDebug safeguards, but the SuperDebug banner/cloud-sync/confirmation code is in the truncated diff and the copy change expands who runs pre-release builds.

View guided diff | Turn on auto-fix | Re-trigger cubic

@sourcery-ai sourcery-ai Bot 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.

Sourcery assessment

Approved.

This branch has not been deployed

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

Labels

size/L user-script This issue or pull request is related to the main user script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants