add light and dark mode toggle to home page#7430
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
Pull request overview
Adds an (alpha) light/dark mode capability to the Admin UI Home page by introducing a theme-mode context in fidesui, a dark Ant Design theme variant, and wiring a dev-only toggle behind a feature flag.
Changes:
- Introduces
ThemeModeProvider/useThemeModeinfidesuiwith localStorage persistence. - Adds a dark Ant Design theme (
darkAntTheme) and dark-mode CSS variable overrides. - Updates Admin UI Home page layout to Ant components and adds an
alphaDarkMode-gated toggle.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| clients/fidesui/src/index.ts | Re-exports new theme-mode APIs and dark theme helpers from the library entrypoint. |
| clients/fidesui/src/hooks/useThemeMode.tsx | Adds theme-mode context/provider + hook with persistence. |
| clients/fidesui/src/hooks/index.ts | Exposes theme-mode exports at the hooks barrel. |
| clients/fidesui/src/ant-theme/index.ts | Re-exports the new dark theme module. |
| clients/fidesui/src/ant-theme/global.scss | Adds dark-mode CSS variable overrides and additional global html/body styling. |
| clients/fidesui/src/ant-theme/dark-theme.ts | Implements darkAntTheme and a createDarkAntTheme factory. |
| clients/fidesui/src/FidesUIProvider.tsx | Makes Ant theme resolution explicit when antTheme isn’t provided. |
| clients/admin-ui/tailwind.config.js | Enables Tailwind dark: variants via a [data-theme="dark"] selector. |
| clients/admin-ui/src/home/HomeLayout.tsx | Migrates layout from Chakra Flex props to Ant Flex API. |
| clients/admin-ui/src/home/HomeContent.tsx | Migrates grid/layout to Ant Row/Col and spacing styles. |
| clients/admin-ui/src/home/HomeContainer.tsx | Wraps Home in ThemeModeProvider, selects Ant theme based on mode, and conditionally renders the toggle. |
| clients/admin-ui/src/home/HomeBanner.tsx | Updates banner typography components and adjusts background based on theme mode. |
| clients/admin-ui/src/flags.json | Adds alphaDarkMode feature flag configuration. |
| clients/admin-ui/src/features/common/ThemeModeToggle.tsx | Adds a segmented/button-based UI control for switching theme mode. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| <ThemeModeProvider | ||
| defaultMode="light" | ||
| locked={!alphaDarkMode} | ||
| wrapperStyle={{ width: "100%" }} | ||
| > | ||
| <HomeContainerInner /> | ||
| </ThemeModeProvider> |
There was a problem hiding this comment.
The theme will only ever be applied to the child contents of this wrapper. This is a pattern we could use elsewhere to start adding theming in sections, without being blocked by a global migration from Chakra to Ant.
Greptile SummaryThis PR implements dark mode support for the Admin UI Home page by introducing a theme mode system with localStorage persistence. The changes migrate the Home page from Chakra UI to Ant Design components and add a feature-flagged toggle for switching between light and dark themes. Key changes:
Issues found:
Confidence Score: 3/5
Important Files Changed
Last reviewed commit: c1756c3 |
b04eaa9 to
999c068
Compare
gilluminate
left a comment
There was a problem hiding this comment.
Looking good! nice work. ship it!
Ticket ENG-2727
Description Of Changes
Adds support for dark mode, scoped to the home page.
Code Changes
Steps to Confirm
/settings/about/alphaand ensure the theme flag is turned onPre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works