feat: Add smooth animated opacity transition for Focus Mode#297
Conversation
|
@bhavyasanthoshi02 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. |
|
Warning Review limit reached
More reviews will be available in 58 minutes and 52 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds a ChangesFocus Mode Fade Duration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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: 4
🤖 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.html`:
- Around line 556-557: The Focus Mode switch markup is left open, causing the
DOM to spill into later sections. Update the Focus Mode block around the
focus-mode-checkbox markup and its related container elements so every newly
opened label/div is properly closed before the next section begins, and verify
the same structure in the later duplicated Focus Mode block referenced by the
comment.
- Around line 548-557: Move all Focus Mode controls into a single dedicated
Focus Mode section and remove the older duplicate block so the page only renders
one UI for this feature. Update the related markup around the Focus Mode
toggle/sliders and delete the legacy Focus Mode section later in the file,
ensuring `id="val-focus-mode-dim-opacity"` appears only once. Keep the
`focus-mode-checkbox` and the Focus Mode range/value elements together so the
`getElementById(...)` logic in `settings.js` targets a single set of controls.
In `@settings.js`:
- Around line 289-293: The later toggleFocusModeControls helper is shadowing the
earlier one, so the focus mode settings container visibility logic is never
reached. Rename this helper in settings.js and update the relevant call sites so
the version that controls focusModeSettingsContainer is the one being invoked,
keeping the two focus mode behaviors distinct.
In `@settingsStore.js`:
- Around line 582-584: The transitionDuration sanitization currently falls back
to DEFAULT_SETTINGS.focusMode.transitionDuration for any out-of-range input,
which turns values outside the 0.1–10 contract into 1.5 instead of the nearest
bound. Update the logic around transitionDuration in settingsStore.js to first
verify the input is finite and then clamp it to the 0.1–10 range, so values
below the minimum become 0.1 and values above the maximum become 10 rather than
resetting to the default.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ad713f02-8ef6-4142-acf0-2c164af130cc
📒 Files selected for processing (4)
renderer.jssettings.htmlsettings.jssettingsStore.js
|
@bhavyasanthoshi02 pls fix the coderabbit review comments |
…icates and clamp out-of-range inputs
|
Resolved. Removed the duplicate Focus Mode controls, cleaned up the shadowed selectors in settings.js, and implemented out-of-range value clamping with test coverage in settingsStore.js. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
SamXop123
left a comment
There was a problem hiding this comment.
Great! Thank you for the contribution @bhavyasanthoshi02
|
🎉 Congratulations @bhavyasanthoshi02! 🎉 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! 💻✨ |
Description
This PR replaces the instant snap opacity transition in Focus Mode with a smooth, animated opacity transition. It also extends the settings store and UI to support a user-configurable transition duration.
Changes
settingsStore.js): AddedtransitionDuration(default1.5seconds, bounded between0.1and10.0seconds) tofocusModeschema and sanitation logic.renderer.js): Modified the Focus Mode opacity IPC handler to apply a CSS transition (canvas.style.transition = 'opacity <duration>s ease') before updating the opacity value.settings.html,settings.js):Please review the pr and send the required changes which are to be done
Thank you
Closes #271
Summary by CodeRabbit