zen-gitsync 2.11.34 → 2.11.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-gitsync",
3
- "version": "2.11.34",
3
+ "version": "2.11.35",
4
4
  "description": "A Git automation platform with interactive commits, scheduled sync, command orchestration, file locking, and a visual GUI.",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/config.js CHANGED
@@ -43,7 +43,21 @@ const defaultConfig = {
43
43
  theme: 'light', // 主题: light | dark | auto
44
44
  locale: 'zh-CN', // 语言: zh-CN | en-US
45
45
  // AI 模型配置
46
- models: []
46
+ models: [],
47
+ // UI 状态(跨项目共享,存到顶层 ui 对象)
48
+ // 之前散落在 localStorage,因随机端口启动而失效,迁到文件持久化
49
+ ui: {
50
+ layout: { leftRatio: 0.25, midRatio: 0.375, rightRatio: 0.375, topRatio: 0.5 },
51
+ fileListViewMode: 'list', // 'list' | 'tree'
52
+ fileDiffSplitPercent: 35, // 15-85
53
+ commandConsole: {
54
+ expanded: true,
55
+ useTerminal: true,
56
+ showTerminalSessions: true,
57
+ splitPercent: 25, // 15-85
58
+ },
59
+ editorAutoSave: false,
60
+ }
47
61
  };
48
62
 
49
63
  // 规范化项目路径作为配置键
@@ -121,16 +135,17 @@ async function loadConfig() {
121
135
  return { ...defaultConfig, ...raw };
122
136
  }
123
137
 
124
- // 新版结构:{ projects: { [key]: projectConfig }, theme?, locale?, recentDirectories? }
138
+ // 新版结构:{ projects: { [key]: projectConfig }, theme?, locale?, ui?, recentDirectories? }
125
139
  const projectConfig = raw?.projects?.[key];
126
- // 合并:默认配置 + 项目配置 + 全局通用设置(theme, locale, models)
127
- // models 是全局配置(跨项目共享),始终取顶层,不使用项目级的(防止旧数据 models:[] 覆盖)
140
+ // 合并:默认配置 + 项目配置 + 全局通用设置(theme, locale, models, ui
141
+ // models / ui 是全局配置(跨项目共享),始终取顶层,不使用项目级的(防止旧数据覆盖)
128
142
  return {
129
143
  ...defaultConfig,
130
144
  ...(projectConfig || {}),
131
145
  theme: raw?.theme ?? defaultConfig.theme,
132
146
  locale: raw?.locale ?? defaultConfig.locale,
133
- models: raw?.models ?? defaultConfig.models
147
+ models: raw?.models ?? defaultConfig.models,
148
+ ui: raw?.ui ?? defaultConfig.ui
134
149
  };
135
150
  }
136
151
 
@@ -162,8 +177,8 @@ async function saveConfig(config) {
162
177
  }
163
178
 
164
179
  // 分离全局设置和项目设置
165
- // models 也是全局配置(跨项目共享),和 theme/locale 一样存到顶层
166
- const { theme, locale, models, ...projectConfig } = config;
180
+ // models / ui 也是全局配置(跨项目共享),和 theme/locale 一样存到顶层
181
+ const { theme, locale, models, ui, ...projectConfig } = config;
167
182
 
168
183
  // 保存全局设置到根级别
169
184
  if (theme !== undefined) {
@@ -175,6 +190,9 @@ async function saveConfig(config) {
175
190
  if (models !== undefined) {
176
191
  raw.models = models;
177
192
  }
193
+ if (ui !== undefined) {
194
+ raw.ui = ui;
195
+ }
178
196
 
179
197
  // 写入当前项目配置(在 defaultConfig 基础上合并,但不清空顶层其它键)
180
198
  const existingProjectConfig = (raw.projects[key] && typeof raw.projects[key] === 'object') ? raw.projects[key] : {};