Repository navigation
Save the chosen theme to the user's account and apply it on sign-in - #555
Merged
Merged
Conversation
…546) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Closes #546
Finding
The theme picker only wrote to the browser's
localStorage. Nothing saved it to the database, and nothing read theUser.themecolumn back (the column exists and MARKER already reads and writes it). So a theme was per-browser, and MARKER never saw what someone picked in STAPLE. I couldn't find the fix mentioned in the issue ondevor in any branch or PR, so this adds it.What
updateThememutation: saves the theme on the signed-in user's own account (validated against the theme list) and refreshes the session.tooltipsdoes: set at login, updated by the mutation), souseInitializeThemeapplies it on every page without another query. The database copy wins over the browser's, and the browser copy is updated to match, so the theme follows the user to other devices and matches MARKER.src/core/utils/themes.ts(same 30 themes; MARKER's list matches).Things to know
User.themedefaults to"dark", but STAPLE defaulted to light. Anyone who has never picked a theme will see dark after their next sign-in (a theme they picked in MARKER will show up too).Testing
8 new tests: the mutation (saves to the right user, refreshes the session, rejects unknown themes), the load behavior (browser theme first, saved theme wins, follows changes, ignores unknown values), and the picker (saves on change, failure message keeps the theme applied). Typecheck (apart from the existing
getJsonSchema.test.tserrors), lint and the full test suite (86 passed, 2 skipped as before) pass. Not yet checked in a browser, including signing in on a second browser to see the saved theme.🤖 Generated with Claude Code