Skip to content

Fix/focus mode numeric string parsing#343

Merged
SamXop123 merged 3 commits into
SamXop123:mainfrom
mayurigade-hub:fix/focus-mode-numeric-string-parsing
Jul 7, 2026
Merged

Fix/focus mode numeric string parsing#343
SamXop123 merged 3 commits into
SamXop123:mainfrom
mayurigade-hub:fix/focus-mode-numeric-string-parsing

Conversation

@mayurigade-hub

Copy link
Copy Markdown
Contributor

Related Issue

Closes #321


Description

Fixed an issue where Focus Mode settings such as dimOpacity, idleTimeout, and transitionDuration were only accepted when stored as numeric values. If these settings were saved as numeric strings (e.g., "0.4" or "20"), they were treated as invalid and reset to their default values.

This fix updates sanitizeFocusMode() to parse numeric strings using Number()/parseFloat() before applying validation and clamping, ensuring valid imported or manually edited settings are preserved.


Changes Made

  • Updated sanitizeFocusMode() to parse numeric string values.
  • Applied clamping after converting string values to numbers.
  • Preserved valid Focus Mode settings imported from backups.
  • Kept existing validation for invalid or non-numeric values.

Steps to Test

  1. Open settings.json.
  2. Set the following values:
    "focusMode": {
      "enabled": true,
      "dimOpacity": "0.4",
      "idleTimeout": "20",
      "transitionDuration": "2.5"
    }
  3. Restart the application.
  4. Open the Focus Mode settings.
  5. Verify the values are loaded as:
    • dimOpacity: 0.4
    • idleTimeout: 20
    • transitionDuration: 2.5
  6. Test with invalid values such as "abc" or "" and verify they fall back to the default values.

Expected Result

  • Valid numeric strings are converted to numbers and retained.
  • Invalid values continue to fall back to defaults.
  • Focus Mode settings remain consistent after importing or editing backups.

Files Changed

  • settingsStore.js

Type of Change

☑️ Bug fix

☐ New feature

☐ Breaking change

☐ Documentation update

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

@mayurigade-hub 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

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 21741984-dc68-4b67-b097-273cd85f7a9f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

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

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.

github.rest.pulls.createComment does not exist in the Octokit API.
PR comments must use github.rest.issues.createComment with issue_number,
since GitHub treats pull requests as issues for commenting purposes.
@mayurigade-hub

Copy link
Copy Markdown
Contributor Author

Hello @SamXop123
Please review this PR.
Thank you!

@SamXop123 SamXop123 merged commit a5f3e9e into SamXop123:main Jul 7, 2026
4 of 5 checks passed
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

🎉 Congratulations @mayurigade-hub! 🎉

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.

[Bug]: Focus Mode Numeric Strings Are Ignored When Loading Settings

2 participants