mirror of
https://github.com/andrewyng/openworker.git
synced 2026-09-11 06:30:25 +00:00
gui: gate the macOS overlay layout to macOS
Shell injects the OS; Windows/Linux keep the native title bar with no traffic-light insets. Thin scrollbars on Windows/Linux so panels stop losing width to classic scrollbars.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { test, expect } from "./fixtures";
|
||||
|
||||
// The macOS overlay layout (traffic-light insets) must never apply on Windows —
|
||||
// Windows keeps its native title bar (alignment bug, 2026-07-21). The shell injects
|
||||
// __OCW_PLATFORM__; this simulates each platform and checks the overlay class.
|
||||
test("windows platform gets no tauri-overlay layout", async ({ page }) => {
|
||||
await page.addInitScript(() => {
|
||||
(window as any).__TAURI__ = {}; // simulate the desktop shell
|
||||
(window as any).__OCW_PLATFORM__ = "windows";
|
||||
});
|
||||
await page.goto("/");
|
||||
await expect(page.locator("html")).toHaveAttribute("data-platform", "windows");
|
||||
await expect(page.locator(".app.tauri-overlay")).toHaveCount(0);
|
||||
});
|
||||
|
||||
test("macos platform keeps the overlay layout", async ({ page }) => {
|
||||
await page.addInitScript(() => {
|
||||
(window as any).__TAURI__ = {};
|
||||
(window as any).__OCW_PLATFORM__ = "macos";
|
||||
});
|
||||
await page.goto("/");
|
||||
await expect(page.locator(".app.tauri-overlay").first()).toBeVisible();
|
||||
});
|
||||
Reference in New Issue
Block a user