From 6fb00da3f966a23fd44d3ecfc80082c07506292e Mon Sep 17 00:00:00 2001 From: kang Date: Wed, 13 May 2026 19:06:46 +0800 Subject: [PATCH] auto-save 2026-05-13 19:06 (~3) --- .memory/worklog.json | 7 +++ docs/source-analysis.html | 13 ++++- web/components/nodes/index.tsx | 99 ++++++++++++---------------------- 3 files changed, 52 insertions(+), 67 deletions(-) diff --git a/.memory/worklog.json b/.memory/worklog.json index dddc022..65cc215 100644 --- a/.memory/worklog.json +++ b/.memory/worklog.json @@ -2155,6 +2155,13 @@ "type": "session-heartbeat", "message": "Codex 会话活跃 · 最近命令:codex · 3 项未提交变更 · 最近提交:auto-save 2026-05-13 18:51 (~1)", "files_changed": 3 + }, + { + "ts": "2026-05-13T19:01:14+08:00", + "type": "commit", + "message": "auto-save 2026-05-13 18:57 (+1, ~3)", + "hash": "aec7fda", + "files_changed": 4 } ] } diff --git a/docs/source-analysis.html b/docs/source-analysis.html index 14c0fda..8ceef2f 100644 --- a/docs/source-analysis.html +++ b/docs/source-analysis.html @@ -830,6 +830,17 @@ api/main.py

变更记录

这个记录不是 git log 的替代品。它记录“产品理解发生了什么变化、影响了哪些源码、你以后描述需求时该怎么说”。后续每次改功能都要补一条。

+
+
+

2026-05-13 · 元素改造 hover 预览改为节点内效果

+ StoryboardNode +
+
+

问题:上一版把元素预览用 createPortal 挂到 body,DevTools 里会出现额外 fixed 层,交互形态和关键帧节点不一致。

+

改动:改成和镜头拆解关键帧一致的节点内 group-hover 预览:hover 时在元素缩略图上方展示来源原帧 + 提取元素,不再向 body 插入预览层。

+

影响:web/components/nodes/index.tsx;元素改造板块的 DOM 和交互效果更接近关键帧缩略图。

+
+

2026-05-13 · 新增独立源码解析与协作地图

@@ -849,7 +860,7 @@ api/main.py

问题:元素改造节点上方小图 hover 没有像镜头拆解节点一样显示原图预览,并且首次修复时出现运行时错误。

原因:节点内部 overflow 裁剪了预览;随后 portal 预览里把变量写成了不存在的 aspectRatio

-

影响:web/components/nodes/index.tsx。现在 hover 展示来源原帧和提取元素,运行时异常已验证为 0。

+

影响:web/components/nodes/index.tsx。该记录之后又改为节点内预览,见上方最新记录。

diff --git a/web/components/nodes/index.tsx b/web/components/nodes/index.tsx index f0665fb..11af45f 100644 --- a/web/components/nodes/index.tsx +++ b/web/components/nodes/index.tsx @@ -1,6 +1,5 @@ "use client" import { useEffect, useRef, useState } from "react" -import { createPortal } from "react-dom" import { type NodeProps } from "@xyflow/react" import { Link2, Upload, Download, Scissors, Image as ImageIcon, @@ -599,14 +598,6 @@ const IMAGEGEN_WIDTH = 360 export function StoryboardNode({ data, selected }: any) { const d: NodeData = data const job = d?.job - const [hover, setHover] = useState<{ - rect: DOMRect - name: string - elementSrc: string - frameSrc: string - frameIdx: number - timestamp: number - } | null>(null) // 上方浮条 = 所有 frame 的 elements 已提取图("分镜头编排"的输入素材) type ElPreview = { frameIdx: number; elementId: string; name: string; src: string; cid: string; frameSrc: string; timestamp: number } @@ -651,19 +642,8 @@ export function StoryboardNode({ data, selected }: any) { return (
{ - setHover({ - rect: e.currentTarget.getBoundingClientRect(), - name: p.name, - elementSrc: p.src, - frameSrc: p.frameSrc, - frameIdx: p.frameIdx, - timestamp: p.timestamp, - }) - }} - onMouseLeave={() => setHover(null)} >
) })}
)} - {job && hover && (() => { - const w = 420 - const h = 300 - const gap = 12 - const centerX = hover.rect.left + hover.rect.width / 2 - const left = Math.max(12, Math.min(window.innerWidth - w - 12, centerX - w / 2)) - const top = hover.rect.top > h + gap - ? hover.rect.top - h - gap - : Math.min(window.innerHeight - h - 12, hover.rect.bottom + gap) - return createPortal( -
-
-
-
-
来源原帧
-
- -
-
-
-
提取元素
-
- -
-
-
-
- {hover.name} - 分镜 {hover.frameIdx + 1} · {hover.timestamp.toFixed(2)}s -
-
-
, - document.body, - ) - })()} - }