Commit Graph

271 Commits

Author SHA1 Message Date
130ab226ff fix: JSON syntax errors and add missing translations
- Fix missing comma in en-US.json
- Add noIpa translation to all locale files
2026-03-18 10:16:46 +08:00
59d22ccf4c fix: add missing comma in en-US.json 2026-03-18 09:48:45 +08:00
06012c43f2 feat: add study modes to Memorize page
- Add 4 study modes: order-limited, order-infinite, random-limited, random-infinite
- Add mode selector buttons with icons
- Update progress display for infinite modes
- Add translations for all 8 locales
2026-03-18 08:52:45 +08:00
c54376cbe6 feat: display card meanings as table in Memorize
- Change card back display from joined string to structured table
- Each meaning shows part of speech and definition separately
- Improved readability for multiple meanings
2026-03-18 08:42:22 +08:00
3ed3478c66 fix: change default theme color to mist in CSS
Prevent FOUC (Flash of Unstyled Content) on page refresh by aligning
CSS default colors with the DEFAULT_THEME setting in theme-presets.ts
2026-03-18 08:36:22 +08:00
bc7608e049 fix: add missing translations and fix namespace usage
- Fix srt-player to use srtT namespace for error messages
- Add deck_id.enterLanguageName and language labels (english, chinese, japanese, korean)
- Add memorize.review.nextCard translation
- Update all 8 locales with consistent translations
2026-03-18 08:34:04 +08:00
1ef337801d refactor: unify i18n function calls and simplify scripts
- Replace dynamic t(lang.labelKey) with static t(lang.label) using helper functions
- Add getLanguageLabel/getLangLabel/getLocaleLabel helper functions for switch-based label lookup
- Simplify translation check scripts to only detect literal string calls
- Fix namespace lookup for dotted namespaces like 'memorize.review'
2026-03-18 08:13:58 +08:00
286add7fff fix: rewrite translation check scripts with proper regex
- Fix regex to handle 'await getTranslations' pattern
- Add word boundary to prevent false matches like 'get("q")'
- Improve namespace detection for dotted namespaces
- Reduce false positives in both scripts
2026-03-18 07:59:21 +08:00
de7c1321c2 refactor: remove Anki import/export and simplify card system
- Remove Anki apkg import/export functionality
- Remove OCR feature module
- Remove note and note-type modules
- Simplify card/deck modules (remove spaced repetition complexity)
- Update translator and dictionary features
- Clean up unused translations and update i18n files
- Simplify prisma schema
2026-03-17 20:24:42 +08:00
95ce49378b feat: add translation check scripts
- find-missing-translations.ts: detect translation keys used in code but missing in message files
- find-unused-translations.ts: detect translation keys in message files but not used in code
2026-03-17 20:24:06 +08:00
2f5ec1c0f0 feat(translator): add custom target language input
- Replace Select with Input for custom language entry
- Users can now type any target language they want
- Add i18n translations for all 8 languages
2026-03-16 12:07:46 +08:00
f53fa5e2a1 refactor: unify design-system components across pages
- Replace native textarea with Textarea in translator and text-speaker pages
- Replace custom loading spinners with Skeleton in InDeck and FavoritesClient pages
- Add shared constants DEFAULT_NEW_PER_DAY, DEFAULT_REV_PER_DAY
2026-03-16 09:44:51 +08:00
1d5732abc8 refactor: optimize repoGetTodayStudyStats with SQL aggregation and use shared constants
- Replace JS counting with Prisma groupBy for better performance
- Add DEFAULT_NEW_PER_DAY and DEFAULT_REV_PER_DAY constants
- Use constants in InDeck.tsx
2026-03-16 09:31:21 +08:00
ada2f249ee refactor: add shared utilities and replace console.log with logger
- Add shared action-utils.ts with getCurrentUserId and requireAuth helpers
- Add shared constants for anki defaults (FIELD_SEPARATOR, DEFAULT_NEW_PER_DAY, DEFAULT_REV_PER_DAY)
- Add shared time constants (SECONDS_PER_DAY, MS_PER_DAY, etc.)
- Replace console.error with logger in auth.ts
2026-03-16 09:24:57 +08:00
bc0b392875 feat(deck): add daily learning limits and today's study stats
- Add newPerDay and revPerDay fields to Deck model (Anki-style)
- Add settings modal to configure daily limits per deck
- Display today's studied counts (new/review/learning) on deck page
- Add i18n translations for all 8 languages
- Fix JSON syntax errors in fr-FR.json and it-IT.json
- Fix double counting bug in repoGetTodayStudyStats
2026-03-16 09:01:55 +08:00
a68951f1d3 refactor(ui): use design-system components across pages
- Replace custom spinners with Skeleton
- Replace native inputs/select with design-system components
- Simplify dictation mode (user self-judges instead of input)
- Set body background to primary-50
- Clean up answer button shortcuts
2026-03-16 07:58:43 +08:00
c525bd4591 feat(learn): add reverse and dictation modes for card review
- Add reverse mode to swap card front/back
- Add dictation mode with TTS audio playback and answer verification
- Add i18n translations for new features in all 8 languages
- Integrate useAudioPlayer hook for TTS playback
2026-03-14 11:52:56 +08:00
6213dd2338 refactor: move memorize feature to /decks/[deck_id]/learn route
- Delete (features)/memorize directory
- Create /decks/[deck_id]/learn with Memorize component and page
- Update InDeck.tsx to navigate to new learn route
- Fix homepage memorize link to point to /decks
2026-03-14 11:34:46 +08:00
af684a15ce feat: add reset deck progress feature for deck detail page 2026-03-13 22:02:55 +08:00
279eee2953 i18n: fix navbar 'folders' to 'decks' and add follow section 2026-03-13 19:30:44 +08:00
168f0c161e i18n: add follow section to all languages and fix duplicate decks 2026-03-13 19:05:38 +08:00
7c71ffcf31 fix(card): use RELEARNING_STEPS for relearning card interval preview 2026-03-13 15:44:06 +08:00
4243cdc68b fix(card): improve SM-2 algorithm An An SM-2 algorithm for LEARNING/RElearning cards now uses correct steps ( RELEARNING_STEPS for relearning cards)
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-13 15:36:29 +08:00
cbb9326f84 refactor(anki): improve APKG import/export reliability
- Use crypto.getRandomValues for GUID generation
- Use SHA1 checksum for consistent hashing
- Add proper deep cloning for note type fields/templates
- Improve unique ID generation with timestamp XOR random
- Add file size validation for APKG uploads

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-13 15:10:34 +08:00
49ad953add fix(card): improve SM-2 algorithm compatibility with Anki
- Fix scheduleNewCard ease===3 (Good) to use steps[1] or graduate
- Fix scheduleLearningCard ease===2 (Hard) to repeat current step
- Ensure graduating cards get DEFAULT_FACTOR
- Fix interval calculations for learning card graduation

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-13 15:09:54 +08:00
f1eafa8015 i18n: add card type labels for memorize feature
Add translations for cardTypeNew, cardTypeLearning, cardTypeReview,
cardTypeRelearning in all 8 supported languages (en-US, zh-CN, ja-JP,
ko-KR, de-DE, fr-FR, it-IT, ug-CN).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-13 15:08:02 +08:00
12e502313b feat(memorize): enhance review UI with dynamic intervals and keyboard shortcuts
- Add keyboard shortcuts: Space/Enter to show answer, 1-4 for responses
- Display dynamic preview intervals on answer buttons (1m, 6m, 4d, etc.)
- Add card type indicator (New/Learning/Review/Relearning) with color badges
- Highlight Good button as recommended option with ring and icon
- Show keyboard hint on Show Answer button

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-13 15:07:49 +08:00
13e8f51ada feat(memorize): add interval preview calculation utility
- Add calculatePreviewIntervals for Again/Hard/Good/Easy buttons
- Support NEW, LEARNING, RELEARNING, and REVIEW card types
- Use SM2_CONFIG constants for accurate interval calculation
- All intervals returned in minutes for consistent formatting

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-13 15:07:32 +08:00
7ba31a37bd feat: 添加 Anki APKG 导入/导出功能
- 添加 APKG 解析器 (src/lib/anki/apkg-parser.ts)
- 添加 APKG 导出器 (src/lib/anki/apkg-exporter.ts)
- 添加导入/导出 Server Actions
- 添加导入/导出 UI 组件
- 集成到牌组页面
- 添加 i18n 翻译

同时修复断链:
- /folders → /decks (Navbar, signup, profile)
2026-03-11 10:37:23 +08:00
4d4062985d fix: 修复 React Compiler 严格模式下的 lint 错误
- Memorize: 将 loadCards 内联到 useEffect 中避免变量提升问题
- DecksClient: 修复 effect 中异步加载,创建 deck 后使用 actionGetDeckById
- LanguageSettings: 使用 effect 设置 cookie 避免 render 期间修改
- theme-provider: 修复 hydration 逻辑避免 render 期间访问 ref
2026-03-11 09:51:25 +08:00
804c28ada9 refactor: 修复 modules 三层架构违规
- auth: actionDeleteAccount 改用 service+repo,forgot-password 完整三层实现
- card: serviceCheckCardOwnership 替代直接调用 repository
- deck: 移除 service 层的 use server 指令
- dictionary: 数据转换逻辑从 repository 移到 service
- ocr: 认证移到 action 层,跨模块调用改用 service
- translator: genIPA/genLanguage 改用 service 层
2026-03-11 09:40:53 +08:00
e68e24a9fb style: 降低注销按钮的视觉显著性
- 改用 ghost 样式替代 error 样式
- 使用小尺寸
2026-03-10 20:21:38 +08:00
8099320e00 feat: 添加注销账号功能
- 在个人资料页面添加注销账号按钮
- 需要输入用户名确认才能删除
- 删除所有用户数据:牌组、卡片、笔记、关注等
- 添加 8 种语言翻译
2026-03-10 19:54:19 +08:00
db0b0ff348 fix: 强制 username 登录也需要邮箱验证
- 添加 sendOnSignIn: true 配置
- 在 hook 中拦截 /sign-in/username 请求
- 检查用户邮箱是否已验证,未验证返回 403
2026-03-10 19:41:30 +08:00
6f4b123a84 fix: 添加邮箱验证重发功能
- 登录时检测 403 错误(邮箱未验证)
- 显示重发验证邮件按钮
- 修复邮件发送失败时静默忽略的问题
- 添加 8 种语言的验证相关翻译
2026-03-10 19:38:54 +08:00
57ad1b8699 refactor: 完全重构为 Anki 兼容数据结构
- 用 Deck 替换 Folder
- 用 Note + Card 替换 Pair (双向复习)
- 添加 NoteType (卡片模板)
- 添加 Revlog (复习历史)
- 实现 SM-2 间隔重复算法
- 更新所有前端页面
- 添加数据库迁移
2026-03-10 19:20:46 +08:00
9b78fd5215 feat: 添加 OCR 词汇提取功能
新增 OCR 页面,用户可上传教材词汇表截图,使用 GLM-4.6V 视觉模型
提取单词-释义对并保存到指定文件夹。

- AI 管道: src/lib/bigmodel/ocr/ (orchestrator, types)
- 后端模块: src/modules/ocr/ (action-service-repository 架构)
- 前端页面: src/app/(features)/ocr/ (拖拽上传、folder 选择)
- i18n: 8 种语言翻译支持
2026-03-10 15:21:45 +08:00
683a4104ec feat: 添加用户关注功能
- 新增 Follow 表和 User.bio 字段 (Prisma schema)
- 创建 follow 模块 (action-service-repository)
- 新增 FollowButton/FollowStats/UserList 组件
- 用户页面显示 bio、粉丝/关注数、关注按钮
- 新增 /users/[username]/followers 和 following 页面
- 添加 en-US/zh-CN i18n 翻译

⚠️ 需要运行: prisma migrate dev --name add_follow_and_bio
2026-03-10 14:58:43 +08:00
abcae1b8d1 feat: 添加移动端下拉菜单和主题色设置
- 新增 MobileMenu 组件,小屏幕使用汉堡菜单替代多个按钮
- 重构 LanguageSettings 为统一下拉框样式
- 新增设置页面,支持主题色切换
- 翻译页添加源语言选择器
- 更新 8 种语言的 i18n 翻译
2026-03-10 13:44:52 +08:00
6b9fba254d refactor: 使用 openai SDK 替换 fetch 调用 LLM
All checks were successful
continuous-integration/drone/push Build is passing
- 安装 openai 包
- 重命名 zhipu.ts -> llm.ts
- 使用 OpenAI SDK 替代原生 fetch 实现
- 更新所有导入路径
2026-03-10 11:58:27 +08:00
0cb240791b feat(auth): 强制要求用户名,- 添加 hooks 验证注册时 username 必填
All checks were successful
continuous-integration/drone/push Build is passing
- 修改数据库 schema: username 设为 NOT NULL
- 重置并重新初始化本地和生产数据库
- 更新 .env.example 添加 Resend SMTP 配置说明
2026-03-10 09:45:55 +08:00
d9fd09c13d feat(auth): 强制要求 username 并- 添加 hooks 验证 username 必填
- 修改 schema: username 改为 NOT NULL
- 重置本地和生产数据库
2026-03-10 09:45:15 +08:00
5406543cbe feat(auth): 添加忘记密码功能
- 添加忘记密码页面,支持通过邮箱重置密码
- 添加重置密码页面
- 登录页面添加忘记密码链接
- 添加邮件发送功能
- 完善所有8种语言的翻译 (en-US, zh-CN, ja-JP, ko-KR, de-DE, fr-FR, it-IT, ug-CN)
2026-03-09 20:45:18 +08:00
d2a3d32376 chore: 添加 CI 并发控制,更新 Node.js 版本要求 2026-03-09 20:00:01 +08:00
436d58be52 fix(auth): 修复登录注册失败无错误提示的问题
All checks were successful
continuous-integration/drone/push Build is passing
better-auth 客户端不抛出异常,而是返回 { data, error } 对象
修改错误处理逻辑检查 error 对象而非 try-catch
2026-03-09 19:52:41 +08:00
11a265d52e i18n: 完整翻译所有语言文件
- de-DE: 德语完整翻译
- fr-FR: 法语完整翻译
- it-IT: 意大利语完整翻译
- ja-JP: 日语完整翻译
- ko-KR: 韩语完整翻译
- ug-CN: 维吾尔语完整翻译

所有翻译保持与 en-US.json 结构一致,保留插值变量
2026-03-09 19:49:34 +08:00
fb4346377a feat(explore): 添加文件夹详情页面
- 修复 folder-aciton.ts 文件名拼写错误为 folder-action.ts
- 修复所有导入路径中的拼写错误
- 添加 repoGetPublicFolderById 和 actionGetPublicFolderById
- 创建 ExploreDetailClient 详情页组件
- /explore/[id] 现在显示文件夹详情和链接到 /folders/[id]
- 添加 exploreDetail 中英文翻译
2026-03-09 19:39:03 +08:00
c83aefabfa fix: 修复代码审查发现的所有 bug
Critical 级别:
- zhipu.ts: 添加 API 响应边界检查
- DictionaryClient.tsx: 添加 entries 数组边界检查
- subtitleParser.ts: 修复 getNearestIndex 逻辑错误

High 级别:
- text-speaker/page.tsx: 修复非空断言和 ref 检查
- folder-repository.ts: 添加 user 关系 null 检查

Medium 级别:
- InFolder.tsx: 修复 throw result.message 为 throw new Error()
- localStorageOperators.ts: 返回类型改为 T | null,添加 schema 验证
- SaveList.tsx: 处理 data 可能为 null 的情况
2026-03-09 19:11:49 +08:00
020744b353 fix(i18n): 补充页面缺失的中英文翻译并修复登录重定向循环
- 补充 login/signup/dictionary/srt-player/alphabet 页面的翻译
- 修复登录页面邮箱登录时 password 参数错误
- 修复登录/注册页面的无限重定向循环问题
- 调整登录/注册卡片宽度为 w-96
2026-03-09 18:41:41 +08:00
719aef5a7f fix(dictionary): 修复语义映射和错误日志
- 修复语义映射:强制将输入转换为查询语言的对应词
- 移除拼写自动纠正,避免错误纠正(如 franch→franchise)
- 修复 winston 日志 Error 对象序列化问题
2026-03-09 18:14:14 +08:00