Skip to content

feat(dark-mode): add force dark mode#8

Merged
moonrailgun merged 3 commits into
mainfrom
moonrailgun/force-dark-mode
Jul 7, 2026
Merged

feat(dark-mode): add force dark mode#8
moonrailgun merged 3 commits into
mainfrom
moonrailgun/force-dark-mode

Conversation

@moonrailgun

Copy link
Copy Markdown
Contributor

Background

Dao needs a user-facing control for applying Chromium Auto Dark Mode to websites when the system appearance is already dark, plus a corresponding product highlight on the website.

Changes

  • Adds a persisted dao.force_dark_mode_enabled profile preference and helpers to determine availability, effective state, and web preference application.
  • Integrates force dark mode into Chromium web preferences through a chrome_content_browser_client patch, including preference refresh after navigation.
  • Adds a Control Center utility button for Force Dark Mode, with localized labels/tooltips, disabled behavior in light system mode, selected styling, and a moon icon.
  • Moves the Share action into the Control Center More menu and keeps Little Dao site center free of the Force Dark Mode control.
  • Highlights Force Dark Mode on the website feature grid and adds the moon icon to the website icon set.

Testing

Patch includes browser tests for force dark mode defaults, Control Center placement/toggling, More menu share action, and Little Dao exclusion. Patch also adds a Vitest coverage check for the homepage Force Dark Mode feature highlight.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@moonrailgun, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4ac90e80-4bca-45e9-949f-c367fcd0d2e9

📥 Commits

Reviewing files that changed from the base of the PR and between 3f42a0c and 274d224.

📒 Files selected for processing (17)
  • src/dao/browser/dao_pref_names.cc
  • src/dao/browser/dao_pref_names.h
  • src/dao/browser/strings/dao_strings.grd
  • src/dao/browser/ui/views/dao_browser_browsertest.cc
  • src/dao/browser/ui/views/dao_control_center_more_menu.cc
  • src/dao/browser/ui/views/dao_control_center_more_menu.h
  • src/dao/browser/ui/views/dao_control_center_popup.cc
  • src/dao/browser/ui/views/dao_control_center_popup.h
  • src/dao/browser/ui/views/dao_control_center_utility_section.cc
  • src/dao/browser/ui/views/dao_control_center_utility_section.h
  • src/dao/browser/ui/views/dao_lucide_icons.cc
  • src/dao/browser/ui/views/dao_lucide_icons.h
  • src/patches/chrome/browser/chrome_content_browser_client_force_dark_mode.cc.patch
  • website/components/FeatureGrid.module.css
  • website/components/FeatureGrid.tsx
  • website/components/ui/LucideIcon.tsx
  • website/lib/__tests__/homepage-features.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch moonrailgun/force-dark-mode

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@moonrailgun moonrailgun changed the title feat(dark-mode): 添加强制暗色模式控制 feat(dark-mode): add force dark mode Jul 7, 2026
@moonrailgun moonrailgun merged commit cf79aa2 into main Jul 7, 2026
2 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.

1 participant