* 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
27 lines
709 B
TypeScript
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);
|
|
});
|