Skip to content

Fix dark mode detection when user setting is based on schedule - #9400

Merged
lmac012 merged 1 commit into
developfrom
fix/lukasz/detect-dark-mode-when-schedule-is-enabled
Aug 6, 2026
Merged

Fix dark mode detection when user setting is based on schedule#9400
lmac012 merged 1 commit into
developfrom
fix/lukasz/detect-dark-mode-when-schedule-is-enabled

Conversation

@lmac012

@lmac012 lmac012 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/project/488551667048375/task/1217187293280095?focus=true
Tech Design URL (if applicable):
API Proposals URL(s) (if applicable):

Description

When the app theme is "System default", isDarkThemeEnabled() read the UiModeManager.nightMode setting, which only reports MODE_NIGHT_YES for a manual toggle — a scheduled dark theme (sunset/custom/bedtime) or battery saver reports AUTO/CUSTOM and was treated as light. enableEdgeToEdge() then applied light system bars on a dark UI, making status bar icons black. Now resolves night mode from the configuration's uiMode (isInNightMode()), the same source applyTheme() uses. Same fix applied to the equivalent checks in InitialFeedbackFragment and the internal AppComponentsActivity.

Fixes #9370.

Steps to test this PR

Prerequisites - both should be met by default, but confirm just in case

  • App theme to "System default"
  • edgeToEdge feature flag is enabled

UI elements matching scheduled dark theme

  • Set OS Dark theme → Schedule → custom time covering now, relaunch the app
  • Verify status bar icons are white on the dark UI
  • Navigate to app settings -> send feedback
  • Verify buttons have dark backround

No regression with manual toggle

  • Toggle OS dark theme manually (no schedule) and verify status bar theme is consistent with the rest of the UI.

UI changes

Before After
Screenshot_20260805_134641 Screenshot_20260805_135203

Note

Low Risk
Localized theming and system-bar styling changes with no auth, data, or security impact; behavior should better match OS scheduled dark mode.

Overview
When the app theme is System default, dark/light decisions for edge-to-edge system bars and feedback button assets no longer use UiModeManager.nightMode, which only reflects a manual OS dark toggle and misreports scheduled or battery-saver dark mode as light.

DuckDuckGoActivity.isDarkThemeEnabled(), AppComponentsActivity, and InitialFeedbackFragment now use isInNightMode() (configuration uiMode) for SYSTEM_DEFAULT, aligning with applyTheme() so status bar icon styling and feedback imagery match the actual UI theme.

Reviewed by Cursor Bugbot for commit 89673d2. Bugbot is set up for automated code reviews on this repo. Configure here.

DuckDuckGoActivity.isDarkThemeEnabled() resolved SYSTEM_DEFAULT via the
UiModeManager.nightMode setting, which only reports MODE_NIGHT_YES when
dark theme is toggled on manually. When dark theme is activated by a
schedule (sunset-to-sunrise or custom time, reported as AUTO/CUSTOM) or
by battery saver, the check returned false while the app rendered dark,
so enableEdgeToEdge() applied light system bars and status bar icons
turned black on the dark UI.

Resolve SYSTEM_DEFAULT from the configuration's current uiMode instead
(isInNightMode()), the same source applyTheme() uses, and apply the same
fix to the equivalent checks in InitialFeedbackFragment and the internal
AppComponentsActivity.

Fixes #9370

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@joshliebe joshliebe 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.

Tested, works as expected now. Thanks for fixing it 🙂

@lmac012
lmac012 merged commit c0a9ab6 into develop Aug 6, 2026
37 of 41 checks passed
@lmac012
lmac012 deleted the fix/lukasz/detect-dark-mode-when-schedule-is-enabled branch August 6, 2026 13:36
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.

[Bug] When dark theme is used, status bar icons are black

2 participants