Update all user-facing strings (HTML title, manifest, header logo, browser title updater), code comments, and documentation references. Folder name retained as-is.
24 lines
769 B
TypeScript
24 lines
769 B
TypeScript
import { useEffect } from "react";
|
|
import { trpc } from "@/lib/trpc";
|
|
|
|
export function BrowserTitleUpdater() {
|
|
const agents = trpc.listAgents.useQuery(undefined, {
|
|
refetchInterval: 10000,
|
|
});
|
|
|
|
const runningCount = agents.data?.filter((a) => a.status === "running").length ?? 0;
|
|
const questionsCount = agents.data?.filter((a) => a.status === "waiting_for_input").length ?? 0;
|
|
|
|
useEffect(() => {
|
|
const parts: string[] = [];
|
|
if (questionsCount > 0) parts.push(`${questionsCount} question${questionsCount > 1 ? "s" : ""}`);
|
|
if (runningCount > 0) parts.push(`${runningCount} running`);
|
|
|
|
document.title = parts.length > 0
|
|
? `(${parts.join(", ")}) Codewalkers`
|
|
: "Codewalkers";
|
|
}, [runningCount, questionsCount]);
|
|
|
|
return null;
|
|
}
|