feat(roundtable): 深链策划流程小图 + 流程图弹窗横向/缩略图/深蓝适配
- Step1 消息列表头部:深链 taskId 模式取到目的树后,左侧标题换成「策划流程」 彩色层级小图(任务→目的→…→叙事,每级配色对齐流程图节点 + 类型小图标), 点击打开任务目的流程图弹窗;仅第一步、有数据时出现。 - TaskPurposeDialog 流程图:横向(LR)布局 + 右下角缩略图(MiniMap)。 - FlowGraphPanel 深蓝主题适配(随 ThemeContext):容器/头部/画布点阵/连线/图例/ 小地图/节点详情弹窗 + 节点配色(FLOW_NODE_TYPE_META_DARK),浅色红主题不受影响。 - 圆桌侧栏深色兜底:neutral 家族 + 米色 hex(#FAF6F5/#ECE7E4/#E8D0CC) 映射到深蓝 token(关系图背板、第N步 tag 等不再泛白)。 附带提交工作区其余暂存改动(AI 写作等),不含 config.yaml。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
85cca36ddb
commit
03b6fb724c
40 files changed
+2167
-119
No files matched your search
@@ -53,11 +53,16 @@ export interface FlowGraphData {
|
||||
edges: FlowGraphEdge[];
|
||||
}
|
||||
|
||||
export interface FlowNodeColors {
|
||||
label: string;
|
||||
bg: string;
|
||||
border: string;
|
||||
text: string;
|
||||
dot: string;
|
||||
}
|
||||
|
||||
/** 各类型节点的配色(浅底 + 深字 + 强调点),前端按 type 区分颜色。 */
|
||||
export const FLOW_NODE_TYPE_META: Record<
|
||||
FlowNodeType,
|
||||
{ label: string; bg: string; border: string; text: string; dot: string }
|
||||
> = {
|
||||
export const FLOW_NODE_TYPE_META: Record<FlowNodeType, FlowNodeColors> = {
|
||||
start: { label: "开始", bg: "#f1f5f9", border: "#94a3b8", text: "#334155", dot: "#64748b" },
|
||||
end: { label: "结束", bg: "#f1f5f9", border: "#94a3b8", text: "#334155", dot: "#64748b" },
|
||||
stage: { label: "阶段", bg: "#eff6ff", border: "#60a5fa", text: "#1d4ed8", dot: "#3b82f6" },
|
||||
@@ -68,6 +73,27 @@ export const FLOW_NODE_TYPE_META: Record<
|
||||
role: { label: "角色", bg: "#faf5ff", border: "#c084fc", text: "#7e22ce", dot: "#a855f7" },
|
||||
};
|
||||
|
||||
/**
|
||||
* 深蓝主题下的节点配色(对齐《深蓝色 UI 规范》ZS-004 深底):保留各类型色相作识别,
|
||||
* 底色取该色相在深底上的低透明度叠色(dot @ ~16–18%),描边取色相高透明度,
|
||||
* 文字用同色相浅色调(深底可读),强调点沿用亮色。供流程图弹窗 + 头部小节点用。
|
||||
*/
|
||||
export const FLOW_NODE_TYPE_META_DARK: Record<FlowNodeType, FlowNodeColors> = {
|
||||
start: { label: "开始", bg: "rgba(100,116,139,0.20)", border: "rgba(148,163,184,0.55)", text: "#C5CFE0", dot: "#94a3b8" },
|
||||
end: { label: "结束", bg: "rgba(100,116,139,0.20)", border: "rgba(148,163,184,0.55)", text: "#C5CFE0", dot: "#94a3b8" },
|
||||
stage: { label: "阶段", bg: "rgba(59,130,246,0.20)", border: "rgba(96,165,250,0.60)", text: "#bfdbfe", dot: "#60a5fa" },
|
||||
task: { label: "任务", bg: "rgba(6,182,212,0.20)", border: "rgba(34,211,238,0.60)", text: "#a5f3fc", dot: "#22d3ee" },
|
||||
decision: { label: "判断", bg: "rgba(245,158,11,0.18)", border: "rgba(251,191,36,0.55)", text: "#fcd34d", dot: "#fbbf24" },
|
||||
risk: { label: "风险", bg: "rgba(239,68,68,0.18)", border: "rgba(248,113,113,0.55)", text: "#fecaca", dot: "#f87171" },
|
||||
deliverable: { label: "交付物", bg: "rgba(34,197,94,0.18)", border: "rgba(74,222,128,0.55)", text: "#bbf7d0", dot: "#4ade80" },
|
||||
role: { label: "角色", bg: "rgba(168,85,247,0.20)", border: "rgba(192,132,252,0.58)", text: "#e9d5ff", dot: "#c084fc" },
|
||||
};
|
||||
|
||||
/** 按明暗取节点配色表。 */
|
||||
export function flowNodeMeta(dark: boolean): Record<FlowNodeType, FlowNodeColors> {
|
||||
return dark ? FLOW_NODE_TYPE_META_DARK : FLOW_NODE_TYPE_META;
|
||||
}
|
||||
|
||||
const VALID_TYPES = new Set<string>(Object.keys(FLOW_NODE_TYPE_META));
|
||||
|
||||
export const FLOW_FENCE_OPEN = "```flow-json";
|
||||
@@ -395,9 +421,22 @@ export interface PositionedFlowNode extends FlowGraphNode {
|
||||
export const FLOW_NODE_W = 176;
|
||||
const X_GAP = 224;
|
||||
const Y_GAP = 132;
|
||||
// 横向布局:层间走 x(节点宽 176 + 连线/标签留白),层内同层节点沿 y 堆叠。
|
||||
const LAYER_GAP_X = 248;
|
||||
const NODE_GAP_Y = 104;
|
||||
|
||||
/** 最长路径分层(环保护:访问中的节点按 0 层处理,保证终止)。 */
|
||||
export function layoutFlowGraph(data: FlowGraphData): PositionedFlowNode[] {
|
||||
export type FlowOrientation = "vertical" | "horizontal";
|
||||
|
||||
/**
|
||||
* 最长路径分层(环保护:访问中的节点按 0 层处理,保证终止)。
|
||||
*
|
||||
* orientation="vertical"(默认):层自上而下、同层横向铺开。
|
||||
* orientation="horizontal":层自左而右、同层纵向铺开(弹窗里宽屏看着更舒展)。
|
||||
*/
|
||||
export function layoutFlowGraph(
|
||||
data: FlowGraphData,
|
||||
orientation: FlowOrientation = "vertical",
|
||||
): PositionedFlowNode[] {
|
||||
const preds = new Map<string, string[]>();
|
||||
for (const e of data.edges) {
|
||||
const list = preds.get(e.to);
|
||||
@@ -428,10 +467,19 @@ export function layoutFlowGraph(data: FlowGraphData): PositionedFlowNode[] {
|
||||
|
||||
const pos = new Map<string, { x: number; y: number }>();
|
||||
for (const [layer, nodes] of byLayer) {
|
||||
const rowWidth = (nodes.length - 1) * X_GAP;
|
||||
nodes.forEach((n, i) => {
|
||||
pos.set(n.id, { x: i * X_GAP - rowWidth / 2, y: layer * Y_GAP });
|
||||
});
|
||||
if (orientation === "horizontal") {
|
||||
// 层 → x,同层节点沿 y 居中堆叠。
|
||||
const colHeight = (nodes.length - 1) * NODE_GAP_Y;
|
||||
nodes.forEach((n, i) => {
|
||||
pos.set(n.id, { x: layer * LAYER_GAP_X, y: i * NODE_GAP_Y - colHeight / 2 });
|
||||
});
|
||||
} else {
|
||||
// 层 → y,同层节点沿 x 居中铺开(原默认)。
|
||||
const rowWidth = (nodes.length - 1) * X_GAP;
|
||||
nodes.forEach((n, i) => {
|
||||
pos.set(n.id, { x: i * X_GAP - rowWidth / 2, y: layer * Y_GAP });
|
||||
});
|
||||
}
|
||||
}
|
||||
// 保持原始(流式)顺序输出,方便调用方做「最新节点」判断。
|
||||
return data.nodes.map((n) => ({ ...n, ...pos.get(n.id)! }));
|
||||
|
||||
Reference in new issue
Block a user