Skip to content

fix: use shared Switch component for System settings toggles (#1668) - #1670

Open
RounakKumarAgarwal wants to merge 1 commit into
AOSSIE-Org:devfrom
RounakKumarAgarwal:fix/toggle-switch-v2
Open

RounakKumarAgarwal wants to merge 1 commit into
AOSSIE-Org:devfrom
RounakKumarAgarwal:fix/toggle-switch-v2

Conversation

@RounakKumarAgarwal

@RounakKumarAgarwal RounakKumarAgarwal commented Oct 28, 2026 •

Copy link
Copy Markdown

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 shared Switch component (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.
  • Preserved all existing behavior — the autostart/close-to-tray state logic, Tauri invoke calls, loading/pending/disabled handling, and accessibility attributes (aria-labelledby / aria-describedby) are unchanged. Only the visual element was swapped; onClick maps to onCheckedChange, which the existing handlers support.

Testing

  • Verified in the running desktop app: both toggles now match the other toggles visually, flip correctly, and the underlying settings (autostart, close-to-tray) still take effect.
  • ruff / black pass.

Before

image

After

Screenshot 2026-10-29 010446

Summary by CodeRabbit

  • Style
    • Updated the autostart and close-to-tray controls to use the app’s shared switch design. Their existing behavior and accessibility labels remain unchanged.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 5e30cb2 and 6a901d2.

Files selected for processing: 1
  • frontend/src/pages/SettingsPage/components/SystemSettingsCard.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Walkthrough

The System settings card now uses the shared Switch component for its autostart and close-to-tray controls. Both controls retain their existing state, change handlers, disabled conditions, and accessibility references.

Changes

System settings toggles

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: Low

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: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: replacing the System settings toggles with the shared Switch component.
Linked Issues check Passed Issue #1668 requires the two System settings toggles to use the shared Switch component and preserve their logic and accessibility attributes. The whole-PR summary shows that `SystemSettingsCard.tsx…
Out of Scope Changes check Passed The reported change is limited to frontend/src/pages/SettingsPage/components/SystemSettingsCard.tsx. It replaces the two custom controls with the shared Switch component and preserves existing beh…
Full details: Linked Issues check

Explanation

Issue #1668 requires the two System settings toggles to use the shared Switch component and preserve their logic and accessibility attributes. The whole-PR summary shows that SystemSettingsCard.tsx imports and uses Switch for both controls, while retaining checked state, change handlers, disabled conditions, and aria-labelledby and aria-describedby references.

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 shared Switch component and preserves existing behavior. This change directly implements issue #1668 and 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.

❤️ Share

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.

@github-actions github-actions Bot added bug Something isn't working enhancement New feature or request possible-duplicate Potential semantic duplicate (upstream comparison) labels Oct 28, 2026

This branch has not been deployed

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

Labels

bug Something isn't working enhancement New feature or request possible-duplicate Potential semantic duplicate (upstream comparison)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG:PROD:System settings toggles use a custom switch instead of the shared Switch component

1 participant