Skip to content

V0.8 文章库 · 技术文档阅读器 (/library) #46

Description

@bob798

Tracking issue for V0.8 文章库 implementation. PR per Step, each PR Refs #<this>.

Spec & Plan

Goal

`/library` = 用户自带英文技术文档(GitHub Markdown / 任意 URL / 粘贴正文)→ 阅读 → 点词/选区翻译 → 翻译自动入生词本 → 「本文沉淀」侧栏复习。

跟 BBC `/articles`(跟读 + 发音 + FSRS)路径并行存在,共用 `vocabulary` 表与 `explain_service`。

实现进度(16 Task,逐个 PR)

后端

  • Task 1: 依赖与 LibraryArticle ORM model
  • Task 2: library_service.import_article — URL 抓取 + Markdown 粘贴
  • Task 3: library_service — list / get / delete / refetch
  • Task 4: app/routers/library.py — CRUD 5 端点
  • Task 5: 扩展 source_type='library' + _auto_save_library_vocab
  • Task 6: /library/articles/{id}/explain 同步 + 入库 + 回填
  • Task 7: /library/articles/{id}/explain/phonetic IPA 秒出
  • Task 8: /library/articles/{id}/explain/stream NDJSON 流式

前端

  • Task 9: 前端依赖 + API 常量 + useLibraryApi composable
  • Task 10: Library.vue 列表页 + AddArticleModal
  • Task 11: LibraryArticle.vue 骨架 + Markdown 渲染 + 点词浮气泡
  • Task 12: 选区菜单 + 流式 explain 浮层 + 共享 ExplanationCard
  • Task 13: 「本文沉淀」侧栏 + 原地展开
  • Task 14: 移动端降级(最小可用)

文档与验收

  • Task 15: 文档同步 — CLAUDE.md / README / 架构图 / 数据流
  • Task 16: 全量回归 + 手动 E2E 验收

约定

  • 测试 user_id:`test_user_v08_library_task`
  • 每 Task 一个独立分支 `feat/library-step-N`、一个 PR `[V0.8 library / Step N] ...`
  • PR body 必须 `Refs #`

并行 spec

  • BBC `/articles` 改名:`docs/superpowers/specs/2026-05-19-articles-vocab-tag-design.md`(独立 issue 跟踪)
  • 共依赖项 `update_explanation` 已就位;`ExplanationCard` 由本 spec Task 12 抽取,BBC `/vocabulary` 复用

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions