UI: Implement Dark Mode toggle - #245
Merged
Merged
Conversation
…in-ui feat(web): add robust dark mode toggle and theme test scaffolding
|
@Johnpii1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #153
Description
Update the ThemeToggle component to add dynamic aria-label, aria-pressed, a screen-reader label, explicit icon aria-hidden flags, and a 150ms transition for micro-interactions.
Wire the app theme through Providers by switching defaultTheme to system and adding a persistent storageKey (lance-theme).
Harden RootLayout by adding suppressHydrationWarning and applying semantic theme classes on body (bg-background text-foreground).
Replace and expand globals.css with explicit light/dark CSS variables, focus-visible styling, global transition timing, and a reusable .glass-surface utility; add vitest config and a unit test for the toggle, and add a test script plus test devDependencies in package.json.
Testing
npm run lint (in apps/web) completed successfully after the component refactor.
npm install (in apps/web) failed due to a 403 Forbidden from the registry, preventing installation of test dependencies so tests could not be executed in this environment.
npm run test (in apps/web) could not run because vitest was not available in the runtime (vitest not found) due to the blocked dependency install, but unit test files for ThemeToggle were added and mock the next-themes hook for expected toggle behavior.