diff --git a/apps/web/src/shell/contextual-panel.tsx b/apps/web/src/shell/contextual-panel.tsx index 3fcf5e674..ec1c216d7 100644 --- a/apps/web/src/shell/contextual-panel.tsx +++ b/apps/web/src/shell/contextual-panel.tsx @@ -1,14 +1,14 @@ // Column 2: route-aware contextual panel with three bands. // // 1. Page band — title, settings entry, quick actions, canvas toggle. -// 2. Global pins — user-curated, same on every page. -// 3. Page-specific — contribution content for the current route. +// 2. Global pins — user-curated, same on every page (hidden when empty). +// 3. Page-specific — contribution content for the current route (omitted when null). // // Live activity lives here (left), never in the right canvas. Clicking a // list item navigates to the full surface for that entity. -import { Button, EmptyState, SidebarItemRow } from "@corbits/react-ui"; -import { Pin as PinIcon, Settings } from "lucide-react"; +import { Button, SidebarItemRow } from "@corbits/react-ui"; +import { Settings } from "lucide-react"; import { useState } from "react"; import { CanvasToggle } from "./canvas-column"; @@ -95,13 +95,9 @@ export function ContextualPanel({ ) : null} -
-

Pinned

- {pins.length === 0 ? ( -

- Pin channels, agents, or routines to keep them here on every page. -

- ) : ( + {pins.length > 0 ? ( +
+

Pinned

{pins.map((pin) => ( ))}
- )} -
+
+ ) : null} -
-

{pageBand.title}

- {pageSpecific ?? ( - - )} -
+ {pageSpecific !== null ? ( +
+

{pageBand.title}

+ {pageSpecific} +
+ ) : null} ); } - -// PinIcon kept for future pin-toggle affordances in rows. -void PinIcon; diff --git a/apps/web/test/contextual-panel.test.tsx b/apps/web/test/contextual-panel.test.tsx index 9b62c610d..76f471e89 100644 --- a/apps/web/test/contextual-panel.test.tsx +++ b/apps/web/test/contextual-panel.test.tsx @@ -45,12 +45,13 @@ describe("ContextualPanel", () => { expect(markup).not.toContain(">Pages<"); }); - test("renders the three panel bands", () => { + test("renders the page and page-specific bands, hides empty pins", () => { const markup = renderPanel("/"); expect(markup).toContain("panel-band-page"); - expect(markup).toContain("panel-band-pins"); expect(markup).toContain("panel-band-page-specific"); - expect(markup).toContain("Pinned"); + // Pins default to empty (no localStorage entries) so the band hides. + expect(markup).not.toContain("panel-band-pins"); + expect(markup).not.toContain("Pinned"); }); test("shows an honest empty state once no bench resolves", async () => {