57dc91585d
Internal SmartGift build of a Claude Code monitoring dashboard. Lanes: a durable unit of parallel agent work, one per working directory, tracked across session restarts. Managed lanes are git worktrees the dashboard provisions and can reset or remove behind a three-check destroy guard and a counted preflight; adopted lanes are directories you already own and are never destroyable. Pipelines: a lane moves through pipeline stages. A stage the agent declares with evidence renders green; a stage inferred from the tool-event stream renders dashed amber and never counts as done. Detection is forward-only within a 30-minute window, and never writes the declared stage. Workspace: one page at /run with a lane grid, the selected lane's pipeline, and a full Claude console behind a disclosure.
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
/**
|
|
* @file DocumentTitle.tsx
|
|
* @description Route-aware document title setter nested under BrowserRouter so
|
|
* `useLocation` works. Keeps multi-tab window switchers readable.
|
|
* @author Nguyễn Ngọc Trí Vĩ <vinnt@smartgift.vn>
|
|
*/
|
|
|
|
import { useLocation } from "react-router-dom";
|
|
import { useTranslation } from "react-i18next";
|
|
import { useDocumentTitle } from "../hooks/useDocumentTitle";
|
|
|
|
/**
|
|
* Maps the current pathname to a localized browser tab title.
|
|
*/
|
|
export function DocumentTitle() {
|
|
const { t } = useTranslation("nav");
|
|
const location = useLocation();
|
|
|
|
let title = t("dashboard");
|
|
const path = location.pathname;
|
|
const sessionId = path.match(/^\/sessions\/([^/]+)/)?.[1];
|
|
|
|
if (sessionId) {
|
|
title = `${t("sessions")} · ${sessionId.slice(0, 8)}`;
|
|
} else if (path.startsWith("/sessions")) {
|
|
title = t("sessions");
|
|
} else if (path.startsWith("/kanban")) {
|
|
title = t("agentBoard");
|
|
} else if (path.startsWith("/activity")) {
|
|
title = t("activityFeed");
|
|
} else if (path.startsWith("/analytics")) {
|
|
title = t("analytics");
|
|
} else if (path.startsWith("/workflows")) {
|
|
title = t("workflows");
|
|
} else if (path.startsWith("/cc-config")) {
|
|
title = t("ccConfig");
|
|
} else if (path.startsWith("/run")) {
|
|
title = t("run");
|
|
} else if (path.startsWith("/settings")) {
|
|
title = t("settings");
|
|
} else if (path !== "/") {
|
|
title = t("notFound");
|
|
}
|
|
|
|
useDocumentTitle(title);
|
|
return null;
|
|
}
|