Skip to content

sync: dev to extern-contrib#935

Merged
boomzero merged 18 commits intoextern-contribfrom
dev
Mar 14, 2026
Merged

sync: dev to extern-contrib#935
boomzero merged 18 commits intoextern-contribfrom
dev

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 14, 2026

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


Summary by cubic

Sync extern-contrib with dev. Adds an ImageEnlarger modal and fixes the contest Problem Switcher refresh; bumps version to 3.3.2.

  • New Features

    • ImageEnlarger utility with a modal viewer: zoom in/out/reset, drag-to-pan, mouse wheel/touch support, keyboard shortcuts, and save/download.
    • Auto-applies to images (skips gravatar/cravatar) and handles dynamically added images via MutationObserver.
  • Bug Fixes

    • Contest ProblemSwitcher not updating: centralized fetch via GetContestProblemList, cached in localStorage, and added a “刷新” action to refresh the list.

Written for commit 7119f81. Summary will update on new commits.

PythonSmall-Q and others added 18 commits March 7, 2026 09:07
Introduce an ImageEnlarger utility: add a toggle option to the feature list and implement a modal image viewer with CSS, toolbar (zoom in/out, reset, save), keyboard shortcuts, and click-to-open behavior. Images are annotated with a preview class and the feature ignores gravatar/cravatar sources; it applies to existing and dynamically added images via a MutationObserver. Errors are logged and surface a DebugMode alert when enabled.
…rc, and MutationObserver performance

Co-authored-by: PythonSmall-Q <106425289+PythonSmall-Q@users.noreply.github.com>
Co-authored-by: PythonSmall-Q <106425289+PythonSmall-Q@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Shan Wenxiao <seanoj_noreply@yeah.net>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Shan Wenxiao <seanoj_noreply@yeah.net>
Fix ImageEnlarger: accessibility, modal re-entry, responsive images, MutationObserver perf
Co-authored-by: PythonSmall-Q <106425289+PythonSmall-Q@users.noreply.github.com>
Co-authored-by: PythonSmall-Q <106425289+PythonSmall-Q@users.noreply.github.com>
Co-authored-by: PythonSmall-Q <106425289+PythonSmall-Q@users.noreply.github.com>
Fix image viewer: broken pan, missing wheel zoom, download navigates instead of saving
Add ImageEnlarger feature with modal viewer
* Update Update.json

Signed-off-by: Zhu Chenrui <boomzero_zcr@outlook.com>

* Parse release notes from comment block

(cherry picked from commit c7137ff)

* Update bug.yml

Signed-off-by: Zhu Chenrui <boomzero_zcr@outlook.com>
(cherry picked from commit 07d7590)

Update feature.yml

Signed-off-by: Zhu Chenrui <boomzero_zcr@outlook.com>
(cherry picked from commit 1a99430)

Update docs.yml

Signed-off-by: Zhu Chenrui <boomzero_zcr@outlook.com>
(cherry picked from commit 6017bcf)

* Update GitHub Actions workflow to skip bot triggers

Signed-off-by: Shan Wenxiao <seanoj_noreply@yeah.net>

* Prevent UpdateVersion from running if last commit was by github-actions[bot]

This prevents infinite loops where the bot commits version updates,
which triggers the workflow again, causing another commit.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Allow metadata updates on edited PRs after bot version commit

The last-commit-author guard now only exits for non-edited events,
so PR title/body changes still update Update.json metadata even
when the branch tip is a github-actions[bot] commit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Allow metadata updates on edited PRs after bot version commit

Exclude all bot actors (not just github-actions[bot]) from triggering
the UpdateVersion workflow, preventing loops from AI code review bots.
Allow edited events through the script-level guard so PR title/body
changes still update Update.json metadata.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix Problem Switcher Not Update

* Fix Problem Switcher Not Update

* 3.3.2

* Update version info to 3.3.2

* Fix Version List (1.999999.0 -> 1.10.0)

Signed-off-by: zsTree <wa2025666@gmail.com>

* Update time and description of 3.3.2

* Fix Problem Switcher Null Problem

Signed-off-by: zsTree <wa2025666@gmail.com>

* Update time and description of 3.3.2

* Fix XSS bug

Signed-off-by: zsTree <wa2025666@gmail.com>

* Update time and description of 3.3.2

---------

Signed-off-by: Zhu Chenrui <boomzero_zcr@outlook.com>
Signed-off-by: Shan Wenxiao <seanoj_noreply@yeah.net>
Signed-off-by: zsTree <wa2025666@gmail.com>
Co-authored-by: Zhu Chenrui <boomzero_zcr@outlook.com>
Co-authored-by: Shan Wenxiao <seanoj_noreply@yeah.net>
Co-authored-by: boomzero <thomas_rainbowfish@icloud.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

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

Latest commit: 7119f81
Status: ✅  Deploy successful!
Preview URL: https://30cd1e55.xmoj-script-dev-channel.pages.dev

View logs

@boomzero boomzero merged commit 73291e1 into extern-contrib Mar 14, 2026
7 checks passed
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="package.json">

<violation number="1" location="package.json:3">
P2: Don't manually bump `package.json` here. This repo's release workflow updates all versioned files together, and changing only this line can leave `package.json`, `XMOJ.user.js`, and `Update.json` out of sync.</violation>
</file>

<file name="XMOJ.user.js">

<violation number="1" location="XMOJ.user.js:6040">
P2: Prevent the default click action when opening the image modal, or linked images will still navigate away.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

{
"name": "xmoj-script",
"version": "3.3.0",
"version": "3.3.2",
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 14, 2026

Choose a reason for hiding this comment

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

P2: Don't manually bump package.json here. This repo's release workflow updates all versioned files together, and changing only this line can leave package.json, XMOJ.user.js, and Update.json out of sync.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At package.json, line 3:

<comment>Don't manually bump `package.json` here. This repo's release workflow updates all versioned files together, and changing only this line can leave `package.json`, `XMOJ.user.js`, and `Update.json` out of sync.</comment>

<file context>
@@ -1,6 +1,6 @@
 {
   "name": "xmoj-script",
-  "version": "3.3.0",
+  "version": "3.3.2",
   "description": "an improvement script for xmoj.tech",
   "main": "AddonScript.js",
</file context>
Suggested change
"version": "3.3.2",
"version": "3.3.0",
Fix with Cubic

Comment on lines +6040 to +6043
img.addEventListener("click", (e) => {
e.stopPropagation();
OpenImageModal(img);
});
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 14, 2026

Choose a reason for hiding this comment

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

P2: Prevent the default click action when opening the image modal, or linked images will still navigate away.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At XMOJ.user.js, line 6040:

<comment>Prevent the default click action when opening the image modal, or linked images will still navigate away.</comment>

<file context>
@@ -5572,6 +5592,491 @@ int main()
+                        if (!img.title) {
+                            img.title = "点击放大";
+                        }
+                        img.addEventListener("click", (e) => {
+                            e.stopPropagation();
+                            OpenImageModal(img);
</file context>
Suggested change
img.addEventListener("click", (e) => {
e.stopPropagation();
OpenImageModal(img);
});
img.addEventListener("click", (e) => {
e.preventDefault();
e.stopPropagation();
OpenImageModal(img);
});
Fix with Cubic

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.

4 participants