docs(spec): Translate 自动入生词本设计稿(Phase 1)#52
Merged
Conversation
V0.8 explain 自动入库模式平移到 Translate 页:点「翻译」立即占位, 译文回填,匿名降级。包含后端契约、前端 UI、测试与风险清单。
- direction 白名单校验前置到占位写入前(避免非法 direction 留空白行) - update_translated_text 失败用 try/except 降级,不拖垮已成功的翻译 - 复用已有 get_current_user_id_optional,不再新增重复依赖 - 测试补 test_backfill_failure_degrades / test_invalid_direction_no_placeholder
记录原始需求里被推迟的「生词本去重」开放问题,作为后续 brainstorm 的入口,避免被遗忘。
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.
Summary
仅设计稿,不含实现。把 V0.8 「解读发起即自动写入 vocabulary」的同构模式平移到 Translate 页:点「翻译」立即占位入库,译文回填,匿名降级。
Spec:
docs/superpowers/specs/2026-05-20-translate-auto-vocab-design.md提交链:
69dd3dc初版 specf70e7a0应用 codex review 反馈(3 处)eb9e931补 §8 Phase 2「生词本去重」留锚Codex review 结果
get_current_user_id_optional,别新增重复依赖测试用例补
test_backfill_failure_degrades和test_invalid_direction_no_placeholder。实施清单(spec §7,本 PR 范围之外)
vocab_service.update_translated_textrouters/translate.do_translate改造(可选 auth + direction 前置校验 + 回填降级 + 扩响应字段)tests/test_translate_auto_vocab.py(9 用例)test_v05_step3/test_v05_translate_batch/test_v07_step2-3/test_v05_step1-2)Translate.vue顶部能力条 + 译文状态行 + 删按钮Translate.spec.jsPhase 2 占位
原始需求里「生词本做好去重」本次推迟,作为后续独立 brainstorm 启动 — 见 spec §8。
Test plan
🤖 Generated with Claude Code