Releases: Zjj-Low-Key/zotero-word-learning
Release list
Word Learning 0.10.9
0.10.9 — Data safety and plugin lifecycle fixes
修复内容
- 词库 JSON 损坏、结构异常或读取失败时停止保存并显示错误,避免以空词库覆盖原文件。
- 将新增、编辑、删除、复习统计及后台混淆项保存放入同一读改写队列,避免同一 Zotero 进程内多窗口及后台请求互相覆盖数据。
- 切换数据库路径时先验证目标并完成迁移,再保存设置;迁移失败时继续保留原路径。
- 插件禁用后取消延迟启动注册;保存 Zotero 返回的真实面板 ID,卸载时只注销本插件面板,并使用 onDestroy 清理资源。
- PDF 选词只应用一次;过期选词重试、旧 LLM 返回及旧保存完成事件不再清空新添加草稿。
- 编辑时拒绝把单词重命名为词库内已有单词。
- 防止连点复习按钮重复记分;保存复习统计失败时保留当前题目。
- 未配置 API 时不再永久占用混淆项生成状态。
- 将占位自动更新地址替换为本仓库 release 中的 updates.json,包含 XPI SHA-256 校验。
安装
从本 release 下载 zotero-word-learning-0.10.9.xpi,在 Zotero 插件管理器中选择“从文件安装插件”。
0.10.8 及以前的安装仍指向占位更新地址,因此需要手动安装一次;新版会使用本仓库的更新清单。
Validation and limits
- 17 Node.js regression tests pass; JavaScript syntax and XPI archive validation pass.
- Tests use mocked Zotero/IOUtils interfaces. Real Zotero 7/8/9 GUI and Better Notes / Translate / LLM-for-Zotero coexistence have not been run in this environment.
- The queue coordinates this plugin within one Zotero process. It is not a cross-process or cloud-sync database lock.
- Existing damaged databases are preserved, not automatically repaired.
Zotero Word Learning v0.10.8
Zotero Word Learning v0.10.8
本版本重点提升 LLM 补全功能的稳定性和容错能力,修复 API 偶发返回空内容、截断 JSON 或非标准响应时,插件出现 JSON.parse: unexpected end of data 的问题。
修复与优化
- 新增 LLM 补全自动重试机制:空响应、JSON 不完整、网络超时、HTTP 429 或 5xx 等临时异常最多自动重试 3 次。
- 增加空响应检查,不再直接对空字符串执行
JSON.parse()。 - 增强 JSON 解析,支持 Markdown JSON 代码块、响应前后说明文字、尾随逗号、JSON 字符串嵌套、字符串形式的
phrases和 Unicode BOM。 - 支持更多 OpenAI-compatible 响应格式,包括
choices[0].message.content、choices[0].text、output_text、Geminicandidates及部分 SSEdata:响应。 - 请求明确设置
stream: false,降低兼容接口返回流式数据造成解析失败的概率。 - 提高 LLM 返回长度上限,降低上下文解释较长时 JSON 被截断的概率。
- 补全失败时显示 HTTP 状态码、具体错误原因及部分原始响应内容;自动重试成功后会给出明确提示。
升级说明
建议安装新版本后完整重启 Zotero,避免旧版本脚本或监听器残留。
Assets
zotero-word-learning-0.10.8.xpiWord-Learning-0.10.8-source-no-README.zip
Zotero Word Learning v0.10.7
Zotero Word Learning v0.10.7
Version 0.10.7 fixes the top-button layout regression introduced in 0.10.6.
修复内容
1. 修复“刷新状态”和日夜切换按钮排布异常
0.10.6 中这两个按钮被放进了独立的右侧 action group:
wl-tab-actions
并且 CSS 中用了:
margin-left: auto;
这会导致它们不像其他 tab 按钮一样自然换行,而是作为一组被推到最右侧。侧栏宽度变窄时,前面的按钮会正常换行,但“刷新状态”和太阳按钮会单独占据右侧或下一行,排布不协调。
2. 改回统一的顶部按钮流
现在改为:
- 移除独立右对齐 action group;
刷新状态按钮直接加入顶部按钮流;- 日夜模式按钮也直接加入顶部按钮流。
这样它们会像 添加单词 / 单词卡片 / 全部词汇 / 复习 / 设置 一样,根据插件宽度自然换行。
3. 保留兼容样式兜底
对仍然存在旧 wl-tab-actions DOM 的情况,保留了兼容样式处理,但不再强制右对齐或单独成组显示。
Assets
zotero-word-learning-0.10.7.xpiWord-Learning-0.10.7-source-no-README.zip
Zotero Word Learning v0.10.6
Zotero Word Learning v0.10.6
Version 0.10.6 improves panel refresh, connection testing, and PDF-selection handoff reliability.
更新内容
1. 新增显式的刷新状态按钮
现在面板顶部提供 Refresh / 刷新状态 按钮,用于:
- 重新绑定当前面板;
- 刷新词库和设置状态;
- 在不重置插件的情况下恢复当前面板显示。
2. 测试连接结果更完整,不再被保存提示覆盖
Test connection / 测试连接 现在会先静默保存当前设置,再直接显示本次测试结果。
状态区域会展示:
- Provider;
- Model;
- Endpoint;
- HTTP 状态;
- 请求耗时;
- 响应片段。
这样可以更直接地确认当前到底测试了哪个接口,以及服务端返回了什么。
3. 从 PDF 选中文本打开草稿更稳定
从 Reader 里的选中文本点击 Add to Wordbook / 加入词库 后,插件现在会:
- 先尝试当前 reader 窗口;
- 再尝试父窗口、顶层窗口和 Zotero 主窗口;
- 如果目标面板尚未创建完成,会在短延迟后自动重试几次。
这能减少“选中了文本但没有正确带入添加草稿”的情况。
Assets
zotero-word-learning-0.10.6.xpiWord-Learning-0.10.6-source-no-README.zip
Zotero Word Learning v0.10.5
Zotero Word Learning v0.10.5
Version 0.10.5 restores strict database path behavior while keeping the Better Notes compatibility fixes from 0.10.4.
修复内容
1. 移除默认数据库兜底读取
删除了 0.10.4 中这类逻辑:
loaded default database as fallback
现在不会再出现:
自定义路径不可用 -> 自动读取默认数据库
2. 数据库路径选择逻辑改回严格模式
现在逻辑是:
用户设置了自定义数据库路径
-> 只读取用户设置的路径
用户没有设置自定义数据库路径
-> 读取 Zotero profile 下的默认路径
如果用户设置的路径暂时不可用,插件会显示空词库,并在 debug 中记录:
database path missing: ...
但不会偷偷读取默认词库。
3. 保留 0.10.4 的 Better Notes 兼容修复
仍然保留:
- 禁用自动 fallback 侧栏注入;
- fallback 只允许浮动面板;
- 启动后多次重试刷新词库;
- 避免误挂到 Better Notes / Zotero Notes 面板。
Assets
zotero-word-learning-0.10.5.xpiWord-Learning-0.10.5-source-no-README.zip
Zotero Word Learning v0.10.3
Zotero Word Learning v0.10.3
Version 0.10.3 adds duplicate-word validation before saving terms.
Changes
- Adds normalized duplicate detection before saving a word or phrase.
- Treats case-only differences as the same term, for example
Abstract,abstract, andABSTRACTare considered duplicates. - Normalizes text with trim, whitespace collapsing, Unicode NFKC normalization, and case folding before comparison.
- Blocks duplicate saves with a clear warning instead of silently overwriting or reusing an existing term.
- Excludes the currently edited term from duplicate checks in the Modify Word page, so editing the selected term itself is still allowed.
- Prevents editing one term into another existing term.
Result
Users are warned when attempting to add a word or phrase that already exists in the vocabulary database, including entries that differ only by capitalization or surrounding whitespace.
Assets
zotero-word-learning-0.10.3.xpiWord Learning 0.10.3 source no README.zip
Zotero Word Learning v0.10.1
Zotero Word Learning v0.10.1
Version 0.10.1 fixes speech style list loading in the settings panel.
Changes
- Speech style options now refresh asynchronously after panel creation.
- Reads voices once immediately, then retries after 250ms, 800ms, 1600ms, and 3000ms.
- Refreshes again when
speechSynthesisfiresvoiceschanged. - Uses
speechSynthesis.addEventListener('voiceschanged', fill)instead of replacingspeechSynthesis.onvoiceschanged. - The extra listener and retry timers are cleaned up through the existing panel lifecycle disposal path.
- Keeps the current selected voice whenever it still exists after a refresh.
Result
If Zotero or Firefox exposes system voices late, the settings panel can now pick them up automatically instead of staying stuck on System Default.
Zotero Word Learning v0.10.0
Zotero Word Learning v0.10.0
Version 0.10.0 fixes the Reader selected-text popup regression while keeping the compact non-invasive button design introduced in the 0.9.9 line.
Changes
- Removed
setTimeout(addControl, 0). - Restored synchronous
append(btn). - Keeps the non-invasive Reader popup strategy:
- no large wrapper
div - no status hint row
- no DOM changes to other plugin controls
- only one compact appended button
- no large wrapper
- Keeps the compact blue button style to reduce the chance of covering Translate and LLM-for-Zotero actions.
Result
The Word Learning action is added during Zotero's popup render lifecycle again, while the popup stays compact and avoids interfering with neighboring plugin buttons.
Zotero Word Learning v0.9.8
Zotero Word Learning v0.9.8
Version 0.9.8 fixes a layout regression introduced by the 0.9.7 architecture upgrade in Zotero's native ItemPane mode.
Root Cause
After clicking Save Settings, rebuildPanelUI() rebuilt the plugin's internal UI but did not reapply the native ItemPane layout cleanup path. That caused the plugin fallback header to reappear and restored an internal fixed-height scrolling container inside Zotero's own ItemPane scroll area.
Fixes
- Added
normalizeNativeItemPaneLayout(win, panel). - Removes the plugin fallback header in native Zotero ItemPane mode.
- Keeps the Zotero native header and lets Zotero control the panel height.
- Clears the internal
maxHeight: 560pxbehavior. - Switches the native ItemPane body to
overflow: visible, emptymaxHeight, andflex: 0 0 auto. - Calls the same normalization path during initial render and after
rebuildPanelUI().
Result
Saving settings no longer adds an extra Word Learning ... loaded navigation bar, and native ItemPane mode no longer falls back to a nested internal scroll area.
Zotero Word Learning v0.9.7
Zotero Word Learning v0.9.7
Version 0.9.7 is an architecture upgrade focused on Zotero panel stability during long-running async work and repeated ItemPane rebuilds.
Panel Lifecycle
- Adds render generation tracking per Zotero window.
- Guards stale async callbacks before they write to the current panel.
- Adds lifecycle-managed cleanup for panel event handlers and active panel references.
- Uses a
MutationObserverto dispose panel resources when Zotero removes a panel body from the DOM.
Event Handling
- Builds the panel synchronously, then installs a unified delegated controller.
- Moves tabs, theme switching, add-word controls, wordbook actions, all-words sorting, review controls, and settings controls under the shared controller.
- Keeps the older idle rescue entry point only as a compatibility no-op.
Async Guarding
Generation checks now cover vocabulary refresh, LLM completion, connection testing, and LLM-generated review distractors. This prevents old PDF panels, stale forms, or outdated vocabulary refreshes from overwriting the active UI after Zotero rebuilds the panel.
Fallback Panel
The fallback panel path now uses the same generation tracking, active panel tracking, delegated handlers, and lifecycle cleanup as the native Zotero ItemPane path.