feat(timeline): 吸附迟滞+多探针 / 链接 offset 角标 / 音量橡皮筋 (#99)#120
Open
cuic19053-hue wants to merge 2 commits into
Open
feat(timeline): 吸附迟滞+多探针 / 链接 offset 角标 / 音量橡皮筋 (#99)#120cuic19053-hue wants to merge 2 commits into
cuic19053-hue wants to merge 2 commits into
Conversation
appergb
requested changes
Jun 23, 2026
appergb
left a comment
Owner
There was a problem hiding this comment.
@cuic19053-hue 自动审核结论:请修改(REQUEST_CHANGES)。snap 迟滞/多探针、链接 offset 角标、音量橡皮筋方向不错,但有阻塞:
- 与刚合并的 #119 关键帧路线冲突:你在
web/src/store/editActions.ts重复定义了stampKeyframe/moveKeyframe(纯前端 read-modify-write),而 #119 已合并并确立后端命令路线(走真命令 + undo + 全属性含 pair/crop)。两者同名同签名,同时进 main 会 TS 重复导出编译失败 + 语义分叉(RMW 有 TOCTOU 竞态、仅支持 scalar)。请删除本 PR 的前端 RMWstampKeyframe/moveKeyframe,改调 #119 的后端命令(或本 PR 专注 snap/offset/音量,移除关键帧段)。 - 与 #123 在
timelineCanvas.ts的 DragPaint 类型冲突:你加volumeKf变体,#123 把move变体改为对象——rebase 时手动整合 DragPaint 与 paintTimeline。 - 请 rebase 到含 #119 的最新 main(#119 已改 editActions/clipRenderer/types,本 PR 现已冲突)。
appergb
pushed a commit
to cuic19053-hue/OpenTake
that referenced
this pull request
Jun 24, 2026
…ppergb#120-123 request-changes
appergb
requested changes
Jun 24, 2026
appergb
left a comment
Owner
There was a problem hiding this comment.
@cuic19053-hue Sonnet 4.6 复审:主体功能(吸附迟滞+多探针、音量橡皮筋、链接 offset 角标)已实现,但有三处阻塞:
- 角标位置违反 1:1。 本 PR 放左上角(
clipRenderer.tsbx = rect.x + CLIP.stripWidth + 3),上游ClipRenderer.swift:640-644是右上角(x = rect.maxX - handleW - badgeWidth - 2)。且与 #139 重复实现同名drawOffsetBadge+linkOffset字段,合并必冲突——请与 #139 二选一/协调(#139 位置与上游一致)。 - move 拖拽错误吸附 playhead。
TimelineContainer.tsxmove 分支collectTargets(timeline, excluded, activeFrame)传了 activeFrame,使拖移可吸附播放头;上游SnapEngine.swiftmove 拖拽includePlayhead默认 false(仅 razor 传 true)。注意此处与 #138 同行冲突,需协调。 - 与 #123 的 DragPaint 冲突。 本 PR 新增
volumeKfvariant、#123 改movevariant,同改timelineCanvas.ts的DragPaint/paintTimeline,合并顺序不定必产生 TS 冲突,需手动整合。
请处理后重提。
cuic19053-hue
added a commit
to cuic19053-hue/OpenTake
that referenced
this pull request
Jun 24, 2026
…view appergb#120) Two PR appergb#120 review request-changes fixes, both for spec 5.7 / 5.4 1:1 port correctness: 1. drawOffsetBadge anchored to the right edge of the clip, just inside the right trim handle (ClipRenderer.swift:640-644). The old top-left position sat on top of the color strip and label, and the new width-guard reserves room for the trim handle so the badge never overlaps it. 2. Move drag no longer includes the playhead in the snap target set. The old collectTargets(timeline, excluded, activeFrame) made moving clips stick to the playhead, which felt like a bug. Pass null (the same exclusion the trim path uses) so a move only snaps to other clip edges and the playhead stays a passive reference. pnpm tsc --noEmit + pnpm build + pnpm test 52/52 green.
1. 吸附迟滞 + 多探针
- snap.ts: findSnapDelta 扩展接受 currentlySnapped + probeOffsets,
返回 probeOffset,支持 sticky band 跨 pointer 事件保持
- TimelineContainer.tsx: 新增 snapStateRef 跨事件保持吸附状态;
onPointerMove move 分支收集所有 companions 的 start+end 作为探针组,
改用 findSnapDelta(不再传 null);onPointerUp 清空 snapStateRef
2. 链接 offset 角标
- clip.ts: 新增 linkOffsetForClip 计算链接组内帧偏移(相对 lead clip)
- clipRenderer.ts: 新增 drawOffsetBadge 绘制红色圆角徽章 "+N"/"-N"
- timelineCanvas.ts: clip 绘制参数增加 linkOffset,调用 drawOffsetBadge
3. 音量橡皮筋
- clipRenderer.ts: 新增 drawVolumeEnvelope 绘制 volumeTrack 折线 + kf 圆点
(半径 5px,黄色填充白色边框);拖拽时 ghost dot 跟随光标
- hitTest.ts: 新增 audioVolumeKfHit 命中测试(8px 容差)
- TimelineContainer.tsx: 新增 audioVolumeKf DragState + 拖拽逻辑;
Cmd+click 空白处调 stampKeyframe
- editActions.ts: moveKeyframe / stampKeyframe 实现为前端 wrapper
(read-modify-write over setKeyframes,因后端仅暴露 SetKeyframes)
验证:pnpm tsc --noEmit 通过;pnpm build 通过;52 项测试全通过
…view appergb#120) Two PR appergb#120 review request-changes fixes, both for spec 5.7 / 5.4 1:1 port correctness: 1. drawOffsetBadge anchored to the right edge of the clip, just inside the right trim handle (ClipRenderer.swift:640-644). The old top-left position sat on top of the color strip and label, and the new width-guard reserves room for the trim handle so the badge never overlaps it. 2. Move drag no longer includes the playhead in the snap target set. The old collectTargets(timeline, excluded, activeFrame) made moving clips stick to the playhead, which felt like a bug. Pass null (the same exclusion the trim path uses) so a move only snaps to other clip edges and the playhead stays a passive reference. pnpm tsc --noEmit + pnpm build + pnpm test 52/52 green.
7d6e507 to
32f0d9a
Compare
Contributor
Author
|
@appergb 请求重新审查。此前反馈已全部修复,CI 双绿(Rust ✅ Web ✅,commit \32f0d9a\):
DragPaint 合并顺序:本 PR 与 #123 在 \ imelineCanvas.ts\ 的 \DragPaint\ 类型有冲突。本 PR 新增 \�olumeKf\ 变体(纯新增,风险低),#123 给 \move\ 变体加 \duplicate\ 字段。建议先合并本 PR(#120),#123 rebase 整合后再合并。 请 re-review,谢谢! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
解决 #99:吸附迟滞+多探针 / 链接 offset 角标 / 音量橡皮筋
How
1. 吸附迟滞 + 多探针
2. 链接 offset 角标
3. 音量橡皮筋
额外说明
#95(keyframe editing)尚未合并到 upstream/main,后端
EditCommand仅暴露SetKeyframes。为保持纯前端 PR,
edit.moveKeyframe/edit.stampKeyframe实现为前端 wrapper(read-modify-write over
setKeyframes):读取当前 timeline mirror → 修改 kf 数组 → 调用已有的
setKeyframes命令。运行时可用,无需后端改动。Testing
Limitation
Closes #99