fix(editing): IPC 序列化总根因(camelCase 字段)+ 蓝色选中 + 递归导入 + 红绿灯位置#143
Merged
Conversation
…ector/…) + blue selection + recursive folder import + traffic-light position
THE root cause of "the whole editing suite is broken": serde's enum-level
`#[serde(rename_all = "camelCase")]` renames variant NAMES but NOT the fields of
struct variants, so every EditRequest variant with a multi-word field (clip_ids,
clip_id, at_frame, track_index, offset_frames, …) expected snake_case while the
front end sends camelCase — the `command` arg failed to deserialize ("missing
field `clip_ids`") and the action silently did nothing. Only single-word-field
commands (AddClips/MoveClips/TrimClips) worked, which is why drag-in/move/trim
looked fine but Delete, Split-at-playhead, Duplicate, Inspector SetClipProperties,
all keyframe ops, Link/Unlink and folder ops never applied. Long misdiagnosed as
"selection not working".
- src-tauri/src/commands.rs: add `#[serde(rename_all = "camelCase")]` to every
EditRequest struct variant + a regression test deserializing camelCase
removeClips/splitClip/insertClips/rippleDeleteClips.
- clipRenderer: selected clips get a clear blue 2px outline (old near-white
border read as grey).
- mediaActions: import folder recursively so nested media is imported.
- tauri.conf/tokens: nudge the macOS traffic lights down + widen the titlebar
safe area so the sidebar title clears them.
Self-contained subset extracted from the integration branch (#141); the buggy
feature PRs and the preview/playback rewrite (#142) are tracked separately.
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.
从集成分支 #141 抽出的干净、自包含修复子集,直接合 main(不夹带仍有 bug 的功能 PR)。
核心:剪辑套件失效的总根因(详见 #142)
serde 的 enum 级
#[serde(rename_all="camelCase")]只改变体名、不改 struct 变体的字段名(已实测)。于是EditRequest里所有多词字段命令(clip_ids/clip_id/at_frame/track_index/offset_frames…)只认 snake_case,而前端发 camelCase → 整条命令反序列化失败、被void静默吞掉。删除时 toast 暴露:missing field 'clip_ids'。结果:拖入/移动/修剪(单词字段)正常,但删除、在播放头分割、Inspector 改属性、关键帧、Link/Unlink、文件夹操作全部静默失效——长期被误诊为"选中没生效"。main 上一直有此 bug。
修复:给
EditRequest每个 struct 变体加#[serde(rename_all="camelCase")]+ 回归测试。附带的自包含小修
{x:18,y:24}+ titlebar 安全区下移,标题留白。验证
cargo test -p opentake-tauri edit_request_serde✅(camelCase removeClips/splitClip/insertClips/rippleDeleteClips 均反序列化通过)tsc✅ · 52 前端测试 ✅ ·vite build✅关联
🤖 Generated with Claude Code