Skip to content

fix(desktop): align sidebar toggle switches to right edge#8101

Open
Git-on-my-level wants to merge 1 commit into
BasedHardware:mainfrom
Git-on-my-level:fix/sidebar-toggle-alignment
Open

fix(desktop): align sidebar toggle switches to right edge#8101
Git-on-my-level wants to merge 1 commit into
BasedHardware:mainfrom
Git-on-my-level:fix/sidebar-toggle-alignment

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Problem

In the desktop app sidebar, the quick-capture toggle switches (Screen recording and Microphone) were not reliably flush-right aligned within their rows. The toggle switch container relied solely on the sibling <span> having flex-1 to absorb remaining space, which left the right-edge position implicit and fragile.

Fix

Added ml-auto to the toggle switch <span> inside toggleRow() in Sidebar.tsx.

-            'relative h-4 w-7 shrink-0 rounded-full transition-colors duration-200',
+            'relative ml-auto h-4 w-7 shrink-0 rounded-full transition-colors duration-200',

ml-auto (Tailwind for margin-left: auto) explicitly pushes the toggle switch to the far right of the flex row, independent of label text length. Since both toggle rows use the same toggleRow() function, they now share the same right-edge position.

Before / After (layout diagram)

Before                              After
┌──────────────────────────┐       ┌──────────────────────────┐
│ 🖥  Screen recording  ○  │       │ 🖥  Screen recording   ○  │
│ 🎤  Microphone       ○   │       │ 🎤  Microphone          ○  │
└──────────────────────────┘       └──────────────────────────┘
         ↑ toggles not at           ↑ toggles flush-right,
           same right edge           visually aligned

File changed

  • desktop/windows/src/renderer/src/components/layout/Sidebar.tsx — added ml-auto to toggle switch className in toggleRow() (line 129)

Review in cubic

Add ml-auto to the toggle switch container in toggleRow() so the
Screen recording and Microphone toggle switches are always flush-right
within their rows, regardless of label text length.

Previously the toggle relied solely on flex-1 on the sibling label to
push it right. Adding ml-auto makes the intent explicit and ensures
both toggles share the same right-edge position.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more

Re-trigger cubic

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant