Skip to content

Fix toggle sidebar icon alignment after Add Site modal#2636

Merged
sejas merged 1 commit intotrunkfrom
stu-1309-toggle-sidebar-icon-changes-alignment-when-you-open-add-site
Feb 23, 2026
Merged

Fix toggle sidebar icon alignment after Add Site modal#2636
sejas merged 1 commit intotrunkfrom
stu-1309-toggle-sidebar-icon-changes-alignment-when-you-open-add-site

Conversation

@sejas
Copy link
Copy Markdown
Member

@sejas sejas commented Feb 20, 2026

Related issues

Proposed Changes

  • Fix the traffic light position when hiding them, for example, after the Add Site modal opens.

Long explanation:

  • Extract the macOS traffic light position ({ x: 20, y: 20 }) into a shared MACOS_TRAFFIC_LIGHT_POSITION constant in constants.ts
  • Use the constant in main-window.ts instead of the hardcoded literal
  • After calling setWindowButtonVisibility(true) in the setWindowControlVisibility IPC handler, restore the custom position via setWindowButtonPosition(MACOS_TRAFFIC_LIGHT_POSITION) — this fixes the alignment shift caused by Electron not preserving the custom trafficLightPosition when re-showing window buttons

Testing Instructions

  • Start the app with npm start on MacOS
  • Click "Add Site" to open the modal, or press cmd+n
  • Close the modal without creating a site, or press esc
  • Verify the macOS traffic lights (red/yellow/green) and the "Toggle sidebar" icon remain in their correct position — they should not shift

Before

window-buttons-mac-before.mp4

After

window-buttons-mac-after.mp4

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors? (Tests pass, no errors)

Restore the custom macOS traffic light position after calling
setWindowButtonVisibility(true), which does not preserve the position
set during BrowserWindow creation. Extract the position into a shared
MACOS_TRAFFIC_LIGHT_POSITION constant.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sejas sejas self-assigned this Feb 20, 2026
@sejas sejas marked this pull request as ready for review February 20, 2026 18:17
@sejas sejas requested a review from a team February 20, 2026 18:18
Copy link
Copy Markdown
Contributor

@bcotrim bcotrim left a comment

Choose a reason for hiding this comment

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

Works as described
LGTM 👍

Copy link
Copy Markdown
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this @sejas! I have tested it, and it works as expected, I don't see the misalignment anymore on this branch. LGTM! :shipit:

Before After
Image Image

@sejas sejas merged commit 439feac into trunk Feb 23, 2026
9 checks passed
@sejas sejas deleted the stu-1309-toggle-sidebar-icon-changes-alignment-when-you-open-add-site branch February 23, 2026 21:40
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.

3 participants