diff --git a/CLAUDE.md b/CLAUDE.md index 24bf01d3..54243962 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -84,7 +84,7 @@ The frontend (`frontend-web/`) is a React 19 + Vite SPA: - **LLM streaming**: `@langchain/langgraph-sdk` streams messages from the backend via SSE - **UI**: Radix UI primitives + TailwindCSS v4 + shadcn-style components in `src/components/ui/` - **Shims**: `src/shims/` provides `next/link` and `next/navigation` polyfills (original code was Next.js) -- **Login URL params** (`LoginPage.tsx`, frontend-only — the backend never sees these): besides the auth params (`ticket`/`userId`/`env`/`theme`/`yUserId`/`token`/`access_token`/`authToken`/`password`), the page supports a **task deep-link** via `?taskId=&goPath=`. After login it calls the consumer API `GET {VITE_AIPI_CONSUMER_URL}/taskAnalysSearch/cop-task-detail?taskId=` (header `Authorization: Bearer admin`, auto-injected by `utils/request.ts`), stashes the full `data` (`id/overview/taskDirection/taskName/taskContent`) into `sessionStorage["login.copTaskDetail"]`, then routes by `goPath`: base codes `3qfx`/`rwfx`/`xdfx` → that business's configured **single agent** Q&A (resolved via `/api/business-mapping`, opening message in `sessionStorage.pendingAgentMessage`); the `-A` suffix (`3qfx-A`/…) → **multi-agent roundtable** with `roundtablePrefill.businessCode` so the page auto-selects the configured 业务链条. goPath→businessCode: `3qfx`→`3Q`, `rwfx`→`6BF`, `xdfx`→`7BF`. **Both targets render embedded under the 任务管理 layout** — nested routes under `task-management//{roundtable,agent/:agent_id/chats/:thread_id}` in `StrategyRoutes.tsx` (`` = `plan-task-sentiment` / `plan-task/plan-task-fx` / `plan-task/plan-task-action`, matching the COH中任务 menu paths in `sidebar-menu.ts`) so the global sidebar keeps 任务管理 → COH中任务 → the matching business highlighted. The agent chat is rendered via `TaskEmbeddedAgentChat`, which passes `AgentChatPage`'s `chatBasePath` prop so the post-send URL rewrite + new-chat button stay in the task-management context (instead of the standalone `/agents/...` route). Any failure (no consumer URL / fetch error / unmapped goPath / no configured agent) silently falls back to the default home. Helpers: `core/auth/task-deeplink.ts`. +- **Login URL params** (`LoginPage.tsx`, frontend-only — the backend never sees these): besides the auth params (`ticket`/`userId`/`env`/`theme`/`yUserId`/`token`/`access_token`/`authToken`/`password`), the page supports a **task deep-link** via `?taskId=&goPath=`. After login it calls the consumer API `GET {VITE_AIPI_CONSUMER_URL}/taskAnalyseSearch/cop-task-detail?taskId=` (header `Authorization: Bearer admin`, auto-injected by `utils/request.ts`), stashes the full `data` (`id/overview/taskDirection/taskName/taskContent`) into `sessionStorage["login.copTaskDetail"]`, then routes by `goPath`: base codes `3qfx`/`rwfx`/`xdfx` → that business's configured **single agent** Q&A (resolved via `/api/business-mapping`, opening message in `sessionStorage.pendingAgentMessage`); the `-A` suffix (`3qfx-A`/…) → **multi-agent roundtable** with `roundtablePrefill.businessCode` so the page auto-selects the configured 业务链条. goPath→businessCode: `3qfx`→`3Q`, `rwfx`→`6BF`, `xdfx`→`7BF`. **Both targets render embedded under the 任务管理 layout** — nested routes under `task-management//{roundtable,agent/:agent_id/chats/:thread_id}` in `StrategyRoutes.tsx` (`` = `plan-task-sentiment` / `plan-task/plan-task-fx` / `plan-task/plan-task-action`, matching the COH中任务 menu paths in `sidebar-menu.ts`) so the global sidebar keeps 任务管理 → COH中任务 → the matching business highlighted. The agent chat is rendered via `TaskEmbeddedAgentChat`, which passes `AgentChatPage`'s `chatBasePath` prop so the post-send URL rewrite + new-chat button stay in the task-management context (instead of the standalone `/agents/...` route). Any failure (no consumer URL / fetch error / unmapped goPath / no configured agent) silently falls back to the default home. Helpers: `core/auth/task-deeplink.ts`. ### Configuration diff --git a/frontend-web/src/components/workspace/general-qa-sidebar.tsx b/frontend-web/src/components/workspace/general-qa-sidebar.tsx index 8eb784ca..c935ea42 100644 --- a/frontend-web/src/components/workspace/general-qa-sidebar.tsx +++ b/frontend-web/src/components/workspace/general-qa-sidebar.tsx @@ -95,13 +95,15 @@ const MORE_CHATS_HREF = "/page/workspace/chats"; /** 常用智能体最多展示个数。 */ const MAX_FREQUENT = 4; -// 智能体图标统一用 Bot 机器人图标;底色按 id 稳定散列到一组主题色,复刻参考图的彩色方块。 +// 智能体图标统一用 Bot 机器人图标;底色按 id 稳定散列到一组**深蓝 UI 规范**的色值 +// (§1.1.7 装饰色 / §1.1.8 小面积色序,docs/ui规范-深蓝),克制的蓝/青系,深蓝主题下不刺眼, +// 浅主题也成立。图标做「主色→深一档」的轻渐变保留层次,不再用原来高彩度的玫瑰/琥珀/翠绿。 const AGENT_COLORS = [ - { from: "#fb7185", to: "#ef4444" }, - { from: "#60a5fa", to: "#3b82f6" }, - { from: "#fbbf24", to: "#f59e0b" }, - { from: "#34d399", to: "#10b981" }, - { from: "#a78bfa", to: "#8b5cf6" }, + { from: "#4096FF", to: "#1677FF" }, // 蓝(链接蓝 → 主色) + { from: "#36CFC9", to: "#13C2C2" }, // 青(辅色) + { from: "#6388FF", to: "#0958D9" }, // 紫蓝(装饰紫 → 主色深一档) + { from: "#5CDBD3", to: "#08979C" }, // 浅青 → 深青 + { from: "#69B1FF", to: "#003EB3" }, // 浅蓝 → 主色按下 ] as const; function agentColor(id: string) { @@ -309,12 +311,14 @@ export function GeneralQaSidebar() { const isStatic = env.NEXT_PUBLIC_STATIC_WEBSITE_ONLY === "true"; return ( -
+ // 背景走 sidebar token(浅主题=白、深蓝主题=深蓝),不要写死 bg-white,否则全量版深蓝主题下侧栏仍是白底。 +
{/* ── 顶部:新对话胶囊 + 收起按钮 ── */}
{/* 新对话按钮:完全自定义样式(不复用 Button variant)。borderColor / color 走 - inline style,避免被全局 border-color(--border)覆盖;无阴影。浅主色底 + 主色描边 - + 5px 圆角,全部走 --primary token,自动适配红/蓝/深蓝主题。 */} + inline style,避免被全局 border-color(--border)覆盖;无阴影。主色描边 + 5px 圆角。 + 底色用「主色混入透明」=主色低透明度叠在当前侧栏底色上,浅/红/蓝/深蓝主题都自适应 + (不要混 white,否则深蓝主题下会变成浅色块)。 */} diff --git a/frontend-web/src/core/auth/task-deeplink.ts b/frontend-web/src/core/auth/task-deeplink.ts index f375ea01..603e75c4 100644 --- a/frontend-web/src/core/auth/task-deeplink.ts +++ b/frontend-web/src/core/auth/task-deeplink.ts @@ -3,7 +3,7 @@ * 拉取任务详情并据 goPath 把用户直接送到对应的智能体问答 / 多智能体会商页。 * * 流程: - * 1. 调 consumer 接口 ``GET {VITE_AIPI_CONSUMER_URL}/taskAnalysSearch/cop-task-detail?taskId=``, + * 1. 调 consumer 接口 ``GET {VITE_AIPI_CONSUMER_URL}/taskAnalyseSearch/cop-task-detail?taskId=``, * 请求头 ``Authorization: Bearer admin``(由 service 拦截器统一注入)。 * 2. 把返回的 data(id/overview/taskDirection/taskName/taskContent)整包存到 sessionStorage。 * 3. 按 goPath 解析出业务码 + 模式: @@ -74,7 +74,7 @@ export async function fetchCopTaskDetail(taskId: string): Promise; diff --git a/frontend-web/src/strategy-components/components/task-components/task-mock-data.ts b/frontend-web/src/strategy-components/components/task-components/task-mock-data.ts index 9f6c5fc7..da45f0b0 100644 --- a/frontend-web/src/strategy-components/components/task-components/task-mock-data.ts +++ b/frontend-web/src/strategy-components/components/task-components/task-mock-data.ts @@ -401,7 +401,7 @@ const MOCK_ROUTES: Array<{ match: string; dataset: MockDataset }> = [ // ───────────── 任务详情假数据(cop-task-detail,给登录任务深链用) ───────────── // -// consumer 接口 `{VITE_AIPI_CONSUMER_URL}/taskAnalysSearch/cop-task-detail` 外网可能不可达, +// consumer 接口 `{VITE_AIPI_CONSUMER_URL}/taskAnalyseSearch/cop-task-detail` 外网可能不可达, // 可用假数据模拟登录深链(?taskId=&goPath=)效果。返回结构与真实接口一致: // `{ code, message, data: { id, overview, taskDirection, taskName, taskContent } }` // @@ -409,7 +409,7 @@ const MOCK_ROUTES: Array<{ match: string; dataset: MockDataset }> = [ // 见 `utils/request.ts` 的请求拦截器。 /** cop-task-detail 命中路径。 */ -const COP_TASK_DETAIL_ROUTE = '/taskAnalysSearch/cop-task-detail'; +const COP_TASK_DETAIL_ROUTE = '/taskAnalyseSearch/cop-task-detail'; interface CopTaskDetailSeed { taskName: string;