Repository navigation
fix: use shared Switch component for System settings toggles (#1668) - #1670
RounakKumarAgarwal wants to merge 2 commits 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 startup and close-to-tray controls now use the shared Switch component. Their state, handlers, disabled conditions, and accessibility references remain in place. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Refactor · Severity of issue fixed: Low
Possibly related PRs
- AOSSIE-Org/PictoPy#1669: Its stated objective also replaces the System settings toggles with the shared
Switchcomponent.
Suggested labels: TypeScript/JavaScript
Suggested reviewers: g-k-s-03
Merge Risk: 
Minimal · up to c26dc
-
The replacement preserves the identified setting behavior, with no actionable merge risk remaining after normal checks.
Pre-merge checks: 
4
-
Full details: Linked Issues check
-
Explanation
Issue
#1668requires both System settings toggles to use the sharedSwitchcomponent and preserve their setting logic and accessibility attributes.SystemSettingsCard.tsximportsSwitchand uses it for both controls. The file retains the checked state, handlers, disabled conditions, Tauriinvokecalls,aria-labelledby, andaria-describedbyvalues.
-
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 the toggles bright,
Shared switches now sit just right.
Startup waits at a gentle tap,
Close-to-tray follows the same map.
Two controls keep their state in view,
And access labels stay there too.
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