feat: Bug Fixes & Performance Optimization#67
Merged
OctagonalStar merged 4 commits intoOctagonalStar:mainfrom Feb 28, 2026
Merged
feat: Bug Fixes & Performance Optimization#67OctagonalStar merged 4 commits intoOctagonalStar:mainfrom
OctagonalStar merged 4 commits intoOctagonalStar:mainfrom
Conversation
Signed-off-by: JYinherit <jyinherit@qq.com>
Owner
你是怎么在Android上用上IndexDB的?(doge |
OctagonalStar
requested changes
Feb 28, 2026
Co-authored-by: OctagonalStar <76486554+OctagonalStar@users.noreply.github.com> Signed-off-by: JYinherit <138550825+JYinherit@users.noreply.github.com>
Signed-off-by: JYinherit <jyinherit@qq.com>
Contributor
Author
|
问题描述:在没有词库(或第一次开启没触发过学习)的情况下,不仅 getLeastDueCard() 从空数组取数会报 RangeError 崩溃,而且LearningPage 会拦截你,只要 FSRS已开启 且 待复习数量为0,它就不让你进入复习界面 |
OctagonalStar
approved these changes
Feb 28, 2026
OctagonalStar
added a commit
that referenced
this pull request
Mar 1, 2026
Signed-off-by: OctagonalStar <76486554+OctagonalStar@users.noreply.github.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.
[Arabic Learning] Bug Fixes & Performance Optimization
📅 版本信息
🐛 描述问题与复现步骤
1. 规律学习重复推送同一个单词
for循环和随机种子组合,系统不会在当次批次内校验历史抽取记录,导致同一个单词可能在单次学习会话中被连续推送多次。2. 新安装无复习任务时 FSRS 设置菜单丢失
3. 同形异义单词重复录入被错误合并(去重逻辑缺陷)
كَلِمَة(带有元音符号)。文件 B 包含كلمة(不带符号) 或是كُتِبَ(同形异音异义)。🛠️ 修改方案与实现逻辑
🟢 修复:学习推送批次去重
将 LearningPage 中负责抽取单词的固定大小
for循环,重构为了由Set<WordItem>驱动的while循环逻辑。利用 Set 数据结构天生的唯一性,强制系统不断抽取随机词直至填满用户设定的每日推送配额 (
pushAmount)。这从数据结构层面上彻底根除了单批次推送池内出现重复词的可能性。🟢 修复:桥接无数据时的 FSRS 菜单
修改了主界面复习按钮的响应拦截阀。在拦截条件中追加了
|| !context.read<Global>().globalFSRS.config.enabled。现在,如果系统检测到复习功能本身处于彻底的禁用/未激活状态,无论待复习卡片数为多少,点击“复习”都将作为安全通道,直接带用户进入
ForeFSRSSettingPage开启及配置算法。🟢 新功能/修复:基于 Jaccard 重叠率的同义词交叉校验与 O(1) 性能跃迁
重构了 global.dart 中底层词典数据化模型 dataFormater 的去重与映射逻辑。
实现逻辑(语义防误伤):
.hasSimilarMeaning()。chineseList。.hasSimilarMeaning()比对双方的中文释义:清洗掉标点后把两组释义打碎为单汉字集合,计算intersection / minLength。实现逻辑(万级词库导入性能拔高):
为了承载可能高达数万词的巨型词典交叉比对带来的 CPU 峰值压力,废弃了原有的
rawWordList及pureWordList线性数组。使用
Map<String, int>字典哈希表重新构建了索引链。这使得引擎对全局单词库的存在性嗅探和下标获取的时间复杂度由沉重的 O(N) 跌至完美的 O(1),彻底消灭了导入海量 JSON 词库时可能发生的 UI 线程阻塞与卡顿。