дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-06 10:07:11 +02:00
The panel needed the workbench to run as a child webview, which on macOS declines key equivalents, so Command shortcuts went to the native menu and many were lost (#5954, #5992). Reverts #5788, #5917 and the #5956 key-monitor workaround; the workbench webview is the window's own view again on every platform. The panel can come back once it no longer needs a child webview.
35 рядки
1.8 KiB
TypeScript
35 рядки
1.8 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { auxiliaryWindow } from "./auxWindow";
|
|
import capability from "../../src-tauri/capabilities/default.json";
|
|
import bridgeCapability from "../../src-tauri/capabilities/e2e.json";
|
|
|
|
describe("auxiliaryWindow", () => {
|
|
it("reads the kind and parent from the label", () => {
|
|
expect(auxiliaryWindow("settings-main")).toEqual({ kind: "settings", parent: "main" });
|
|
expect(auxiliaryWindow("settings-project-2")).toEqual({ kind: "settings", parent: "project-2" });
|
|
expect(auxiliaryWindow("comparison-main-0")).toEqual({ kind: "comparison", parent: "main" });
|
|
expect(auxiliaryWindow("comparison-project-2-14")).toEqual({ kind: "comparison", parent: "project-2" });
|
|
expect(auxiliaryWindow("diff-main-0")).toEqual({ kind: "diff", parent: "main" });
|
|
expect(auxiliaryWindow("diff-project-2-14")).toEqual({ kind: "diff", parent: "project-2" });
|
|
expect(auxiliaryWindow("editor-main-0")).toEqual({ kind: "editor", parent: "main" });
|
|
expect(auxiliaryWindow("editor-project-2-14")).toEqual({ kind: "editor", parent: "project-2" });
|
|
expect(auxiliaryWindow("deployment-project-2")).toEqual({ kind: "deployment", parent: "project-2" });
|
|
});
|
|
|
|
it.each(["settings", "comparison", "diff", "editor", "deployment"])(
|
|
"grants %s windows permission to close",
|
|
(kind) => {
|
|
expect(capability.windows).toContain(`${kind}-*`);
|
|
expect(bridgeCapability.windows).toContain(`${kind}-*`);
|
|
expect(capability.permissions).toContain("core:window:allow-close");
|
|
expect(capability.permissions).toContain("core:window:allow-destroy");
|
|
},
|
|
);
|
|
|
|
it("leaves project windows and malformed labels alone", () => {
|
|
for (const label of ["", "main", "project-1", "settings-", "comparison-main", "comparison-main-x"]) {
|
|
expect(auxiliaryWindow(label)).toBeNull();
|
|
}
|
|
});
|
|
});
|