-
+ {channelId === null ? (
+ }
+ title="No channel open"
+ description="Pick a channel from the panel, or open one from Agents or the command palette."
+ />
+ ) : (
+
+ )}
);
diff --git a/apps/web/src/shell/panel-contributions.tsx b/apps/web/src/shell/panel-contributions.tsx
index 0e27684c9..9a71f3ca2 100644
--- a/apps/web/src/shell/panel-contributions.tsx
+++ b/apps/web/src/shell/panel-contributions.tsx
@@ -5,6 +5,7 @@ import { EmptyState, SidebarItemRow, Skeleton } from "@corbits/react-ui";
import { Hash, MessageSquare, Workflow, Bell } from "lucide-react";
import { useBench } from "../bench-context";
+import { channelIdFromPath, channelPath, isChannelPath } from "../channel-path";
import { useBenchActivity } from "./bench-activity";
import {
registerPanelContribution,
@@ -12,18 +13,10 @@ import {
} from "./panel-contribution";
import type { RoutineActivityItem } from "./routine-activity";
-const CHAT_PATH_PREFIX = "/chat";
-
function pathMatches(prefix: string, path: string): boolean {
return path === prefix || path.startsWith(`${prefix}/`);
}
-function activeChatChannelId(path: string): string | null {
- if (!path.startsWith(`${CHAT_PATH_PREFIX}/`)) return null;
- const rest = path.slice(CHAT_PATH_PREFIX.length + 1);
- return rest === "" ? null : decodeURIComponent(rest);
-}
-
function ChannelsBand({
path,
onNavigate,
@@ -33,7 +26,7 @@ function ChannelsBand({
}) {
const { selectedTenantId } = useBench();
const activity = useBenchActivity(selectedTenantId);
- const activeId = activeChatChannelId(path);
+ const activeId = channelIdFromPath(path);
if (activity.kind === "loading") {
return