Skip to content

Fix contest ranking table styling for dark mode#916

Merged
boomzero merged 3 commits intodevfrom
fix/contestrank-dark-mode
Feb 22, 2026
Merged

Fix contest ranking table styling for dark mode#916
boomzero merged 3 commits intodevfrom
fix/contestrank-dark-mode

Conversation

@boomzero
Copy link
Member

@boomzero boomzero commented Feb 22, 2026

Purpose

Fix broken styling on contest ranking pages (contestrank-oi.php and contestrank-correct.php) where XMOJ server inline styles caused white/light backgrounds and unreadable text in dark mode.

Implementation

Changelog

  • Header row: Force black background with white text on all header cells (including problem letter <a> links), removing bgcolor attributes and using !important to prevent Bootstrap overrides
  • Data rows (cells 0-4): Clear inline backgroundColor and color from the XMOJ server so Bootstrap's dark theme applies correctly
  • Data rows (row element): Clear inline backgroundColor on <tr> elements
  • OI ranking solved cells: Fix rgb()rgba() for background with alpha channel
  • Correct ranking score cells: Add missing style.color for dark mode text visibility

Confirmation

  • I have read the contributor's guide and I'm making this PR to the dev branch.

  • I have added code comments (if necessary) and tested my changes.

  • I am willing to maintain this change in the future.

  • This submission is compatible with GPL v3.0.

  • I have squashed all insignificant commits.

  • There is no existing duplicate PR for this.

  • I believe this change may be valuable to others.

  • I accept that this submission may not be used and the PR may be closed.

  • I surrender all ownership claims to the code submitted.

  • I have read everything above and my PR is ready for review.

🤖 Generated with Claude Code


Summary by cubic

Fixes dark mode styling for contest ranking tables by removing conflicting inline colors and enforcing readable header styles. Improves readability on both OI and Correct ranking pages.

  • Bug Fixes
    • Strip server inline colors from the header, first five columns, and rows so the Bootstrap dark theme applies.
    • Enforce a black header with white text and links on both pages, including after refresh.
    • Use rgba for solved-cell backgrounds and set Correct ranking cell text color based on theme (white in dark, black in light).
    • Bump version to 3.2.1 and add Update.json release notes entry.

Written for commit ba94e6f. Summary will update on new commits.

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>
@hendragon-bot hendragon-bot bot added the user-script This issue or pull request is related to the main user script label Feb 22, 2026
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.

No issues found across 1 file

@boomzero boomzero merged commit caf1ee0 into dev Feb 22, 2026
5 checks passed
@boomzero boomzero deleted the fix/contestrank-dark-mode branch February 22, 2026 06:11
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.

1 issue found across 3 files (changes from recent commits).

Prompt for AI agents (all 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: Manual version bump in package.json conflicts with the automated versioning workflow; this should be handled by UpdateVersion.js instead of editing by hand.</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.2.0",
"version": "3.2.1",
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 22, 2026

Choose a reason for hiding this comment

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

P2: Manual version bump in package.json conflicts with the automated versioning workflow; this should be handled by UpdateVersion.js instead of editing by hand.

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 conflicts with the automated versioning workflow; this should be handled by UpdateVersion.js instead of editing by hand.</comment>

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

@boomzero boomzero mentioned this pull request Feb 27, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M 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.

1 participant