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
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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);
|
||||
});
|
||||
Reference in New Issue
Block a user