Skip to content

Commit 72ce567

Browse files
author
Jet
committed
Merge branch 'fix_043'
Merge branch 'fix_043'
2 parents efb5765 + 07dabae commit 72ce567

File tree

13 files changed

+235
-61
lines changed

13 files changed

+235
-61
lines changed

nodemon.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"verbose": true,
33
"ignore": ["node_modules/", "dist/"],
4-
"ext": "js,json,html,css"
4+
"ext": "js,json,html,css",
5+
"delay": 1000
56
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "notewizard",
3-
"version": "0.4.2",
3+
"version": "0.4.3",
44
"type": "module",
55
"description": "NoteWizard Installer",
66
"license": "MIT License",

src/assets/changelog/history_cn.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
### [0.4.3] - 2025-12-07
2+
#### 修复
3+
- 修复在某些场景下导致加密笔记内容丢失的问题。
4+
- 修复加密状态导入首选项配置重启后笔记内容无法解密的问题。
25
#### 优化
3-
- 优化笔记右键菜单。
4-
- 优化笔记列表交互体验。
6+
- 优化预览体验。
7+
- 优化笔记列表的交互体验。
8+
- 优化笔记右键菜单选项。
59

610
### [0.4.2] - 2025-11-30
711
#### 新增

src/assets/changelog/history_en.md

Lines changed: 49 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,128 @@
1+
### [0.4.3] - 2025-12-07
2+
#### Fixes
3+
- Fixed an issue that could cause encrypted note content to be lost in certain scenarios.
4+
- Fixed an issue where encrypted notes could not be decrypted after importing preference settings and restarting the app.
5+
#### Improvements
6+
- Improved preview experience.
7+
- Improved the interaction experience of the notes list.
8+
- Improved the options in the notes context menu.
9+
110
### [0.4.2] - 2025-11-30
2-
#### Added
11+
#### New
312
- Added an emergency decryption feature for local notes to restore encrypted content in special scenarios.
4-
#### Fixed
13+
#### Fixes
514
- Fixed an issue where content in the Recycle Bin could not be encrypted properly.
6-
#### Improved
15+
#### Improvements
716
- Enhanced the interaction experience of the preferences pane.
817

918
### [0.4.1] - 2025-11-28
10-
#### Fixed
19+
#### Fixes
1120
- Fixed an issue where the search bar could not perform searches.
1221
- Fixed an issue where encryption could not be disabled in certain scenarios.
13-
#### Improved
22+
#### Improvements
1423
- Improved the interaction experience of security-related features.
1524
- Improved the interaction experience when exporting the .nwp format.
1625

1726
### [0.4.0] - 2025-11-24
18-
#### Added
27+
#### New
1928
- Added local note encryption using the AES-256-GCM algorithm for on-device data protection.
20-
#### Fixed
29+
#### Fixes
2130
- Fixed an issue where the Windows version could leave a background process running after uninstallation in certain scenarios.
2231
- Fixed translation issues in several non-English languages.
23-
#### Improved
32+
#### Improvements
2433
- Optimized view rendering performance.
2534
- Improved default language initialization.
2635
- Optimized application startup speed.
2736
- Improved the interaction experience of exporting the .nwp format.
2837

2938
### [0.3.2] - 2025-10-26
30-
#### Improved
39+
#### Improvements
3140
- Optimized the performance of the editor.
3241

3342
### [0.3.1] - 2025-10-25
34-
#### Fixed
43+
#### Fixes
3544
- Fixed missing translation issues in other languages.
36-
#### Improved
45+
#### Improvements
3746
- Improved the interactive experience of the Check for Updates panel.
3847

3948
### [0.3.0] - 2025-10-24
40-
#### Added
49+
#### New
4150
- Added note import and export functionality, supporting the import and export of NoteWizard Package (.nwp) and Markdown (.md) formats.
42-
#### Fixed
51+
#### Fixes
4352
- Fixed known issues.
4453
- Fixed translation issues in other languages.
45-
#### Improved
54+
#### Improvements
4655
- Refactored the Preferences panel code.
4756
- Improved the Recycle Bin experience.
4857
- Optimized the update log module loading performance.
4958
- Optimized VFS performance.
5059
- Optimized the IPC module.
5160

5261
### [0.2.6] - 2025-10-04
53-
#### Improved
62+
#### Improvements
5463
- Improved the editor experience.
5564

5665
### [0.2.5] - 2025-10-03
57-
#### Fixed
66+
#### Fixes
5867
- Fixed an issue introduced in version 0.2.2 that caused the note list in the workspace not to refresh in real time after restarting.
5968

6069
### [0.2.4] - 2025-10-03
61-
#### Added
70+
#### New
6271
- Added automatic software update feature.
63-
#### Fixed
72+
#### Fixes
6473
- Fixed an issue where the workspace was incorrectly collapsed when closing the preview panel.
6574

6675
### [0.2.2] - 2025-10-02
67-
#### Fixed
76+
#### Fixes
6877
- Fixed hardcoded internationalization issues.
6978
- Fixed an issue where the menu bar language did not update after switching languages and restarting.
70-
#### Improved
79+
#### Improvements
7180
- Optimized logic for importing, exporting, and resetting preferences configuration.
7281

7382
### [0.2.1] - 2025-10-01
74-
#### Added
83+
#### New
7584
- Added automatic build support for Windows, macOS, and Linux installers.
7685
- Added view switching functionality.
7786
- Added AI service settings for input delay, minimum input length, system prompt, and network connectivity test for AI service endpoints.
78-
#### Fixed
87+
#### Fixes
7988
- Fixed context menu issues.
8089
- Fixed several known translation issues.
8190
- Fixed several known UI issues.
8291
- Fixed cursor position issue in AI suggestions.
8392
- Fixed an outline display error introduced in version 0.1.0.
84-
#### Improved
93+
#### Improvements
8594
- Improved interaction experience in the Preferences interface.
8695
- Refactored AI service interfaces to support all AI services compatible with the OpenAI API.
8796

8897
### [0.1.0] - 2025-09-20
89-
#### Fixed
98+
#### Fixes
9099
- Fixed scrollbar issue in the note list.
91100
- Fixed deletion logic issue in the Recycle Bin.
92101
- Fixed registry residue issue after disabling startup on boot.
93-
#### Improved
102+
#### Improvements
94103
- Improved Recycle Bin interface and interaction.
95104

96105
### [0.0.9-dev] - 2025-09-15
97-
#### Improved
106+
#### Improvements
98107
- Improved high-resolution display adaptation.
99108

100109
### [0.0.8-dev] - 2025-09-13
101-
#### Fixed
110+
#### Fixes
102111
- Fixed inaccurate translations in some languages.
103112
- Fixed untranslated text on some pages.
104113
- Fixed layout misalignment on some pages when switching languages.
105114
- Fixed an issue introduced in version 0.0.7 where language switching caused import/export settings to fail.
106115

107116
### [0.0.7-dev] - 2025-09-11
108-
#### Added
117+
#### New
109118
- Added support for 18 languages and regions: English, French, Russian, German, Italian, etc.
110119
- Added system tray icon and startup on boot.
111-
#### Fixed
120+
#### Fixes
112121
- Fixed incorrect file size display in note properties dialog.
113122
- Fixed rare cases where icons or changelog content failed to load on startup.
114123
- Fixed incorrect file path display in some cases when creating a new note in the workspace.
115124
- Fixed rare cases where canceling a rename operation was not properly recognized.
116-
#### Improved
125+
#### Improvements
117126
- Upgraded Electron framework to version 37.4.0.
118127
- Optimized installer package size.
119128
- Improved notebook expand/collapse state.
@@ -123,51 +132,51 @@
123132
- Dropped support for Windows 32-bit (x86). Now only supports **Windows 10 and later 64-bit operating systems**.
124133

125134
### [0.0.6-dev] - 2025-08-30
126-
#### Added
135+
#### New
127136
- Added user guide module.
128137

129138
### [0.0.5-dev] - 2025-08-29
130-
#### Added
139+
#### New
131140
- Added context menu option to open file location.
132141
- Added import/export for user preferences configuration.
133142
- Added custom save path option for note files.
134143
- Added preferences shortcut key.
135144
- Added support for the latest AI models.
136-
#### Fixed
145+
#### Fixes
137146
- Fixed incorrect version number display on the About page.
138147
- Fixed AI service provider list loading failure in some cases.
139148
- Fixed content security policy issue introduced in version 0.0.4.
140-
#### Improved
149+
#### Improvements
141150
- Improved interaction logic and experience for custom note file save path.
142151

143152
### [0.0.4-dev] - 2025-08-03
144-
#### Added
153+
#### New
145154
- Added developer tools module.
146155

147156
### [0.0.3-dev] - 2025-07-29
148-
#### Added
157+
#### New
149158
- Added font size and font family settings.
150159
- Added About panel, Changelog page, and Check for Updates module.
151-
#### Fixed
160+
#### Fixes
152161
- Fixed misaligned UI elements in some cases.
153162
- Fixed reset actions not taking effect when switching to English interface.
154163
- Fixed note save failure in certain cases.
155164
- Fixed window size memory function failure.
156165
- Fixed incorrect path when creating notes via context menu in some cases.
157166
- Fixed AI configuration panel language not updating in real time when switching app language.
158-
#### Improved
167+
#### Improvements
159168
- Improved default window size to support more display devices.
160169
- Improved page transition and animation effects.
161170
- Improved interaction experience across multiple UI elements.
162171
- Improved application startup speed.
163172

164173
### [0.0.2-dev] - 2025-05-27
165-
#### Added
174+
#### New
166175
- Added dark mode support.
167176
- Added configuration support for AI providers such as OpenAI ChatGPT, xAI Grok, DeepSeek, Qwen, etc.
168177

169178
### [0.0.1-dev] - 2025-05-22
170-
#### Added
179+
#### New
171180
- Initial release of the application.
172181
- Implemented core Markdown editor with real-time preview.
173182
- Added support for Windows 7 and later operating systems.

src/locales/zh-CN.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@
9797
"startupEnabled": "已启用开机自启动",
9898
"startupDisabled": "已关闭开机自启动",
9999
"setStartupFailed": "设置开机自启动失败",
100-
"importConfirm": "导入配置将覆盖当前首选项设置,是否继续",
100+
"importConfirm": "导入新的首选项配置将覆盖当前设置,并在应用重启后生效。\n是否继续导入",
101101
"restartAppNotify": "设置需要重启应用才能生效,是否现在重启?",
102102
"importFailed": "导入失败: ",
103103
"importSuccess": "导入成功: ",
104104
"exportFailed": "导出失败: ",
105105
"exportSuccess": "导出成功: ",
106-
"resetConfirmNotify": "确定要重置所有设置为默认值吗?此操作不可撤销!",
106+
"resetConfirmNotify": "即将重置首选项至默认配置。此操作将清除所有当前设置且不可恢复。\n是否继续?",
107107
"labelAISystemPrompt": "系统提示词",
108108
"hintAISystemPrompt": "自定义 AI 辅助写作行为和风格,留空使用默认提示词",
109109
"placeholderAISystemPrompt": "你是一位AI写作助手,请根据用户提供的上下文,续写或完善文本。只需要返回续写的部分,不要重复用户的文本。每次最多返回一句话。",

src/modules/preferences/preferences-ipc.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,21 +185,36 @@ export function createPreferencesManager(deps) {
185185
app.getPath("userData"),
186186
"preferences.json"
187187
);
188+
let existingEncryption = null;
189+
188190
if (fs.existsSync(settingsPath)) {
189191
const currentData = await fs.promises.readFile(settingsPath, "utf8");
190-
currentSettings.settings = JSON.parse(currentData);
192+
const currentPrefs = JSON.parse(currentData);
193+
currentSettings.settings = currentPrefs;
191194
currentSettings.backupDate = new Date().toISOString();
195+
196+
// 保存现有的加密配置,导入时不覆盖
197+
if (currentPrefs.encryption) {
198+
existingEncryption = currentPrefs.encryption;
199+
}
200+
192201
await fs.promises.writeFile(
193202
backupPath,
194203
JSON.stringify(currentSettings, null, 2),
195204
"utf8"
196205
);
197206
}
198207

199-
// 保存新设置
208+
// 合并设置:保留原有的加密配置
209+
const mergedSettings = { ...preferences.settings };
210+
if (existingEncryption) {
211+
mergedSettings.encryption = existingEncryption;
212+
}
213+
214+
// 保存合并后的设置
200215
await fs.promises.writeFile(
201216
path.join(app.getPath("userData"), "preferences.json"),
202-
JSON.stringify(preferences.settings, null, 2),
217+
JSON.stringify(mergedSettings, null, 2),
203218
"utf8"
204219
);
205220

src/renderer/editor/editor.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,31 @@ function setupEditorEventListeners(editor, aiAssistant) {
6767
});
6868
window.dispatchEvent(event);
6969
});
70+
71+
// 滚动同步:编辑器滚动时同步预览面板
72+
const scrollElement = editor.getScrollerElement();
73+
if (scrollElement) {
74+
let isSyncing = false;
75+
scrollElement.addEventListener('scroll', function() {
76+
if (isSyncing) return;
77+
78+
const previewContainer = document.getElementById('preview-container');
79+
if (!previewContainer) return;
80+
81+
const scrollTop = scrollElement.scrollTop;
82+
const scrollHeight = scrollElement.scrollHeight - scrollElement.clientHeight;
83+
if (scrollHeight <= 0) return;
84+
85+
const scrollRatio = scrollTop / scrollHeight;
86+
87+
const previewScrollHeight = previewContainer.scrollHeight - previewContainer.clientHeight;
88+
if (previewScrollHeight > 0) {
89+
isSyncing = true;
90+
previewContainer.scrollTop = scrollRatio * previewScrollHeight;
91+
requestAnimationFrame(() => { isSyncing = false; });
92+
}
93+
});
94+
}
7095
}
7196

7297
function handleTabKey(cm) {

src/renderer/preferences/preferences.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ <h2 id="pref-title" data-i18n="preferencesTitle"></h2>
55
<button id="pref-export" class="exportSetting-btn" data-i18n="btnExportSetting"></button>
66
<button id="pref-import" class="importSetting-btn" data-i18n="btnImportSetting"></button>
77
<button id="pref-reset" class="resetSetting-btn" data-i18n="btnResetSetting"></button>
8+
</br>
89
<span class="close" id="pref-close" data-i18n="btnClose"></span>
910
</div>
11+
1012
</div>
1113
<div class="pref-layout">
1214
<nav class="pref-sidebar">

0 commit comments

Comments
 (0)