diff --git a/apps/web/components/AiToolbar.tsx b/apps/web/components/AiToolbar.tsx new file mode 100644 index 0000000..7d86e82 --- /dev/null +++ b/apps/web/components/AiToolbar.tsx @@ -0,0 +1,48 @@ +import Link from "next/link"; + +import { aiToolItems } from "@/lib/nav/ai-tools"; +import type { ActiveNav } from "@/lib/nav/items"; + +interface AiToolbarProps { + projectId: string; + activeNav?: ActiveNav; +} + +// T4-a · 项目内页常驻 AI 工具条(顶栏下,UX §3/§5)。 +// 纯链接服务端组件:写本章=朱砂主动作,其余次级;激活项朱砂高亮。窄屏横向滚动。 +export function AiToolbar({ projectId, activeNav }: AiToolbarProps) { + return ( + + ); +} + +function toolClassName(isPrimary: boolean, isActive: boolean): string { + const base = + "flex items-center gap-1.5 rounded border px-3 py-1.5 text-sm transition-colors"; + if (isActive) { + return `${base} border-cinnabar text-cinnabar`; + } + if (isPrimary) { + return `${base} border-cinnabar bg-cinnabar text-panel hover:border-cinnabar`; + } + return `${base} border-line text-ink-soft hover:border-cinnabar hover:text-cinnabar`; +} diff --git a/apps/web/components/AppShell.tsx b/apps/web/components/AppShell.tsx index 634e137..372e7a5 100644 --- a/apps/web/components/AppShell.tsx +++ b/apps/web/components/AppShell.tsx @@ -2,6 +2,7 @@ import Link from "next/link"; import type { ReactNode } from "react"; import type { ActiveNav } from "@/lib/nav/items"; +import { AiToolbar } from "./AiToolbar"; import { LeftNav } from "./LeftNav"; import { NavDrawer } from "./NavDrawer"; @@ -25,7 +26,10 @@ export function AppShell({ activeNav, }: AppShellProps) { return ( -
+
+ {projectId ? ( + + ) : null}
-
{children}
+
+ {children} +
); diff --git a/apps/web/components/codex/CodexPage.tsx b/apps/web/components/codex/CodexPage.tsx index 803cb8c..ba12ffc 100644 --- a/apps/web/components/codex/CodexPage.tsx +++ b/apps/web/components/codex/CodexPage.tsx @@ -59,7 +59,7 @@ export function CodexPage({ projectId={project.id} activeNav="codex" > -
+
{TABS.map((t) => (