feat(library): /library 模块 — 用户技术文档精读 (V0.8)#54
Merged
Conversation
New module allowing users to import English tech docs (via URL or paste), read them in-app with click-to-translate, and automatically save vocabulary to the shared `vocabulary` table with source_type='library'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Conflicts: # app/services/vocab_service.py
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
library_articles表(LibraryArticleORM model)+library_service.py(trafilatura URL 抓取 + 粘贴 Markdown 导入 + CRUD)+app/routers/library.py(7 个端点:CRUD + 3 个解读端点);添加trafilatura>=2.0.0依赖;VALID_SOURCE_TYPES加入"library"Library.vue(列表页 + 添加文章模态框)+LibraryArticle.vue(阅读详情 + 点词浮气泡 + 选区翻译 + 本文沉淀侧栏);路由/library+/library/:id;Home 页导航加入「文章库」入口Key Design Decisions
{existing: true, ...}+ 200_auto_save_vocab模式(先占位 → 完成回填 explanation_json){error: "fetch_failed", hint: "..."},前端自动切到粘贴 tabTest plan
pytest tests/test_v08_library.py -v→ 13 passed🤖 Generated with Claude Code