The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): off means off when glass is turned down
Brooklyn Nicholsonb8c6547ca42a
diff --git a/apps/desktop/electron/translucency.test.ts b/apps/desktop/electron/translucency.test.tsindex 276c5c4b00e..ed7216c47cc 100644--- a/apps/desktop/electron/translucency.test.ts+++ b/apps/desktop/electron/translucency.test.ts@@ -189,7 +189,7 @@ describe('windowOpacityFor', () => {it('fades a glass window only through its own lever, on the ramp clear uses', () => {expect(windowOpacityFor(glass(60, DEFAULT_GLASS_MATERIAL, 0))).toBe(1)expect(windowOpacityFor(glass(60, DEFAULT_GLASS_MATERIAL, 40))).toBe(windowOpacityFor(clear(40)))- expect(windowOpacityFor(glass(0, DEFAULT_GLASS_MATERIAL, 100))).toBe(windowOpacityFor(clear(100)))+ expect(windowOpacityFor(glass(100, DEFAULT_GLASS_MATERIAL, 100))).toBe(windowOpacityFor(clear(100)))})it('leaves fade inert under clear, where the intensity lever already is the opacity', () => {@@ -552,6 +552,18 @@ describe('what an update actually changes natively', () => {it('is everything when switching between the two modes', () => {expect(nativeDiff(clear(60), glass(60))).toEqual({ backing: true, material: true, opacity: true })})++ it('leaves a window alone when glass is selected but off', () => {+ // The light default carries one point of fade. Someone who dragged the+ // tint to zero asked for an opaque window, and that point must not follow+ // them there — off has to mean exactly 1, not 0.9999.+ expect(windowOpacityFor({ ...glass(0), fade: 1 })).toBe(1)+ expect(windowOpacityFor({ ...glass(0), fade: 40 })).toBe(1)+ })++ it('still fades a window whose glass is actually on', () => {+ expect(windowOpacityFor({ ...glass(66), fade: 40 })).toBeLessThan(1)+ })})/**diff --git a/apps/shared/src/translucency.ts b/apps/shared/src/translucency.tsindex 4469d549060..75fc2139d95 100644--- a/apps/shared/src/translucency.ts+++ b/apps/shared/src/translucency.ts@@ -415,9 +415,19 @@ function opacityRamp(lever: number): number {* and only the separate `fade` reaches the window, so a glass window stays at* 1 until the user opts into fading it — which is what keeps a tint drag from* touching anything native.+ *+ * Fade is gated on glass being ACTIVE, not merely selected. The light default+ * carries a single point of it so the window edge reads as glass rather than+ * as paint, and without this gate that point would follow someone who had+ * turned the tint to zero — leaving a window that asked to be opaque sitting+ * at 0.9999. Off has to mean off.*/-export function windowOpacityFor({ intensity, fade, mode }: TranslucencyState): number {- return opacityRamp(mode === 'glass' ? fade : intensity)+export function windowOpacityFor(state: TranslucencyState): number {+ if (state.mode !== 'glass') {+ return opacityRamp(state.intensity)+ }++ return opacityRamp(glassActive(state) ? state.fade : 0)}/**