Update workspace and app changes

This commit is contained in:
Mohamed Boudra
2026-03-07 19:09:00 +07:00
parent 1d1c7058f1
commit 7d76da3249
40 changed files with 2693 additions and 976 deletions
@@ -196,4 +196,42 @@ describe("terminal-emulator-runtime", () => {
expect(terminal.options?.theme).toEqual({ background: "after" });
expect(refresh).toHaveBeenCalledWith(0, 11);
});
it("forces a refit when the page becomes visible again", () => {
const runtime = new TerminalEmulatorRuntime();
const fitAndEmitResize = vi.fn();
(runtime as unknown as { fitAndEmitResize: (force: boolean) => void }).fitAndEmitResize =
fitAndEmitResize;
(globalThis as { document?: { visibilityState?: string } }).document = {
visibilityState: "visible",
};
(
runtime as unknown as {
handleVisibilityRestore: () => void;
}
).handleVisibilityRestore();
expect(fitAndEmitResize).toHaveBeenCalledWith(true);
});
it("does not refit while the page is still hidden", () => {
const runtime = new TerminalEmulatorRuntime();
const fitAndEmitResize = vi.fn();
(runtime as unknown as { fitAndEmitResize: (force: boolean) => void }).fitAndEmitResize =
fitAndEmitResize;
(globalThis as { document?: { visibilityState?: string } }).document = {
visibilityState: "hidden",
};
(
runtime as unknown as {
handleVisibilityRestore: () => void;
}
).handleVisibilityRestore();
expect(fitAndEmitResize).not.toHaveBeenCalled();
});
});