From 3bfdf0dfe046c383b936d46a3e44861c779467b5 Mon Sep 17 00:00:00 2001 From: iris Date: Sun, 4 Oct 2026 22:43:07 +0200 Subject: [PATCH] =?UTF-8?q?swarm-ui:=20each=20route=20sets=20its=20own=20d?= =?UTF-8?q?ocument=20title=20('=20=C2=B7=20')?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/packages/swarm-ui/src/shell/Shell.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/packages/swarm-ui/src/shell/Shell.tsx b/frontend/packages/swarm-ui/src/shell/Shell.tsx index 71f57543..7989fc6f 100644 --- a/frontend/packages/swarm-ui/src/shell/Shell.tsx +++ b/frontend/packages/swarm-ui/src/shell/Shell.tsx @@ -350,9 +350,16 @@ export function Shell({ children }: { children: ComponentChildren }) { }, []); const brand = swarmName ?? DEFAULT_BRAND; + // Per-route label so browser tabs of different pages tell apart: a + // top-level route takes its nav label, a terminal route takes the + // label its page registered as a dynamic tab. An unmatched path gets + // the bare brand. + const pageLabel = + NAV_ITEMS.find((item) => item.href === location)?.label ?? + tabs.find((tab) => tab.href === location)?.label; useEffect(() => { - document.title = brand; - }, [brand]); + document.title = pageLabel ? `${pageLabel} · ${brand}` : brand; + }, [brand, pageLabel]); // Same value the indicator itself is drawn with, including mid-sweep — // the brand text rides the identical hop sequence rather than