Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/cortex/CortexDesktopLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export function CortexDesktopLayout(props: ParentProps) {
"view:agents": (() => { setSidebarTab("agents"); setSidebarCollapsed(false); }) as EventListener,
"sidebar:toggle": (() => setSidebarCollapsed(!sidebarCollapsed())) as EventListener,
"selection:select-all": (() => document.execCommand("selectAll")) as EventListener,
"help:docs": (() => window.open("https://docs.cortex.dev", "_blank")) as EventListener,
"help:docs": (() => { setSidebarTab("docs"); setSidebarCollapsed(false); }) as EventListener,
"terminal:toggle": (() => { if (bottomPanelCollapsed()) { setBottomPanelCollapsed(false); setBottomPanelTab("terminal"); } else if (bottomPanelTab() === "terminal") { setBottomPanelCollapsed(true); } else { setBottomPanelTab("terminal"); } }) as EventListener,
"layout:toggle-panel": (() => setBottomPanelCollapsed(!bottomPanelCollapsed())) as EventListener,
"ai:modifications:toggle": (() => setShowAIModifications((prev) => !prev)) as EventListener,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ vi.mock("@/components/cortex/CortexAccountPanel", () => ({
CortexAccountPanel: () => <div data-testid="panel-account">Account Panel</div>,
}));

vi.mock("@/components/cortex/CortexDocumentationPanel", () => ({
CortexDocumentationPanel: () => <div data-testid="panel-docs">Documentation Panel</div>,
}));

const STORAGE_KEYS = {
sidebarTab: "figma_layout_sidebar_tab",
sidebarCollapsed: "figma_layout_sidebar_collapsed",
Expand All @@ -119,6 +123,7 @@ const NAV_ITEMS: ActivityBarItem[] = [
{ id: "agents", icon: "users", label: "AI Agents" },
{ id: "extensions", icon: "grid", label: "Extensions" },
{ id: "themes", icon: "brush", label: "Themes" },
{ id: "docs", icon: "book", label: "Documentation" },
];

function SidebarIntegrationWrapper(props: { initialTab?: SidebarTab; initialCollapsed?: boolean }) {
Expand Down Expand Up @@ -311,6 +316,19 @@ describe("SidebarNavigation Integration", () => {
expect(panel).toBeTruthy();
expect(panel.textContent).toContain("Account Panel");
});

it("clicking 'docs' shows documentation panel", async () => {
const { container, findByTestId } = render(() => <SidebarIntegrationWrapper />);

const docsButton = container.querySelector('button[aria-label="Documentation"]');
expect(docsButton).toBeTruthy();

await fireEvent.click(docsButton!);

const panel = await findByTestId("panel-docs");
expect(panel).toBeTruthy();
expect(panel.textContent).toContain("Documentation Panel");
});
});

describe("Collapse and Expand", () => {
Expand Down
Loading