feat(editor): drag an editor tab out to a standalone window (#470)

Dragging an editor tab past the window edge, or choosing Open in New Window from its menu, now opens the file in its own window and closes the tab here. A text file is saved first and a custom document runs its Save / Do not Save / Cancel guard once; if saving or opening fails, the tab stays. The new window is forced even when the project is already open elsewhere, and a file outside the project opens as LightEdit.

Dragging out tool windows is not covered. Refs #454

Co-authored-by: a-rookie-of-C-language <[email protected]>
Цей коміт міститься в:
arookieofcтаa-rookie-of-C-language authored and GitHub committed 2026-10-31 00:57:53 +08:00
1 джерело 986b0ade58
коміт 2754cf327f
12 files changed
+345 -12

No files matched your search

+19
Переглянути файл
@@ -0,0 +1,19 @@
import { describe, expect, it } from "vitest";
import { isOutsideWindow } from "./pointerDrag";
const viewport = { left: 0, top: 0, right: 1280, bottom: 800 };
describe("isOutsideWindow", () => {
it("treats the viewport interior as inside (issue #454: drag a tab out)", () => {
expect(isOutsideWindow(viewport, 640, 400)).toBe(false);
expect(isOutsideWindow(viewport, 0, 0)).toBe(false);
expect(isOutsideWindow(viewport, 1279, 799)).toBe(false);
});
it("treats every side of the viewport as outside", () => {
expect(isOutsideWindow(viewport, -1, 400)).toBe(true);
expect(isOutsideWindow(viewport, 1280, 400)).toBe(true);
expect(isOutsideWindow(viewport, 640, -1)).toBe(true);
expect(isOutsideWindow(viewport, 640, 800)).toBe(true);
});
});