fix(desktop): user's wallpaper pick wins over theme default on login (#1603) - #1670
Conversation
…1603) restoreActiveTheme re-applied the active theme's declared default wallpaper on every boot, overriding a wallpaper the user had picked while on that theme (the wallpaper is persisted separately and restored by useSessionPersistence). That is the 'wallpaper always resets' report. Stop applying the theme default on restore: the persisted pick is authoritative, and a theme's default is already persisted when the theme is selected, so it still survives restore. Drop the now-dead restore branch of applyThemeDefaultWallpaper and update the test to assert the persisted pick wins.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe theme store's wallpaper resolution logic was refactored to always prioritize a remembered per-theme user choice over the theme's declared default wallpaper, removing the restore-specific branch. ChangesTheme Restore Wallpaper Fix
Estimated code review effort: 2 (Simple) | ~12 minutes Sequence Diagram(s)sequenceDiagram
participant App
participant useSessionPersistence
participant restoreActiveTheme
participant themeStore
App->>useSessionPersistence: restore persisted wallpaper (ocean)
App->>restoreActiveTheme: restore theme (indigo)
restoreActiveTheme->>themeStore: set activeThemeId, themeDefaultWallpaper
Note over restoreActiveTheme: skips applying theme default wallpaper
useSessionPersistence->>themeStore: re-apply persisted wallpaper (ocean)
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The fix is small, targeted, and well-reasoned:
Files Reviewed (2 files)
Reviewed by minimax-m3 · Input: 34.4K · Output: 4.1K · Cached: 210.7K |
Addresses the wallpaper half of #1603.
Root cause
The desktop-settings persistence race that caused resets was already fixed (beta.24). The remaining "wallpaper always resets" symptom comes from a second restore path:
restoreActiveThemecalledapplyThemeDefaultWallpaper(..., { restore: true })on every boot, which re-applied the active theme's declared default wallpaper over the user's own pick. The user's chosen wallpaper is persisted separately (PUT /api/desktop/settings) and restored byuseSessionPersistence, so for anyone on a non-default theme that declares a wallpaper, their pick was stomped on every login.Fix
Stop applying the theme default on restore. The persisted wallpaper is authoritative, and a theme's default is already persisted when the theme is selected (so it still survives restore through that persisted value). Removed the now-dead
restorebranch ofapplyThemeDefaultWallpaperand itsoptsparam.This is a deliberate product decision (jaylfc): a user's explicit wallpaper choice should win over a theme's default. The previously-passing test that asserted the old override is updated to assert the pick wins.
Test
restore-theme.test.ts: user's persisted "ocean" survives restore of an Indigo theme declaring "neural-live". Theme-store suites: 20 passed.Takes effect after an SPA rebuild (frontend change).
Summary by CodeRabbit