feat(translate): DeepL 风重设计 — 三栏布局/分词词卡/FSRS 侧栏/移动端#55
Merged
Conversation
翻译页 V0.11 重设计第一阶段: - 拆分为 4 个子组件 (TopBar/TranslateInput/TranslateResult/TranslateSidebar) - 三栏 CSS grid 布局 (1fr 1fr 320px),sidebar 可折叠 - 800ms debounce 自动翻译 + 100 条 LRU 前端缓存 - requestId + AbortController stale response 防御 - swap 只切方向不动文本,标记 stale - CJK 比例 ≥30% 自动检测方向,手动 swap 后 5s 内不重判 - Cmd/Ctrl+Enter 手动触发 - 响应式:1024px 双栏、768px 单栏 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- vocabulary.source_type: bbc_eaw → article + 新增 series 字段(bbc_eaw/voa/...) - bbc_eaw_episodes 表重命名为 article_episodes + 新增 series 列 - /bbc-eaw/* 路由迁移到 /articles/episodes/* - 新增迁移脚本 scripts/migrate_article_refactor.py - 前端 tag chip 由 series 字段派生,去除 source_type 硬编码 mapping - 保留 BbcEawEpisode 别名确保向后兼容 - 跳过 /practice/* alias 移除(距 V0.8 上线不足 14 天) - fix(model_client): 添加 from __future__ import annotations 修复 Python 3.9 兼容性 Refs #42 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DeepL 重设计第三阶段:
- GET /vocab?limit=500 加载 + source_type=translate 本地过滤
- item_type chip 过滤(全部/单词/句子)
- 4 档评分(again/hard/good/easy)→ POST /vocab/{id}/rate
- due 倒计时(分钟/小时/天)
- 评分后用返回 item 原地替换条目
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts:
# frontend/src/components/translate/TranslateSidebar.vue
DeepL 重设计第四阶段: - <1024px 时 sidebar 隐藏,显示右下角 FAB 按钮 - FAB 点击打开 bottom-sheet(Teleport + overlay) - sheet 含 grip handle + 关闭按钮 + TranslateSidebar - sheet 动画(translateY 滑入/滑出) - safe-area 处理(safe-bottom padding) - resize 事件动态切换 mobile/desktop 模式 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts: # frontend/src/views/Translate.vue
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.11 完整重设计,包含原计划 4 个 PR 的全部内容:
PR1 · 结构 + 翻译主流程
PR2 · 单词交互
PR3 · Sidebar FSRS + 收藏闭环
PR4 · 移动端
Test plan
npm run build构建通过(全部 4 个阶段)🤖 Generated with Claude Code