plane icon indicating copy to clipboard operation
plane copied to clipboard

[WEB-5772] chore: theme switcher code refactor

Open anmolsinghbhatia opened this issue 1 week ago โ€ข 3 comments

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.

anmolsinghbhatia avatar Dec 23 '25 13:12 anmolsinghbhatia

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.

cursor[bot] avatar Dec 23 '25 13:12 cursor[bot]

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.

โค๏ธ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Dec 23 '25 13:12 coderabbitai[bot]

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

makeplane[bot] avatar Dec 23 '25 13:12 makeplane[bot]