Skip to content

fix: improve log text contrast in dark mode (#1741)#1793

Merged
UNIkeEN merged 1 commit into
UNIkeEN:mainfrom
zaixiZaixiSJTU:fix/1741-dark-mode-log-contrast
Jun 22, 2026
Merged

fix: improve log text contrast in dark mode (#1741)#1793
UNIkeEN merged 1 commit into
UNIkeEN:mainfrom
zaixiZaixiSJTU:fix/1741-dark-mode-log-contrast

Conversation

@zaixiZaixiSJTU

@zaixiZaixiSJTU zaixiZaixiSJTU commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Use useColorModeValue to switch INFO text from gray.600 to gray.300 and DEBUG text from blue.600 to blue.300 when in dark mode, fixing low contrast readability issues with the game log window.

Checklist

  • Changes have been tested locally and work as expected.
  • All tests in workflows pass successfully.

This PR is a ..

  • 🐞 Bug fix

Related Issues

close #1741

Description

  • Please insert your description here and provide info about the "what" this PR is solving.

Additional Context

image

Summary by Sourcery

Bug Fixes:

  • Fix low contrast INFO and DEBUG log text in the game log when using dark mode by using theme-aware colors.

Use useColorModeValue inside logLevelMap for INFO (gray.600→gray.300)
and DEBUG (blue.600→blue.300) in dark mode, fixing low contrast
readability issues with the game log window.

Co-Authored-By: Claude <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Jun 22, 2026

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

Reviewer's Guide

Adjusts game log INFO/DEBUG text colors to use Chakra UI's useColorModeValue for better contrast in dark mode.

Flow diagram for log level textColor selection with useColorModeValue

flowchart LR
  A[GameLogPage render] --> B[INFO textColor]
  A --> C[DEBUG textColor]

  B --> D{useColorModeValue}
  C --> E{useColorModeValue}

  D -->|light mode| F[gray.600]
  D -->|dark mode| G[gray.300]

  E -->|light mode| H[blue.600]
  E -->|dark mode| I[blue.300]
Loading

File-Level Changes

Change Details Files
Switch INFO and DEBUG log text colors to be color-mode aware for improved dark mode contrast.
  • Replaced static INFO textColor from gray.600 with a color-mode dependent value that is gray.600 in light mode and gray.300 in dark mode
  • Replaced static DEBUG textColor from blue.600 with a color-mode dependent value that is blue.600 in light mode and blue.300 in dark mode
src/pages/standalone/game-log.tsx

Assessment against linked issues

Issue Objective Addressed Explanation
#1741 Increase the contrast/brightness of INFO log text in the game log window when using dark mode so that it remains clearly readable.
#1741 Ensure that normal log text (including other non-error levels like DEBUG) maintains adequate visibility in dark mode for comfortable reading.

Possibly linked issues


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

@github-actions github-actions Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 22, 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.

Hey - I've left some high level feedback:

  • Consider assigning the useColorModeValue results to constants (e.g., const infoTextColor = useColorModeValue(...)) before constructing logLevelStyles to improve readability and make it clearer where hooks are being used.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider assigning the `useColorModeValue` results to constants (e.g., `const infoTextColor = useColorModeValue(...)`) before constructing `logLevelStyles` to improve readability and make it clearer where hooks are being used.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@UNIkeEN
UNIkeEN merged commit e01f37b into UNIkeEN:main Jun 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 日志窗口,深色模式下日志内容对比度较低

2 participants