Keep workspace focus mode scoped and easy to exit (#2151)
* fix(workspace): keep focus mode scoped and easy to exit Route focus mode through the active workspace so persisted state cannot hide chrome on settings or other screens. Add a visible exit control and keep desktop window chrome aligned and visually quiet. * fix(app): clarify muted chrome semantics
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import {
|
||||
applyMacWindowControlsUpdate,
|
||||
applyWindowControlsOverlayUpdate,
|
||||
createWindowControlsOverlayState,
|
||||
DEFAULT_WINDOW_HEIGHT,
|
||||
@@ -70,10 +71,12 @@ describe("window-manager", () => {
|
||||
readWindowControlsOverlayUpdate({
|
||||
height: 48,
|
||||
backgroundColor: "#181B1A",
|
||||
trafficLightOffsetY: -5,
|
||||
}),
|
||||
).toEqual({
|
||||
height: 48,
|
||||
backgroundColor: "#181B1A",
|
||||
trafficLightOffsetY: -5,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -82,6 +85,13 @@ describe("window-manager", () => {
|
||||
expect(readWindowControlsOverlayUpdate({})).toBeNull();
|
||||
expect(readWindowControlsOverlayUpdate({ height: 0 })).toBeNull();
|
||||
expect(readWindowControlsOverlayUpdate({ backgroundColor: 12 })).toBeNull();
|
||||
expect(readWindowControlsOverlayUpdate({ trafficLightOffsetY: -11 })).toBeNull();
|
||||
});
|
||||
|
||||
it("preserves fractional traffic-light offsets", () => {
|
||||
expect(readWindowControlsOverlayUpdate({ trafficLightOffsetY: 1.5 })).toEqual({
|
||||
trafficLightOffsetY: 1.5,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -139,6 +149,24 @@ describe("window-manager", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("applyMacWindowControlsUpdate", () => {
|
||||
it("uses the focus and normal traffic-light positions", () => {
|
||||
const setWindowButtonPosition = vi.fn();
|
||||
|
||||
applyMacWindowControlsUpdate({
|
||||
win: { setWindowButtonPosition },
|
||||
update: { trafficLightOffsetY: -5 },
|
||||
});
|
||||
applyMacWindowControlsUpdate({
|
||||
win: { setWindowButtonPosition },
|
||||
update: { trafficLightOffsetY: 0.5 },
|
||||
});
|
||||
|
||||
expect(setWindowButtonPosition).toHaveBeenNthCalledWith(1, { x: 16, y: 9 });
|
||||
expect(setWindowButtonPosition).toHaveBeenNthCalledWith(2, { x: 16, y: 14.5 });
|
||||
});
|
||||
});
|
||||
|
||||
describe("getMainWindowChromeOptions", () => {
|
||||
it("uses frameless hidden title bars with overlay on windows", () => {
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user