Skip to content

Add reset to default button in theme settings#124

Merged
SamXop123 merged 3 commits into
SamXop123:mainfrom
sohika-sharma20:feat-reset-theme-button
May 30, 2026
Merged

Add reset to default button in theme settings#124
SamXop123 merged 3 commits into
SamXop123:mainfrom
sohika-sharma20:feat-reset-theme-button

Conversation

@sohika-sharma20
Copy link
Copy Markdown
Contributor

@sohika-sharma20 sohika-sharma20 commented May 29, 2026

Summary

Added a "Reset to Default" button in the Theme Properties section of the Settings page.

Changes

  • Added a Reset to Default button below Theme Properties.
  • Connected the button to the existing theme reset functionality.
  • Added a confirmation dialog before resetting.
  • Reloads the UI after reset so default values are immediately reflected.

Issue

Closes #109

Summary by CodeRabbit

  • New Features
    • Added a "Reset to Default" button in the Theme Properties area of Settings.
    • Button prompts for confirmation and then resets the currently active theme back to defaults.
    • After reset the UI automatically refreshes to reflect the restored theme settings.

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

@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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

📝 Walkthrough

Walkthrough

Adds a "Reset to Default" button to Theme Properties that prompts for confirmation, calls window.paralineApp.resetActiveThemeSettings() (IPC: theme-profiles:reset-current), and reloads the page after the main process returns updated renderer settings.

Changes

Theme Reset Feature

Layer / File(s) Summary
Reset button UI and renderer click handler
settings.html, settings.js
Adds a btn-reset-theme button beneath the dynamic theme settings and binds a click handler that confirms, calls window.paralineApp.resetActiveThemeSettings(), and reloads the page.
Preload API and main IPC handler
preload.js, main.js
Adds resetActiveThemeSettings to paralineApp (invokes theme-profiles:reset-current) and implements ipcMain.handle("theme-profiles:reset-current", ...) to reset the currently selected theme profile and return updated renderer settings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

type:feature, type:design

Poem

🐰 A small white button, bright and neat,
Click to mend a theme's misbeat,
It asks politely, then hops away,
Resets the hues, restores the day.
✨ Rabbit cheers — defaults are here to stay!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a reset button to theme settings.
Linked Issues check ✅ Passed All coding requirements from #109 are met: reset button added, active theme only reset implemented, UI updates immediately, and confirmation dialog included.
Out of Scope Changes check ✅ Passed All changes directly support the linked issue objective of adding a reset button for active theme settings. No unrelated or out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
settings.js (1)

517-517: ⚡ Quick win

Missing space after assignment operator.

Minor style issue: const btnResetTheme =document.getElementById should 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

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b62685dd-202a-4939-881c-77eb765480f6

📥 Commits

Reviewing files that changed from the base of the PR and between 7e6a9e1 and 3450c34.

📒 Files selected for processing (2)
  • settings.html
  • settings.js

Comment thread settings.js Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
preload.js (1)

107-111: 💤 Low value

Channel wiring is correct, but the two reset method names are easy to confuse.

resetActiveThemeSettingstheme-profiles:reset-current correctly maps to the scoped (current-theme-only) reset, while resetThemeSettingstheme-profiles:reset maps to resetAllSettings(), which wipes all settings (and also clears isPaused). Given the commit history shows mis-scoping this reset was the prior regression, the near-identical names (resetThemeSettings vs resetActiveThemeSettings) are a future foot-gun. Consider renaming the global one to something like resetAllSettings/resetAllThemeSettings to 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

📥 Commits

Reviewing files that changed from the base of the PR and between 3450c34 and 47bf361.

📒 Files selected for processing (3)
  • main.js
  • preload.js
  • settings.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • settings.js

Copy link
Copy Markdown
Owner

@SamXop123 SamXop123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
paraline Ready Ready Preview, Comment May 30, 2026 11:02am

@SamXop123 SamXop123 merged commit dddd1a8 into SamXop123:main May 30, 2026
6 checks passed
@github-actions
Copy link
Copy Markdown

🎉 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?

  • Keep the momentum going! Feel free to browse through our open Issues and grab another one that interests you!
  • Support the Project: If you enjoyed contributing to Paraline, please take a second to star our repository! It helps increase the project's visibility and supports our community. ⭐

💬 Stay Connected:
Have any questions, want feedback, or just want to discuss further contributions? Feel free to reach out directly to the maintainer on Discord: dot_notsam!

Thank you again, and keep up the amazing work! 💻✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add Reset Theme Settings Button

2 participants