From 4a6339936310c0a06addc8f6c6e7f0c9d1631e78 Mon Sep 17 00:00:00 2001 From: xuhd Date: Fri, 29 May 2026 10:47:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=AE=A4=E5=B1=95=E7=A4=BA=E5=BC=80=E5=85=B3=20VITE=5FSTUDIO?= =?UTF-8?q?=5FENABLED?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- .../src/components/workspace/workspace-nav-chat-list.tsx | 5 ++++- frontend-web/src/env.ts | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend-web/src/components/workspace/workspace-nav-chat-list.tsx b/frontend-web/src/components/workspace/workspace-nav-chat-list.tsx index 2fca2ddf..f75996d2 100644 --- a/frontend-web/src/components/workspace/workspace-nav-chat-list.tsx +++ b/frontend-web/src/components/workspace/workspace-nav-chat-list.tsx @@ -19,6 +19,9 @@ import { BotIcon, BrainIcon, ListChecks, MessageSquarePlus, MessagesSquare, PenL import { SidebarCollapseButton } from "./workspace-header"; import { WorkspaceNavStudio } from "./workspace-nav-studio"; import { cn } from "@/lib/utils"; +import { env } from "@/env"; + +const studioEnabled = env.STUDIO_ENABLED?.toLowerCase() === "true"; // 普通导航项:默认中性色,激活态与「新对话」一致——主色浅底 + 主色文字/图标 const NAV_ITEM_CLASS = @@ -165,7 +168,7 @@ export function WorkspaceNavChatList({ )} - {!showCollapseTrigger && } + {!showCollapseTrigger && studioEnabled && } ); } diff --git a/frontend-web/src/env.ts b/frontend-web/src/env.ts index 10b6603c..dbf2ef33 100644 --- a/frontend-web/src/env.ts +++ b/frontend-web/src/env.ts @@ -8,7 +8,8 @@ function readEnv( | "VITE_NOTE_API_BASE_URL" | "VITE_NOTEBOOK_API_BASE_URL" | "VITE_STATIC_WEBSITE_ONLY" - | "VITE_GITHUB_OAUTH_TOKEN", + | "VITE_GITHUB_OAUTH_TOKEN" + | "VITE_STUDIO_ENABLED", ): EnvValue { const value = import.meta.env[key]; return typeof value === "string" && value.trim() ? value : undefined; @@ -24,4 +25,5 @@ export const env = { NEXT_PUBLIC_NOTEBOOK_API_BASE_URL: readEnv("VITE_NOTEBOOK_API_BASE_URL"), NEXT_PUBLIC_STATIC_WEBSITE_ONLY: readEnv("VITE_STATIC_WEBSITE_ONLY"), GITHUB_OAUTH_TOKEN: readEnv("VITE_GITHUB_OAUTH_TOKEN"), + STUDIO_ENABLED: readEnv("VITE_STUDIO_ENABLED"), };