Conversation
Clear inline background/color styles from XMOJ server on header and data rows so Bootstrap dark theme applies correctly. Force black background with white text on all header cells including problem letter links. Also fix rgb -> rgba for solved cell background alpha channel, and add missing text color styling for contestrank-correct.php cells. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix contest ranking table styling for dark mode
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>
The WebSocket handler called CreateAndShowBBSMentionToast and CreateAndShowMailMentionToast unconditionally, ignoring the user's BBSPopup/MessagePopup toggle. This made behavior differ from the polling fallback, which already checks UtilityEnabled() per type. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gate WebSocket toast notifications by per-feature popup settings
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>
Reviewer's GuideRelease 3.2.2 bumps the script/package versions and applies two behavior changes: dark-mode-safe contest ranking table styling on OI/correct ranking pages, and WebSocket notification handling that respects per-feature popup toggles, plus a safer auto-version-bump workflow that avoids infinite loops and supports edited PR events. Sequence diagram for WebSocket notification handling with popup gatingsequenceDiagram
participant WSClient as WebSocketClient
participant Server as WebSocketServer
participant Handler as NotificationHandler
participant Settings as SettingsStore
participant UI as ToastUI
Server->>WSClient: bbs_mention message (data)
WSClient->>Handler: HandleNotificationMessage(event)
Handler->>Settings: UtilityEnabled(BBSPopup)
Settings-->>Handler: true_or_false
alt BBSPopup_enabled
Handler->>UI: CreateAndShowBBSMentionToast(data)
else BBSPopup_disabled
Handler-->>UI: No_call_suppress_BBS_toast
end
Server->>WSClient: mail_mention message (data)
WSClient->>Handler: HandleNotificationMessage(event)
Handler->>Settings: UtilityEnabled(MessagePopup)
Settings-->>Handler: true_or_false
alt MessagePopup_enabled
Handler->>UI: CreateAndShowMailMentionToast(data)
else MessagePopup_disabled
Handler-->>UI: No_call_suppress_mail_toast
end
Flow diagram for contest ranking table dark mode styling logicflowchart TD
A[Detect_ranking_page_and_load_rank_table] --> B[Select_header_cells_querySelectorAll_rank_thead_tr_star]
B --> C[Set_header_texts_to_rank_user_nickname_ac_score]
C --> D[For_each_header_cell_remove_bgcolor_and_force_black_background_and_white_text]
D --> E[For_each_header_cell_force_link_color_white]
E --> F[Fetch_current_page_HTML_for_refresh]
F --> G[Parse_document_and_select_rank_table_rows]
G --> H[For_each_data_row_clear_row_background_color]
H --> I[Set_first_cell_medal_span_and_adjust_medal_color]
I --> J[Normalize_username_and_nickname_cells]
J --> K[For_each_of_first_five_cells_clear_background_and_text_color]
K --> L[For_each_problem_cell_from_index_5_compute_status_and_error_count]
L --> M[Set_problem_cell_background_color_with_rgba_green_for_solved_and_other_colors_for_status]
M --> N[Set_problem_cell_text_color_white_if_DarkMode_else_black]
N --> O[Replace_rank_table_body_with_processed_rows]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The contest rank header styling logic is duplicated for both OI and correction views; consider extracting the common header update/styling into a shared helper to reduce repetition and keep future changes in one place.
- In the rank table loops you frequently hard-code indices like
HeaderCells[0..4]andfor (let j = 0; j < 5 && j < Temp[i].cells.length; j++); using the actuallengthof the header/cells (or a derived constant) would make this code more resilient to future column layout changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The contest rank header styling logic is duplicated for both OI and correction views; consider extracting the common header update/styling into a shared helper to reduce repetition and keep future changes in one place.
- In the rank table loops you frequently hard-code indices like `HeaderCells[0..4]` and `for (let j = 0; j < 5 && j < Temp[i].cells.length; j++)`; using the actual `length` of the header/cells (or a derived constant) would make this code more resilient to future column layout changes.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
wtf |
Update to release 3.3.0
There was a problem hiding this comment.
3 issues found across 5 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="Update/UpdateVersion.js">
<violation number="1" location="Update/UpdateVersion.js:18">
P2: The new skip condition contradicts the comment and still blocks non-"edited" actions like `opened`/`reopened`. If the intent is to skip only on push-triggered `synchronize` events, this should explicitly check for `synchronize` instead of `!== "edited"` so metadata updates aren’t skipped for other actions.</violation>
</file>
<file name="package.json">
<violation number="1" location="package.json:3">
P2: Manual version bump in package.json violates the automated versioning workflow and risks desynchronizing versions. Revert the manual change and let UpdateVersion.js handle version updates.</violation>
</file>
<file name="Update.json">
<violation number="1" location="Update.json:3391">
P2: Production releases should set "Prerelease" to false. This entry marks 3.2.2 as a prerelease, which will mislabel the production release.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| console.log("Last commit author: " + lastCommitAuthor); | ||
| if (lastCommitAuthor === "github-actions[bot]") { | ||
| console.log("Event action : " + eventAction); | ||
| if (lastCommitAuthor === "github-actions[bot]" && eventAction !== "edited") { |
There was a problem hiding this comment.
P2: The new skip condition contradicts the comment and still blocks non-"edited" actions like opened/reopened. If the intent is to skip only on push-triggered synchronize events, this should explicitly check for synchronize instead of !== "edited" so metadata updates aren’t skipped for other actions.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Update/UpdateVersion.js, line 18:
<comment>The new skip condition contradicts the comment and still blocks non-"edited" actions like `opened`/`reopened`. If the intent is to skip only on push-triggered `synchronize` events, this should explicitly check for `synchronize` instead of `!== "edited"` so metadata updates aren’t skipped for other actions.</comment>
<file context>
@@ -8,9 +8,14 @@ execSync("gh pr checkout " + PRNumber);
console.log("Last commit author: " + lastCommitAuthor);
-if (lastCommitAuthor === "github-actions[bot]") {
+console.log("Event action : " + eventAction);
+if (lastCommitAuthor === "github-actions[bot]" && eventAction !== "edited") {
console.log("Last commit was made by github-actions[bot]. Skipping to prevent infinite loop.");
process.exit(0);
</file context>
| if (lastCommitAuthor === "github-actions[bot]" && eventAction !== "edited") { | |
| if (lastCommitAuthor === "github-actions[bot]" && eventAction === "synchronize") { |
package.json
Outdated
| { | ||
| "name": "xmoj-script", | ||
| "version": "3.2.0", | ||
| "version": "3.2.2", |
There was a problem hiding this comment.
P2: Manual version bump in package.json violates the automated versioning workflow and risks desynchronizing versions. Revert the manual change and let UpdateVersion.js handle version updates.
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>Manual version bump in package.json violates the automated versioning workflow and risks desynchronizing versions. Revert the manual change and let UpdateVersion.js handle version updates.</comment>
<file context>
@@ -1,6 +1,6 @@
{
"name": "xmoj-script",
- "version": "3.2.0",
+ "version": "3.2.2",
"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
</file context>
| }, | ||
| "3.2.1": { | ||
| "UpdateDate": 1771740586846, | ||
| "Prerelease": true, |
There was a problem hiding this comment.
P2: Production releases should set "Prerelease" to false. This entry marks 3.2.2 as a prerelease, which will mislabel the production release.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Update.json, line 3391:
<comment>Production releases should set "Prerelease" to false. This entry marks 3.2.2 as a prerelease, which will mislabel the production release.</comment>
<file context>
@@ -3385,6 +3385,28 @@
+ },
+ "3.2.1": {
+ "UpdateDate": 1771740586846,
+ "Prerelease": true,
+ "UpdateContents": [
+ {
</file context>
| "Prerelease": true, | |
| "Prerelease": false, |
What does this PR aim to accomplish?:
Release version 3.2.2 to production. This release includes two bug fixes:
contestrank-oi.phpandcontestrank-correct.phpnow display with proper colors in dark mode.BBSPopupandMessagePopup), instead of always showing.How does this PR accomplish the above?:
Merges the
devbranch (containing PRs #916 and #919) intomasterto trigger a production release.By submitting this pull request, I confirm the following:
git rebase)