Files
paseo/packages/app/src/utils/app-visibility.test.ts
T
Mohamed BoudraandGitHub 7917532716 Keep focused agent timelines live and catch up instantly (#2196)
* fix(app): keep focused agent timelines live

Window focus was conflated with app visibility, so switching OS windows could remove the selected timeline subscription. Separate those signals, grace every visibility-driven removal, and cover retained history until authoritative catch-up completes.

* fix(app): keep timeline catch-up failures non-blocking

* fix(app): surface timeline catch-up failures

* fix(app): preserve file preview refocus

* fix(app): preserve optimistic catch-up flow
2026-07-18 16:30:59 +02:00

27 lines
709 B
TypeScript

import { expect, test } from "vitest";
import { isAppActivelyVisible, isAppVisible } from "./app-visibility";
test("a visible desktop app remains visible when another window has focus", () => {
const input = {
appState: "active",
native: false,
documentVisible: true,
windowFocused: false,
};
expect(isAppVisible(input)).toBe(true);
expect(isAppActivelyVisible(input)).toBe(false);
});
test("a hidden desktop page is neither visible nor actively visible", () => {
const input = {
appState: "active",
native: false,
documentVisible: false,
windowFocused: true,
};
expect(isAppVisible(input)).toBe(false);
expect(isAppActivelyVisible(input)).toBe(false);
});