[WEB-5772] chore: theme switcher code refactor
Summary by CodeRabbit
- Bug Fixes
- Theme updates now apply immediately without delay, providing a faster and more responsive user experience when switching themes across the app.
โ๏ธ Tip: You can customize this high-level summary in your review settings.
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on January 20.
To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Walkthrough
Removed a 1.5-second delay before page reload following theme updates across three preference-related files. All instances now call window.location.reload() immediately upon promise resolution instead of using setTimeout.
Changes
| Cohort / File(s) | Summary |
|---|---|
Remove delayed reload after theme update apps/web/app/(all)/profile/appearance/page.tsx, apps/web/ce/components/preferences/theme-switcher.tsx, apps/web/core/components/power-k/config/preferences-commands.ts |
Removed setTimeout(..., 1500) delay before window.location.reload() calls. Page now reloads immediately upon theme update promise resolution. Error handling and toast notifications remain unchanged. |
Estimated code review effort
๐ฏ 2 (Simple) | โฑ๏ธ ~8 minutes
Pre-merge checks and finishing touches
โ Failed checks (2 warnings)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Description check | โ ๏ธ Warning | No pull request description was provided. The description is completely missing, lacking all required template sections including type of change, test scenarios, and references. | Add a detailed PR description using the repository template, including type of change (code refactoring), test scenarios confirming immediate reload works correctly, and any related issue references. |
| Docstring Coverage | โ ๏ธ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
โ Passed checks (1 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | โ Passed | The title clearly describes the main change: removing the delayed reload timeout and making theme updates reload immediately after promise resolution across multiple files. |
โจ Finishing touches
- [ ] ๐ Generate docstrings
๐งช Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
chore-theme-switcher-code-refactor
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 @coderabbitai help to get the list of available commands and usage tips.