feat(desktop/studio): Tier1 编排画布主题化 + 节点精修(产品灵魂打磨)
react-flow 此前 colorMode 写死 dark、背景/连线/控件全用库默认,换肤下不协调。改为: - colorMode 绑定当前主题 → 控件/连线/手柄/选区自动随亮暗切换。 - Background 点阵色、MiniMap 遮罩随主题;隐藏库水印(proOptions.hideAttribution,更干净)。 - index.css 精修 react-flow:控件(细边/圆角/themed hover)、连线(中性描边+选中紫)、迷你图边框,对齐设计系统。 - TypedNode:卡面落到表面色(ink-850)、选中环用 brand 令牌(替硬编码紫)、加 hover 描边、手柄themed。 - 工具栏/调色板/检查器已用新 Button + 令牌类,自动一致。 tsc + 生产构建通过;桌面端已 HMR。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,7 @@ import { NODE_KINDS, NODE_ORDER } from "./nodeCatalog";
|
||||
import { exportDsl, validate, type Issue, type TaskDsl } from "../lib/dsl";
|
||||
import type { RunPhase } from "../lib/run";
|
||||
import { listKb, listChatModels, listAgents, saveAgent, deleteAgent, type Identity, type AgentInfo } from "../lib/api";
|
||||
import { useTheme } from "../lib/theme";
|
||||
import { Button, Input, cn, useToast } from "../ui";
|
||||
|
||||
let seq = 0;
|
||||
@@ -50,6 +51,7 @@ function buildExample(): { nodes: Node[]; edges: Edge[] } {
|
||||
// 编排 Studio:左(节点面板 + 我的编排) · 中画布 · 右检查器 · 顶工具栏。
|
||||
export function StudioView({ onRun, phase, identity }: { onRun: (dsl: TaskDsl) => void; phase: RunPhase; identity: Identity }) {
|
||||
const toast = useToast();
|
||||
const { theme } = useTheme();
|
||||
const [nodes, setNodes, onNodesChange] = useNodesState<Node>([]);
|
||||
const [edges, setEdges, onEdgesChange] = useEdgesState<Edge>([]);
|
||||
const [selId, setSelId] = useState<string | null>(null);
|
||||
@@ -263,7 +265,8 @@ export function StudioView({ onRun, phase, identity }: { onRun: (dsl: TaskDsl) =
|
||||
</div>
|
||||
|
||||
<ReactFlow
|
||||
colorMode="dark"
|
||||
colorMode={theme}
|
||||
proOptions={{ hideAttribution: true }}
|
||||
nodes={nodes}
|
||||
edges={edges}
|
||||
nodeTypes={nodeTypes}
|
||||
@@ -275,9 +278,9 @@ export function StudioView({ onRun, phase, identity }: { onRun: (dsl: TaskDsl) =
|
||||
deleteKeyCode={["Backspace", "Delete"]}
|
||||
fitView
|
||||
>
|
||||
<Background color="#242b3c" gap={18} />
|
||||
<Background color={theme === "dark" ? "#27272a" : "#e4e4e7"} gap={18} />
|
||||
<Controls />
|
||||
<MiniMap zoomable pannable className="!bg-ink-850" />
|
||||
<MiniMap zoomable pannable maskColor={theme === "dark" ? "rgba(0,0,0,0.55)" : "rgba(0,0,0,0.08)"} className="!bg-ink-850" />
|
||||
</ReactFlow>
|
||||
|
||||
{issues && issues.length > 0 && (
|
||||
|
||||
Reference in New Issue
Block a user