feat(roundtable): 多智能体会商 + 业务链条页脱敏
- 区域级脱敏 Hook useDesensitizeSubtree:对左右侧面板、顶部标题、 业务链条选择器/列表弹窗/列表页/配置页/映射页整片脱敏(文本节点, 跳过 input/textarea 等可编辑控件) - 消息列表正文保持原文,仅智能体名称脱敏(senderName / 席位名 / 流程图节点) - Step3 总结/报告/大屏、推荐弹窗等结果面板脱敏 - 沙箱产物预览不脱敏:ArtifactFileDetail 加 disableDesensitize,会商沙箱传入 - desensitize.ts 新增 desensitizeDeep 递归脱敏结构化数据 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
0e4caa5a66
commit
45049975c2
29 files changed
+853
-66
No files matched your search
@@ -63,6 +63,7 @@ import {
|
||||
import { CSS } from "@dnd-kit/utilities";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useDesensitizeSubtree } from "@/roundtable-planning/lib/use-desensitize-subtree";
|
||||
import { TagSearchBar } from "@/components/workspace/tags/tag-search-bar";
|
||||
import { listAgents } from "@/core/agents";
|
||||
|
||||
@@ -134,6 +135,8 @@ type ActiveDrag =
|
||||
export default function BusinessChainEditorPage() {
|
||||
const navigate = useNavigate();
|
||||
const [searchParams] = useSearchParams();
|
||||
// 整片脱敏:链条配置页展示文本(链条名/描述/席位名/标题)。可编辑的 input/textarea 不脱敏(Hook 跳过),保证编辑用原文。
|
||||
const dzRef = useDesensitizeSubtree<HTMLDivElement>();
|
||||
|
||||
// ─── 数据 ────────────────────────────────────────────────────────────
|
||||
const [pool, setPool] = useState<RecommendCandidate[]>([]);
|
||||
@@ -804,7 +807,7 @@ export default function BusinessChainEditorPage() {
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="flex h-full min-h-0 flex-col bg-muted/40 text-foreground">
|
||||
<div ref={dzRef} className="flex h-full min-h-0 flex-col bg-muted/40 text-foreground">
|
||||
{/* 顶栏 */}
|
||||
<header className="flex shrink-0 flex-wrap items-center gap-3 border-b border-border bg-card px-6 py-3">
|
||||
<button
|
||||
|
||||
@@ -62,6 +62,7 @@ import {
|
||||
} from "@/components/ui/dialog";
|
||||
import { useRouteNavigate } from "@/core/route-base";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useDesensitizeSubtree } from "@/roundtable-planning/lib/use-desensitize-subtree";
|
||||
|
||||
import { deleteChain, listChains, setChainPublic, type ChainScope } from "../api/chains";
|
||||
import { chainTagClasses, type BusinessChain } from "../lib/business-chain";
|
||||
@@ -79,6 +80,8 @@ const BRAND =
|
||||
|
||||
export default function BusinessChainListPage() {
|
||||
const navigate = useRouteNavigate();
|
||||
// 整片脱敏:链条列表页展示文本(链条名/描述/席位名/标题)。
|
||||
const dzRef = useDesensitizeSubtree<HTMLDivElement>();
|
||||
|
||||
// 进入编辑器:带 chainId = 打开并切到该链条;不带 = 空白新建。
|
||||
// 路径写 workspace base,`useRouteNavigate` 会按当前路由 base 改写。
|
||||
@@ -233,7 +236,7 @@ export default function BusinessChainListPage() {
|
||||
}, [chains, search, sortBy]);
|
||||
|
||||
return (
|
||||
<div className="flex h-full min-h-0 w-full flex-col bg-zinc-50/60 font-sans text-zinc-900 antialiased dark:bg-[#0C1836] dark:text-[#C5CFE0]">
|
||||
<div ref={dzRef} className="flex h-full min-h-0 w-full flex-col bg-zinc-50/60 font-sans text-zinc-900 antialiased dark:bg-[#0C1836] dark:text-[#C5CFE0]">
|
||||
{/* 顶栏:标题 + 描述 + 新建链条 */}
|
||||
<header className="shrink-0 border-b border-zinc-200/80 bg-white/85 px-6 py-4 backdrop-blur-md dark:border-[#1A2F5A] dark:bg-[#122347]/80">
|
||||
<div className="mx-auto flex w-full max-w-7xl flex-col gap-4 md:flex-row md:items-center md:justify-between">
|
||||
|
||||
@@ -55,7 +55,9 @@ import {
|
||||
import { useTheme } from "@/contexts/ThemeContext";
|
||||
import { useArtifacts } from "@/components/workspace/artifacts";
|
||||
import { useSidebarSafe } from "@/components/ui/sidebar";
|
||||
import { desensitize } from "@/lib/desensitize";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useDesensitizeSubtree } from "@/roundtable-planning/lib/use-desensitize-subtree";
|
||||
import { useModels } from "@/core/models/hooks";
|
||||
|
||||
import { getAvatar, Man1Avatar, RobotAvatar } from "@/roundtable-planning/components/Avatars";
|
||||
@@ -1178,6 +1180,8 @@ export default function RoundtablePlanningPage() {
|
||||
// 真正建好的窗口里,用它让历史记录显示「挂起中」(作业建好后转 queued/running,由后端状态接管)。
|
||||
// resetToStep1 不卸载本页,故该 state 跨「跳转」存活。
|
||||
const [pendingSuspendIds, setPendingSuspendIds] = useState<Set<string>>(() => new Set());
|
||||
// 整片脱敏:顶部页头(步骤导航 / 历史记录 / 标题等)的所有文本。
|
||||
const headerDzRef = useDesensitizeSubtree<HTMLElement>();
|
||||
const markPendingSuspend = useCallback((draftId: string) => {
|
||||
setPendingSuspendIds((prev) => {
|
||||
const next = new Set(prev);
|
||||
@@ -1477,7 +1481,7 @@ export default function RoundtablePlanningPage() {
|
||||
)}
|
||||
|
||||
{/* HEADER */}
|
||||
<header className="relative z-[40] flex shrink-0 items-center justify-between gap-4 border-b border-slate-100 bg-white px-6 py-3 shadow-[0_1px_3px_rgba(0,0,0,0.02)] dark:border-border dark:bg-card dark:shadow-none">
|
||||
<header ref={headerDzRef} className="relative z-[40] flex shrink-0 items-center justify-between gap-4 border-b border-slate-100 bg-white px-6 py-3 shadow-[0_1px_3px_rgba(0,0,0,0.02)] dark:border-border dark:bg-card dark:shadow-none">
|
||||
<StepNavigation
|
||||
currentStep={currentStep}
|
||||
intentReady={step1.intentReady}
|
||||
@@ -2141,6 +2145,9 @@ function LeftSidebar({
|
||||
onSelectChain,
|
||||
onOpenDraft,
|
||||
}: LeftSidebarProps) {
|
||||
// 整片脱敏:左侧面板(任务概览/参与角色/人工参与等)的所有文本——标题、动态内容、
|
||||
// 嵌套子组件文本一并脱敏。消息列表与沙箱是另外的容器,不挂此 Hook,保持原文。
|
||||
const dzRef = useDesensitizeSubtree<HTMLElement>();
|
||||
const isStep2 = currentStep === 2;
|
||||
// 仅第二步可按席位筛选会商记录;点中已选则取消(回到显示全部)。
|
||||
const toggleSeatFilter = (filter: SeatFilter) =>
|
||||
@@ -2152,6 +2159,7 @@ function LeftSidebar({
|
||||
|
||||
return (
|
||||
<section
|
||||
ref={dzRef}
|
||||
id="left-sidebar"
|
||||
className={cn(
|
||||
"shrink-0 flex flex-col gap-3 overflow-y-auto pr-1 transition-[width] duration-200 ease-out",
|
||||
@@ -3031,14 +3039,14 @@ function RoleAvatarBadge({
|
||||
);
|
||||
|
||||
if (!clickable) {
|
||||
return <div title={`${role.name} · ${role.status}`}>{inner}</div>;
|
||||
return <div title={`${desensitize(role.name)} · ${role.status}`}>{inner}</div>;
|
||||
}
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onSelect}
|
||||
aria-pressed={active}
|
||||
title={active ? "取消筛选,显示全部发言" : `只看 ${role.name} 的发言`}
|
||||
title={active ? "取消筛选,显示全部发言" : `只看 ${desensitize(role.name)} 的发言`}
|
||||
className="shrink-0 cursor-pointer rounded-full transition hover:opacity-80 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60"
|
||||
>
|
||||
{inner}
|
||||
@@ -3078,7 +3086,7 @@ function RoleRow({
|
||||
clickable
|
||||
? active
|
||||
? "取消筛选,显示全部发言"
|
||||
: `只看 ${role.name} 的发言`
|
||||
: `只看 ${desensitize(role.name)} 的发言`
|
||||
: undefined
|
||||
}
|
||||
onClick={onSelect}
|
||||
@@ -3108,7 +3116,7 @@ function RoleRow({
|
||||
<RoleAvatarBadge role={role} agentNameToRole={agentNameToRole} size="h-10 w-10" />
|
||||
<div className="flex min-w-0 flex-col gap-0.5">
|
||||
<span className="truncate text-sm font-bold leading-5 tracking-tight text-slate-800">
|
||||
{role.name}
|
||||
{desensitize(role.name)}
|
||||
</span>
|
||||
{role.type === "agent" && (
|
||||
<span className="text-[11px] text-primary font-medium leading-4">AI 智能体</span>
|
||||
@@ -3178,10 +3186,13 @@ function RightSidebar({
|
||||
triggerToast,
|
||||
onSaveIntent,
|
||||
}: RightSidebarProps) {
|
||||
// 整片脱敏:右侧面板(推荐模型 / 意图摘要 / 澄清记录)所有文本。
|
||||
const dzRef = useDesensitizeSubtree<HTMLElement>();
|
||||
// Step 2 侧栏内容已迁至左侧;Step 3 沿用原逻辑不展示右侧栏。
|
||||
if (currentStep !== 1) return null;
|
||||
return (
|
||||
<section
|
||||
ref={dzRef}
|
||||
id="right-sidebar"
|
||||
className="w-[300px] shrink-0 flex flex-col gap-4 overflow-y-auto pl-1"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user