auto-save 2026-05-13 19:39 (~3)

This commit is contained in:
2026-05-13 19:39:46 +08:00
parent 1ea6f0d850
commit fddc83b365
3 changed files with 33 additions and 2 deletions

View File

@@ -2215,6 +2215,19 @@
"type": "session-heartbeat",
"message": "Codex 会话活跃 · 最近命令codex · 1 项未提交变更 · 最近提交auto-save 2026-05-13 19:28 (~4)",
"files_changed": 1
},
{
"ts": "2026-05-13T19:34:17+08:00",
"type": "commit",
"message": "auto-save 2026-05-13 19:34 (~4)",
"hash": "1ea6f0d",
"files_changed": 4
},
{
"ts": "2026-05-13T11:39:29Z",
"type": "session-heartbeat",
"message": "Codex 会话活跃 · 最近命令codex · 3 项未提交变更 · 最近提交auto-save 2026-05-13 19:34 (~4)",
"files_changed": 3
}
]
}

View File

@@ -830,6 +830,17 @@ api/main.py
<h2>变更记录</h2>
<p>这个记录不是 git log 的替代品。它记录“产品理解发生了什么变化、影响了哪些源码、你以后描述需求时该怎么说”。后续每次改功能都要补一条。</p>
<div class="changelog">
<article class="change">
<header>
<h3>2026-05-13 · 钉住关键帧详情不再触发尺寸跳变</h3>
<span class="tag orange">KeyframePanelNode</span>
</header>
<div class="body">
<p><strong>问题:</strong>钉住时面板从 ReactFlow 画布节点切到浏览器上层浮层,原本被画布 zoom 缩放过的视觉尺寸会丢失,表现为突然放大或缩小。</p>
<p><strong>改动:</strong>钉住瞬间只冻结当前屏幕缩放比例,不改面板自身 <code>framePanelScale</code>;右下角拖拽缩放也按冻结比例换算。</p>
<p><strong>影响:</strong><code>web/components/nodes/index.tsx</code>;钉住只改变“是否跟随画布”,不再顺手改变面板大小。</p>
</div>
</article>
<article class="change">
<header>
<h3>2026-05-13 · 关键帧详情支持右下角拖拽缩放和上层钉住</h3>

View File

@@ -517,6 +517,7 @@ export function KeyframePanelNode({ data }: any) {
const { getZoom } = useReactFlow()
const panelRef = useRef<HTMLDivElement>(null)
const [pinRect, setPinRect] = useState<{ left: number; top: number }>({ left: 24, top: 72 })
const [pinScreenScale, setPinScreenScale] = useState(1)
if (!d.job || d.expandedFrame === null) return null
const active = d.job.frames.find((f) => f.index === d.expandedFrame)
const scale = d.framePanelScale ?? 1
@@ -533,6 +534,7 @@ export function KeyframePanelNode({ data }: any) {
if (!pinned) {
const rect = panelRef.current?.getBoundingClientRect()
if (rect) {
setPinScreenScale(rect.width > 0 ? rect.width / panelWidth : 1)
setPinRect({
left: Math.max(12, Math.min(window.innerWidth - Math.min(rect.width, window.innerWidth - 24), rect.left)),
top: Math.max(12, Math.min(window.innerHeight - 80, rect.top)),
@@ -548,7 +550,7 @@ export function KeyframePanelNode({ data }: any) {
const startX = e.clientX
const startY = e.clientY
const startScale = scale
const zoom = pinned ? 1 : getZoom()
const zoom = pinned ? pinScreenScale : getZoom()
const onMove = (ev: PointerEvent) => {
const dx = (ev.clientX - startX) / zoom
const dy = (ev.clientY - startY) / zoom
@@ -656,7 +658,12 @@ export function KeyframePanelNode({ data }: any) {
return createPortal(
<div
className="fixed z-[240]"
style={{ left: pinRect.left, top: pinRect.top }}
style={{
left: pinRect.left,
top: pinRect.top,
transform: `scale(${pinScreenScale})`,
transformOrigin: "top left",
}}
>
{panel}
</div>,