feat(proofread): 支持角色命名、纠错与批量管理 - #422
Merged
buxuku merged 2 commits intoAug 5, 2026
Merged
Conversation
buxuku
requested changes
Aug 5, 2026
buxuku
left a comment
Owner
There was a problem hiding this comment.
感谢 PR , 有两个数据持久化的问题希望能够修复一下。
-
[P1] 保证“未分配”状态能够持久化 — /renderer/components/proofread/SpeakerCueControl.tsx:162-162
对已有角色的字幕执行此操作后,normalizeSpeakerAssignment会删除speakerIds;保存时updateProofreadDataFromSubtitles又通过subtitle.speakerIds || previous?.speakerIds回退到旧角色。因此界面暂时显示“未分配”,但保存并重新打开后原角色会恢复。保存逻辑需要区分显式清空与旧数据缺失,例如保留空数组或按属性是否存在判断。 -
[P1] 时间调整后仍以手工角色修改为准 — /main/helpers/proofreadData.ts:293-297
当用户先调整 cue 时间、再纠正或批量移动其角色且尚未保存时,上面的speakerIds来自realignSpeakerIdsForCue(existing.cues);只要新区间仍与旧 cue 重叠,该函数就返回旧角色并忽略当前字幕上的 fallback,最终这里会把手工修改覆盖掉。导出的字幕甚至可能使用新角色,而 sidecar 在重新打开后恢复旧角色;应只对没有显式编辑过角色的行重新对齐,或在时间编辑时完成对齐后直接持久化当前状态。
Contributor
Author
|
已在追加提交
同时补充了显式空归属、缺失元数据区分、人工来源恢复及重对齐门禁测试。 验证:
麻烦再帮忙 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.
变更内容
安全与兼容说明
未分配以空归属表示,不伪造角色 ID;多人 cue 保留完整speakerIds,主要角色通过独立字段持久化验证
npm run test:proofread-speakers:31/31(v1→v2 迁移、名册生成、主要角色、多角色去重、批量移动、名称清理与导出前缀)npm run test:speaker-diarization:配置 10/10,对齐 30/30npm run test:dubbing:151/151npm run test:alignment-e2e:离线 31/31npm run check:i18nnpm run build:Renderer + Main production build 通过git diff --check尚未覆盖
Closes #420