feat(webui): polish agent output and app discovery

This commit is contained in:
Xubin Ren committed 2026-07-22 22:42:31 +08:00
1 parent b189a37648
commit aa8387fb4d
87 files changed
+6225 -2379

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
import { useEffect, useState } from "react";
function pageIsVisible(): boolean {
return typeof document === "undefined" || document.visibilityState !== "hidden";
}
/** Keep background tabs quiet while resuming work immediately on return. */
export function usePageVisibility(): boolean {
const [visible, setVisible] = useState(pageIsVisible);
useEffect(() => {
const update = () => setVisible(pageIsVisible());
document.addEventListener("visibilitychange", update);
return () => document.removeEventListener("visibilitychange", update);
}, []);
return visible;
}