Skip to content

Commit 3227889

Browse files
jetyuJet
andauthored
Feature/v2.2.4 (#291)
## Summary - ## Type of Change - [ ] Bug fix - [ ] Feature - [ ] Documentation - [ ] Refactor - [ ] Build, CI, or release - [ ] Other ## Related Issues Closes # ## Changes - ## Testing - [ ] `npm run build:main` - [ ] `npm run build:preload` - [ ] `npm run typecheck` - [ ] `npm run lint` - [ ] `npm run test:unit` - [ ] `Not run` ## Checklist - [ ] I kept this pull request focused and avoided unrelated refactors. - [ ] I followed the Electron layer boundary: Renderer → Preload/Bridge → Main. - [ ] I validated IPC input at the boundary when applicable. - [ ] I avoided `any`, `@ts-ignore`, and unnecessary `@ts-expect-error`. - [ ] I updated Simplified Chinese locale files for new or changed user-visible UI text. - [ ] I updated documentation when behavior, setup, or user-facing functionality changed. - [ ] I considered privacy, security, and user-data impact. --------- Co-authored-by: Jet <jetyu91@163.com>
1 parent 83035d8 commit 3227889

11 files changed

Lines changed: 472 additions & 45 deletions

File tree

‎docs/Changelog/history_cn.md‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
### v2.2.4 - 2026-08-12
2+
本次更新优化了细节及用户体验。
3+
#### 优化
4+
* 优化快照功能
5+
* 优化版本历史对比功能
6+
17
### v2.2.3 - 2026-08-08
28
本次更新优化了细节及用户体验。
3-
### 新增
9+
#### 新增
410
* 支持调整重建索引并发数,提升索引重建效率
511
* 智能写作支持翻译功能(简体中文、英文、日语、韩语、繁体中文)
612
#### 优化
@@ -12,14 +18,14 @@
1218

1319
### v2.2.2 - 2026-08-05
1420
本次更新包含多项功能增强、体验优化与问题修复,进一步提升 AI 功能及整体使用体验。
15-
### 新增
21+
#### 新增
1622
* 新增官方 AI 免费体验额度,开箱即可体验 AI 功能
1723
* 新增 Azure OpenAI、Fireworks AI 服务商配置支持
18-
### 优化
24+
#### 优化
1925
* 优化用户功能权限管理体验
2026
* 优化首选项配置体验
2127
* 优化笔记搜索体验
22-
### 修复
28+
#### 修复
2329
* 修复收藏列表中笔记最后修改时间未实时更新的问题
2430
* 修复笔记列表光标位置显示异常的问题
2531
* 修复部分 AI 服务商模型名称显示错误的问题

‎docs/Changelog/history_en.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### v2.2.4 - 2026-08-12
2+
This update optimizes details and the user experience.
3+
#### Improvements
4+
* Improved snapshot functionality
5+
* Improved version history comparison functionality
6+
17
### v2.2.3 - 2026-08-08
28
This update optimizes details and the user experience.
39
### New

‎electron/assets/locales/en-US.json‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@
260260
"favorites.type": "Type",
261261
"favorites.typeNote": "Note",
262262
"favorites.typeNotebook": "Notebook",
263+
"history.diffAdded": "Added",
264+
"history.diffDeleted": "Deleted",
265+
"history.diffModified": "Modified",
266+
"history.diffModifiedAfter": "After",
267+
"history.diffModifiedBefore": "Before",
263268
"history.emptyState": "No historical versions for this note",
264269
"history.previewPlaceholder": "Select a version on the left to preview content",
265270
"history.restore": "Restore this version",
@@ -471,9 +476,10 @@
471476
"option.previewRemoteImages.all": "Allow all sources",
472477
"option.previewRemoteImages.blocked": "Prohibit loading",
473478
"option.previewRemoteImages.trusted": "Trusted sources only",
479+
"option.snapshotInterval.05min": "5分钟",
480+
"option.snapshotInterval.10min": "10分钟",
474481
"option.snapshotInterval.15min": "15 Minutes",
475482
"option.snapshotInterval.30min": "30 Minutes",
476-
"option.snapshotInterval.60min": "60 Minutes",
477483
"option.startup.workbench": "Workbench",
478484
"option.startup.workspace": "Workspace",
479485
"option.sync.10min": "Every 10 minutes",

‎electron/assets/locales/zh-CN.json‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@
260260
"favorites.type": "类型",
261261
"favorites.typeNote": "笔记",
262262
"favorites.typeNotebook": "笔记本",
263+
"history.diffAdded": "新增",
264+
"history.diffDeleted": "删除",
265+
"history.diffModified": "修改",
266+
"history.diffModifiedAfter": "修改后",
267+
"history.diffModifiedBefore": "修改前",
263268
"history.emptyState": "暂无该笔记的历史版本",
264269
"history.previewPlaceholder": "选中左侧版本以预览内容",
265270
"history.restore": "恢复此版本",
@@ -471,9 +476,10 @@
471476
"option.previewRemoteImages.all": "允许所有来源",
472477
"option.previewRemoteImages.blocked": "禁止加载",
473478
"option.previewRemoteImages.trusted": "仅受信任来源",
479+
"option.snapshotInterval.05min": "5分钟",
480+
"option.snapshotInterval.10min": "10分钟",
474481
"option.snapshotInterval.15min": "15分钟",
475482
"option.snapshotInterval.30min": "30分钟",
476-
"option.snapshotInterval.60min": "60分钟",
477483
"option.startup.workbench": "工作台",
478484
"option.startup.workspace": "工作区",
479485
"option.sync.10min": "每 10 分钟",

‎electron/assets/locales/zh-TW.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@
450450
"option.previewRemoteImages.trusted": "僅受信任來源",
451451
"option.snapshotInterval.15min": "15 分鐘",
452452
"option.snapshotInterval.30min": "30 分鐘",
453-
"option.snapshotInterval.60min": "60 分鐘",
454453
"option.startup.workbench": "工作台",
455454
"option.startup.workspace": "工作區",
456455
"option.sync.10min": "每 10 分鐘",

‎electron/main/services/settings.service.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ export function normalizeNoteStorageConfig(
538538
path: normalizeString(config.path, defaultPath).trim() || defaultPath,
539539
maxHistoryVersions: normalizeAllowedInteger(config.maxHistoryVersions, [0, 10, 20, 50, 100], 50),
540540
trashAutoClearDays: normalizeAllowedInteger(config.trashAutoClearDays, [0, 7, 30], 30),
541-
snapshotInterval: normalizeAllowedInteger(config.snapshotInterval, [15, 30, 60], 15),
541+
snapshotInterval: normalizeAllowedInteger(config.snapshotInterval, [5, 10, 15, 30], 10),
542542
};
543543
}
544544

‎electron/main/services/vfs.service.ts‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -733,15 +733,12 @@ export const vfsService = {
733733
try {
734734
const oldContent = await this.readContent(safeContentId);
735735

736-
// 简化策略:时间间隔到达 且 笔记有一定内容(> 100 字符)
737736
const isTimeElapsed = (Date.now() - lastTime) >= interval;
738-
const isMeaningful = text.length > 100;
737+
const hasPreviousContent = oldContent.length > 0;
739738

740-
if (isTimeElapsed && isMeaningful) {
741-
if (oldContent !== text) {
742-
await historyService.saveVersion(root, safeContentId, oldContent, config.noteStorage.maxHistoryVersions);
743-
lastSnapshotTimes.set(safeContentId, Date.now());
744-
}
739+
if (isTimeElapsed && hasPreviousContent && oldContent !== text) {
740+
await historyService.saveVersion(root, safeContentId, oldContent, config.noteStorage.maxHistoryVersions);
741+
lastSnapshotTimes.set(safeContentId, Date.now());
745742
}
746743
} catch (error: unknown) {
747744
logger.warn(`Failed to save history version: ${getErrorMessage(error)}`);

‎src/renderer/features/settings/components/tabs/NoteStorageSettings.vue‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
<section class="setting-card">
77
<div class="setting-copy">
88
<p class="setting-label">{{ t('label.noteStorageLocation') }}</p>
9-
<p class="setting-description">{{ t('text.noteStorageLocation') }}{{ settingsStore.config.noteStorage.path }}</p>
9+
<p class="setting-description">{{ t('text.noteStorageLocation') }}{{ settingsStore.config.noteStorage.path }}
10+
</p>
1011
</div>
1112
<button type="button" class="action-button secondary" @click="handlePickPath">
1213
{{ t('button.browse') }}
@@ -38,9 +39,10 @@
3839
<label class="select-shell" :class="{ disabled: maxHistoryVersions === 0 }">
3940
<select class="settings-select small-select" :value="snapshotInterval" :disabled="maxHistoryVersions === 0"
4041
@change="handleSnapshotIntervalChange">
42+
<option :value="5"> {{ t('option.snapshotInterval.05min') }}</option>
43+
<option :value="10">{{ t('option.snapshotInterval.10min') }}</option>
4144
<option :value="15">{{ t('option.snapshotInterval.15min') }}</option>
4245
<option :value="30">{{ t('option.snapshotInterval.30min') }}</option>
43-
<option :value="60">{{ t('option.snapshotInterval.60min') }}</option>
4446
</select>
4547
</label>
4648
</section>
@@ -149,7 +151,7 @@ const maxHistoryVersions = computed({
149151
});
150152
151153
const snapshotInterval = computed({
152-
get: () => settingsStore.config.noteStorage.snapshotInterval ?? 15,
154+
get: () => settingsStore.config.noteStorage.snapshotInterval ?? 10,
153155
set: (val: number) => {
154156
settingsStore.noteStorage.update('snapshotInterval', val);
155157
},

‎src/renderer/features/settings/store/settings.store.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ function createDefaultNoteStorageConfig(): NoteStorageConfig {
319319
path: '',
320320
maxHistoryVersions: 50,
321321
trashAutoClearDays: 30,
322-
snapshotInterval: 15,
322+
snapshotInterval: 10,
323323
};
324324
}
325325

0 commit comments

Comments
 (0)