yaooqinn opened a new pull request, #54648:
URL: https://github.com/apache/spark/pull/54648

   ### What changes were proposed in this pull request?
   
   Adds dark/light mode toggle to the Spark UI using Bootstrap 5's 
`data-bs-theme` attribute.
   
   **Changes:**
   - Add `data-bs-theme="light"` default on `<html>` element in both 
`headerSparkPage` and `basicSparkPage`
   - Add inline script in `<head>` to set theme from 
localStorage/`prefers-color-scheme` before render (prevents FOUC)
   - Add theme toggle button in navbar (`headerSparkPage`) and header area 
(`basicSparkPage`)
   - Add `initThemeToggle()` and `updateThemeButton()` functions in webui.js 
with sun/moon SVG icons
   - Theme persists across page navigations via localStorage
   
   ### Why are the changes needed?
   
   This builds on the CSS variable migration done in SPARK-55853. With all 
hardcoded colors replaced by BS5 CSS custom properties and custom `--spark-*` 
variables (with `[data-bs-theme="dark"]` variants already defined), the only 
missing piece is a toggle mechanism. This PR adds that toggle, enabling users 
to switch between light and dark themes.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. A theme toggle button (sun/moon icon) appears in the navbar. Users can 
click it to switch between light and dark mode. The preference is saved in 
localStorage and respects the OS-level `prefers-color-scheme` setting as the 
initial default.
   
   ### How was this patch tested?
   
   - Existing `UIUtilsSuite` tests pass (8/8)
   - `./dev/scalastyle` passes
   - `./dev/lint-js` passes
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Yes, GitHub Copilot was used as a co-author.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to