Skip to content

Conversation

@RoyLee1224
Copy link
Contributor

Fixes: #54204

Root Cause

The UI now supports OS-level color mode detection. When a user relies on their OS settings to switch to dark mode (and has not manually toggled the theme in the UI), the state from the next-themes library is:

  • theme: 'system'
  • resolvedTheme: 'dark'

The previous implementation in RenderedJsonField was checking against the theme property. The check theme === 'dark' would fail, causing the component to incorrectly use a light-mode style, resulting in dark text on a dark background.

Solution

The solution is to consistently use resolvedTheme as the source of truth for the currently displayed theme.

RenderedJsonField.tsx has been updated to use useColorMode.

Additionally, I have confirmed that RenderedJsonField.tsx was the only remaining instance of using the useTheme hook.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Aug 7, 2025
@ashb
Copy link
Member

ashb commented Aug 7, 2025

Could you give before and after screenshots by any chance please?

@RoyLee1224
Copy link
Contributor Author

RoyLee1224 commented Aug 7, 2025

@ashb Sure!

darkmode_before.mp4
darkmode_after.mp4

@jscheffl jscheffl merged commit 04f42ca into apache:main Aug 7, 2025
54 checks passed
@RoyLee1224 RoyLee1224 deleted the darkMode_json branch August 7, 2025 22:36
github-actions bot pushed a commit that referenced this pull request Aug 8, 2025
…54245)

(cherry picked from commit 04f42ca)

Co-authored-by: LI,JHE-CHEN <103923510+RoyLee1224@users.noreply.github.com>
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

Thanks

potiuk pushed a commit that referenced this pull request Aug 10, 2025
…54245) (#54260)

(cherry picked from commit 04f42ca)

Co-authored-by: LI,JHE-CHEN <103923510+RoyLee1224@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Illegible Dag Params in Dark Mode

4 participants