Add reset to default button in theme settings#124
Conversation
|
@sohika-sharma20 is attempting to deploy a commit to the Dot_NotSam's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughAdds a "Reset to Default" button to Theme Properties that prompts for confirmation, calls ChangesTheme Reset Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
settings.js (1)
517-517: ⚡ Quick winMissing space after assignment operator.
Minor style issue:
const btnResetTheme =document.getElementByIdshould have a space after=.✨ Proposed fix
- const btnResetTheme =document.getElementById('btn-reset-theme'); + const btnResetTheme = document.getElementById('btn-reset-theme');🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@settings.js` at line 517, The declaration for btnResetTheme has a missing space after the assignment operator; in the line using const btnResetTheme =document.getElementById('btn-reset-theme'), add a space after '=' so it reads const btnResetTheme = document.getElementById('btn-reset-theme') to follow code style conventions and match surrounding spacing for the btnResetTheme variable and getElementById call.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@settings.js`:
- Around line 517-525: The reset button currently calls
window.paralineApp.resetThemeSettings(), which triggers the IPC channel
'theme-profiles:reset' and ultimately runs resetAllSettings() (overwriting
selectedTheme and every theme block); change the button handler to call a new or
existing IPC that only resets the active theme—for example expose and call
window.paralineApp.resetCurrentThemeSettings() (or add a dedicated
'theme-profiles:reset-current' IPC routed to resetCurrentThemeSettings());
update the click confirmation text(s) for both the Settings and Advanced reset
buttons so they accurately say “Reset current/selected theme settings to
default?” (or consolidate duplicate UI into one control) and ensure no call path
reaches resetAllSettings() from these buttons.
---
Nitpick comments:
In `@settings.js`:
- Line 517: The declaration for btnResetTheme has a missing space after the
assignment operator; in the line using const btnResetTheme
=document.getElementById('btn-reset-theme'), add a space after '=' so it reads
const btnResetTheme = document.getElementById('btn-reset-theme') to follow code
style conventions and match surrounding spacing for the btnResetTheme variable
and getElementById call.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
…to prevent functional regression
There was a problem hiding this comment.
🧹 Nitpick comments (1)
preload.js (1)
107-111: 💤 Low valueChannel wiring is correct, but the two reset method names are easy to confuse.
resetActiveThemeSettings→theme-profiles:reset-currentcorrectly maps to the scoped (current-theme-only) reset, whileresetThemeSettings→theme-profiles:resetmaps toresetAllSettings(), which wipes all settings (and also clearsisPaused). Given the commit history shows mis-scoping this reset was the prior regression, the near-identical names (resetThemeSettingsvsresetActiveThemeSettings) are a future foot-gun. Consider renaming the global one to something likeresetAllSettings/resetAllThemeSettingsto make the broad-vs-scoped distinction obvious at call sites.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@preload.js` around lines 107 - 111, The exported API uses two nearly identical names—resetThemeSettings (mapped to "theme-profiles:reset" which clears all settings) and resetActiveThemeSettings (mapped to "theme-profiles:reset-current")—which is a likely foot-gun; rename the global one (resetThemeSettings) to a clearer name such as resetAllThemeSettings or resetAllSettings, update its reference in the export/object in preload.js, and update all call sites to use the new symbol while keeping the underlying ipc channel ("theme-profiles:reset") unchanged so scoped vs global resets are unambiguous; ensure resetActiveThemeSettings and its "theme-profiles:reset-current" mapping are left intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@preload.js`:
- Around line 107-111: The exported API uses two nearly identical
names—resetThemeSettings (mapped to "theme-profiles:reset" which clears all
settings) and resetActiveThemeSettings (mapped to
"theme-profiles:reset-current")—which is a likely foot-gun; rename the global
one (resetThemeSettings) to a clearer name such as resetAllThemeSettings or
resetAllSettings, update its reference in the export/object in preload.js, and
update all call sites to use the new symbol while keeping the underlying ipc
channel ("theme-profiles:reset") unchanged so scoped vs global resets are
unambiguous; ensure resetActiveThemeSettings and its
"theme-profiles:reset-current" mapping are left intact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1755bd21-dd85-48ec-9465-96bfef780c10
📒 Files selected for processing (3)
main.jspreload.jssettings.js
🚧 Files skipped from review as they are similar to previous changes (1)
- settings.js
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🎉 Congratulations @sohika-sharma20! 🎉 Your pull request has been successfully merged into Paraline! Thank you so much for your valuable contribution and effort. Every single improvement helps make Paraline a better desktop experience for everyone! 🙌 🚀 What's Next?
💬 Stay Connected: Thank you again, and keep up the amazing work! 💻✨ |
Summary
Added a "Reset to Default" button in the Theme Properties section of the Settings page.
Changes
Issue
Closes #109
Summary by CodeRabbit