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
24 changes: 5 additions & 19 deletions src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,15 @@ import { useTranslations } from "next-intl";
import A2ADashboardPage from "./components/A2ADashboard";
import McpDashboardPage from "./components/MCPDashboard";
import NotionSourceCard from "./components/NotionSourceCard";
import ObsidianSourceCard from "./components/ObsidianSourceCard";
import VscodeTokenAliasCard from "./VscodeTokenAliasCard";

const BUILD_TIME_CLOUD_URL = process.env.NEXT_PUBLIC_CLOUD_URL || null;
const CLOUD_ACTION_TIMEOUT_MS = 15000;

type TranslationValues = Record<string, string | number | boolean | Date>;
type CloudflaredTunnelPhase =
| "unsupported"
| "not_installed"
| "stopped"
| "starting"
| "running"
| "error";
"unsupported" | "not_installed" | "stopped" | "starting" | "running" | "error";

type CloudflaredTunnelStatus = {
supported: boolean;
Expand All @@ -43,12 +39,7 @@ type CloudflaredTunnelStatus = {
};

type TailscaleTunnelPhase =
| "unsupported"
| "not_installed"
| "needs_login"
| "stopped"
| "running"
| "error";
"unsupported" | "not_installed" | "needs_login" | "stopped" | "running" | "error";

type TailscaleTunnelStatus = {
supported: boolean;
Expand All @@ -70,13 +61,7 @@ type TailscaleTunnelStatus = {
};

type NgrokTunnelPhase =
| "unsupported"
| "not_installed"
| "stopped"
| "needs_auth"
| "starting"
| "running"
| "error";
"unsupported" | "not_installed" | "stopped" | "needs_auth" | "starting" | "running" | "error";

type NgrokTunnelStatus = {
supported: boolean;
Expand Down Expand Up @@ -1261,6 +1246,7 @@ export default function APIPageClient({ machineId }: Readonly<APIPageClientProps
{activeEndpointTab === "context-sources" ? (
<div className="flex flex-col gap-4">
<NotionSourceCard />
<ObsidianSourceCard />
Comment thread
DKotsyuba marked this conversation as resolved.
Resolved
</div>
) : null}

Expand Down
21 changes: 21 additions & 0 deletions tests/unit/dashboard-shell-tabs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,27 @@ test("endpoint page keeps APIs, MCP, and A2A as in-page tabs", () => {
assert.ok(source.includes('activeEndpointTab === "a2a" ? <A2ADashboardPage /> : null'));
});

test("endpoint page exposes context-sources tab with Notion and Obsidian source cards", () => {
const source = readSource("src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.tsx");

// Verify context-sources is part of the EndpointTab type contract
assert.ok(source.includes('type EndpointTab = "apis" | "mcp" | "a2a" | "context-sources"'));

// Verify context-sources tab label is in ENDPOINT_TABS
assert.ok(
source.includes('{ value: "context-sources", label: "Context Sources", icon: "database" }')
);

// Verify both source card components are imported
assert.ok(source.includes('import NotionSourceCard from "./components/NotionSourceCard"'));
assert.ok(source.includes('import ObsidianSourceCard from "./components/ObsidianSourceCard"'));

// Verify both components are rendered in the context-sources conditional block
assert.ok(source.includes('activeEndpointTab === "context-sources" ? ('));
assert.ok(source.includes("<NotionSourceCard />"));
assert.ok(source.includes("<ObsidianSourceCard />"));
});

test("settings root redirects to section pages instead of rendering a tab shell", () => {
const pageSource = readSource("src/app/(dashboard)/dashboard/settings/page.tsx");

Expand Down
Loading