feat(translate): 翻译自动入生词本 — 占位 + 回填#53
Merged
Merged
Conversation
登录用户点翻译即自动写入 vocabulary,无需手动收藏: - 后端:do_translate 可选 JWT + 占位写入 + 译文回填 - 后端:新增 update_translated_text() 回填函数 - 前端:删除手动收藏按钮,改为自动状态提示 - 修复:model_client.py float|None → Optional[float] (Python 3.9) - 9 个新测试覆盖匿名/登录/幂等/复活/降级场景 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
do_translate接受可选 JWT,翻译前占位写入 vocabulary,成功后回填translated_textvocab_service.update_translated_text()新增回填函数model_client.pyfloat|None→Optional[float](Python 3.9 兼容)实现 spec:
docs/superpowers/specs/2026-05-20-translate-auto-vocab-design.mdTest plan
tests/test_translate_auto_vocab.py)tests/test_v05_translate_batch.py)🤖 Generated with Claude Code