Skip to content

fix: correct settings toggle knob alignment for all font sizes#373

Merged
shobhit99 merged 1 commit into
SuperCmdLabs:mainfrom
monotykamary:fix/settings-toggle-slider-overshoot
May 11, 2026
Merged

fix: correct settings toggle knob alignment for all font sizes#373
shobhit99 merged 1 commit into
SuperCmdLabs:mainfrom
monotykamary:fix/settings-toggle-slider-overshoot

Conversation

@monotykamary

@monotykamary monotykamary commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Problem

Settings toggle sliders (AITab, ExtensionsTab) had a broken "on" position where the knob overshot the pill slightly (in the small font size), making it look inconsistent with the "off" position.

Before After
image image

Root cause

The "off" position used left-0.5 (0.125rem) but the "on" position used a hardcoded translate-x-[18px]. Since the app supports dynamic root font sizes (12–20px), this fixed pixel value did not scale with the pill width, causing misalignment at different font sizes.

Fix

Replaced the asymmetric left-0.5 / translate-x-[18px] approach with a symmetric left-0.5right-0.5 toggle. This guarantees identical inner padding on both sides at any font size, keeping the knob perfectly flush inside the pill.

Files changed

  • src/renderer/src/settings/AITab.tsx (2 toggle instances)
  • src/renderer/src/settings/ExtensionsTab.tsx (emoji picker toggle)

@monotykamary monotykamary changed the title (fix) correct settings toggle knob alignment fix: correct settings toggle knob alignment May 8, 2026
@shobhit99

Copy link
Copy Markdown
Contributor

Hey @monotykamary which version of supercmd are you on right now? i can't find the first toggle button for me on my version
image

@monotykamary

Copy link
Copy Markdown
Collaborator Author

Oh interesting, I see it on v1.0.22

image image

but now that I realized, it's to do with the font-size (I'm using small). I'll likely reweave this PR to make the styling calc more consistent.

@monotykamary

Copy link
Copy Markdown
Collaborator Author

Oh I realized the calc is pretty consistent across the font-sizes already. Should be golden @shobhit99. Let me update the description a bit.

@monotykamary monotykamary changed the title fix: correct settings toggle knob alignment fix: correct settings toggle knob alignment for all font sizes May 9, 2026
@shobhit99 shobhit99 merged commit 2371630 into SuperCmdLabs:main May 11, 2026
1 check failed
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.

2 participants