fix(app): give the traffic lights more room in their pocket

This commit is contained in:
Brendonovich
2026-11-05 02:58:32 +00:00
Unverified
parent 9e680364b1
commit 0afc096173
3 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ export function macVerticalTrafficLights(zoom: number) {
return { x, y, width: x + macTrafficLightsBaseWidth - 14 }
}
const macTrafficLightsGap = 10
const macTrafficLightsGap = 14
// The toggle's 28px plus a 4px gap before the header contents.
const slotWidth = 32
@@ -3,16 +3,16 @@ import { trafficLightsPocket } from "./traffic-lights-notch"
it("bends the closed sidebar's content panel around the traffic lights, its corner concentric with the zoom button", () => {
// The buttons span 20–80px across and 25–39px down at 1x.
expect(trafficLightsPocket(0, 1)).toEqual({ left: 8, right: 86, bottom: 45, top: 8, outer: 10, inner: 13 })
expect(trafficLightsPocket(0, 1)).toEqual({ left: 8, right: 90, bottom: 49, top: 8, outer: 10, inner: 17 })
})
it("flattens the bend into the panel's own corner as the panel's edge reaches the pocket's", () => {
const pocket = trafficLightsPocket(70, 1)
expect(pocket?.outer).toBeCloseTo(10 * (8 / 23), 5)
expect(pocket?.inner).toBeCloseTo(13 * (8 / 23), 5)
expect(trafficLightsPocket(77.99, 1)?.outer).toBeCloseTo(0, 2)
expect(trafficLightsPocket(78, 1)).toBeUndefined()
expect(pocket?.outer).toBeCloseTo(10 * (12 / 27), 5)
expect(pocket?.inner).toBeCloseTo(17 * (12 / 27), 5)
expect(trafficLightsPocket(81.99, 1)?.outer).toBeCloseTo(0, 2)
expect(trafficLightsPocket(82, 1)).toBeUndefined()
expect(trafficLightsPocket(240, 1)).toBeUndefined()
})
@@ -20,7 +20,7 @@ it("stays concentric with the zoom button, which keeps its native size, under re
const pocket = trafficLightsPocket(0, 2)
// At 2x the buttons are 7px across on an 11.5px pitch, the first still centered 27px across and 32px down.
expect(pocket?.inner).toBe(9.5)
expect(pocket?.inner).toBe(13.5)
expect(pocket && pocket.right - pocket.inner).toBe(27 + 2 * 11.5)
expect(pocket && pocket.bottom - pocket.inner).toBe(32)
})
@@ -6,7 +6,7 @@ const panelRadius = 10
const panelInset = 8
// Room between the traffic lights and the pocket the panel bends around them.
const pocketPadding = 6
const pocketPadding = 10
// The native buttons' size in points; they keep it at every renderer zoom.
const trafficLightSize = 14