feat: per-user dark mode - #335
Open
duncanmcqueen wants to merge 1 commit into
Open
Conversation
|
|
Adds an appearance preference (Account > Appearance > Dark Mode) that persists on the user profile and applies a dark palette app-wide. - user_profiles gains a dark_mode boolean (default false); schema.sql and a dated migration keep fresh and upgraded installs in agreement. Profile reads tolerate databases missing the column via the existing missing-column fallback, defaulting to light mode. - PATCH /user/profile accepts darkMode (boolean-validated) and the serialized profile exposes it to the client. - The web client applies the preference by toggling the .dark class and color-scheme on the document root whenever the profile loads or the toggle changes. - The .dark palette adds dark values for the app surface tokens, plus override mappings so surfaces built with Tailwind's hardcoded neutral palette (bg-white/*, gray text/borders/divides) participate in the dark theme without page-by-page forks.
duncanmcqueen
force-pushed
the
dark-mode
branch
from
August 14, 2026 03:32
2013ec4 to
f4f538e
Compare
Collaborator
|
@duncanmcqueen @dwmcqueen Hi Duncan it seems like you have two Github accounts - you need to sign the CLA using both thanks! |
Author
|
Ahh! I lost access to the other account. Let me see if Github can fix that. |
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.
Summary
Adds an opt-in dark mode. Users enable it under Settings > Appearance > Dark Mode; the preference persists on the user profile and applies app-wide on subsequent loads.
This branch has been rebased onto current upstream
mainand the toggle is integrated with the new/settingspage andSettingsSection/SettingsTogglecomponents.How it works
dark_mode boolean not null default falsecolumn onuser_profiles, following the existing per-column preference pattern.schema.sqland20260813_02_user_dark_mode.sqlkeep fresh installs and upgraded deployments aligned.PATCH /user/profileaccepts booleandarkMode; serialized profiles expose it. Older databases without the column fall back to light mode until the migration is applied.UserProfileContexttoggles the.darkclass andcolor-schemeon the document root. Toggle changes apply immediately while persistence is in flight; failures restore the previous theme..darkpalette covers semantic app tokens plus legacy hardcoded Tailwind neutral surfaces (bg-white/*, gray text/borders/divides), avoiding page-by-page forks.Tests
theme.test.tscovers applying light and dark root state.UserProfileContext.test.tsxcovers dark -> light -> dark switching and rollback after a failed save.Validation completed:
The local full frontend suite has four pre-existing Node 26/jsdom
Blob.text()failures in untouchedmikeApi.test.ts; upstream CI uses its normal fresh Node 22 environment.Deliberate behavior
prefers-color-schemedetection.