Skip to content

fix: adjust dark theme text colors for better readability - #652

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
GongHeng2017:202609091021-master-fix
Sep 9, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
GongHeng2017:202609091021-master-fix

Conversation

@GongHeng2017

@GongHeng2017 GongHeng2017 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Update the article body text color from #C0C6D4 to #FFFFFF and table text color from #6D7C88 to rgba(255,255,255,0.5) in dark theme to improve contrast and readability. Also add OPT_BUILD_UT option to CMakeLists.txt to control unit test build.

调整深色主题下正文文字和表格文字颜色,提升可读性

Log: 调整深色主题下正文和表格文字颜色
PMS: BUG-376465
Influence: 深色主题下正文和表格的文字颜色显示

Summary by Sourcery

Improve dark-theme text readability and make unit-test builds configurable.

Bug Fixes:

  • Improve dark-theme readability by increasing article body text contrast and adjusting table text to a more legible translucent white.

Build:

  • Add an OPT_BUILD_UT CMake option to enable or disable unit-test builds.

@sourcery-ai

sourcery-ai Bot commented Sep 9, 2026

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

Reviewer's Guide

The PR improves dark-theme readability by increasing article and table text contrast in both the editable JavaScript source and bundled distribution output, and adds a CMake option to control whether Debug unit tests are included in the build.

Flow diagram for optional Debug unit-test builds

flowchart TD
    Configure[CMake configuration] --> Opt{OPT_BUILD_UI enabled?}
    Opt -->|No| Skip[Skip tests]
    Opt -->|Yes| Debug{CMAKE_BUILD_TYPE is Debug?}
    Debug -->|Yes| Tests["add_subdirectory(tests)"]
    Debug -->|No| Skip
Loading

File-Level Changes

Change Details Files
Improve dark-theme article and table text contrast by updating the runtime CSS custom-property values in both source and bundled web assets.
  • Set article body text to opaque white.
  • Set table text to 50% white opacity.
  • Keep source and generated/bundled implementations synchronized.
src/web/toManual/js/App.js
src/web_dist/toManual/index.js
Add an opt-in build switch for the test target while retaining the existing Debug-only test behavior.
  • Introduce the OPT_BUILD_UI CMake option, enabled by default.
  • Only add the tests subdirectory when the option is enabled and the build type is Debug.
CMakeLists.txt

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

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="CMakeLists.txt" line_range="10" />
<code_context>
 project(deepin-manual)

 option(DMAN_RELEAE OFF "Install dman resources to system or not")
+option(OPT_BUILD_UI "Build init tests" ON)

 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
</code_context>
<issue_to_address>
**issue (bug_risk):** The new option is named `OPT_BUILD_UI`, but the requested/documented unit-test control is `OPT_BUILD_UT`; passing `-DOPT_BUILD_UT=OFF` therefore has no effect and Debug builds still add the tests subdirectory.

**Triggers:** When a build invokes the intended `OPT_BUILD_UT` CMake option.

**Suggested fix:** Rename the option and its condition to `OPT_BUILD_UT` (and update the help text to describe unit-test builds).
</issue_to_address>

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

Comment thread CMakeLists.txt Outdated
@GongHeng2017
GongHeng2017 force-pushed the 202609091021-master-fix branch from fb84f81 to 26ddc60 Compare September 9, 2026 02:55
Update the article body text color from #C0C6D4 to #FFFFFF and table
text color from #6D7C88 to rgba(255,255,255,0.5) in dark theme to
improve contrast and readability. Also add OPT_BUILD_UT option to
CMakeLists.txt to control unit test build.

调整深色主题下正文文字和表格文字颜色,提升可读性

Log: 调整深色主题下正文和表格文字颜色
PMS: BUG-376465
Influence: 深色主题下正文和表格的文字颜色显示
@GongHeng2017
GongHeng2017 force-pushed the 202609091021-master-fix branch from 26ddc60 to bee57e1 Compare September 9, 2026 02:56
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 98 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 优秀
评分详情 代码变更简单清晰,主要是调整暗色主题文本颜色以提升可读性,以及新增CMake构建选项控制单元测试编译。未发现安全漏洞,各维度均通过审查。代码变更与commit目的完全一致。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: CMake语法正确,嵌套if/endif结构完整;JavaScript setProperty调用语法正确


2. 代码质量 ✅

评价: 优秀 ✅ 通过

潜在问题:

  1. src/web_dist/toManual/index.js:734 - 该文件为Babel转译后的分发版本(使用var App = function (_React$Component)而非class App extends React.Component),需与源文件src/web/toManual/js/App.js手动同步维护,存在维护不一致风险

建议: 建议通过构建工具自动生成分发文件,避免手动同步


3. 代码性能 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: CSS颜色值变更不影响性能,CMake构建选项不影响运行时性能


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: CSS颜色值为静态常量,无用户输入,无注入风险


💡 改进建议代码示例

// 建议在构建流程中自动生成 web_dist 文件
// 例如在 CMakeLists.txt 中添加自定义命令:
// add_custom_command(TARGET App.js POST_BUILD
//     COMMAND npx babel src/web --out-dir src/web_dist
//     COMMENT "Building web distribution files")

本报告由 AI 代码审查工具自动生成

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: GongHeng2017, lzwind

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@GongHeng2017

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot
deepin-bot Bot merged commit 2dc7e46 into linuxdeepin:master Sep 9, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants