Repository navigation
fix: use shared Switch component for System settings toggles (#1668) - #1670
RounakKumarAgarwal wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Replace custom system toggles frontend/src/pages/SettingsPage/components/SystemSettingsCard.tsx |
The autostart and close-to-tray controls now use the shared Switch component. Their state, handlers, disabled conditions, and accessibility references remain in place. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Refactor · Severity of issue fixed: Low
Suggested labels: TypeScript/JavaScript
Suggested reviewers: g-k-s-03
Merge Risk: 
Minimal · up to 6a901
-
The scoped UI change retains the existing system-settings behavior and is ready to merge.
Pre-merge checks: 
4
-
Full details: Linked Issues check
-
Explanation
Issue
#1668requires the two System settings toggles to use the sharedSwitchcomponent and preserve their logic and accessibility attributes. The whole-PR summary shows thatSystemSettingsCard.tsximports and usesSwitchfor both controls, while retaining checked state, change handlers, disabled conditions, andaria-labelledbyandaria-describedbyreferences.
Full details: Out of Scope Changes check
-
Explanation
The reported change is limited to
frontend/src/pages/SettingsPage/components/SystemSettingsCard.tsx. It replaces the two custom controls with the sharedSwitchcomponent and preserves existing behavior. This change directly implements issue#1668and shows no unrelated scope.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
A rabbit checks each toggle's place,
Then hops to share a steadier face.
Startup waits at one small switch,
Tray-close follows, neat as a stitch.
Two controls now match the rest.
Comment @coderabbitai help to get the list of available commands.
What this does
Fixes #1668.
The two toggles in the System settings card ("Launch at startup" and "Close to tray") were hand-built with
<button role="switch">and custom Tailwind classes, instead of the sharedSwitchcomponent (components/ui/switch) that every other toggle in the app uses. This made them look visually different (larger, different styling) from the toggles in Albums, Metadata Export, User Preferences, and Folder Management.This swaps them to the shared
<Switch>so all toggles are consistent.Changes
SystemSettingsCard.tsx: replaced the two custom<button role="switch">toggles with the shared<Switch>component.invokecalls, loading/pending/disabled handling, and accessibility attributes (aria-labelledby/aria-describedby) are unchanged. Only the visual element was swapped;onClickmaps toonCheckedChange, which the existing handlers support.Testing
ruff/blackpass.Before
After
Summary by CodeRabbit