swarm-ui: a terminal tab takes its agent's icon as the browser-tab icon
The agent terminal page swaps the page's favicon for the agent's icon while it is mounted, so tabs of different agents tell apart. A subagent terminal shows its agent's icon. An agent with no icon, or an unreachable controller, keeps the hyperhive mark; leaving the page restores the page's own icon.
This commit is contained in:
parent
e2ea842a93
commit
9761ffa24a
3 changed files with 45 additions and 0 deletions
|
|
@ -12,6 +12,7 @@
|
|||
import { useEffect } from "preact/hooks";
|
||||
import type { RouteComponentProps } from "wouter-preact";
|
||||
import { AgentTermPreview, termPaths } from "./AgentTermPreview.js";
|
||||
import { useAgentFavicon } from "../../shell/useAgentFavicon.js";
|
||||
import { useDynamicTabs } from "../../shell/useDynamicTabs.js";
|
||||
import "./AgentTerminalPage.css";
|
||||
|
||||
|
|
@ -27,6 +28,8 @@ export function AgentTerminalPage({
|
|||
? undefined
|
||||
: decodeURIComponent(params.subagent);
|
||||
const { page, label } = termPaths(name, subagent);
|
||||
// A subagent has no icon of its own: its tab wears its agent's.
|
||||
useAgentFavicon(name);
|
||||
|
||||
// Runs once per mounted terminal — re-registering on every render
|
||||
// would just be redundant work against an already-deduped list, but
|
||||
|
|
|
|||
Loading…
Reference in a new issue