Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions plugins/cafe-notice/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 1.0.2 - 2026-12-03

### 修复

- 修复升级到 ZTools 3.3.0 后插件页报 `TypeError: Cannot read properties of undefined (reading 'notice')`:新版宿主把 Electron 固定到 35.0.0-alpha.2,该版本没有内置 `node:sqlite`,preload 顶层 `require('node:sqlite')` 抛 `No such built-in module` 后 `window.services` 从未赋值。通知库改由新增的纯 JS 只读读取器 `preload/sqlite-lite.js` 解析(支持 WAL 快照、溢出页、64 位整型)
- 兼容未升级的旧版 ZTools:宿主带 `node:sqlite`(Electron 36.7.3+,如 3.2.x 的 Electron 41)时仍优先走原生实现,缺失或打开失败才启用纯 JS 兜底,且只降级一次不会每轮抛错;三种引擎(原生 / 兜底 / 原生失败降级)对同一份真实通知库的解析结果已逐条比对一致
- 本地存储由 SQLite 改为 JSON / JSONL:`history.jsonl` 追加写、`config.json` / `state.json` 分文件避免采集写入覆盖用户设置、`apps.json` 按 mtime 缓存;旧 `history.db` 自动并入新存储(只补缺失项,不覆盖),迁移不再依赖宿主是否有 sqlite
- 采集、旧库迁移、横幅接管恢复等启动副作用移入 `init()`,排在 `window.services` 赋值之后并逐段 try/catch:任一步失败只降级对应功能,不再让整个插件页拿到 undefined
- `getStatus()` 增加 `dbEngine` 字段(`native` / `lite`),排障时可直接看出当前用的是哪个读取引擎

## 1.0.1 - 2026-11-12

### 修复
Expand Down
11 changes: 9 additions & 2 deletions plugins/cafe-notice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

## 更新日志

### v1.0.2 - 2026-12-03
- 修复 ZTools 3.3.0 下打不开、控制台报 `Cannot read properties of undefined (reading 'notice')`:新版宿主把 Electron 固定到 35,`node:sqlite` 已不是内置模块,preload 顶层 `require` 失败导致 `window.services` 从未赋值。现在通知库改由内置的纯 JS 只读 SQLite 读取器解析(支持 WAL 快照与溢出页)
- 两版宿主都兼容:ZTools 3.2.x / 更早(Electron 41,自带 `node:sqlite`)仍走原生实现,3.3.0(Electron 35,无该模块)或原生打开失败时自动改用纯 JS 兜底,降级只发生一次;三种走法对同一份通知库的解析结果已逐条比对一致(`getStatus().dbEngine` 可看出当前引擎)
- 本地存储由 SQLite 改为 JSON / JSONL(`history.jsonl` 只追加),旧 `history.db` 自动并入新存储,只补缺失项、不覆盖新数据;迁移不依赖宿主是否有 sqlite
- 采集、迁移等启动副作用挪到 `window.services` 赋值之后并逐段兜底:任一步失败只降级对应功能,不再让整个插件页拿到 undefined

### v1.0.1 - 2026-11-12
- 修复卡片通知的透明区域挡住鼠标点击的问题:卡片窗默认整窗穿透,只有卡片区域接收点击,卡片间隙、内边距与无卡片时的空窗都不再挡下方操作

Expand Down Expand Up @@ -52,14 +58,15 @@ npm run build # 产物输出到 src-ztools/dist(含浮层 overlay.html)

## 数据存储

- 历史与配置存于本地 SQLite:`<ZTools userData>/cafe-notice/history.db`(notice / app_config / config 三张表)
- 数据存于 `<ZTools userData>/cafe-notice/`:`history.jsonl`(通知历史,只追加写)、`config.json`(用户配置)、`state.json`(采集游标/统计/选主锁)、`apps.json`(按应用设置)
- 旧版 SQLite 库 `history.db` 原样保留,首次启动新版本时无论宿主有没有 `node:sqlite` 都会自动并入新存储(只补缺失项、不覆盖)
- 默认留存 30 天、上限 5000 条,可在配置页调整或一键清空
- 导出文件落在系统下载目录
- 除读取本机通知库与注册表外不联网

## 技术栈

Vue 3 + Vite + TypeScript、Element Plus(按需引入)、node:sqlite、Electron 浮层窗口(createBrowserWindow)
Vue 3 + Vite + TypeScript、Element Plus(按需引入)、纯 JS 只读 SQLite 读取器(`preload/sqlite-lite.js`,支持 WAL 快照与溢出页)、Electron 浮层窗口(createBrowserWindow)

## 许可证

Expand Down
2 changes: 1 addition & 1 deletion plugins/cafe-notice/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cafe-notice",
"version": "1.0.1",
"version": "1.0.2",
"description": "A ZTools plugin",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion plugins/cafe-notice/src-ztools/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "通知美化(弹幕/卡片)",
"description": "把 Windows 系统通知重新展示为跨屏弹幕或角落卡片,支持按应用静音/接管原生横幅、历史留存与导出",
"author": "咖啡八杯",
"version": "1.0.1",
"version": "1.0.2",
"categories": ["productivity", "system"],
"main": "dist/index.html",
"preload": "preload/services.js",
Expand Down
Loading
Loading