Skip to content

sync: dev to extern-contrib - #1047

Merged
boomzero merged 55 commits into
extern-contribfrom
dev
Oct 6, 2026
Merged

boomzero merged 55 commits into
extern-contribfrom
dev

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

sync-branches: New code has just landed in dev, so let's bring extern-contrib up to speed!

Summary by Sourcery

Handle missing user badges gracefully and improve code-navigation agent reliability.

New Features:

  • Handle absent database badges as an empty state, allowing administrators to add a new badge while preventing invalid edits or submissions.

Bug Fixes:

  • Improve badge loading behavior when the API reports that a badge does not exist, while preserving handling for genuine failures.

Enhancements:

  • Switch the xmoj-code-navigator agent from Haiku to Sonnet for more reliable code analysis.

Build:

  • Bump the project and userscript versions from 3.8.4 to 3.8.5.

Tests:

  • Add browser regression coverage for missing badges, retries, administrator badge creation, and varied missing-badge response messages.

Summary by cubic

Syncs extern-contrib with dev, bringing in script bug fixes, a reworked user rating, and a full website redesign.

Bug Fixes

  • Treats a badge the API reports as absent as an empty state: admins can add a new badge, tag editing is hidden, and invalid edits or submissions are blocked while genuine failures still show retry.
  • Switches the xmoj-code-navigator agent from haiku to sonnet.
  • Bumps the project and userscript version to 3.8.6 and adds browser regression coverage for missing badge responses.

Rating

  • Replaces the AC-rate rating with a 0–3000 skill-based score computed from a single profile page, with six color tiers and one palette readable on every page and theme.
  • Matches the web contest rank page to the legacy OI rank styling and shows rating colors, avatars, and badges there.
  • Removes ratings cached under the old key from localStorage in a one-time sweep.

Website

  • Rebuilds the site on xmoj-script.uk with shared monochrome CSS and JS, rewritten legal pages, a rebuilt 404, and removal of the dead SSO login tab.
  • Releases no longer deploy the site; Cloudflare Pages' GitHub integration handles it, and the backend submodule is tracked on master with daily Dependabot bumps.

Written for commit 63b7518. Summary will update on new commits.

Review in cubic

boomzero and others added 13 commits October 4, 2026 19:23
- Rewrite index.html: new copy, feature grid, 3-step install with browser
  detection and the Chrome/Edge "allow user scripts" step, FAQ, feedback.
  Drop AdSense, the inline GPL text, and the screenshot carousel.
- Add shared site.css (tokens copied from MonochromeSkinCSS in
  XMOJ.user.js) and site.js (theme toggle, browser detection, live version
  from Update.json).
- Rebuild 404.html in the same style.
- Rewrite privacy/terms/child-protection in plain Chinese based on what
  the script and XMOJ-bbs actually store.
- Remove the dead SSO login tab and its code from messages.html.
- Move links off the dead xmoj-bbs.me domain (site, README, sitemap);
  add the sitemap to robots.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dqWu3YgeVRGwBt5pXDq4A
- New Deploy workflow deploys on every push to master (Cloudflare Pages +
  GitHub Pages) and dev (GitHub Pages). Release/Prerelease now only cut
  releases, so site-only changes no longer wait for a script release.
- Track XMOJ-bbs master in .gitmodules and let Dependabot open daily
  submodule bump PRs against dev.
- Bump backend to 7bd99ac (latest master, includes the session log
  redaction from XMOJ-bbs#72).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dqWu3YgeVRGwBt5pXDq4A
- Replace the CSS mock status card with screenshots of xmoj.tech running
  XMOJ.user.js with MonochromeUI (contest problem page), captured with
  tests/userscript-harness.cjs in light and dark theme. The username in
  the navbar is blurred. The shown image follows the site theme.
- The logo is 317x180; keep its aspect ratio instead of forcing 32x32.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dqWu3YgeVRGwBt5pXDq4A
- Deploy: split Cloudflare Pages and GitHub Pages into separate jobs so a
  Cloudflare failure no longer blocks the GitHub Pages deploy.
- Pin Bootstrap CSS/JS with SRI (sha512 from cdnjs, verified locally).
- 404: resolve assets/links through <base> so the page works under the
  github.io /XMOJ-Script/ project path; don't throw on malformed paths.
- Show the latest stable version from Update.json, not a prerelease.
- Replace the ↗ character (renders as emoji on Apple devices) with a CSS
  arrow that follows the text color.
- Browser picker: toggle buttons with aria-pressed instead of fake tabs.
- Chrome 138+ step covers ScriptCat as well as Tampermonkey.
- Link 短消息在线看 from the main nav and add a homepage section for it.
- Privacy: Clarity is site-wide; state the product is not intended for EU
  residents. Child protection: admins can technically read messages;
  GitHub Issues are public, send identifying details by email.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dqWu3YgeVRGwBt5pXDq4A
Messages are AES-encrypted before storage (XMOJ-bbs Process.ts SendMail),
so admins can't read them without changing server code. Say that, note
it's not end-to-end, and ask reporters to include a screenshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dqWu3YgeVRGwBt5pXDq4A
- Drop Microsoft Clarity from every page: Microsoft says it shouldn't be
  used on sites aimed at under-18s, and most of our users are minors.
- Privacy: replace "以代码为准" with a commitment to keep the page in
  sync; rephrase the EU notice; say third parties do process data
  instead of "不会交给其他人"; add a third-party services table; warn
  that uploaded images are public by link and can't be self-deleted;
  state that unread messages currently have no retention limit.
- Child protection: "不会要求提供…个人照片" instead of "不收集照片";
  extend the personal-info warning to images.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dqWu3YgeVRGwBt5pXDq4A
Haiku twice missed or misreported code during the website/docs work
(e.g. badge editing location, rating thresholds).

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

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

Copy link
Copy Markdown

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

Latest commit: 63b7518
Status: ✅  Deploy successful!
Preview URL: https://bc9be2df.xmoj-script-dev-channel.pages.dev

View logs

@sourcery-ai

sourcery-ai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The sync updates the XMOJ code-navigation agent configuration to use the Sonnet model instead of Haiku, with no other behavioral or source-code changes.

File-Level Changes

Change Details Files
Upgrade the configured model for the XMOJ code-navigation agent.
  • Change the agent model from Haiku to Sonnet to provide stronger code-navigation and retrieval capabilities.
.claude/agents/xmoj-code-navigator.md

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

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

boomzero and others added 7 commits October 5, 2026 19:55
xmoj-script (master → www.xmoj-script.uk) and xmoj-script-dev-channel
(dev → dev./ghpages.xmoj-script.uk) build on every push, including
pushes that don't touch XMOJ.user.js. The workflow only produced
duplicate deployments and a github.io copy nothing links to.

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

fix: restore admin add-tag button for users without tags
@pull-request-size pull-request-size Bot added size/L and removed size/XS labels Oct 5, 2026
@hendragon-bot hendragon-bot Bot added the user-script This issue or pull request is related to the main user script label Oct 5, 2026
@pull-request-size pull-request-size Bot removed the size/L label Oct 5, 2026
github-actions Bot and others added 29 commits October 5, 2026 14:15
/web/contest/<cid>/rank-correct never called GetUsernameHTML, so usernames
had no avatar, rating color or badge, unlike contestrank-oi.php. Vue owns
the rank table and reuses rows when it re-sorts, so hide its link and add a
script-owned copy keyed by username, redrawn only when the row's user changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp
Decode the server's cell colors into tries counts and shaded green/red
backgrounds like contestrank-oi.php, show the rank in a badge instead of the
server's orange cell, render nick and AC count as plain text, stop the
general .well theme rule from boxing problem cells, center cells vertically,
and use the black MonochromeUI header. Vue resets inline colors when it
patches a row, so the observer now also watches style changes and each cell
remembers the color Vue set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp
The rank table's .xmoj-scroll-x wrapper clipped the right columns once tries
counts widened the cells, and macOS hides its scrollbar. Let it overflow into
the page as contestrank-oi.php does. Also drop the MonochromeUI underline,
which is a border-bottom, from the nick and AC count links.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp
The server labels first place "Winner" while contestrank-oi.php shows the
number. Other ranks already arrive as numbers and "*" stays as is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp
The new rating is cached under "-UserRatingV2", which left every old
AC-rate value under "UserScript-User-<name>-UserRating" behind. Delete those
once, guarded by a marker key so localStorage is not rescanned on every page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp
Bootstrap's link-* colors change with theme and hover: the green was too
dark on the dark background and the yellow nearly unreadable on white.
Rating tiers now use their own classes with one palette, tuned for at least
3.4:1 contrast on both backgrounds, injected on legacy pages and in /web.
The yellow tier becomes a vivid orange.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp
Like Bootstrap's link-* hover, darken the tier color by 20% and make the
underline opaque. The shades are fixed, so they match on every page and theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp
The two were only about 30 degrees apart in hue at the same lightness and
read as one color. Red moves toward crimson and orange toward amber, more
than doubling their perceptual distance while staying readable on both
backgrounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp
The amber looked muddy. With red now crimson, the vivid orange stays
clearly distinct from it and has better contrast on white.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp
CalculateUserRating only read p(id, count) script calls, so a profile that
lists solved problems as rendered problem.php links rated 0. Use
GetProfileSolvedProblems, which handles both forms. Per-problem attempt
counts are not used by the rating, so no fallback is needed for them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp
Redesign user rating to reward skill instead of AC rate
@boomzero
boomzero merged commit 06a10f5 into extern-contrib Oct 6, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GitHub-related size/XXL user-script This issue or pull request is related to the main user script website This issue or pull request is related to website related files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant