[codex] Guard traffic light sync off macOS (#531)

This commit is contained in:
Pim de Jong
2026-04-12 01:18:41 -07:00
committed by GitHub
parent 839d87181b
commit fc53f978b6
3 changed files with 60 additions and 3 deletions
+8 -2
View File
@@ -1,3 +1,5 @@
const isMac = navigator.userAgent.includes('Mac')
/**
* Apply a UI zoom level change: sets webFrame zoom via the preload API,
* updates the CSS variable used to compensate the traffic-light pad,
@@ -7,7 +9,9 @@ export function applyUIZoom(level: number): void {
const zoomFactor = Math.pow(1.2, level)
window.api.ui.setZoomLevel(level)
document.documentElement.style.setProperty('--ui-zoom-factor', String(zoomFactor))
window.api.ui.syncTrafficLights(zoomFactor)
if (isMac) {
window.api.ui.syncTrafficLights(zoomFactor)
}
}
/**
@@ -18,5 +22,7 @@ export function syncZoomCSSVar(): void {
const level = window.api.ui.getZoomLevel()
const zoomFactor = Math.pow(1.2, level)
document.documentElement.style.setProperty('--ui-zoom-factor', String(zoomFactor))
window.api.ui.syncTrafficLights(zoomFactor)
if (isMac) {
window.api.ui.syncTrafficLights(zoomFactor)
}
}