Repository navigation
V2.2.2 Zeta
版本代号:Zeta
亮点 🎉
- 改进了 AI 服务对第三方/自定义 OpenAI 兼容 API 的支持,修复了空响应导致的 JSON 解析错误以及自定义 API URL 未附带 /chat/completions 导致的 404 问题。
- 优化独立窗口(Standalone)行为:关闭托盘内的“退出”或在应用退出时将强制销毁所有窗口,避免进程残留导致重复启动或主应用无法重新打开的问题。
- Windows 安装程序(NSIS)新增交互式卸载选项,用户可在卸载时选择是否删除本地数据(笔记 / 数据库 / 设置)。
- 修复若干 UI/UX 和前端逻辑问题,包括拖放、HTML 嵌套/水合报错,以及笔记/待办独立窗口的保存/关闭流程。
主要修复与改进
AI 服务
- 修复:当第三方/自定义 AI 服务返回空或 malformed JSON 时,之前使用
response.json()会抛出 "Unexpected end of JSON input" 的异常。现在统一使用response.text()+ JSON.parse 的安全处理方式并捕获错误,防止主进程崩溃。 - 新增:对自定义 OpenAI 兼容 API 的 URL 自动标准化(normalizeApiUrl),当用户填写的 URL 以
/v1,/v2,/v3等结尾时,会自动追加/chat/completions,避免 404 错误导致请求失败。 - 修复:AI 服务测试接口(testOpenAI、testQwen 等)也采用了更健壮的错误处理与超时保护。
Windows 安装/卸载与数据保留
- 改进:NSIS 安装脚本(Electron-builder 配置)支持自定义卸载脚本,卸载时弹窗询问用户是否删除数据(包括数据库、配置文件、缓存等)。默认保留(便于重装时恢复),用户选择“删除”则会清理 APPDATA/local 目录中的 FlashNote 数据。
- 注意:如果你希望默认自动删除,请在
package.json的 NSIS 配置中切换deleteAppDataOnUninstall。
独立窗口与进程管理
- 修复:独立窗口(例如笔记独立窗口、Todo 独立窗口)在关闭时可能由于
close事件中preventDefault()的处理而被阻止退出,配合before-quit的应用退出流程,导致进程残留。现在,在应用退出时(通过托盘菜单或其他方式触发)会强制销毁所有窗口(window.destroy())以确保程序正确退出。 - 改进:在
window-all-closed事件中,增加对主窗口存在性的检测。如果主窗口仍存在且仅被隐藏(托盘),则不退出;如果主窗口已经被销毁(例如独立窗口单独运行场景),则退出应用。
前端/界面修复
- 修复:Quadrant 视图中钩子和
renderTodoItem中未传递onDragStart/onDragEnd导致无法拖动的问题(支持将待办从一个象限拖到另一个象限)。 - 修复:MUI
ListItemText的 secondary 中包裹div导致的<div> cannot be a descendant of <p>水合错误,统一改为secondaryTypographyProps={{ component: 'div' }}来避免报错和样式问题。 - 修复:独立窗口关闭前保存逻辑增加超时保护,避免 UI 锁死或窗口无法关闭的问题。
其他修复
- 版本号统一:从 “Epsilon” 更新为 “Zeta” 并同步到
package.json、主进程以及 README/文档中的版本引用。 - 修复若干插件管理、快捷键、托盘图标显示相关的 bug 和异常处理逻辑,提升稳定性与恢复能力。
开发者说明 / 升级须知
- 自定义 AI 提供者:现已支持更宽松的自定义地址格式;如果此前遇到 404 或 “Unexpected end of JSON input” 的问题,建议更新到该版本。
- NSIS 卸载脚本:我们引入了
build/installer.nsh的自定义脚本来询问是否删除应用数据;如需更改默认行为,请修改package.json的nsis配置(deleteAppDataOnUninstall/include)。 - 应用退出:为了保证数据一致性和避免残留进程,我们在
before-quit中使用强制销毁窗口来保证退出流程完成。如果你的插件或窗口依赖close事件上的交互,最好升级并适配新的退出行为,或在窗口中监听beforeunload并做相应的数据同步。
已知问题及后续计划
- 部分自定义插件在旧版本中可能依赖
close事件阻塞行为,建议插件作者检查并兼容beforeunload/__saveBeforeClose的调用时机。 - 我们计划在下一版本中:
- 改善托盘交互体验(图标状态和快捷动作)
- 提供更详细的卸载清理控制(只删除特定部分数据)
- 增强插件 API 的退出钩子兼容性
Version Code: Zeta
Highlights 🎉
- Enhanced AI service support for third-party/custom OpenAI-compatible APIs, fixing JSON parsing errors caused by empty responses and 404 issues when custom API URLs lacked the /chat/completions path.
- Optimized Standalone window behavior: Closing the “Exit” button in the tray or exiting the app will now force-destroy all windows, preventing process leaks that caused repeated launches or the main app failing to reopen.
- Added interactive uninstall option to the Windows installer (NSIS), allowing users to choose whether to delete local data (notes / database / settings) during uninstallation.
- Fixed several UI/UX and frontend logic issues, including drag-and-drop, HTML nesting/hydration errors, and save/close workflows for standalone note/to-do windows.
Major Fixes and Improvements
AI Services
- Fixed: When third-party/custom AI services returned empty or malformed JSON, using
response.json()previously threw an “Unexpected end of JSON input” exception. Now uniformly uses the safer approach ofresponse.text()+ JSON.parse and catches errors to prevent main process crashes. - Added: Automatic URL normalization for custom OpenAI-compatible APIs (normalizeApiUrl). URLs ending with
/v1,/v2,/v3, etc., will now automatically append/chat/completionsto prevent request failures caused by 404 errors. - Fixed: AI service test interfaces (testOpenAI, testQwen, etc.) now employ more robust error handling and timeout protection.
Windows Installation/Uninstallation and Data Retention
- Improved: NSIS installer script (Electron-builder configuration) now supports custom uninstall scripts. During uninstallation, a popup prompts users to confirm data deletion (including databases, configuration files, caches, etc.). Data is retained by default (for easy restoration during reinstallation). Selecting “Delete” will clear FlashNote data from the
APPDATA/localdirectory. - Note: To enable automatic deletion by default, toggle
deleteAppDataOnUninstallin the NSIS configuration withinpackage.json.
Independent Windows and Process Management
- Fixed: Independent windows (e.g., note windows, Todo windows) might be prevented from closing due to
preventDefault()handling in thecloseevent. Combined with the application exit process triggered bybefore-quit, this caused process leaks. Now, when the application exits (triggered via the tray menu or other methods), all windows are forcibly destroyed (window.destroy()) to ensure proper program termination. - Improvement: Added detection for the main window's existence within the
window-all-closedevent. If the main window remains present but is merely hidden (e.g., in the tray), the application does not exit. If the main window has been destroyed (e.g., in scenarios where standalone windows operate independently), the application exits.
Frontend/UI Fixes
- Fixed: Drag functionality was unavailable in Quadrant view due to missing
onDragStart/onDragEndhooks andrenderTodoItem(now supports dragging tasks between quadrants). - Fixed: Hydration error
<div> cannot be a descendant of <p>caused by wrappingdivin MUIListItemTextsecondary. Unified tosecondaryTypographyProps={{ component: ‘div’ }}to prevent errors and styling issues. - Fixed: Added timeout protection to save logic before closing standalone windows, preventing UI freezes or windows failing to close.
Other Fixes
- Versioning unified: Updated from “Epsilon” to “Zeta” and synchronized across
package.json, main process, and version references in README/documentation. - Fixed several bugs and improved exception handling related to plugin management, shortcuts, and tray icon display, enhancing stability and recovery capabilities.
Developer Notes / Upgrade Considerations
- Custom AI Providers: Supports more flexible custom address formats. If you previously encountered 404 errors or “Unexpected end of JSON input” issues, updating to this version is recommended.
- NSIS Uninstall Script: We've introduced a custom script in
build/installer.nshto prompt whether to delete application data. To override the default behavior, modify thensisconfiguration inpackage.json(deleteAppDataOnUninstall/include). - Application Exit: To ensure data consistency and prevent residual processes, we now use forced window destruction in
before-quitto guarantee the exit process completes. If your plugins or windows rely on interactions triggered by thecloseevent, it is recommended to upgrade and adapt to the new exit behavior, or listen forbeforeunloadin your windows and perform corresponding data synchronization.
Known Issues and Future Plans
- Some custom plugins may rely on the blocking behavior of the
closeevent in older versions. Plugin authors are advised to review and adapt their code to utilizebeforeunloador__saveBeforeCloseappropriately. - In the next release, we plan to:
- Improve tray interaction experience (icon states and quick actions)
- Provide more granular unload cleanup control (delete only specific data segments)
- Enhance exit hook compatibility in the plugin API