dsh-keeper-plugin 0.1.7 → 0.1.8
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/README.md +30 -33
- package/client.js +2067 -238
- package/index.js +81 -1
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -111,7 +111,7 @@ const DICT = {
|
|
|
111
111
|
notifyEnabled: '启用通知',
|
|
112
112
|
notifyEnabledHint: '关闭后不再发送任何提醒。',
|
|
113
113
|
notifyChannels: '提醒方式',
|
|
114
|
-
notifyChannelsHint: '
|
|
114
|
+
notifyChannelsHint: '「横幅」即系统通知,需先在上方授权;开启后任务完成或失败时会弹出提醒。',
|
|
115
115
|
notifyChannelBanner: '横幅',
|
|
116
116
|
notifyChannelSound: '声音',
|
|
117
117
|
notifySoundHint: '打开后,不论 DSH 在前台或后台,你都会收到声音提示。',
|
|
@@ -121,17 +121,40 @@ const DICT = {
|
|
|
121
121
|
notifySoundPlay: '播放声音',
|
|
122
122
|
notifySoundPick: '自定义声音(mp3 / wav / ogg)',
|
|
123
123
|
notifySoundClear: '恢复默认声音',
|
|
124
|
-
notifySoundSaved: '
|
|
124
|
+
notifySoundSaved: '自定义提示音已保存',
|
|
125
125
|
notifySoundSaveFailed: '保存提示音失败',
|
|
126
|
-
notifySoundResetDone: '
|
|
127
|
-
notifySoundTooLarge: '音频文件不能超过 2 MB
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
notifySoundResetDone: '已恢复默认提示音',
|
|
127
|
+
notifySoundTooLarge: '音频文件不能超过 2 MB',
|
|
128
|
+
notifyDesktopTitle: '桌面通知',
|
|
129
|
+
notifyStatusGranted: '已授权',
|
|
130
|
+
notifyStatusGrantedText: '可以接收系统通知',
|
|
131
|
+
notifyStatusDefault: '尚未授权',
|
|
132
|
+
notifyStatusDefaultText: '授权后可以接收系统通知',
|
|
133
|
+
notifyStatusDenied: '已被拒绝',
|
|
134
|
+
notifyStatusDeniedText: '通知权限已关闭,请手动开启',
|
|
135
|
+
notifyStatusUnsupported: '不支持',
|
|
136
|
+
notifyStatusUnsupportedText: '当前环境无法使用系统通知',
|
|
137
|
+
notifyRecheck: '重新检测',
|
|
138
|
+
notifyHelp: '如何开启',
|
|
139
|
+
notifyHelpTitle: '开启系统通知',
|
|
140
|
+
notifyHelpWinStep1: '打开「设置 → 系统 → 通知」',
|
|
141
|
+
notifyHelpWinStep2: '找到 DeepSeek Harness,打开「通知」',
|
|
142
|
+
notifyHelpWinStep3: '检查「勿扰」或「专注助手」是否拦截',
|
|
143
|
+
notifyHelpMacStep1: '打开「系统设置 → 通知」',
|
|
144
|
+
notifyHelpMacStep2: '找到 DeepSeek Harness,允许通知',
|
|
145
|
+
notifyHelpMacStep3: '检查「专注模式」是否拦截',
|
|
146
|
+
notifyHelpWebStep1: '点击地址栏左侧的站点图标',
|
|
147
|
+
notifyHelpWebStep2: '把「通知」改为「允许」',
|
|
148
|
+
notifyHelpWebStep3: '回到本页,点「重新检测」',
|
|
149
|
+
notifyHelpCopyPath: '复制设置路径',
|
|
150
|
+
notifyHelpCopied: '已复制。按 Win+R 粘贴后回车,即可打开通知设置',
|
|
151
|
+
notifyRecheckDefault: '仍未授权,请点「授权系统通知」',
|
|
152
|
+
notifyRecheckDenied: '通知权限仍关闭,请点「如何开启」在系统设置中允许',
|
|
153
|
+
notifyRecheckHelp: '仍未授权,请按上述步骤开启后重试',
|
|
133
154
|
notifyRequestPermission: '授权系统通知',
|
|
134
|
-
|
|
155
|
+
notifyTestShort: '发送测试',
|
|
156
|
+
notifyTestSent: '测试通知已发送,声音已播放;无横幅请检查系统通知设置',
|
|
157
|
+
notifyTestFailed: '测试通知未能触发,请检查系统通知权限',
|
|
135
158
|
notifyTestTitle: 'DSH 管家测试通知',
|
|
136
159
|
notifyTestBody: '通知与声音工作正常。',
|
|
137
160
|
notifyDone: '任务完成',
|
|
@@ -147,8 +170,8 @@ const DICT = {
|
|
|
147
170
|
notifyUndone: '已撤销,通知设置恢复到重置前的状态。',
|
|
148
171
|
notifySaveFailed: '保存通知设置失败',
|
|
149
172
|
notifyHostStale: '通知服务未就绪:请完全退出并重启 DSH 桌面端后刷新。',
|
|
150
|
-
notifyPermissionGrantedToast: '
|
|
151
|
-
notifyPermissionDeniedToast: '
|
|
173
|
+
notifyPermissionGrantedToast: '已获得系统通知权限',
|
|
174
|
+
notifyPermissionDeniedToast: '系统通知权限被拒绝,可在系统设置中开启',
|
|
152
175
|
notifyDoneTitle: '会话任务完成',
|
|
153
176
|
notifyErrorTitle: '会话任务失败',
|
|
154
177
|
notifyStoppedTitle: '会话任务已停止',
|
|
@@ -189,6 +212,9 @@ const DICT = {
|
|
|
189
212
|
notifyLoadedAll: '已全部加载',
|
|
190
213
|
notifyTotalN: '共 {n} 条记录',
|
|
191
214
|
notifyShowingRecentN: '显示最近 {n} 条',
|
|
215
|
+
notifyCollapse: '收起',
|
|
216
|
+
notifyExpand: '展开',
|
|
217
|
+
notifyCollapsedCount: '{n} 条记录',
|
|
192
218
|
notifyMutedTag: '已静音',
|
|
193
219
|
quietTitle: '静音规则',
|
|
194
220
|
quietEnabled: '启用免打扰时段',
|
|
@@ -209,6 +235,7 @@ const DICT = {
|
|
|
209
235
|
expandGroup: '展开分组',
|
|
210
236
|
collapseGroup: '折叠分组',
|
|
211
237
|
panelEntryHint: '控制该入口是否显示在侧栏(不影响插件是否启用)。',
|
|
238
|
+
panelEntryToggle: '在侧栏显示「{name}」',
|
|
212
239
|
selectAll: '全选',
|
|
213
240
|
clearAll: '取消全选',
|
|
214
241
|
clearSelection: '取消选择',
|
|
@@ -222,8 +249,88 @@ const DICT = {
|
|
|
222
249
|
purge: '彻底删除',
|
|
223
250
|
open: '打开',
|
|
224
251
|
exportAction: '导出',
|
|
225
|
-
autoClean: '
|
|
226
|
-
autoCleanEmpty: '
|
|
252
|
+
autoClean: '会话自动整理',
|
|
253
|
+
autoCleanEmpty: '暂无符合条件的会话',
|
|
254
|
+
autoCleanTitle: '会话自动整理',
|
|
255
|
+
autoCleanMaster: '自动整理',
|
|
256
|
+
autoCleanHintOn: '按当前规则生成建议,可预览再执行。',
|
|
257
|
+
autoCleanHintOff: '开启后才能调整规则和执行,关闭时不会做任何清理。',
|
|
258
|
+
autoCleanOffInfo: '自动整理已关闭,不会评估或清理任何会话。',
|
|
259
|
+
autoCleanOffHint: '开启后可勾选执行。',
|
|
260
|
+
autoCleanSubtitle: '按规则找出可归档或移入回收站的会话。',
|
|
261
|
+
autoCleanExcludeCount: '已排除 {n} / 共 {total}',
|
|
262
|
+
autoCleanExpand: '展开',
|
|
263
|
+
autoCleanCollapse: '收起',
|
|
264
|
+
autoCleanRuleSummary: '满足任一条件:{conditions};动作:{action};排除:{exclude}。',
|
|
265
|
+
autoCleanTipConditions: '满足任一条件:',
|
|
266
|
+
autoCleanTipAction: '动作:',
|
|
267
|
+
autoCleanTipExclude: '排除:',
|
|
268
|
+
autoCleanCondIdle: '闲置 ≥{n} 天',
|
|
269
|
+
autoCleanCondSize: '大小 ≥{n} MB',
|
|
270
|
+
autoCleanCondBlank: '空会话(无消息)',
|
|
271
|
+
autoCleanCondNone: '未设置触发条件',
|
|
272
|
+
autoCleanExcludeNone: '不排除',
|
|
273
|
+
autoCleanExcludeMore: '等 {n} 个',
|
|
274
|
+
autoCleanListSeparator: '、',
|
|
275
|
+
autoCleanEnable: '启用会话自动整理',
|
|
276
|
+
autoCleanEnableHint: '关闭时不生成建议,也不会执行任何操作。',
|
|
277
|
+
autoCleanRules: '规则',
|
|
278
|
+
autoCleanIdleLabel: '闲置天数',
|
|
279
|
+
autoCleanIdleHint: '超过该天数未活动(0 表示不启用)',
|
|
280
|
+
autoCleanSizeLabel: '大小阈值',
|
|
281
|
+
autoCleanSizeUnit: 'MB',
|
|
282
|
+
autoCleanDaysUnit: '天',
|
|
283
|
+
autoCleanIncrease: '增加',
|
|
284
|
+
autoCleanDecrease: '减少',
|
|
285
|
+
autoCleanSizeHint: '大于该大小(0 表示不启用)',
|
|
286
|
+
autoCleanBlankLabel: '包含空会话',
|
|
287
|
+
autoCleanBlankHint: '没有消息内容的会话',
|
|
288
|
+
autoCleanActionLabel: '执行动作',
|
|
289
|
+
autoCleanArchive: '归档',
|
|
290
|
+
autoCleanArchiveHint: '从列表隐藏,可随时取消归档',
|
|
291
|
+
autoCleanTrash: '移入回收站',
|
|
292
|
+
autoCleanTrashHint: '可在回收站恢复或再彻底删除',
|
|
293
|
+
autoCleanExcludeLabel: '排除工作区',
|
|
294
|
+
autoCleanExcludeHint: '这些工作区不会被整理',
|
|
295
|
+
autoCleanPreview: '建议整理',
|
|
296
|
+
autoCleanSelectAll: '全选',
|
|
297
|
+
autoCleanClear: '取消全选',
|
|
298
|
+
autoCleanOnlyBlank: '仅清理空会话',
|
|
299
|
+
autoCleanDisabled: '会话自动整理未启用,当前仅预演,不会执行。',
|
|
300
|
+
autoCleanSelected: '已选 {n} 个 · 合计 {size}',
|
|
301
|
+
autoCleanRun: '确认执行',
|
|
302
|
+
autoCleanRunning: '正在整理…',
|
|
303
|
+
autoCleanTooMany: '一次最多整理 100 个会话,请分批执行',
|
|
304
|
+
autoCleanResultTitle: '整理结果',
|
|
305
|
+
autoCleanResultDone: '已处理 {n} 个会话',
|
|
306
|
+
autoCleanResultFailed: '失败 {n} 个',
|
|
307
|
+
autoCleanResultMore: '还有 {n} 条',
|
|
308
|
+
autoCleanResultClose: '完成',
|
|
309
|
+
autoCleanReasonIdle: '闲置 {n} 天',
|
|
310
|
+
autoCleanReasonSize: '大于 {size}',
|
|
311
|
+
autoCleanReasonBlank: '空会话',
|
|
312
|
+
autoCleanDoneArchived: '已归档 {n} 个会话',
|
|
313
|
+
autoCleanDoneTrashed: '已移入回收站 {n} 个会话',
|
|
314
|
+
autoCleanDonePartial: '已处理 {done} 个,失败 {failed} 个',
|
|
315
|
+
autoCleanEnableFirst: '请先开启会话自动整理',
|
|
316
|
+
autoCleanNoneSelected: '请选择要整理的会话',
|
|
317
|
+
autoCleanFailed: '整理失败,请稍后重试',
|
|
318
|
+
autoCleanBadgeTitle: '有 {n} 个会话符合整理条件',
|
|
319
|
+
autoCleanRulesTitle: '整理规则',
|
|
320
|
+
autoCleanGroupTriggers: '触发条件',
|
|
321
|
+
autoCleanGroupAction: '执行方式',
|
|
322
|
+
autoCleanScanned: '已扫描 {n} 个会话',
|
|
323
|
+
autoCleanHit: '命中 {n}',
|
|
324
|
+
autoCleanExcludeLine: '已排除:{items}',
|
|
325
|
+
autoCleanExcludeRunning: '运行中 {n}',
|
|
326
|
+
autoCleanExcludeArchived: '已归档 {n}',
|
|
327
|
+
autoCleanExcludePinned: '置顶 {n}',
|
|
328
|
+
autoCleanExcludeCurrent: '当前打开 {n}',
|
|
329
|
+
autoCleanExcludeWorkspace: '排除工作区 {n}',
|
|
330
|
+
autoCleanEmptyTitle: '没有符合条件的会话',
|
|
331
|
+
autoCleanEmptyHint: '当前规则:闲置 ≥{days}、大小 ≥{size}、空会话{blank};调整规则后会自动更新。',
|
|
332
|
+
autoCleanBlankIncluded: '已包含',
|
|
333
|
+
autoCleanBlankExcluded: '未包含',
|
|
227
334
|
cleanBlankConfirmTitle: '清理空会话',
|
|
228
335
|
cleanBlankConfirmBody: '将把 {n} 个空会话(约 {size})移入回收站,之后可以恢复。',
|
|
229
336
|
showPath: '显示路径',
|
|
@@ -249,6 +356,7 @@ const DICT = {
|
|
|
249
356
|
emptyTrash: '清空回收站',
|
|
250
357
|
trashEmptied: '回收站已清空',
|
|
251
358
|
refresh: '刷新',
|
|
359
|
+
refreshed: '已刷新',
|
|
252
360
|
loading: '正在加载…',
|
|
253
361
|
loadFailed: '加载失败:{msg}',
|
|
254
362
|
retry: '重试',
|
|
@@ -339,12 +447,13 @@ const DICT = {
|
|
|
339
447
|
panelOfficial: '官方',
|
|
340
448
|
panelPreset: '预设',
|
|
341
449
|
panelThirdParty: '第三方',
|
|
342
|
-
panelLocal: '
|
|
450
|
+
panelLocal: '本地',
|
|
343
451
|
panelStateActive: '已启用',
|
|
344
452
|
panelStateDisabled: '已禁用',
|
|
345
453
|
panelStateFailed: '加载失败',
|
|
346
454
|
panelStateReadOnly: '由管理端管理',
|
|
347
|
-
panelStateUnaddressable: '
|
|
455
|
+
panelStateUnaddressable: '不可寻址(由插件管理系统统一处理,不能单独启停或打开)',
|
|
456
|
+
panelStatePresetManaged: '由预设管理(随所属预设启停)',
|
|
348
457
|
panelPhasePending: '等待加载',
|
|
349
458
|
panelPhaseLoading: '加载中',
|
|
350
459
|
panelPhaseActive: '已启用',
|
|
@@ -352,6 +461,12 @@ const DICT = {
|
|
|
352
461
|
panelPhaseUnloading: '卸载中',
|
|
353
462
|
panelPhaseNotLoaded: '未加载',
|
|
354
463
|
panelPhaseBuiltin: '随应用加载',
|
|
464
|
+
panelReasonManaged: '受管理端控制,不能在此启停',
|
|
465
|
+
panelReasonPreset: '由预设控制,随所属预设启停',
|
|
466
|
+
panelReasonUnaddressable: '不可单独寻址,不能在此启停',
|
|
467
|
+
panelReasonConditional: '由运行条件决定,当前未启用',
|
|
468
|
+
panelReasonManualDisabled: '已在 profile 手动禁用,可在此启用',
|
|
469
|
+
panelReasonDefaultDisabled: '默认关闭,可在此启用',
|
|
355
470
|
panelYes: '是',
|
|
356
471
|
panelNo: '否',
|
|
357
472
|
panelUnknown: '未知',
|
|
@@ -385,7 +500,7 @@ const DICT = {
|
|
|
385
500
|
scopeAll: '全部',
|
|
386
501
|
scopeGlobal: '全局',
|
|
387
502
|
scopeSession: '会话',
|
|
388
|
-
scopeBoth: '
|
|
503
|
+
scopeBoth: '全局 · 会话',
|
|
389
504
|
scopeTitle: '作用域',
|
|
390
505
|
scopeGlobalHint: '由 DSH 主程序加载,应用范围内常驻,不随会话预设变化。',
|
|
391
506
|
scopeSessionHint: '由 Agent 预设加载,只在启用该预设的会话里生效。',
|
|
@@ -450,7 +565,6 @@ const DICT = {
|
|
|
450
565
|
settingsNav: 'DSH 管家',
|
|
451
566
|
settingsHint: '设置页位于「设置 → DSH 管家」。',
|
|
452
567
|
settingsTitle: 'DSH 管家设置',
|
|
453
|
-
settingsSubtitle: '删除策略与侧栏入口的默认行为',
|
|
454
568
|
defaultDeleteMode: '删除会话行为',
|
|
455
569
|
modeTrash: '移入回收站',
|
|
456
570
|
modeTrashHint: '推荐。会话先进入回收站,可恢复;彻底删除需要再次确认。',
|
|
@@ -467,20 +581,19 @@ const DICT = {
|
|
|
467
581
|
resetSettingsDone: '已恢复默认设置',
|
|
468
582
|
about: '关于',
|
|
469
583
|
version: '版本 {v}',
|
|
470
|
-
dshVersion: '当前 DSH 版本',
|
|
471
584
|
compatibility: '兼容性',
|
|
472
585
|
compatRange: '兼容范围',
|
|
473
586
|
compatOk: '兼容',
|
|
474
|
-
compatBad: '
|
|
587
|
+
compatBad: '不兼容',
|
|
475
588
|
compatUnknown: '未知',
|
|
476
589
|
compatUndeclared: '未声明',
|
|
477
590
|
compatReason: '原因',
|
|
478
|
-
compatReasonOk: '已声明兼容范围 {range}
|
|
479
|
-
compatReasonMismatch: '
|
|
480
|
-
compatReasonNoVersion: '无法读取当前 DSH
|
|
481
|
-
compatReasonNoRange: '
|
|
482
|
-
compatReasonUnparsable: '
|
|
483
|
-
compatHostHint: '随 DSH
|
|
591
|
+
compatReasonOk: '已声明兼容范围 {range}',
|
|
592
|
+
compatReasonMismatch: '范围 {range},当前 {version} 不在范围内',
|
|
593
|
+
compatReasonNoVersion: '无法读取当前 DSH 版本',
|
|
594
|
+
compatReasonNoRange: '未声明 engines.dsh 兼容范围',
|
|
595
|
+
compatReasonUnparsable: '兼容范围或版本号无法解析',
|
|
596
|
+
compatHostHint: '随 DSH 安装提供',
|
|
484
597
|
compatUndeclaredHint: '该插件未声明 engines.dsh,无法判断兼容性。',
|
|
485
598
|
compatPresetHint: '由 Agent 预设提供,未声明兼容范围。',
|
|
486
599
|
settingsSaved: '设置已保存',
|
|
@@ -562,7 +675,7 @@ const DICT = {
|
|
|
562
675
|
notifyEnabledHint: 'Off stops all reminders.',
|
|
563
676
|
notifyChannels: 'How to notify',
|
|
564
677
|
notifyChannelsHint:
|
|
565
|
-
'
|
|
678
|
+
'Banner means system notifications and needs the permission above; when on, a notification appears when a task finishes or fails.',
|
|
566
679
|
notifyChannelBanner: 'Banner',
|
|
567
680
|
notifyChannelSound: 'Sound',
|
|
568
681
|
notifySoundHint: 'When on, sound plays whether DSH is in the foreground or background.',
|
|
@@ -572,17 +685,40 @@ const DICT = {
|
|
|
572
685
|
notifySoundPlay: 'Play sound',
|
|
573
686
|
notifySoundPick: 'Custom sound (mp3 / wav / ogg)',
|
|
574
687
|
notifySoundClear: 'Reset to default sound',
|
|
575
|
-
notifySoundSaved: 'Custom sound saved
|
|
688
|
+
notifySoundSaved: 'Custom sound saved',
|
|
576
689
|
notifySoundSaveFailed: 'Could not save the sound',
|
|
577
|
-
notifySoundResetDone: 'Default sound restored
|
|
578
|
-
notifySoundTooLarge: 'The audio file must be 2 MB or smaller
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
690
|
+
notifySoundResetDone: 'Default sound restored',
|
|
691
|
+
notifySoundTooLarge: 'The audio file must be 2 MB or smaller',
|
|
692
|
+
notifyDesktopTitle: 'Desktop notifications',
|
|
693
|
+
notifyStatusGranted: 'Granted',
|
|
694
|
+
notifyStatusGrantedText: 'Can receive system notifications',
|
|
695
|
+
notifyStatusDefault: 'Not granted yet',
|
|
696
|
+
notifyStatusDefaultText: 'Grant permission to receive system notifications',
|
|
697
|
+
notifyStatusDenied: 'Denied',
|
|
698
|
+
notifyStatusDeniedText: 'Notifications are turned off; enable them manually',
|
|
699
|
+
notifyStatusUnsupported: 'Unsupported',
|
|
700
|
+
notifyStatusUnsupportedText: 'System notifications are unavailable here',
|
|
701
|
+
notifyRecheck: 'Check again',
|
|
702
|
+
notifyHelp: 'How to enable',
|
|
703
|
+
notifyHelpTitle: 'Enable system notifications',
|
|
704
|
+
notifyHelpWinStep1: 'Open Settings → System → Notifications',
|
|
705
|
+
notifyHelpWinStep2: 'Find DeepSeek Harness and turn Notifications on',
|
|
706
|
+
notifyHelpWinStep3: 'Check whether Do not disturb or Focus assist blocks it',
|
|
707
|
+
notifyHelpMacStep1: 'Open System Settings → Notifications',
|
|
708
|
+
notifyHelpMacStep2: 'Find DeepSeek Harness and allow notifications',
|
|
709
|
+
notifyHelpMacStep3: 'Check whether a Focus mode blocks it',
|
|
710
|
+
notifyHelpWebStep1: 'Click the site icon at the left of the address bar',
|
|
711
|
+
notifyHelpWebStep2: 'Change Notifications to Allow',
|
|
712
|
+
notifyHelpWebStep3: 'Return to this page and click Check again',
|
|
713
|
+
notifyHelpCopyPath: 'Copy settings path',
|
|
714
|
+
notifyHelpCopied: 'Copied. Press Win+R, paste, and press Enter to open notification settings',
|
|
715
|
+
notifyRecheckDefault: 'Not granted yet. Click “Grant system notifications”',
|
|
716
|
+
notifyRecheckDenied: 'Notifications are still blocked. Click “How to enable” and allow them in system settings',
|
|
717
|
+
notifyRecheckHelp: 'Not granted yet. Follow the steps above, then try again',
|
|
584
718
|
notifyRequestPermission: 'Grant system notifications',
|
|
585
|
-
|
|
719
|
+
notifyTestShort: 'Send test',
|
|
720
|
+
notifyTestSent: 'Test notification sent; sound played. No banner? Check system notification settings',
|
|
721
|
+
notifyTestFailed: 'Test notification failed to trigger. Check system notification permission',
|
|
586
722
|
notifyTestTitle: 'DSH Keeper test notification',
|
|
587
723
|
notifyTestBody: 'Notifications and sound are working.',
|
|
588
724
|
notifyDone: 'Task finished',
|
|
@@ -598,8 +734,8 @@ const DICT = {
|
|
|
598
734
|
notifyUndone: 'Undone — notification settings are back to their previous values.',
|
|
599
735
|
notifySaveFailed: 'Could not save notification settings',
|
|
600
736
|
notifyHostStale: 'Notification service is not ready: fully quit and restart the DSH desktop app, then refresh.',
|
|
601
|
-
notifyPermissionGrantedToast: 'System notification permission granted
|
|
602
|
-
notifyPermissionDeniedToast: 'System notification permission was denied. Enable it in system settings
|
|
737
|
+
notifyPermissionGrantedToast: 'System notification permission granted',
|
|
738
|
+
notifyPermissionDeniedToast: 'System notification permission was denied. Enable it in system settings',
|
|
603
739
|
notifyDoneTitle: 'Session task finished',
|
|
604
740
|
notifyErrorTitle: 'Session task failed',
|
|
605
741
|
notifyStoppedTitle: 'Session task stopped',
|
|
@@ -640,6 +776,9 @@ const DICT = {
|
|
|
640
776
|
notifyLoadedAll: 'All loaded',
|
|
641
777
|
notifyTotalN: '{n} records',
|
|
642
778
|
notifyShowingRecentN: 'Showing latest {n}',
|
|
779
|
+
notifyCollapse: 'Collapse',
|
|
780
|
+
notifyExpand: 'Expand',
|
|
781
|
+
notifyCollapsedCount: '{n} records',
|
|
643
782
|
notifyMutedTag: 'Muted',
|
|
644
783
|
quietTitle: 'Quiet rules',
|
|
645
784
|
quietEnabled: 'Enable quiet hours',
|
|
@@ -659,6 +798,7 @@ const DICT = {
|
|
|
659
798
|
expandGroup: 'Expand group',
|
|
660
799
|
collapseGroup: 'Collapse group',
|
|
661
800
|
panelEntryHint: 'Toggles whether this entry shows in the sidebar (plugin enablement is separate).',
|
|
801
|
+
panelEntryToggle: 'Show “{name}” in the sidebar',
|
|
662
802
|
sortTitle: 'Title',
|
|
663
803
|
selectAll: 'Select all',
|
|
664
804
|
clearAll: 'Clear all',
|
|
@@ -673,8 +813,88 @@ const DICT = {
|
|
|
673
813
|
purge: 'Delete permanently',
|
|
674
814
|
open: 'Open',
|
|
675
815
|
exportAction: 'Export',
|
|
676
|
-
autoClean: '
|
|
677
|
-
autoCleanEmpty: 'No
|
|
816
|
+
autoClean: 'Auto clean',
|
|
817
|
+
autoCleanEmpty: 'No matching sessions',
|
|
818
|
+
autoCleanTitle: 'Auto clean',
|
|
819
|
+
autoCleanMaster: 'Auto clean',
|
|
820
|
+
autoCleanHintOn: 'Suggestions follow the current rules; preview before running.',
|
|
821
|
+
autoCleanHintOff: 'Turn it on to adjust rules and run; nothing is cleaned while off.',
|
|
822
|
+
autoCleanOffInfo: 'Auto clean is off; nothing is evaluated or cleaned.',
|
|
823
|
+
autoCleanOffHint: 'Turn it on to select and run.',
|
|
824
|
+
autoCleanSubtitle: 'Find sessions eligible for archiving or moving to the trash.',
|
|
825
|
+
autoCleanExcludeCount: '{n} of {total} excluded',
|
|
826
|
+
autoCleanExpand: 'Expand',
|
|
827
|
+
autoCleanCollapse: 'Collapse',
|
|
828
|
+
autoCleanRuleSummary: 'Matches any: {conditions}; action: {action}; excluded: {exclude}.',
|
|
829
|
+
autoCleanTipConditions: 'Matches any: ',
|
|
830
|
+
autoCleanTipAction: 'action: ',
|
|
831
|
+
autoCleanTipExclude: 'excluded: ',
|
|
832
|
+
autoCleanCondIdle: 'idle ≥{n} days',
|
|
833
|
+
autoCleanCondSize: 'size ≥{n} MB',
|
|
834
|
+
autoCleanCondBlank: 'blank sessions (no messages)',
|
|
835
|
+
autoCleanCondNone: 'no conditions set',
|
|
836
|
+
autoCleanExcludeNone: 'none',
|
|
837
|
+
autoCleanExcludeMore: '+{rest} more',
|
|
838
|
+
autoCleanListSeparator: ', ',
|
|
839
|
+
autoCleanEnable: 'Enable auto clean',
|
|
840
|
+
autoCleanEnableHint: 'When off, no suggestions are generated and nothing is executed.',
|
|
841
|
+
autoCleanRules: 'Rules',
|
|
842
|
+
autoCleanIdleLabel: 'Idle days',
|
|
843
|
+
autoCleanIdleHint: 'Inactive for more than this many days (0 = off)',
|
|
844
|
+
autoCleanSizeLabel: 'Size threshold',
|
|
845
|
+
autoCleanSizeUnit: 'MB',
|
|
846
|
+
autoCleanDaysUnit: 'days',
|
|
847
|
+
autoCleanIncrease: 'Increase',
|
|
848
|
+
autoCleanDecrease: 'Decrease',
|
|
849
|
+
autoCleanSizeHint: 'Larger than this size (0 = off)',
|
|
850
|
+
autoCleanBlankLabel: 'Include blank sessions',
|
|
851
|
+
autoCleanBlankHint: 'Sessions without any messages',
|
|
852
|
+
autoCleanActionLabel: 'Action',
|
|
853
|
+
autoCleanArchive: 'Archive',
|
|
854
|
+
autoCleanArchiveHint: 'Hide from the list; unarchive any time',
|
|
855
|
+
autoCleanTrash: 'Move to trash',
|
|
856
|
+
autoCleanTrashHint: 'Restore or purge later from the trash',
|
|
857
|
+
autoCleanExcludeLabel: 'Excluded workspaces',
|
|
858
|
+
autoCleanExcludeHint: 'Sessions in these workspaces are never cleaned',
|
|
859
|
+
autoCleanPreview: 'Suggested cleanup',
|
|
860
|
+
autoCleanSelectAll: 'Select all',
|
|
861
|
+
autoCleanClear: 'Clear selection',
|
|
862
|
+
autoCleanOnlyBlank: 'Clean blank sessions only',
|
|
863
|
+
autoCleanDisabled: 'Auto clean is off — preview only, nothing will be executed.',
|
|
864
|
+
autoCleanSelected: '{n} selected · {size} total',
|
|
865
|
+
autoCleanRun: 'Run selected',
|
|
866
|
+
autoCleanRunning: 'Cleaning…',
|
|
867
|
+
autoCleanTooMany: 'Clean up at most 100 sessions at a time',
|
|
868
|
+
autoCleanResultTitle: 'Result',
|
|
869
|
+
autoCleanResultDone: 'Processed {n} sessions',
|
|
870
|
+
autoCleanResultFailed: 'Failed: {n}',
|
|
871
|
+
autoCleanResultMore: '{n} more',
|
|
872
|
+
autoCleanResultClose: 'Done',
|
|
873
|
+
autoCleanReasonIdle: 'Idle {n} days',
|
|
874
|
+
autoCleanReasonSize: 'Larger than {size}',
|
|
875
|
+
autoCleanReasonBlank: 'Blank',
|
|
876
|
+
autoCleanDoneArchived: 'Archived {n} sessions',
|
|
877
|
+
autoCleanDoneTrashed: 'Moved {n} sessions to the trash',
|
|
878
|
+
autoCleanDonePartial: 'Processed {done}, failed {failed}',
|
|
879
|
+
autoCleanEnableFirst: 'Enable auto clean first',
|
|
880
|
+
autoCleanNoneSelected: 'Select sessions to clean',
|
|
881
|
+
autoCleanFailed: 'Cleanup failed, try again later',
|
|
882
|
+
autoCleanBadgeTitle: '{n} sessions can be cleaned',
|
|
883
|
+
autoCleanRulesTitle: 'Rules',
|
|
884
|
+
autoCleanGroupTriggers: 'Conditions',
|
|
885
|
+
autoCleanGroupAction: 'Action',
|
|
886
|
+
autoCleanScanned: 'Scanned {n} sessions',
|
|
887
|
+
autoCleanHit: '{n} matched',
|
|
888
|
+
autoCleanExcludeLine: 'Excluded: {items}',
|
|
889
|
+
autoCleanExcludeRunning: 'running {n}',
|
|
890
|
+
autoCleanExcludeArchived: 'archived {n}',
|
|
891
|
+
autoCleanExcludePinned: 'pinned {n}',
|
|
892
|
+
autoCleanExcludeCurrent: 'currently open {n}',
|
|
893
|
+
autoCleanExcludeWorkspace: 'excluded workspace {n}',
|
|
894
|
+
autoCleanEmptyTitle: 'No sessions match',
|
|
895
|
+
autoCleanEmptyHint: 'Current rules: idle ≥{days}, size ≥{size}, blank sessions {blank}. Adjust the rules to update this list.',
|
|
896
|
+
autoCleanBlankIncluded: 'included',
|
|
897
|
+
autoCleanBlankExcluded: 'excluded',
|
|
678
898
|
cleanBlankConfirmTitle: 'Clean blank sessions',
|
|
679
899
|
cleanBlankConfirmBody: 'Move {n} blank sessions ({size}) to the trash? You can restore them later.',
|
|
680
900
|
showPath: 'Show path',
|
|
@@ -700,6 +920,7 @@ const DICT = {
|
|
|
700
920
|
emptyTrash: 'Empty trash',
|
|
701
921
|
trashEmptied: 'Trash emptied',
|
|
702
922
|
refresh: 'Refresh',
|
|
923
|
+
refreshed: 'Refreshed',
|
|
703
924
|
loading: 'Loading…',
|
|
704
925
|
loadFailed: 'Failed to load: {msg}',
|
|
705
926
|
retry: 'Retry',
|
|
@@ -790,12 +1011,13 @@ const DICT = {
|
|
|
790
1011
|
panelOfficial: 'Official',
|
|
791
1012
|
panelPreset: 'Preset',
|
|
792
1013
|
panelThirdParty: 'Third-party',
|
|
793
|
-
panelLocal: 'Local
|
|
1014
|
+
panelLocal: 'Local',
|
|
794
1015
|
panelStateActive: 'Enabled',
|
|
795
1016
|
panelStateDisabled: 'Disabled',
|
|
796
1017
|
panelStateFailed: 'Failed to load',
|
|
797
1018
|
panelStateReadOnly: 'Managed by profile',
|
|
798
|
-
panelStateUnaddressable: 'Unaddressable (
|
|
1019
|
+
panelStateUnaddressable: 'Unaddressable (handled by the plugin manager; cannot be toggled or opened separately)',
|
|
1020
|
+
panelStatePresetManaged: 'Managed by a preset (enabled/disabled with it)',
|
|
799
1021
|
panelPhasePending: 'Pending',
|
|
800
1022
|
panelPhaseLoading: 'Loading',
|
|
801
1023
|
panelPhaseActive: 'Active',
|
|
@@ -803,6 +1025,12 @@ const DICT = {
|
|
|
803
1025
|
panelPhaseUnloading: 'Unloading',
|
|
804
1026
|
panelPhaseNotLoaded: 'Not loaded',
|
|
805
1027
|
panelPhaseBuiltin: 'Loaded with the app',
|
|
1028
|
+
panelReasonManaged: 'Controlled by management; cannot be toggled here',
|
|
1029
|
+
panelReasonPreset: 'Controlled by a preset; enables with that preset',
|
|
1030
|
+
panelReasonUnaddressable: 'Not individually addressable; cannot be toggled here',
|
|
1031
|
+
panelReasonConditional: 'Not enabled by its runtime condition, currently off',
|
|
1032
|
+
panelReasonManualDisabled: 'Manually disabled in the profile; you can enable it here',
|
|
1033
|
+
panelReasonDefaultDisabled: 'Off by default; you can enable it here',
|
|
806
1034
|
panelYes: 'Yes',
|
|
807
1035
|
panelNo: 'No',
|
|
808
1036
|
panelUnknown: 'Unknown',
|
|
@@ -901,7 +1129,6 @@ const DICT = {
|
|
|
901
1129
|
settingsNav: 'DSH Keeper',
|
|
902
1130
|
settingsHint: 'Find this page under Settings → DSH Keeper.',
|
|
903
1131
|
settingsTitle: 'DSH Keeper settings',
|
|
904
|
-
settingsSubtitle: 'Delete policy and sidebar entry defaults',
|
|
905
1132
|
defaultDeleteMode: 'Delete action in the session list',
|
|
906
1133
|
modeTrash: 'Move to trash',
|
|
907
1134
|
modeTrashHint: 'Recommended. Sessions go to the trash first and can be restored; purging asks again.',
|
|
@@ -918,20 +1145,19 @@ const DICT = {
|
|
|
918
1145
|
resetSettingsDone: 'Defaults restored',
|
|
919
1146
|
about: 'About',
|
|
920
1147
|
version: 'Version {v}',
|
|
921
|
-
dshVersion: 'Current DSH version',
|
|
922
1148
|
compatibility: 'Compatibility',
|
|
923
1149
|
compatRange: 'Compatibility range',
|
|
924
1150
|
compatOk: 'Compatible',
|
|
925
|
-
compatBad: '
|
|
1151
|
+
compatBad: 'Incompatible',
|
|
926
1152
|
compatUnknown: 'Unknown',
|
|
927
1153
|
compatUndeclared: 'Not declared',
|
|
928
1154
|
compatReason: 'Reason',
|
|
929
|
-
compatReasonOk: 'Declares {range}
|
|
930
|
-
compatReasonMismatch: '
|
|
931
|
-
compatReasonNoVersion: 'Cannot read the running DSH version
|
|
932
|
-
compatReasonNoRange: 'No engines.dsh range is declared
|
|
933
|
-
compatReasonUnparsable: 'The range or version could not be parsed
|
|
934
|
-
compatHostHint: 'Shipped with DSH
|
|
1155
|
+
compatReasonOk: 'Declares {range}',
|
|
1156
|
+
compatReasonMismatch: 'Range {range}; running {version} is outside it',
|
|
1157
|
+
compatReasonNoVersion: 'Cannot read the running DSH version',
|
|
1158
|
+
compatReasonNoRange: 'No engines.dsh range is declared',
|
|
1159
|
+
compatReasonUnparsable: 'The range or version could not be parsed',
|
|
1160
|
+
compatHostHint: 'Shipped with DSH',
|
|
935
1161
|
compatUndeclaredHint: 'This plugin does not declare engines.dsh, so compatibility cannot be determined.',
|
|
936
1162
|
compatPresetHint: 'Provided by an Agent preset; no standalone compatibility range is declared.',
|
|
937
1163
|
settingsSaved: 'Settings saved',
|
|
@@ -955,7 +1181,8 @@ const DICT = {
|
|
|
955
1181
|
const CSS = `
|
|
956
1182
|
.ss-root{height:100%;overflow:auto;scrollbar-gutter:stable;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font-size:13px;line-height:1.5;--ss-surface:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, var(--dsw-alias-bg-base));--ss-surface-hover:color-mix(in srgb, var(--dsw-alias-label-primary) 11%, var(--dsw-alias-bg-base))}
|
|
957
1183
|
.ss-launcherwrap{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none}
|
|
958
|
-
.ss-
|
|
1184
|
+
.ss-dot{display:block;flex:none;width:6px;height:6px;border-radius:50%;corner-shape:round;pointer-events:none;box-sizing:border-box}
|
|
1185
|
+
.ss-launcherdot{position:absolute;top:-1px;right:-1px}
|
|
959
1186
|
.ss-launcherdot[data-state=done]{background:var(--dsw-alias-state-success-primary)}
|
|
960
1187
|
.ss-launcherdot[data-state=warning]{background:var(--dsw-alias-state-warn-primary)}
|
|
961
1188
|
.ss-launcherdot[data-state=error]{background:var(--dsw-alias-state-error-primary)}
|
|
@@ -984,6 +1211,9 @@ const CSS = `
|
|
|
984
1211
|
.ss-btn.quiet:hover:not(:disabled){background:var(--ss-surface-hover);border-color:var(--dsw-alias-border-l2)}
|
|
985
1212
|
.ss-btn.tiny{height:24px;padding:0 9px;font-size:11px;border-radius:6px}
|
|
986
1213
|
.ss-btn .ss-btnicon{vertical-align:-2.5px;margin-right:4px;flex:none}
|
|
1214
|
+
.ss-btn .ss-btnicon.ss-icon-muted{color:var(--dsw-alias-label-secondary)}
|
|
1215
|
+
.ss-btn .ss-btnicon.ss-icon-success{color:var(--dsw-alias-state-success-primary)}
|
|
1216
|
+
.ss-btn:disabled .ss-btnicon{color:inherit}
|
|
987
1217
|
.ss-tag{display:inline-flex;align-items:center;gap:4px;padding:1px 7px;border-radius:999px;font-size:10.5px;line-height:16px;border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);white-space:nowrap}
|
|
988
1218
|
.ss-tag.on{color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 14%,transparent);border-color:color-mix(in srgb,var(--dsw-alias-state-success-primary) 32%,transparent)}
|
|
989
1219
|
.ss-tag.loading{color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 14%,transparent);border-color:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 34%,transparent)}
|
|
@@ -992,6 +1222,7 @@ const CSS = `
|
|
|
992
1222
|
.ss-tag.off{color:color-mix(in srgb, var(--dsw-alias-label-secondary) 72%, transparent)}
|
|
993
1223
|
.ss-tag.disabled{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 12%,transparent);border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 32%,transparent)}
|
|
994
1224
|
.ss-tag.scope-global,.ss-tag.scope-session,.ss-tag.scope-both{color:var(--dsw-alias-label-secondary);background:var(--ss-surface);border-color:var(--dsw-alias-border-l1)}
|
|
1225
|
+
.ss-rowdivider{flex:none;width:1px;height:16px;margin:0 2px;background:var(--dsw-alias-border-l1)}
|
|
995
1226
|
.ss-scopefilter{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin:0 0 12px}
|
|
996
1227
|
.ss-filterbar{display:flex;align-items:center;gap:8px;margin:0 0 12px;padding-right:8px}
|
|
997
1228
|
.ss-filterbar .ss-scopefilter{margin:0;flex:1;min-width:0}
|
|
@@ -1062,6 +1293,16 @@ const CSS = `
|
|
|
1062
1293
|
.ss-tab:hover{color:var(--dsw-alias-label-primary)}
|
|
1063
1294
|
.ss-tab.active{color:var(--dsw-alias-label-primary);border-bottom-color:var(--dsw-alias-brand-primary)}
|
|
1064
1295
|
.ss-toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:12px}
|
|
1296
|
+
.ss-sessiontoolbar .ss-input{flex:1 1 260px;min-width:180px;width:auto}
|
|
1297
|
+
.ss-sessiontoolbar .ss-menuwrap{flex:none}
|
|
1298
|
+
.ss-sessionactions{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none}
|
|
1299
|
+
.ss-sessionactions .ss-btn{gap:6px}
|
|
1300
|
+
.ss-btn.ss-iconbtn{width:32px;padding:0}
|
|
1301
|
+
.ss-btn.ss-icontextbtn{display:inline-flex;align-items:center;gap:6px}
|
|
1302
|
+
.ss-btn.ss-icontextbtn svg{flex:none}
|
|
1303
|
+
.ss-sessionfilters{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 12px}
|
|
1304
|
+
.ss-sessionfilters .ss-scopefilter{margin:0;flex:0 1 auto}
|
|
1305
|
+
.ss-sessionfilters .ss-sessionssummary{margin:0 0 0 auto;min-height:0}
|
|
1065
1306
|
.ss-input{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);border-radius:8px;padding:6px 10px;color:var(--dsw-alias-label-primary);font-size:12px;font-family:inherit;min-width:220px;outline:none}
|
|
1066
1307
|
.ss-input:focus,.ss-input:focus-visible,.ss-plugintoolbar .ss-input:focus,.ss-plugintoolbar .ss-input:focus-visible{border-color:color-mix(in srgb,var(--dsw-alias-label-primary) 34%,var(--dsw-alias-bg-base));box-shadow:none;outline:none}
|
|
1067
1308
|
.ss-searchrow{display:flex;align-items:center;gap:8px;margin:12px 0 10px;padding-right:8px}
|
|
@@ -1095,10 +1336,34 @@ const CSS = `
|
|
|
1095
1336
|
.ss-cardhint{font-size:11px;line-height:1.55;color:var(--dsw-alias-label-secondary);margin:-4px 0 10px}
|
|
1096
1337
|
.ss-kpis{display:flex;gap:18px;flex-wrap:wrap;color:var(--dsw-alias-label-secondary);font-size:12px}
|
|
1097
1338
|
.ss-kpis b{color:var(--dsw-alias-label-primary);font-weight:600}
|
|
1098
|
-
.ss-
|
|
1099
|
-
.ss-
|
|
1100
|
-
.ss-
|
|
1101
|
-
.ss-
|
|
1339
|
+
.ss-permstrip{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;padding:6px 0 12px;border-bottom:1px solid var(--dsw-alias-border-l1);margin-bottom:4px}
|
|
1340
|
+
.ss-permstrip.off{opacity:.55}
|
|
1341
|
+
.ss-permdot{background:var(--dsw-alias-label-tertiary);margin-right:-4px}
|
|
1342
|
+
.ss-permdot.granted{background:var(--dsw-alias-state-success-primary)}
|
|
1343
|
+
.ss-permdot.default{background:var(--dsw-alias-state-warn-primary)}
|
|
1344
|
+
.ss-permdot.denied{background:var(--dsw-alias-state-error-primary)}
|
|
1345
|
+
.ss-permdot.unsupported{background:var(--dsw-alias-label-tertiary)}
|
|
1346
|
+
.ss-permstate{flex:none;font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
1347
|
+
.ss-permstate.granted{color:var(--dsw-alias-state-success-primary)}
|
|
1348
|
+
.ss-permstate.default{color:var(--dsw-alias-state-warn-primary)}
|
|
1349
|
+
.ss-permstate.denied{color:var(--dsw-alias-state-error-primary)}
|
|
1350
|
+
.ss-permstate.unsupported{color:var(--dsw-alias-label-tertiary)}
|
|
1351
|
+
.ss-permtext{flex:1;min-width:120px;font-size:11px;line-height:1.5;color:var(--dsw-alias-label-secondary);margin-left:4px}
|
|
1352
|
+
.ss-permactions{display:flex;align-items:center;gap:6px;margin-left:auto}
|
|
1353
|
+
.ss-helpcard{position:fixed;z-index:1280;width:300px;max-width:calc(100vw - 16px);padding:12px 14px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:10px;box-shadow:var(--dsw-elevation-prominent,0 10px 30px rgba(0,0,0,.35));color:var(--dsw-alias-label-primary);font-size:12px;line-height:1.55;--ss-surface:color-mix(in srgb,var(--dsw-alias-label-primary) 6%,var(--dsw-alias-bg-layer-2));--ss-surface-hover:color-mix(in srgb,var(--dsw-alias-label-primary) 11%,var(--dsw-alias-bg-layer-2));animation:ss-help-in .14s ease-out}
|
|
1354
|
+
.ss-helpcard h5{margin:0 0 8px;padding-right:22px;font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
1355
|
+
.ss-helpclose{position:absolute;top:6px;right:6px;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:6px;background:transparent;color:var(--dsw-alias-label-tertiary);cursor:pointer;transition:background .12s ease,color .12s ease}
|
|
1356
|
+
.ss-helpclose:hover{background:var(--ss-surface-hover);color:var(--dsw-alias-label-primary)}
|
|
1357
|
+
.ss-helpclose:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}
|
|
1358
|
+
.ss-helpsteps{display:flex;flex-direction:column;gap:6px}
|
|
1359
|
+
.ss-helpstep{display:flex;align-items:flex-start;gap:8px;color:var(--dsw-alias-label-secondary)}
|
|
1360
|
+
.ss-helpnum{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-top:1px;box-sizing:border-box;border-radius:50%;corner-shape:round;line-height:1;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);font-size:10px;font-variant-numeric:tabular-nums}
|
|
1361
|
+
.ss-helpactions{display:flex;justify-content:center;gap:8px;margin-top:16px}
|
|
1362
|
+
.ss-helptail{position:absolute;bottom:-6px;left:50%;width:10px;height:10px;background:var(--dsw-alias-bg-layer-2);border-right:1px solid var(--dsw-alias-border-l2);border-bottom:1px solid var(--dsw-alias-border-l2);transform:rotate(45deg)}
|
|
1363
|
+
.ss-helpcard.below .ss-helptail{bottom:auto;top:-6px;transform:rotate(225deg)}
|
|
1364
|
+
@keyframes ss-help-in{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}
|
|
1365
|
+
@keyframes ss-ac-tip-in{from{opacity:0}to{opacity:1}}
|
|
1366
|
+
@media (prefers-reduced-motion: reduce){.ss-helpcard{animation:none}}
|
|
1102
1367
|
.ss-group{margin-bottom:18px}
|
|
1103
1368
|
.ss-grouphead{display:flex;align-items:center;gap:8px;padding:6px 2px;color:var(--dsw-alias-label-secondary);font-size:12px}
|
|
1104
1369
|
.ss-groupcollapse{flex:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:1px solid transparent;border-radius:5px;background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;font-family:inherit;transition:background .15s ease,color .15s ease}
|
|
@@ -1195,7 +1460,126 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1195
1460
|
.ss-filenamekey{flex:none;font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
1196
1461
|
.ss-filenameval{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--dsw-alias-label-primary)}
|
|
1197
1462
|
.ss-modalfoot .ss-modalfootstart{margin-right:auto}
|
|
1198
|
-
.ss-
|
|
1463
|
+
.ss-autocleanmodal{width:min(780px,calc(100vw - 48px));max-width:none;max-height:calc(100vh - 48px);display:flex;flex-direction:column;overflow:hidden;--ss-surface:color-mix(in srgb,var(--dsw-alias-label-primary) 10%,var(--dsw-alias-bg-layer-2));--ss-surface-hover:color-mix(in srgb,var(--dsw-alias-label-primary) 16%,var(--dsw-alias-bg-layer-2))}
|
|
1464
|
+
.ss-autocleanmodal .ss-btn:not(.primary):not(.danger){background:var(--ss-surface);border-color:var(--dsw-alias-border-l1)}
|
|
1465
|
+
.ss-autocleanmodal .ss-btn:not(.primary):not(.danger):hover:not(:disabled){background:var(--ss-surface-hover);border-color:var(--dsw-alias-border-l2)}
|
|
1466
|
+
.ss-autocleanbody{flex:1;min-height:0;display:flex;flex-direction:column;gap:14px;overflow:auto;margin:2px 0 16px}
|
|
1467
|
+
.ss-autocleancard{display:flex;flex-direction:column;min-height:0;padding:16px;border:1px solid var(--dsw-alias-border-l1);border-radius:12px}
|
|
1468
|
+
.ss-autocleancardrules{flex:none;background:var(--dsw-alias-bg-layer-2)}
|
|
1469
|
+
.ss-ac-master{display:flex;align-items:center;gap:10px;padding-top:2px}
|
|
1470
|
+
.ss-ac-masterlabel{font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
1471
|
+
.ss-ac-master .ss-switch{margin-left:auto}
|
|
1472
|
+
.ss-ac-masterhint{margin-top:6px;font-size:11px;line-height:1.6;color:var(--dsw-alias-label-secondary)}
|
|
1473
|
+
.ss-ac-divider{height:1px;background:var(--dsw-alias-border-l1);margin:12px 0 0}
|
|
1474
|
+
.ss-autocleancardrules.is-off .ss-ac-rulegrid{opacity:.5;cursor:not-allowed}
|
|
1475
|
+
.ss-autocleancardrules.is-off .ss-ac-rulegrid input,.ss-autocleancardrules.is-off .ss-ac-rulegrid button{cursor:not-allowed}
|
|
1476
|
+
.ss-ac-offhint{margin-top:10px;font-size:11px;color:var(--dsw-alias-label-tertiary)}
|
|
1477
|
+
.ss-autocleancardpreview.is-off .ss-aclist,.ss-autocleancardpreview.is-off .ss-ac-empty{opacity:.5}
|
|
1478
|
+
.ss-autocleancardpreview.is-off .ss-ac-summary{opacity:.55}
|
|
1479
|
+
.ss-autocleancardpreview.is-off .ss-ac-cardhead{opacity:.65}
|
|
1480
|
+
.ss-autocleancardpreview{flex:none;height:min(260px,38vh);padding:16px;overflow:hidden;background:color-mix(in srgb,var(--dsw-alias-label-primary) 5%,var(--dsw-alias-bg-layer-2))}
|
|
1481
|
+
.ss-ac-rulegrid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 40px}
|
|
1482
|
+
.ss-ac-rule{min-width:0;padding:12px 0;border-top:1px solid var(--dsw-alias-border-l1)}
|
|
1483
|
+
.ss-ac-rule:nth-child(1),.ss-ac-rule:nth-child(2){border-top:0}
|
|
1484
|
+
.ss-ac-rulespan{grid-column:1/-1}
|
|
1485
|
+
.ss-ac-rule.ss-ac-rulespan{padding-bottom:0}
|
|
1486
|
+
.ss-ac-rule-row{display:flex;align-items:flex-start;justify-content:flex-start;gap:14px}
|
|
1487
|
+
.ss-ac-ruletext{flex:0 0 164px;min-width:0;padding-top:1px}
|
|
1488
|
+
.ss-ac-exclheadtext{flex:1 1 auto;min-width:0}
|
|
1489
|
+
.ss-ac-rulelbl{font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
1490
|
+
.ss-ac-rulehint{margin-top:2px;font-size:11px;line-height:1.5;color:var(--dsw-alias-label-secondary)}
|
|
1491
|
+
.ss-ac-rulectl{flex:none;display:flex;align-items:center;gap:8px;padding-top:1px}
|
|
1492
|
+
.ss-ac-ctrlindent{display:flex;align-items:center;margin-right:32px}
|
|
1493
|
+
.ss-ac-rule-actions{display:flex;align-items:center;gap:10px}
|
|
1494
|
+
.ss-ac-linkbtn{padding:0;border:0;background:none;font-family:inherit;font-size:11px;line-height:1;color:var(--dsw-alias-label-secondary);cursor:pointer}
|
|
1495
|
+
.ss-ac-linkbtn:hover{color:var(--dsw-alias-label-primary)}
|
|
1496
|
+
.ss-ac-exclwrap{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows .2s ease,opacity .2s ease,margin-top .2s ease}
|
|
1497
|
+
.ss-ac-exclwrap.is-open{grid-template-rows:1fr;opacity:1;margin-top:8px}
|
|
1498
|
+
.ss-ac-exclinner{min-height:0;overflow:hidden}
|
|
1499
|
+
.ss-ac-excllist{margin-top:0;max-height:160px;overflow:auto;padding:8px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-1)}
|
|
1500
|
+
.ss-ac-excllist .ss-acchecks{gap:6px 14px;max-height:none;overflow:visible;padding:0}
|
|
1501
|
+
.ss-ac-rule-summary{padding:9px 12px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:color-mix(in srgb,var(--dsw-alias-label-primary) 8%,var(--dsw-alias-bg-layer-2));font-size:11px;line-height:1.7;color:var(--dsw-alias-label-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
1502
|
+
.ss-ac-rule-summary:focus-visible{outline:2px solid color-mix(in srgb,var(--dsw-alias-label-primary) 40%,transparent);outline-offset:2px}
|
|
1503
|
+
.ss-ac-summarytip{position:fixed;z-index:1500;box-sizing:border-box;padding:10px 12px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:10px;box-shadow:var(--dsw-elevation-prominent,0 10px 30px rgba(0,0,0,.35));color:var(--dsw-alias-label-primary);font-size:12px;line-height:1.5;white-space:normal;word-break:break-word;pointer-events:none;animation:ss-ac-tip-in .14s ease-out}
|
|
1504
|
+
.ss-ac-summarytip-tail{position:absolute;bottom:-6px;width:10px;height:10px;background:var(--dsw-alias-bg-layer-2);border-right:1px solid var(--dsw-alias-border-l2);border-bottom:1px solid var(--dsw-alias-border-l2);transform:rotate(45deg)}
|
|
1505
|
+
.ss-ac-summarytip.below .ss-ac-summarytip-tail{bottom:auto;top:-6px;transform:rotate(225deg)}
|
|
1506
|
+
.ss-ac-tiprow{margin:0}
|
|
1507
|
+
.ss-ac-tiprow + .ss-ac-tiprow{margin-top:3px}
|
|
1508
|
+
.ss-ac-tiplane{color:var(--dsw-alias-label-secondary);font-weight:600}
|
|
1509
|
+
.ss-ac-tipvalue{color:var(--dsw-alias-label-primary)}
|
|
1510
|
+
@media (prefers-reduced-motion: reduce){.ss-ac-summarytip{animation:none}}
|
|
1511
|
+
.ss-ac-rule-summary.is-off{opacity:.5}
|
|
1512
|
+
.ss-ac-rule-summary .ss-ac-rslabel{color:var(--dsw-alias-label-secondary)}
|
|
1513
|
+
.ss-ac-rule-summary .ss-ac-rsval{color:var(--dsw-alias-label-primary);font-weight:600}
|
|
1514
|
+
@media (prefers-reduced-motion:reduce){.ss-ac-exclwrap{transition:none}}
|
|
1515
|
+
.ss-ac-footleft{display:flex;align-items:center;gap:10px;margin-right:auto;min-width:0}
|
|
1516
|
+
.ss-ac-footleft .ss-acfootinfo{margin-right:0}
|
|
1517
|
+
.ss-ac-footswitchlabel{font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
1518
|
+
.ss-ac-cardhead{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;margin-bottom:6px}
|
|
1519
|
+
.ss-ac-cardtitle{font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary);white-space:nowrap}
|
|
1520
|
+
.ss-ac-enablehint{margin-top:4px;font-size:11px;line-height:1.6;color:var(--dsw-alias-label-secondary)}
|
|
1521
|
+
.ss-ac-group{margin:16px 0 2px;font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
1522
|
+
.ss-ac-summary{font-size:11px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
1523
|
+
.ss-ac-excluded{margin-top:6px;font-size:11px;line-height:1.6;color:var(--dsw-alias-label-tertiary);word-break:break-word}
|
|
1524
|
+
.ss-ac-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px}
|
|
1525
|
+
.ss-btnbadge{margin-left:6px;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;min-width:14px;height:14px;padding:0 4px;border-radius:999px;background:var(--dsw-alias-state-warn-primary);color:#2b2100;font-size:11px;line-height:1}
|
|
1526
|
+
.ss-acrow{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:12px 0;border-top:1px solid var(--dsw-alias-border-l1)}
|
|
1527
|
+
.ss-ac-group + .ss-acrow{border-top:none;padding-top:6px}
|
|
1528
|
+
.ss-acrowcolumn{flex-direction:column;align-items:stretch}
|
|
1529
|
+
.ss-acrowlabel{display:flex;flex-direction:column;gap:3px;font-size:11px;font-weight:400;line-height:1.6;color:var(--dsw-alias-label-secondary);min-width:0}
|
|
1530
|
+
.ss-acrowlabel small{color:var(--dsw-alias-label-secondary);font-size:11px;line-height:1.6;font-weight:400}
|
|
1531
|
+
.ss-acrowlabel-strong{font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
1532
|
+
.ss-acrowlabel-strong small{font-weight:400}
|
|
1533
|
+
.ss-acnum{display:flex;align-items:center;gap:6px;color:var(--dsw-alias-label-secondary);font-size:12px;flex:none}
|
|
1534
|
+
.ss-acnumunit{display:inline-block;width:26px;flex:none;text-align:right}
|
|
1535
|
+
.ss-acnumwrap{position:relative;display:inline-flex;align-items:center;flex:none}
|
|
1536
|
+
.ss-acnuminput{width:96px;height:30px;flex:none;box-sizing:border-box;padding:0 26px 0 10px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--ss-surface,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-primary);font-family:inherit;font-size:12px;text-align:left;transition:border-color .15s ease}
|
|
1537
|
+
.ss-acnuminput:hover{border-color:var(--dsw-alias-border-l2)}
|
|
1538
|
+
.ss-acnuminput:focus{outline:none;border-color:color-mix(in srgb,var(--dsw-alias-label-primary) 34%,var(--dsw-alias-bg-layer-2))}
|
|
1539
|
+
.ss-acnuminput{appearance:textfield;-moz-appearance:textfield}
|
|
1540
|
+
.ss-acnuminput::-webkit-inner-spin-button,.ss-acnuminput::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
|
|
1541
|
+
.ss-acarrows{position:absolute;right:6px;top:5px;bottom:5px;width:14px;display:flex;flex-direction:column;justify-content:space-between}
|
|
1542
|
+
.ss-acarrow{display:flex;align-items:center;justify-content:center;width:14px;height:9px;margin:0;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer}
|
|
1543
|
+
.ss-acarrow:hover{color:var(--dsw-alias-label-primary)}
|
|
1544
|
+
.ss-acarrow::before{content:'';width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent}
|
|
1545
|
+
.ss-acarrowup::before{border-bottom:5px solid currentColor}
|
|
1546
|
+
.ss-acarrowdown::before{border-top:5px solid currentColor}
|
|
1547
|
+
.ss-acchecks{display:flex;flex-wrap:wrap;gap:4px 14px;max-height:84px;overflow:auto;padding-top:6px}
|
|
1548
|
+
.ss-acheck{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--dsw-alias-label-primary);white-space:nowrap}
|
|
1549
|
+
.ss-acheck input{width:14px;height:14px;flex:none;accent-color:var(--dsw-alias-brand-primary);margin:0}
|
|
1550
|
+
.ss-acsection{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:2px 0 8px;font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
1551
|
+
.ss-acsection .ss-acsum{font-weight:400;color:var(--dsw-alias-label-secondary);font-size:12px}
|
|
1552
|
+
.ss-aclist{flex:1;min-height:0;overflow:auto;margin-top:10px;padding-right:2px}
|
|
1553
|
+
.ss-acitem{display:flex;align-items:flex-start;gap:10px;padding:12px 12px;border-radius:8px;background:color-mix(in srgb,var(--dsw-alias-label-primary) 7%,transparent)}
|
|
1554
|
+
.ss-acitem:hover{background:color-mix(in srgb,var(--dsw-alias-label-primary) 10%,transparent)}
|
|
1555
|
+
.ss-acitem + .ss-acitem{margin-top:8px}
|
|
1556
|
+
.ss-acitem input{accent-color:var(--dsw-alias-brand-primary);margin:2px 0 0;flex:none}
|
|
1557
|
+
.ss-acitemmain{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
|
|
1558
|
+
.ss-acitemtitle{font-size:12px;color:var(--dsw-alias-label-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
1559
|
+
.ss-acitemmeta{font-size:11px;color:var(--dsw-alias-label-secondary);display:flex;flex-wrap:wrap;gap:8px}
|
|
1560
|
+
.ss-acreasons{display:flex;flex-wrap:wrap;gap:4px;flex:none}
|
|
1561
|
+
.ss-acreason{font-size:11px;line-height:18px;padding:0 6px;border-radius:999px;color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 10%,transparent);white-space:nowrap}
|
|
1562
|
+
.ss-ac-empty{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:8px 12px;text-align:center}
|
|
1563
|
+
.ss-ac-emptyicon{display:flex;color:var(--dsw-alias-label-tertiary)}
|
|
1564
|
+
.ss-ac-emptytitle{font-size:12px;font-weight:500;color:var(--dsw-alias-label-primary)}
|
|
1565
|
+
.ss-ac-emptyhint{font-size:11px;line-height:1.6;color:var(--dsw-alias-label-secondary);max-width:460px}
|
|
1566
|
+
.ss-ac-emptylink{margin-top:0}
|
|
1567
|
+
.ss-ac-emptyaction{height:26px;flex:none;display:flex;align-items:center;justify-content:center}
|
|
1568
|
+
.ss-acfootinfo{margin-right:auto;font-size:12px;color:var(--dsw-alias-label-secondary);align-self:center}
|
|
1569
|
+
.ss-acpreviewonly{margin:8px 0 0;font-size:11px;color:var(--dsw-alias-label-secondary)}
|
|
1570
|
+
.ss-autocleanmodal.is-result{width:min(440px,calc(100vw - 48px))}
|
|
1571
|
+
.ss-acresult{display:flex;flex-direction:column;gap:10px;margin:6px 0 12px;font-size:12px;color:var(--dsw-alias-label-primary)}
|
|
1572
|
+
.ss-acresulthead{display:flex;align-items:center;gap:10px}
|
|
1573
|
+
.ss-acresulticon{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:color-mix(in srgb,var(--dsw-alias-label-primary) 7%,transparent)}
|
|
1574
|
+
.ss-acresulticon[data-tone=success]{color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 12%,transparent)}
|
|
1575
|
+
.ss-acresulticon[data-tone=error]{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 12%,transparent)}
|
|
1576
|
+
.ss-acresulttitle{font-weight:600;font-size:12px;color:var(--dsw-alias-label-primary);margin-bottom:2px}
|
|
1577
|
+
.ss-acresultline{font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
1578
|
+
.ss-acresulterrors{margin-top:2px}
|
|
1579
|
+
.ss-acresulterrline{font-size:11px;color:var(--dsw-alias-state-error-primary);margin-bottom:4px}
|
|
1580
|
+
.ss-acresult ul{margin:0;padding-left:18px;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:1.7;word-break:break-word;max-height:160px;overflow:auto}
|
|
1581
|
+
.ss-acresultmore{margin-top:4px;font-size:11px;color:var(--dsw-alias-label-tertiary)}
|
|
1582
|
+
.ss-toast{position:fixed;left:50%;bottom:26px;transform:translateX(-50%);z-index:1300;display:flex;align-items:center;gap:14px;background:var(--dsw-alias-toast-bg);border:1px solid var(--dsw-alias-border-l2);border-radius:10px;padding:10px 14px;font-size:12px;box-shadow:0 8px 24px rgba(0,0,0,.3);color:var(--dsw-alias-label-primary);max-width:min(560px,90vw)}
|
|
1199
1583
|
.ss-undoaction{display:inline-flex;align-items:center;gap:8px;flex:none;padding-left:10px;border-left:1px solid var(--dsw-alias-border-l2)}
|
|
1200
1584
|
.ss-undobtn{appearance:none;border:0;background:transparent;color:#007AFF;font-family:inherit;font-size:12px;font-weight:400;line-height:20px;padding:2px 4px;border-radius:6px;cursor:pointer}
|
|
1201
1585
|
.ss-undobtn:hover{background:transparent;color:#007AFF}
|
|
@@ -1261,6 +1645,9 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1261
1645
|
.ss-phase-notloaded{color:var(--dsw-alias-label-secondary)}
|
|
1262
1646
|
.ss-phase-builtin{color:var(--dsw-alias-label-secondary)}
|
|
1263
1647
|
.ss-phase-unknown{color:var(--dsw-alias-label-secondary)}
|
|
1648
|
+
.ss-phasewrap{display:inline-flex;align-items:baseline;flex-wrap:wrap;gap:2px;min-width:0}
|
|
1649
|
+
.ss-phasewrap .ss-phase{color:var(--dsw-alias-label-primary)}
|
|
1650
|
+
.ss-phasereason{color:var(--dsw-alias-label-primary);font-size:11px;font-weight:400;white-space:normal}
|
|
1264
1651
|
.ss-detaildesc{margin-top:8px;font-size:11.5px;line-height:18px;color:var(--dsw-alias-label-secondary)}
|
|
1265
1652
|
.ss-detaildescrow{display:flex;align-items:flex-start;gap:8px;margin-top:8px}
|
|
1266
1653
|
.ss-detaildescrow .ss-detaildesc{margin-top:0;flex:1;min-width:0}
|
|
@@ -1296,10 +1683,14 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1296
1683
|
.ss-othercard{margin-top:4px}
|
|
1297
1684
|
.ss-hint{font-size:11px;color:var(--dsw-alias-label-secondary);margin-top:8px;line-height:1.55}
|
|
1298
1685
|
/* --- motion: short fades, within the host's own 150-200ms easing range --- */
|
|
1299
|
-
.ss-actionnote{position:fixed;z-index:1400;left:0;top:0;
|
|
1686
|
+
.ss-actionnote{position:fixed;z-index:1400;left:0;top:0;display:flex;align-items:center;gap:6px;box-sizing:border-box;height:46px;padding:0 14px;pointer-events:none;border-radius:10px;border:1px solid transparent;background:var(--dsw-alias-toast-bg);color:var(--dsw-alias-label-primary);font-size:12px;line-height:18px;white-space:nowrap;box-shadow:0 6px 18px rgba(0,0,0,.3);transform:translate(-50%,-20px);transition:transform .32s cubic-bezier(.2,0,0,1),top .18s ease}
|
|
1687
|
+
.ss-actionnote-icon{display:inline-flex;flex:none;width:14px;height:14px;align-items:center;justify-content:center;color:var(--dsw-alias-state-success-primary)}
|
|
1688
|
+
.ss-actionnote-icon svg{display:block}
|
|
1689
|
+
.ss-actionnote-text{display:inline-block}
|
|
1300
1690
|
.ss-actionnote.show{transform:translate(-50%,0)}
|
|
1301
1691
|
.ss-actionnote.is-hiding{opacity:0;transform:translate(-50%,-20px);transition:opacity .4s ease,transform .4s cubic-bezier(.4,0,.8,1)}
|
|
1302
|
-
.ss-actionnote.
|
|
1692
|
+
.ss-actionnote[data-tone=warning] .ss-actionnote-icon{color:var(--dsw-alias-state-warn-primary)}
|
|
1693
|
+
.ss-actionnote[data-tone=error] .ss-actionnote-icon{color:var(--dsw-alias-state-error-primary)}
|
|
1303
1694
|
|
|
1304
1695
|
@keyframes ss-fade-in{from{opacity:0}to{opacity:1}}
|
|
1305
1696
|
.ss-fade{animation:ss-fade-in .16s ease-out both}
|
|
@@ -1337,12 +1728,28 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1337
1728
|
.ss-settings .ss-card{background:transparent;border:0;border-radius:0;padding:4px 0 0;margin:6px 0 0}
|
|
1338
1729
|
.ss-settings .ss-card h4{font-size:13px;font-weight:600;letter-spacing:0;text-transform:none;margin:0 0 8px;color:var(--dsw-alias-label-secondary)}
|
|
1339
1730
|
.ss-settings .ss-notifycard h4{font-size:14px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
1731
|
+
.ss-notifycard h4{display:flex;align-items:center;gap:8px}
|
|
1732
|
+
.ss-notifytoggle{margin-left:auto;flex:none;height:24px;padding:0 8px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1;cursor:pointer}
|
|
1733
|
+
.ss-notifytoggle:hover{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary)}
|
|
1734
|
+
.ss-notifytoggle:focus-visible{outline:2px solid color-mix(in srgb,var(--dsw-alias-label-primary) 40%,transparent);outline-offset:1px}
|
|
1735
|
+
.ss-notifytoggle{display:inline-flex;align-items:center;gap:4px}
|
|
1736
|
+
.ss-notifychevron{flex:none;transition:transform .16s ease}
|
|
1737
|
+
.ss-notifychevron.open{transform:rotate(180deg)}
|
|
1738
|
+
.ss-notifycollapsedcount{margin-left:auto;flex:none;font-size:12px;color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-variant-numeric:tabular-nums}
|
|
1739
|
+
.ss-notifycard.ss-notifycard-collapsed .ss-notifytoggle{margin-left:8px}
|
|
1740
|
+
.ss-notifycard{transition:padding-bottom .38s cubic-bezier(.2,.7,.2,1)}
|
|
1741
|
+
.ss-notifycard.ss-notifycard-collapsed{padding-bottom:4px}
|
|
1742
|
+
.ss-notifybody{display:grid;grid-template-rows:1fr;opacity:1;transition:grid-template-rows .38s cubic-bezier(.2,.7,.2,1),opacity .28s ease,visibility 0s linear 0s}
|
|
1743
|
+
.ss-notifybodyinner{overflow:hidden;min-height:0}
|
|
1744
|
+
.ss-notifybody > .ss-notifybodyinner > :first-child{margin-top:0}
|
|
1745
|
+
.ss-notifycard.ss-notifycard-collapsed .ss-notifybody{grid-template-rows:0fr;opacity:0;visibility:hidden;transition:grid-template-rows .38s cubic-bezier(.2,.7,.2,1),opacity .28s ease,visibility 0s linear .38s}
|
|
1340
1746
|
.ss-notifycount{color:var(--dsw-alias-label-secondary)}
|
|
1341
1747
|
.ss-notifycount b{color:var(--dsw-alias-state-business-primary);font-weight:600;font-variant-numeric:tabular-nums}
|
|
1342
1748
|
.ss-settings .ss-kpis{font-size:13px;line-height:22px;gap:10px}
|
|
1343
1749
|
.ss-settings .ss-kpis b{font-weight:600}
|
|
1344
|
-
.ss-notifyactions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}
|
|
1345
|
-
.ss-
|
|
1750
|
+
.ss-notifyactions{display:flex;flex-direction:row;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px;width:100%;box-sizing:border-box}
|
|
1751
|
+
.ss-notifyactions .ss-btn{flex:none}
|
|
1752
|
+
.ss-notifytotal{margin-left:auto;flex:none;white-space:nowrap;font-size:12px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums}
|
|
1346
1753
|
.ss-notifywrap{position:relative;margin-top:10px}
|
|
1347
1754
|
.ss-notifyhint{position:absolute;left:50%;bottom:10px;padding:5px 12px;border-radius:999px;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px;white-space:nowrap;pointer-events:none;box-shadow:0 2px 10px rgba(0,0,0,.12);transform:translateX(-50%);animation:ss-hint-in .16s ease-out,ss-hint-out .28s ease-in 1.32s forwards}
|
|
1348
1755
|
@keyframes ss-hint-in{from{opacity:0;transform:translate(-50%,4px)}to{opacity:1;transform:translate(-50%,0)}}
|
|
@@ -1415,8 +1822,8 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1415
1822
|
.ss-soundbtn:disabled{opacity:.45;cursor:default}
|
|
1416
1823
|
.ss-soundbtn:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:1px}
|
|
1417
1824
|
.ss-settings .ss-mono{font-size:12px;line-height:18px}
|
|
1418
|
-
.ss-settings .ss-btn{height:34px;padding:0 16px;font-size:13px;border-radius:10px;background:var(--ss-surface);border:1px solid transparent;color:var(--dsw-alias-label-primary);transition:background .12s ease,border-color .12s ease}
|
|
1419
|
-
.ss-settings .ss-btn:hover:not(:disabled){background:var(--ss-surface-hover);border-color:var(--dsw-alias-border-l1)}
|
|
1825
|
+
.ss-settings .ss-btn,.ss-helpcard .ss-btn{height:34px;padding:0 16px;font-size:13px;border-radius:10px;background:var(--ss-surface);border:1px solid transparent;color:var(--dsw-alias-label-primary);transition:background .12s ease,border-color .12s ease}
|
|
1826
|
+
.ss-settings .ss-btn:hover:not(:disabled),.ss-helpcard .ss-btn:hover:not(:disabled){background:var(--ss-surface-hover);border-color:var(--dsw-alias-border-l1)}
|
|
1420
1827
|
.ss-settings .ss-btn.ghost{background:var(--ss-surface);border-color:transparent;color:var(--dsw-alias-label-primary)}
|
|
1421
1828
|
.ss-settings .ss-toolbar{gap:10px;padding-top:4px}
|
|
1422
1829
|
.ss-settings .ss-hint{font-size:12px;line-height:18px;margin-top:10px}
|
|
@@ -1664,11 +2071,10 @@ function compatibilityState(boot) {
|
|
|
1664
2071
|
}
|
|
1665
2072
|
|
|
1666
2073
|
function compatibilityLabel(boot, t) {
|
|
1667
|
-
const {
|
|
2074
|
+
const { satisfied, reason } = compatibilityState(boot);
|
|
1668
2075
|
if (satisfied === true) return t('compatOk');
|
|
1669
|
-
if (satisfied === false)
|
|
1670
|
-
|
|
1671
|
-
}
|
|
2076
|
+
if (satisfied === false) return t('compatBad');
|
|
2077
|
+
if (reason === 'missing-version') return t('compatOk');
|
|
1672
2078
|
return t('compatUnknown');
|
|
1673
2079
|
}
|
|
1674
2080
|
|
|
@@ -1904,7 +2310,7 @@ function SidebarLauncher(props) {
|
|
|
1904
2310
|
React.createElement(PanelIcon, { size, active: Boolean(props?.active) }),
|
|
1905
2311
|
marker.count > 0
|
|
1906
2312
|
? React.createElement('span', {
|
|
1907
|
-
className: 'ss-launcherdot',
|
|
2313
|
+
className: 'ss-dot ss-launcherdot',
|
|
1908
2314
|
'data-state': marker.state,
|
|
1909
2315
|
role: 'status',
|
|
1910
2316
|
'aria-label': label,
|
|
@@ -2553,6 +2959,48 @@ function PlayIcon(props) {
|
|
|
2553
2959
|
);
|
|
2554
2960
|
}
|
|
2555
2961
|
|
|
2962
|
+
function BanIcon(props) {
|
|
2963
|
+
const size = Number(props?.size) || 12;
|
|
2964
|
+
return React.createElement(
|
|
2965
|
+
'svg',
|
|
2966
|
+
{
|
|
2967
|
+
width: size,
|
|
2968
|
+
height: size,
|
|
2969
|
+
viewBox: '0 0 16 16',
|
|
2970
|
+
fill: 'none',
|
|
2971
|
+
stroke: 'currentColor',
|
|
2972
|
+
strokeWidth: 1.35,
|
|
2973
|
+
strokeLinecap: 'round',
|
|
2974
|
+
strokeLinejoin: 'round',
|
|
2975
|
+
className: props?.className,
|
|
2976
|
+
'aria-hidden': 'true',
|
|
2977
|
+
},
|
|
2978
|
+
React.createElement('circle', { cx: 8, cy: 8, r: 5.8 }),
|
|
2979
|
+
React.createElement('path', { d: 'M4.1 11.9 11.9 4.1' }),
|
|
2980
|
+
);
|
|
2981
|
+
}
|
|
2982
|
+
|
|
2983
|
+
function CheckCircleIcon(props) {
|
|
2984
|
+
const size = Number(props?.size) || 12;
|
|
2985
|
+
return React.createElement(
|
|
2986
|
+
'svg',
|
|
2987
|
+
{
|
|
2988
|
+
width: size,
|
|
2989
|
+
height: size,
|
|
2990
|
+
viewBox: '0 0 16 16',
|
|
2991
|
+
fill: 'none',
|
|
2992
|
+
stroke: 'currentColor',
|
|
2993
|
+
strokeWidth: 1.35,
|
|
2994
|
+
strokeLinecap: 'round',
|
|
2995
|
+
strokeLinejoin: 'round',
|
|
2996
|
+
className: props?.className,
|
|
2997
|
+
'aria-hidden': 'true',
|
|
2998
|
+
},
|
|
2999
|
+
React.createElement('circle', { cx: 8, cy: 8, r: 5.8 }),
|
|
3000
|
+
React.createElement('path', { d: 'M5.4 8.2 7.3 10.1 10.7 6.5' }),
|
|
3001
|
+
);
|
|
3002
|
+
}
|
|
3003
|
+
|
|
2556
3004
|
function UploadIcon(props) {
|
|
2557
3005
|
const size = Number(props?.size) || 12;
|
|
2558
3006
|
return React.createElement(
|
|
@@ -2596,6 +3044,27 @@ function ResetIcon(props) {
|
|
|
2596
3044
|
);
|
|
2597
3045
|
}
|
|
2598
3046
|
|
|
3047
|
+
function JumpIcon(props) {
|
|
3048
|
+
const size = Number(props?.size) || 15;
|
|
3049
|
+
return React.createElement(
|
|
3050
|
+
'svg',
|
|
3051
|
+
{
|
|
3052
|
+
width: size,
|
|
3053
|
+
height: size,
|
|
3054
|
+
viewBox: '0 0 24 24',
|
|
3055
|
+
fill: 'none',
|
|
3056
|
+
stroke: 'currentColor',
|
|
3057
|
+
strokeWidth: 1.8,
|
|
3058
|
+
strokeLinecap: 'round',
|
|
3059
|
+
strokeLinejoin: 'round',
|
|
3060
|
+
className: props?.className,
|
|
3061
|
+
'aria-hidden': 'true',
|
|
3062
|
+
},
|
|
3063
|
+
React.createElement('path', { d: 'M13 5l7 7-7 7' }),
|
|
3064
|
+
React.createElement('path', { d: 'M4 5l7 7-7 7' }),
|
|
3065
|
+
);
|
|
3066
|
+
}
|
|
3067
|
+
|
|
2599
3068
|
/**
|
|
2600
3069
|
* DSH-style tooltip. Replaces the browser's native title bubble with the same
|
|
2601
3070
|
* fixed-position bubble the host app uses (dark tooltip surface, 13px text,
|
|
@@ -3183,6 +3652,100 @@ function notifySettingsAreDefault(value) {
|
|
|
3183
3652
|
return JSON.stringify(normalizeNotifySettings(value)) === JSON.stringify(normalizeNotifySettings(null));
|
|
3184
3653
|
}
|
|
3185
3654
|
|
|
3655
|
+
/* --------------------------------------------------------------- auto clean */
|
|
3656
|
+
|
|
3657
|
+
const AUTO_CLEAN_ACTIONS = ['archive', 'trash'];
|
|
3658
|
+
|
|
3659
|
+
function normalizeAutoCleanSettings(value) {
|
|
3660
|
+
const raw = value && typeof value === 'object' ? value : {};
|
|
3661
|
+
const clampInt = (input, min, max, fallback) => {
|
|
3662
|
+
const number = Number(input);
|
|
3663
|
+
if (!Number.isFinite(number)) return fallback;
|
|
3664
|
+
return Math.min(max, Math.max(min, Math.round(number)));
|
|
3665
|
+
};
|
|
3666
|
+
return {
|
|
3667
|
+
enabled: raw.enabled === true,
|
|
3668
|
+
idleDays: clampInt(raw.idleDays, 0, 3650, 30),
|
|
3669
|
+
sizeMb: clampInt(raw.sizeMb, 0, 102400, 100),
|
|
3670
|
+
includeBlank: raw.includeBlank === true,
|
|
3671
|
+
action: AUTO_CLEAN_ACTIONS.includes(raw.action) ? raw.action : 'archive',
|
|
3672
|
+
excludedWorkspaces: Array.isArray(raw.excludedWorkspaces)
|
|
3673
|
+
? [
|
|
3674
|
+
...new Set(
|
|
3675
|
+
raw.excludedWorkspaces.filter(
|
|
3676
|
+
(id) => typeof id === 'string' && id.length > 0 && id.length < 200,
|
|
3677
|
+
),
|
|
3678
|
+
),
|
|
3679
|
+
]
|
|
3680
|
+
: [],
|
|
3681
|
+
};
|
|
3682
|
+
}
|
|
3683
|
+
|
|
3684
|
+
/* ------------------------------------------------- auto clean (P1-1) */
|
|
3685
|
+
|
|
3686
|
+
// 纯函数:根据规则与会话清单算出候选。运行中/已归档/置顶/当前打开/排除工作区
|
|
3687
|
+
// 一律不参与;闲置天数只用于「归档」(回收站按闲置删无法撤销,语义更重)。
|
|
3688
|
+
function buildAutoCleanCandidates(sessions, activeSessionId, draft, now = Date.now()) {
|
|
3689
|
+
const mode = draft && draft.action === 'trash' ? 'trash' : 'archive';
|
|
3690
|
+
const excluded = draft && Array.isArray(draft.excludedWorkspaces) ? draft.excludedWorkspaces : [];
|
|
3691
|
+
const idleDays = draft ? Number(draft.idleDays) || 0 : 0;
|
|
3692
|
+
const sizeMb = draft ? Number(draft.sizeMb) || 0 : 0;
|
|
3693
|
+
const includeBlank = !!(draft && draft.includeBlank);
|
|
3694
|
+
const out = [];
|
|
3695
|
+
for (const session of Array.isArray(sessions) ? sessions : []) {
|
|
3696
|
+
if (!session || !session.id) continue;
|
|
3697
|
+
if (session.running || session.archived) continue;
|
|
3698
|
+
if (session.pinned) continue;
|
|
3699
|
+
if (activeSessionId && session.id === activeSessionId) continue;
|
|
3700
|
+
if (session.workspaceId && excluded.includes(session.workspaceId)) continue;
|
|
3701
|
+
const reasons = [];
|
|
3702
|
+
const updatedAt = Number(session.updatedAt) || 0;
|
|
3703
|
+
if (
|
|
3704
|
+
mode === 'archive' &&
|
|
3705
|
+
!session.blank &&
|
|
3706
|
+
idleDays > 0 &&
|
|
3707
|
+
updatedAt > 0 &&
|
|
3708
|
+
now - updatedAt >= idleDays * 86400000
|
|
3709
|
+
) {
|
|
3710
|
+
reasons.push({ kind: 'idle', days: idleDays });
|
|
3711
|
+
}
|
|
3712
|
+
const sizeBytes = Number(session.sizeBytes) || 0;
|
|
3713
|
+
if (sizeMb > 0 && sizeBytes >= sizeMb * 1024 * 1024) {
|
|
3714
|
+
reasons.push({ kind: 'size', sizeBytes });
|
|
3715
|
+
}
|
|
3716
|
+
if (includeBlank && session.blank) reasons.push({ kind: 'blank' });
|
|
3717
|
+
if (reasons.length === 0) continue;
|
|
3718
|
+
out.push({
|
|
3719
|
+
id: session.id,
|
|
3720
|
+
title: session.title || '',
|
|
3721
|
+
sizeBytes,
|
|
3722
|
+
updatedAt,
|
|
3723
|
+
workspaceId: session.workspaceId || '',
|
|
3724
|
+
workspaceLabel: session.workspaceTitle || session.workspaceId || '',
|
|
3725
|
+
reasons,
|
|
3726
|
+
});
|
|
3727
|
+
}
|
|
3728
|
+
out.sort((a, b) => (b.sizeBytes || 0) - (a.sizeBytes || 0));
|
|
3729
|
+
return out;
|
|
3730
|
+
}
|
|
3731
|
+
|
|
3732
|
+
// Exclusion counts shown in the preview card. Kept in the same order as the
|
|
3733
|
+
// filter chain in buildAutoCleanCandidates so the numbers add up.
|
|
3734
|
+
function summarizeAutoCleanScope(sessions, activeSessionId, draft) {
|
|
3735
|
+
const excluded = new Set(draft && Array.isArray(draft.excludedWorkspaces) ? draft.excludedWorkspaces : []);
|
|
3736
|
+
const stats = { scanned: 0, running: 0, archived: 0, pinned: 0, current: 0, workspace: 0 };
|
|
3737
|
+
for (const session of Array.isArray(sessions) ? sessions : []) {
|
|
3738
|
+
if (!session || !session.id) continue;
|
|
3739
|
+
stats.scanned += 1;
|
|
3740
|
+
if (session.running) stats.running += 1;
|
|
3741
|
+
else if (session.archived) stats.archived += 1;
|
|
3742
|
+
else if (session.pinned) stats.pinned += 1;
|
|
3743
|
+
else if (activeSessionId && session.id === activeSessionId) stats.current += 1;
|
|
3744
|
+
else if (session.workspaceId && excluded.has(session.workspaceId)) stats.workspace += 1;
|
|
3745
|
+
}
|
|
3746
|
+
return stats;
|
|
3747
|
+
}
|
|
3748
|
+
|
|
3186
3749
|
/* ------------------------------------------------- notification center log */
|
|
3187
3750
|
|
|
3188
3751
|
// Local history for the notification center. Bounded and stored in the webview
|
|
@@ -3577,9 +4140,13 @@ function showDesktopNotification(title, body, tag, onClick) {
|
|
|
3577
4140
|
}
|
|
3578
4141
|
}
|
|
3579
4142
|
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
4143
|
+
const ACTION_NOTE_MAX = 3;
|
|
4144
|
+
const ACTION_NOTE_HEIGHT = 46;
|
|
4145
|
+
const ACTION_NOTE_GAP = 8;
|
|
4146
|
+
let actionNotes = [];
|
|
4147
|
+
const ACTION_NOTE_CHECK = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M8 12.4l2.7 2.7 5.5-5.6"/></svg>';
|
|
4148
|
+
const ACTION_NOTE_WARNING = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 7.4v5.4"/><path d="M12 16.4v.1"/></svg>';
|
|
4149
|
+
const ACTION_NOTE_ERROR = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M9.2 9.2l5.6 5.6"/><path d="M14.8 9.2l-5.6 5.6"/></svg>';
|
|
3583
4150
|
function actionNoteAnchor(target) {
|
|
3584
4151
|
const root = target && typeof target.closest === 'function' ? target.closest('.ss-settings') : null;
|
|
3585
4152
|
let base = root;
|
|
@@ -3609,34 +4176,76 @@ function actionNoteAnchor(target) {
|
|
|
3609
4176
|
// 垂直先下移 20px,配合 transform -20px 让入场起点正好落在页面顶边。
|
|
3610
4177
|
return { left: rect.left + rect.width / 2, top: rect.top + 20 };
|
|
3611
4178
|
}
|
|
3612
|
-
function
|
|
3613
|
-
if (typeof
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
4179
|
+
function actionNoteBottomLimit() {
|
|
4180
|
+
if (typeof window === 'undefined' || !Number.isFinite(window.innerHeight)) return Infinity;
|
|
4181
|
+
return Math.max(16, window.innerHeight - ACTION_NOTE_HEIGHT - 16);
|
|
4182
|
+
}
|
|
4183
|
+
function layoutActionNotes() {
|
|
4184
|
+
if (!actionNotes.length) return;
|
|
4185
|
+
const baseTop = Math.min(...actionNotes.map((item) => item.anchorTop));
|
|
4186
|
+
const bottomLimit = actionNoteBottomLimit();
|
|
4187
|
+
actionNotes.forEach((item, index) => {
|
|
4188
|
+
const top = Math.min(baseTop + index * (ACTION_NOTE_HEIGHT + ACTION_NOTE_GAP), bottomLimit);
|
|
4189
|
+
item.el.style.top = `${top}px`;
|
|
4190
|
+
});
|
|
4191
|
+
}
|
|
4192
|
+
function disposeActionNote(item) {
|
|
4193
|
+
if (!item) return;
|
|
4194
|
+
clearTimeout(item.timer);
|
|
4195
|
+
clearTimeout(item.fadeTimer);
|
|
4196
|
+
if (item.el && item.el.parentNode) item.el.remove();
|
|
4197
|
+
actionNotes = actionNotes.filter((entry) => entry !== item);
|
|
4198
|
+
}
|
|
4199
|
+
function hideActionNote(item) {
|
|
4200
|
+
if (!item || item.hidden) return;
|
|
4201
|
+
item.hidden = true;
|
|
4202
|
+
clearTimeout(item.timer);
|
|
4203
|
+
clearTimeout(item.fadeTimer);
|
|
4204
|
+
item.el.classList.add('is-hiding');
|
|
4205
|
+
item.fadeTimer = setTimeout(() => {
|
|
4206
|
+
disposeActionNote(item);
|
|
4207
|
+
layoutActionNotes();
|
|
4208
|
+
}, 420);
|
|
4209
|
+
}
|
|
4210
|
+
function showActionNote(target, text, tone) {
|
|
4211
|
+
if (typeof document === 'undefined' || !document.body) return;
|
|
4212
|
+
const level = tone === true ? 'error' : tone === 'warning' || tone === 'error' ? tone : 'success';
|
|
4213
|
+
const message = String(text ?? '');
|
|
4214
|
+
const duplicate = actionNotes.find((item) => !item.hidden && item.text === message && item.tone === level);
|
|
4215
|
+
if (duplicate) {
|
|
4216
|
+
clearTimeout(duplicate.timer);
|
|
4217
|
+
clearTimeout(duplicate.fadeTimer);
|
|
4218
|
+
duplicate.el.classList.remove('is-hiding');
|
|
4219
|
+
duplicate.timer = setTimeout(() => hideActionNote(duplicate), 3000);
|
|
4220
|
+
return;
|
|
3618
4221
|
}
|
|
3619
|
-
|
|
3620
|
-
clearTimeout(actionNoteFadeTimer);
|
|
3621
|
-
actionNoteEl.style.display = '';
|
|
3622
|
-
actionNoteEl.textContent = String(text ?? '');
|
|
3623
|
-
actionNoteEl.classList.toggle('is-error', error === true);
|
|
3624
|
-
actionNoteEl.classList.remove('is-hiding');
|
|
4222
|
+
while (actionNotes.length >= ACTION_NOTE_MAX) disposeActionNote(actionNotes[0]);
|
|
3625
4223
|
const position = actionNoteAnchor(target);
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
4224
|
+
const baseTop = actionNotes.length ? Math.min(position.top, ...actionNotes.map((item) => item.anchorTop)) : position.top;
|
|
4225
|
+
const bottomLimit = actionNoteBottomLimit();
|
|
4226
|
+
const top = Math.min(baseTop + actionNotes.length * (ACTION_NOTE_HEIGHT + ACTION_NOTE_GAP), bottomLimit);
|
|
4227
|
+
const el = document.createElement('div');
|
|
4228
|
+
el.className = 'ss-actionnote';
|
|
4229
|
+
const icon = document.createElement('span');
|
|
4230
|
+
icon.className = 'ss-actionnote-icon';
|
|
4231
|
+
icon.setAttribute('aria-hidden', 'true');
|
|
4232
|
+
icon.innerHTML = level === 'error' ? ACTION_NOTE_ERROR : level === 'warning' ? ACTION_NOTE_WARNING : ACTION_NOTE_CHECK;
|
|
4233
|
+
const textEl = document.createElement('span');
|
|
4234
|
+
textEl.className = 'ss-actionnote-text';
|
|
4235
|
+
textEl.textContent = message;
|
|
4236
|
+
el.appendChild(icon);
|
|
4237
|
+
el.appendChild(textEl);
|
|
4238
|
+
el.dataset.tone = level;
|
|
4239
|
+
el.setAttribute('role', level === 'error' ? 'alert' : 'status');
|
|
4240
|
+
el.style.left = `${position.left}px`;
|
|
4241
|
+
el.style.top = `${top}px`;
|
|
4242
|
+
document.body.appendChild(el);
|
|
4243
|
+
const item = { el, text: message, tone: level, anchorTop: position.top, timer: null, fadeTimer: null, hidden: false };
|
|
4244
|
+
actionNotes.push(item);
|
|
4245
|
+
layoutActionNotes();
|
|
4246
|
+
void el.offsetWidth;
|
|
4247
|
+
el.classList.add('show');
|
|
4248
|
+
item.timer = setTimeout(() => hideActionNote(item), 3000);
|
|
3640
4249
|
}
|
|
3641
4250
|
|
|
3642
4251
|
function Toast(props) {
|
|
@@ -4888,11 +5497,846 @@ function createQuickJump(bridge, t) {
|
|
|
4888
5497
|
void open();
|
|
4889
5498
|
}
|
|
4890
5499
|
|
|
4891
|
-
return { open, close, toggle };
|
|
5500
|
+
return { open, close, toggle };
|
|
5501
|
+
}
|
|
5502
|
+
|
|
5503
|
+
function notifyHelpPlatform() {
|
|
5504
|
+
try {
|
|
5505
|
+
const ua = String((typeof navigator !== 'undefined' && navigator.userAgent) || '');
|
|
5506
|
+
const electron =
|
|
5507
|
+
/electron/i.test(ua) ||
|
|
5508
|
+
(typeof process !== 'undefined' && process.versions && process.versions.electron);
|
|
5509
|
+
if (electron) return /mac/i.test(ua) ? 'mac' : 'win';
|
|
5510
|
+
} catch (error) {
|
|
5511
|
+
/* fall through to web */
|
|
5512
|
+
}
|
|
5513
|
+
return 'web';
|
|
5514
|
+
}
|
|
5515
|
+
|
|
5516
|
+
function copyPlainText(text) {
|
|
5517
|
+
try {
|
|
5518
|
+
if (typeof navigator !== 'undefined' && navigator.clipboard && typeof navigator.clipboard.writeText === 'function') {
|
|
5519
|
+
return navigator.clipboard.writeText(text).then(
|
|
5520
|
+
() => true,
|
|
5521
|
+
() => false,
|
|
5522
|
+
);
|
|
5523
|
+
}
|
|
5524
|
+
} catch (error) {
|
|
5525
|
+
/* fall through to the legacy path */
|
|
5526
|
+
}
|
|
5527
|
+
try {
|
|
5528
|
+
const area = document.createElement('textarea');
|
|
5529
|
+
area.value = text;
|
|
5530
|
+
area.setAttribute('readonly', 'readonly');
|
|
5531
|
+
area.style.position = 'fixed';
|
|
5532
|
+
area.style.opacity = '0';
|
|
5533
|
+
document.body.appendChild(area);
|
|
5534
|
+
area.select();
|
|
5535
|
+
const ok = document.execCommand('copy');
|
|
5536
|
+
document.body.removeChild(area);
|
|
5537
|
+
return Promise.resolve(ok === true);
|
|
5538
|
+
} catch (error) {
|
|
5539
|
+
return Promise.resolve(false);
|
|
5540
|
+
}
|
|
5541
|
+
}
|
|
5542
|
+
|
|
5543
|
+
/**
|
|
5544
|
+
* Anchored help popover used by the notification permission strip. It is built
|
|
5545
|
+
* with plain DOM on purpose: the plugin bundle has no react-dom, and the card
|
|
5546
|
+
* must escape the panel's overflow clipping (position: fixed on body).
|
|
5547
|
+
*/
|
|
5548
|
+
function openNotifyHelpCard(options) {
|
|
5549
|
+
const { anchor, title, steps, actions, closeLabel, onClose } = options;
|
|
5550
|
+
const root = document.createElement('div');
|
|
5551
|
+
root.className = 'ss-helpcard';
|
|
5552
|
+
root.setAttribute('role', 'dialog');
|
|
5553
|
+
root.setAttribute('aria-label', title);
|
|
5554
|
+
const heading = document.createElement('h5');
|
|
5555
|
+
heading.textContent = title;
|
|
5556
|
+
root.appendChild(heading);
|
|
5557
|
+
const list = document.createElement('div');
|
|
5558
|
+
list.className = 'ss-helpsteps';
|
|
5559
|
+
steps.forEach((step, index) => {
|
|
5560
|
+
const item = document.createElement('div');
|
|
5561
|
+
item.className = 'ss-helpstep';
|
|
5562
|
+
const num = document.createElement('span');
|
|
5563
|
+
num.className = 'ss-helpnum';
|
|
5564
|
+
num.textContent = String(index + 1);
|
|
5565
|
+
const text = document.createElement('span');
|
|
5566
|
+
text.textContent = step;
|
|
5567
|
+
item.appendChild(num);
|
|
5568
|
+
item.appendChild(text);
|
|
5569
|
+
list.appendChild(item);
|
|
5570
|
+
});
|
|
5571
|
+
root.appendChild(list);
|
|
5572
|
+
const tail = document.createElement('span');
|
|
5573
|
+
tail.className = 'ss-helptail';
|
|
5574
|
+
root.appendChild(tail);
|
|
5575
|
+
const foot = document.createElement('div');
|
|
5576
|
+
foot.className = 'ss-helpactions';
|
|
5577
|
+
actions.forEach((action) => {
|
|
5578
|
+
const button = document.createElement('button');
|
|
5579
|
+
button.type = 'button';
|
|
5580
|
+
button.className = 'ss-btn' + (action.primary ? '' : ' quiet');
|
|
5581
|
+
button.textContent = action.label;
|
|
5582
|
+
button.addEventListener('click', () => action.onClick());
|
|
5583
|
+
foot.appendChild(button);
|
|
5584
|
+
});
|
|
5585
|
+
root.appendChild(foot);
|
|
5586
|
+
const closeButton = document.createElement('button');
|
|
5587
|
+
closeButton.type = 'button';
|
|
5588
|
+
closeButton.className = 'ss-helpclose';
|
|
5589
|
+
closeButton.setAttribute('aria-label', closeLabel || title);
|
|
5590
|
+
closeButton.innerHTML = '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12"/><path d="M18 6L6 18"/></svg>';
|
|
5591
|
+
closeButton.addEventListener('click', () => close(true));
|
|
5592
|
+
root.appendChild(closeButton);
|
|
5593
|
+
document.body.appendChild(root);
|
|
5594
|
+
|
|
5595
|
+
let disposed = false;
|
|
5596
|
+
const place = () => {
|
|
5597
|
+
if (disposed || !document.body.contains(anchor) || !document.body.contains(root)) return;
|
|
5598
|
+
const gap = 8;
|
|
5599
|
+
const margin = 8;
|
|
5600
|
+
const rect = anchor.getBoundingClientRect();
|
|
5601
|
+
const width = root.offsetWidth || 300;
|
|
5602
|
+
const height = root.offsetHeight || 160;
|
|
5603
|
+
const centerX = rect.left + rect.width / 2;
|
|
5604
|
+
const left = Math.max(margin, Math.min(centerX - width / 2, window.innerWidth - width - margin));
|
|
5605
|
+
const above = rect.top - gap - height >= margin;
|
|
5606
|
+
const top = above ? rect.top - gap - height : rect.bottom + gap;
|
|
5607
|
+
root.style.left = `${Math.round(left)}px`;
|
|
5608
|
+
root.style.top = `${Math.round(top)}px`;
|
|
5609
|
+
root.classList.toggle('below', !above);
|
|
5610
|
+
const tailX = Math.max(14, Math.min(centerX - left - 5, width - 24));
|
|
5611
|
+
tail.style.left = `${Math.round(tailX)}px`;
|
|
5612
|
+
};
|
|
5613
|
+
place();
|
|
5614
|
+
|
|
5615
|
+
const onResize = () => place();
|
|
5616
|
+
const onScroll = () => place();
|
|
5617
|
+
const onPointer = (event) => {
|
|
5618
|
+
if (disposed) return;
|
|
5619
|
+
if (root.contains(event.target) || anchor.contains(event.target)) return;
|
|
5620
|
+
close(true);
|
|
5621
|
+
};
|
|
5622
|
+
const onKey = (event) => {
|
|
5623
|
+
if (event.key === 'Escape') {
|
|
5624
|
+
event.stopPropagation();
|
|
5625
|
+
close(true);
|
|
5626
|
+
}
|
|
5627
|
+
};
|
|
5628
|
+
window.addEventListener('resize', onResize);
|
|
5629
|
+
window.addEventListener('scroll', onScroll, true);
|
|
5630
|
+
document.addEventListener('pointerdown', onPointer, true);
|
|
5631
|
+
document.addEventListener('keydown', onKey, true);
|
|
5632
|
+
|
|
5633
|
+
function close(notify) {
|
|
5634
|
+
if (disposed) return;
|
|
5635
|
+
disposed = true;
|
|
5636
|
+
window.removeEventListener('resize', onResize);
|
|
5637
|
+
window.removeEventListener('scroll', onScroll, true);
|
|
5638
|
+
document.removeEventListener('pointerdown', onPointer, true);
|
|
5639
|
+
document.removeEventListener('keydown', onKey, true);
|
|
5640
|
+
root.remove();
|
|
5641
|
+
try {
|
|
5642
|
+
anchor.focus();
|
|
5643
|
+
} catch (error) {
|
|
5644
|
+
/* ignore */
|
|
5645
|
+
}
|
|
5646
|
+
if (notify === true && typeof onClose === 'function') onClose();
|
|
5647
|
+
}
|
|
5648
|
+
|
|
5649
|
+
const first = foot.querySelector('button');
|
|
5650
|
+
if (first) first.focus();
|
|
5651
|
+
return { close, reposition: place };
|
|
5652
|
+
}
|
|
5653
|
+
|
|
5654
|
+
function AutoCleanDialog(props) {
|
|
5655
|
+
const {
|
|
5656
|
+
t,
|
|
5657
|
+
draft,
|
|
5658
|
+
workspaces,
|
|
5659
|
+
candidates,
|
|
5660
|
+
selected,
|
|
5661
|
+
blankCount,
|
|
5662
|
+
busy,
|
|
5663
|
+
result,
|
|
5664
|
+
onToggle,
|
|
5665
|
+
onToggleAll,
|
|
5666
|
+
onPatch,
|
|
5667
|
+
onRun,
|
|
5668
|
+
onClose,
|
|
5669
|
+
onCleanBlank,
|
|
5670
|
+
} = props;
|
|
5671
|
+
const cancelRef = React.useRef(null);
|
|
5672
|
+
React.useEffect(() => {
|
|
5673
|
+
if (cancelRef.current && typeof cancelRef.current.focus === 'function') cancelRef.current.focus();
|
|
5674
|
+
}, []);
|
|
5675
|
+
React.useEffect(() => {
|
|
5676
|
+
const onKey = (event) => {
|
|
5677
|
+
if (event.key === 'Escape' && !busy) {
|
|
5678
|
+
event.stopPropagation();
|
|
5679
|
+
onClose();
|
|
5680
|
+
}
|
|
5681
|
+
};
|
|
5682
|
+
document.addEventListener('keydown', onKey, true);
|
|
5683
|
+
return () => document.removeEventListener('keydown', onKey, true);
|
|
5684
|
+
}, [onClose, busy]);
|
|
5685
|
+
|
|
5686
|
+
const selectedCount = candidates.filter((item) => selected.has(item.id)).length;
|
|
5687
|
+
const selectedSize = candidates.reduce(
|
|
5688
|
+
(sum, item) => (selected.has(item.id) ? sum + (Number(item.sizeBytes) || 0) : sum),
|
|
5689
|
+
0,
|
|
5690
|
+
);
|
|
5691
|
+
const allSelected = candidates.length > 0 && candidates.every((item) => selected.has(item.id));
|
|
5692
|
+
const [excludeOpen, setExcludeOpen] = React.useState(true);
|
|
5693
|
+
const excludedCount = draft.excludedWorkspaces.length;
|
|
5694
|
+
const excludedNames = workspaces
|
|
5695
|
+
.filter((workspace) => draft.excludedWorkspaces.includes(workspace.id))
|
|
5696
|
+
.map((workspace) => workspace.label);
|
|
5697
|
+
const setAllExcluded = (value) => {
|
|
5698
|
+
onPatch({ excludedWorkspaces: value ? workspaces.map((workspace) => workspace.id) : [] });
|
|
5699
|
+
};
|
|
5700
|
+
|
|
5701
|
+
const [summaryTip, setSummaryTip] = React.useState(null);
|
|
5702
|
+
const summaryTipTimerRef = React.useRef(0);
|
|
5703
|
+
const summaryRef = React.useRef(null);
|
|
5704
|
+
const clearSummaryTip = () => {
|
|
5705
|
+
if (summaryTipTimerRef.current) {
|
|
5706
|
+
clearTimeout(summaryTipTimerRef.current);
|
|
5707
|
+
summaryTipTimerRef.current = 0;
|
|
5708
|
+
}
|
|
5709
|
+
setSummaryTip(null);
|
|
5710
|
+
};
|
|
5711
|
+
const showSummaryTipSoon = () => {
|
|
5712
|
+
if (summaryTipTimerRef.current) clearTimeout(summaryTipTimerRef.current);
|
|
5713
|
+
summaryTipTimerRef.current = setTimeout(() => {
|
|
5714
|
+
const el = summaryRef.current;
|
|
5715
|
+
if (!el || typeof window === 'undefined') return;
|
|
5716
|
+
const rect = el.getBoundingClientRect();
|
|
5717
|
+
const width = Math.min(360, window.innerWidth - 24);
|
|
5718
|
+
const center = rect.left + rect.width / 2;
|
|
5719
|
+
const centered = center - width / 2;
|
|
5720
|
+
const left = Math.max(12, Math.min(centered, window.innerWidth - width - 12));
|
|
5721
|
+
const tailLeft = Math.max(14, Math.min(center - left, width - 14));
|
|
5722
|
+
const below = rect.top < 220;
|
|
5723
|
+
setSummaryTip({ left, top: below ? rect.bottom + 8 : rect.top - 8, below, width, tailLeft });
|
|
5724
|
+
}, 260);
|
|
5725
|
+
};
|
|
5726
|
+
React.useEffect(() => {
|
|
5727
|
+
if (!draft.enabled) clearSummaryTip();
|
|
5728
|
+
}, [draft.enabled]);
|
|
5729
|
+
React.useEffect(() => {
|
|
5730
|
+
if (!summaryTip) return undefined;
|
|
5731
|
+
const hide = () => clearSummaryTip();
|
|
5732
|
+
const onKey = (event) => {
|
|
5733
|
+
if (event.key === 'Escape') hide();
|
|
5734
|
+
};
|
|
5735
|
+
window.addEventListener('scroll', hide, true);
|
|
5736
|
+
window.addEventListener('resize', hide);
|
|
5737
|
+
document.addEventListener('keydown', onKey, true);
|
|
5738
|
+
return () => {
|
|
5739
|
+
window.removeEventListener('scroll', hide, true);
|
|
5740
|
+
window.removeEventListener('resize', hide);
|
|
5741
|
+
document.removeEventListener('keydown', onKey, true);
|
|
5742
|
+
};
|
|
5743
|
+
}, [summaryTip]);
|
|
5744
|
+
React.useEffect(() => () => {
|
|
5745
|
+
if (summaryTipTimerRef.current) clearTimeout(summaryTipTimerRef.current);
|
|
5746
|
+
}, []);
|
|
5747
|
+
|
|
5748
|
+
const rowLabel = (title, hint, strong) =>
|
|
5749
|
+
React.createElement(
|
|
5750
|
+
'span',
|
|
5751
|
+
{ className: 'ss-acrowlabel' + (strong ? ' ss-acrowlabel-strong' : '') },
|
|
5752
|
+
title,
|
|
5753
|
+
hint ? React.createElement('small', null, hint) : null,
|
|
5754
|
+
);
|
|
5755
|
+
const numInput = (value, onChange, max, step) => {
|
|
5756
|
+
const safeMax = Number.isFinite(max) ? max : 3650;
|
|
5757
|
+
const safeStep = Number.isFinite(step) ? step : 1;
|
|
5758
|
+
const bump = (delta) => {
|
|
5759
|
+
const next = (Number(value) || 0) + delta;
|
|
5760
|
+
onChange(Math.max(0, Math.min(safeMax, next)));
|
|
5761
|
+
};
|
|
5762
|
+
return React.createElement(
|
|
5763
|
+
'span',
|
|
5764
|
+
{ className: 'ss-acnumwrap' },
|
|
5765
|
+
React.createElement('input', {
|
|
5766
|
+
className: 'ss-acnuminput',
|
|
5767
|
+
type: 'number',
|
|
5768
|
+
min: 0,
|
|
5769
|
+
max: safeMax,
|
|
5770
|
+
step: safeStep,
|
|
5771
|
+
value: Number.isFinite(value) ? value : 0,
|
|
5772
|
+
onChange: (event) => onChange(event.target.value === '' ? 0 : Number(event.target.value)),
|
|
5773
|
+
}),
|
|
5774
|
+
React.createElement(
|
|
5775
|
+
'span',
|
|
5776
|
+
{ className: 'ss-acarrows' },
|
|
5777
|
+
React.createElement('button', {
|
|
5778
|
+
type: 'button',
|
|
5779
|
+
tabIndex: -1,
|
|
5780
|
+
className: 'ss-acarrow ss-acarrowup',
|
|
5781
|
+
'aria-label': t('autoCleanIncrease'),
|
|
5782
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
5783
|
+
onClick: () => bump(safeStep),
|
|
5784
|
+
}),
|
|
5785
|
+
React.createElement('button', {
|
|
5786
|
+
type: 'button',
|
|
5787
|
+
tabIndex: -1,
|
|
5788
|
+
className: 'ss-acarrow ss-acarrowdown',
|
|
5789
|
+
'aria-label': t('autoCleanDecrease'),
|
|
5790
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
5791
|
+
onClick: () => bump(-safeStep),
|
|
5792
|
+
}),
|
|
5793
|
+
),
|
|
5794
|
+
);
|
|
5795
|
+
};
|
|
5796
|
+
const reasonNode = (reason) => {
|
|
5797
|
+
let text = t('autoCleanReasonBlank');
|
|
5798
|
+
if (reason.kind === 'idle') text = t('autoCleanReasonIdle').replace('{n}', String(reason.days));
|
|
5799
|
+
if (reason.kind === 'size') text = t('autoCleanReasonSize').replace('{size}', fmtBytes(reason.sizeBytes));
|
|
5800
|
+
return React.createElement('span', { className: 'ss-acreason', key: reason.kind }, text);
|
|
5801
|
+
};
|
|
5802
|
+
const actionRadio = (id, label) =>
|
|
5803
|
+
React.createElement(
|
|
5804
|
+
'label',
|
|
5805
|
+
{ className: 'ss-radio', key: id },
|
|
5806
|
+
React.createElement('input', {
|
|
5807
|
+
type: 'radio',
|
|
5808
|
+
name: 'auto-clean-action',
|
|
5809
|
+
checked: draft.action === id,
|
|
5810
|
+
onChange: () => onPatch({ action: id }),
|
|
5811
|
+
}),
|
|
5812
|
+
label,
|
|
5813
|
+
);
|
|
5814
|
+
|
|
5815
|
+
const workspaceChecks = workspaces.map((workspace) =>
|
|
5816
|
+
React.createElement(
|
|
5817
|
+
'label',
|
|
5818
|
+
{ className: 'ss-acheck', key: workspace.id },
|
|
5819
|
+
React.createElement('input', {
|
|
5820
|
+
type: 'checkbox',
|
|
5821
|
+
checked: draft.excludedWorkspaces.includes(workspace.id),
|
|
5822
|
+
onChange: (event) => {
|
|
5823
|
+
const set = new Set(draft.excludedWorkspaces);
|
|
5824
|
+
if (event.target.checked) set.add(workspace.id);
|
|
5825
|
+
else set.delete(workspace.id);
|
|
5826
|
+
onPatch({ excludedWorkspaces: [...set] });
|
|
5827
|
+
},
|
|
5828
|
+
}),
|
|
5829
|
+
workspace.label,
|
|
5830
|
+
),
|
|
5831
|
+
);
|
|
5832
|
+
|
|
5833
|
+
const ruleCell = (title, hint, control) =>
|
|
5834
|
+
React.createElement(
|
|
5835
|
+
'div',
|
|
5836
|
+
{ className: 'ss-ac-rule' },
|
|
5837
|
+
React.createElement(
|
|
5838
|
+
'div',
|
|
5839
|
+
{ className: 'ss-ac-rule-row' },
|
|
5840
|
+
React.createElement(
|
|
5841
|
+
'div',
|
|
5842
|
+
{ className: 'ss-ac-ruletext' },
|
|
5843
|
+
React.createElement('div', { className: 'ss-ac-rulelbl' }, title),
|
|
5844
|
+
hint ? React.createElement('div', { className: 'ss-ac-rulehint' }, hint) : null,
|
|
5845
|
+
),
|
|
5846
|
+
React.createElement('div', { className: 'ss-ac-rulectl' }, control),
|
|
5847
|
+
),
|
|
5848
|
+
);
|
|
5849
|
+
|
|
5850
|
+
const rules = React.createElement(
|
|
5851
|
+
'section',
|
|
5852
|
+
{ className: 'ss-autocleancard ss-autocleancardrules' + (draft.enabled ? '' : ' is-off') },
|
|
5853
|
+
React.createElement(
|
|
5854
|
+
'div',
|
|
5855
|
+
{ className: 'ss-ac-master' },
|
|
5856
|
+
React.createElement('span', { className: 'ss-ac-masterlabel' }, t('autoCleanMaster')),
|
|
5857
|
+
React.createElement(Switch, {
|
|
5858
|
+
checked: draft.enabled,
|
|
5859
|
+
label: t('autoCleanMaster'),
|
|
5860
|
+
onChange: (value) => onPatch({ enabled: value }),
|
|
5861
|
+
}),
|
|
5862
|
+
),
|
|
5863
|
+
React.createElement(
|
|
5864
|
+
'div',
|
|
5865
|
+
{ className: 'ss-ac-masterhint', 'aria-live': 'polite' },
|
|
5866
|
+
draft.enabled ? t('autoCleanHintOn') : t('autoCleanHintOff'),
|
|
5867
|
+
),
|
|
5868
|
+
React.createElement('div', { className: 'ss-ac-divider', 'aria-hidden': true }),
|
|
5869
|
+
React.createElement(
|
|
5870
|
+
'div',
|
|
5871
|
+
{ className: 'ss-ac-rulegrid', inert: draft.enabled ? undefined : '' },
|
|
5872
|
+
ruleCell(
|
|
5873
|
+
t('autoCleanIdleLabel'),
|
|
5874
|
+
t('autoCleanIdleHint'),
|
|
5875
|
+
React.createElement(
|
|
5876
|
+
'span',
|
|
5877
|
+
{ className: 'ss-acnum' },
|
|
5878
|
+
numInput(draft.idleDays, (value) => onPatch({ idleDays: value }), 3650, 1),
|
|
5879
|
+
React.createElement('span', { className: 'ss-acnumunit' }, t('autoCleanDaysUnit')),
|
|
5880
|
+
),
|
|
5881
|
+
),
|
|
5882
|
+
ruleCell(
|
|
5883
|
+
t('autoCleanBlankLabel'),
|
|
5884
|
+
t('autoCleanBlankHint'),
|
|
5885
|
+
React.createElement(Switch, {
|
|
5886
|
+
checked: draft.includeBlank,
|
|
5887
|
+
label: t('autoCleanBlankLabel'),
|
|
5888
|
+
onChange: (value) => onPatch({ includeBlank: value }),
|
|
5889
|
+
}),
|
|
5890
|
+
),
|
|
5891
|
+
ruleCell(
|
|
5892
|
+
t('autoCleanSizeLabel'),
|
|
5893
|
+
t('autoCleanSizeHint'),
|
|
5894
|
+
React.createElement(
|
|
5895
|
+
'span',
|
|
5896
|
+
{ className: 'ss-acnum' },
|
|
5897
|
+
numInput(draft.sizeMb, (value) => onPatch({ sizeMb: value }), 102400, 10),
|
|
5898
|
+
React.createElement('span', { className: 'ss-acnumunit' }, t('autoCleanSizeUnit')),
|
|
5899
|
+
),
|
|
5900
|
+
),
|
|
5901
|
+
ruleCell(
|
|
5902
|
+
t('autoCleanActionLabel'),
|
|
5903
|
+
null,
|
|
5904
|
+
React.createElement(
|
|
5905
|
+
'div',
|
|
5906
|
+
{ className: 'ss-radios ss-radios-inline', role: 'radiogroup', 'aria-label': t('autoCleanActionLabel') },
|
|
5907
|
+
actionRadio('archive', t('autoCleanArchive')),
|
|
5908
|
+
actionRadio('trash', t('autoCleanTrash')),
|
|
5909
|
+
),
|
|
5910
|
+
),
|
|
5911
|
+
React.createElement(
|
|
5912
|
+
'div',
|
|
5913
|
+
{ className: 'ss-ac-rule ss-ac-rulespan' },
|
|
5914
|
+
React.createElement(
|
|
5915
|
+
'div',
|
|
5916
|
+
{ className: 'ss-ac-rule-row' },
|
|
5917
|
+
React.createElement(
|
|
5918
|
+
'div',
|
|
5919
|
+
{ className: 'ss-ac-exclheadtext' },
|
|
5920
|
+
React.createElement('div', { className: 'ss-ac-rulelbl' }, t('autoCleanExcludeLabel')),
|
|
5921
|
+
React.createElement(
|
|
5922
|
+
'div',
|
|
5923
|
+
{ className: 'ss-ac-rulehint' },
|
|
5924
|
+
t('autoCleanExcludeCount')
|
|
5925
|
+
.replace('{n}', String(excludedCount))
|
|
5926
|
+
.replace('{total}', String(workspaces.length)),
|
|
5927
|
+
),
|
|
5928
|
+
),
|
|
5929
|
+
React.createElement(
|
|
5930
|
+
'div',
|
|
5931
|
+
{ className: 'ss-ac-rule-actions' },
|
|
5932
|
+
excludeOpen
|
|
5933
|
+
? React.createElement(
|
|
5934
|
+
'button',
|
|
5935
|
+
{
|
|
5936
|
+
type: 'button',
|
|
5937
|
+
className: 'ss-ac-linkbtn',
|
|
5938
|
+
onClick: () => setAllExcluded(excludedCount < workspaces.length),
|
|
5939
|
+
},
|
|
5940
|
+
excludedCount >= workspaces.length && workspaces.length > 0
|
|
5941
|
+
? t('autoCleanClear')
|
|
5942
|
+
: t('autoCleanSelectAll'),
|
|
5943
|
+
)
|
|
5944
|
+
: null,
|
|
5945
|
+
React.createElement(
|
|
5946
|
+
'button',
|
|
5947
|
+
{ type: 'button', className: 'ss-btn tiny quiet', onClick: () => setExcludeOpen((value) => !value) },
|
|
5948
|
+
excludeOpen ? t('autoCleanCollapse') : t('autoCleanExpand'),
|
|
5949
|
+
),
|
|
5950
|
+
),
|
|
5951
|
+
),
|
|
5952
|
+
workspaces.length > 0
|
|
5953
|
+
? React.createElement(
|
|
5954
|
+
'div',
|
|
5955
|
+
{ className: 'ss-ac-exclwrap' + (excludeOpen ? ' is-open' : '') },
|
|
5956
|
+
React.createElement(
|
|
5957
|
+
'div',
|
|
5958
|
+
{ className: 'ss-ac-exclinner' },
|
|
5959
|
+
React.createElement(
|
|
5960
|
+
'div',
|
|
5961
|
+
{ className: 'ss-ac-excllist' },
|
|
5962
|
+
React.createElement('div', { className: 'ss-acchecks' }, workspaceChecks),
|
|
5963
|
+
),
|
|
5964
|
+
),
|
|
5965
|
+
)
|
|
5966
|
+
: null,
|
|
5967
|
+
),
|
|
5968
|
+
),
|
|
5969
|
+
);
|
|
5970
|
+
|
|
5971
|
+
const conditionParts = [];
|
|
5972
|
+
if (draft.idleDays > 0) conditionParts.push(t('autoCleanCondIdle').replace('{n}', String(draft.idleDays)));
|
|
5973
|
+
if (draft.sizeMb > 0) conditionParts.push(t('autoCleanCondSize').replace('{n}', String(draft.sizeMb)));
|
|
5974
|
+
if (draft.includeBlank) conditionParts.push(t('autoCleanCondBlank'));
|
|
5975
|
+
const conditionsText =
|
|
5976
|
+
conditionParts.length > 0 ? conditionParts.join(t('autoCleanListSeparator')) : t('autoCleanCondNone');
|
|
5977
|
+
const actionText = t(draft.action === 'archive' ? 'autoCleanArchive' : 'autoCleanTrash');
|
|
5978
|
+
const excludeAllText =
|
|
5979
|
+
excludedCount > 0 ? excludedNames.join(t('autoCleanListSeparator')) : t('autoCleanExcludeNone');
|
|
5980
|
+
const excludeText =
|
|
5981
|
+
excludedCount > 3
|
|
5982
|
+
? `${excludedNames.slice(0, 3).join(t('autoCleanListSeparator'))} ${t('autoCleanExcludeMore')
|
|
5983
|
+
.replace('{n}', String(excludedCount))
|
|
5984
|
+
.replace('{rest}', String(excludedCount - 3))}`
|
|
5985
|
+
: excludeAllText;
|
|
5986
|
+
const ruleSummaryText = t('autoCleanRuleSummary')
|
|
5987
|
+
.replace('{conditions}', conditionsText)
|
|
5988
|
+
.replace('{action}', actionText)
|
|
5989
|
+
.replace('{exclude}', excludeAllText);
|
|
5990
|
+
const summarySegments = t('autoCleanRuleSummary').split(/\{(?:conditions|action|exclude)\}/);
|
|
5991
|
+
const summaryLabel = (text) =>
|
|
5992
|
+
text ? React.createElement('span', { className: 'ss-ac-rslabel' }, text) : null;
|
|
5993
|
+
const summaryValue = (text) =>
|
|
5994
|
+
React.createElement('span', { className: 'ss-ac-rsval' }, text);
|
|
5995
|
+
const ruleSummary = React.createElement(
|
|
5996
|
+
'div',
|
|
5997
|
+
{
|
|
5998
|
+
className: 'ss-ac-rule-summary' + (draft.enabled ? '' : ' is-off'),
|
|
5999
|
+
ref: summaryRef,
|
|
6000
|
+
tabIndex: draft.enabled ? 0 : -1,
|
|
6001
|
+
'aria-label': ruleSummaryText,
|
|
6002
|
+
onMouseEnter: draft.enabled ? showSummaryTipSoon : undefined,
|
|
6003
|
+
onMouseLeave: draft.enabled ? clearSummaryTip : undefined,
|
|
6004
|
+
onFocus: draft.enabled ? showSummaryTipSoon : undefined,
|
|
6005
|
+
onBlur: draft.enabled ? clearSummaryTip : undefined,
|
|
6006
|
+
},
|
|
6007
|
+
summaryLabel(summarySegments[0]),
|
|
6008
|
+
summaryValue(conditionsText),
|
|
6009
|
+
summaryLabel(summarySegments[1]),
|
|
6010
|
+
summaryValue(actionText),
|
|
6011
|
+
summaryLabel(summarySegments[2]),
|
|
6012
|
+
summaryValue(excludeText),
|
|
6013
|
+
summaryLabel(summarySegments[3]),
|
|
6014
|
+
);
|
|
6015
|
+
const summaryTipRows = [
|
|
6016
|
+
{ label: t('autoCleanTipConditions'), value: conditionsText },
|
|
6017
|
+
{ label: t('autoCleanTipAction'), value: actionText },
|
|
6018
|
+
{ label: t('autoCleanTipExclude'), value: excludeAllText },
|
|
6019
|
+
];
|
|
6020
|
+
const summaryTipNode = summaryTip
|
|
6021
|
+
? React.createElement(
|
|
6022
|
+
'div',
|
|
6023
|
+
{
|
|
6024
|
+
className: 'ss-ac-summarytip' + (summaryTip.below ? ' below' : ''),
|
|
6025
|
+
role: 'tooltip',
|
|
6026
|
+
style: {
|
|
6027
|
+
left: summaryTip.left,
|
|
6028
|
+
top: summaryTip.top,
|
|
6029
|
+
width: summaryTip.width,
|
|
6030
|
+
transform: summaryTip.below ? 'none' : 'translateY(-100%)',
|
|
6031
|
+
},
|
|
6032
|
+
},
|
|
6033
|
+
summaryTipRows.map((row) =>
|
|
6034
|
+
React.createElement(
|
|
6035
|
+
'div',
|
|
6036
|
+
{ className: 'ss-ac-tiprow', key: row.label },
|
|
6037
|
+
React.createElement('span', { className: 'ss-ac-tiplane' }, row.label),
|
|
6038
|
+
React.createElement('span', { className: 'ss-ac-tipvalue' }, row.value),
|
|
6039
|
+
),
|
|
6040
|
+
),
|
|
6041
|
+
React.createElement('span', {
|
|
6042
|
+
className: 'ss-ac-summarytip-tail',
|
|
6043
|
+
style: { left: summaryTip.tailLeft },
|
|
6044
|
+
}),
|
|
6045
|
+
)
|
|
6046
|
+
: null;
|
|
6047
|
+
|
|
6048
|
+
const candidatesSize = candidates.reduce((sum, item) => sum + (Number(item.sizeBytes) || 0), 0);
|
|
6049
|
+
const scope = props.scope || { scanned: 0, running: 0, archived: 0, pinned: 0, current: 0, workspace: 0 };
|
|
6050
|
+
const excludedParts = [];
|
|
6051
|
+
if (scope.running > 0) excludedParts.push(t('autoCleanExcludeRunning').replace('{n}', String(scope.running)));
|
|
6052
|
+
if (scope.archived > 0) excludedParts.push(t('autoCleanExcludeArchived').replace('{n}', String(scope.archived)));
|
|
6053
|
+
if (scope.pinned > 0) excludedParts.push(t('autoCleanExcludePinned').replace('{n}', String(scope.pinned)));
|
|
6054
|
+
if (scope.current > 0) excludedParts.push(t('autoCleanExcludeCurrent').replace('{n}', String(scope.current)));
|
|
6055
|
+
const scannedText = t('autoCleanScanned').replace('{n}', String(Number(scope.scanned) || 0));
|
|
6056
|
+
const idleText = draft.idleDays > 0 ? `${draft.idleDays} ${t('autoCleanDaysUnit')}` : '—';
|
|
6057
|
+
const sizeText = draft.sizeMb > 0 ? `${draft.sizeMb} ${t('autoCleanSizeUnit')}` : '—';
|
|
6058
|
+
const blankText = draft.includeBlank ? t('autoCleanBlankIncluded') : t('autoCleanBlankExcluded');
|
|
6059
|
+
const emptyHint = t('autoCleanEmptyHint')
|
|
6060
|
+
.replace('{days}', idleText)
|
|
6061
|
+
.replace('{size}', sizeText)
|
|
6062
|
+
.replace('{blank}', blankText);
|
|
6063
|
+
|
|
6064
|
+
const emptyNode = React.createElement(
|
|
6065
|
+
'div',
|
|
6066
|
+
{ className: 'ss-ac-empty' },
|
|
6067
|
+
React.createElement(
|
|
6068
|
+
'span',
|
|
6069
|
+
{ className: 'ss-ac-emptyicon' },
|
|
6070
|
+
React.createElement(
|
|
6071
|
+
'svg',
|
|
6072
|
+
{
|
|
6073
|
+
width: 22,
|
|
6074
|
+
height: 22,
|
|
6075
|
+
viewBox: '0 0 24 24',
|
|
6076
|
+
fill: 'none',
|
|
6077
|
+
stroke: 'currentColor',
|
|
6078
|
+
strokeWidth: 1.7,
|
|
6079
|
+
strokeLinecap: 'round',
|
|
6080
|
+
strokeLinejoin: 'round',
|
|
6081
|
+
},
|
|
6082
|
+
React.createElement('path', { d: 'M4 13.5V18a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4.5' }),
|
|
6083
|
+
React.createElement('path', { d: 'M4 13.5 6.5 5A2 2 0 0 1 8.4 3.5h7.2A2 2 0 0 1 17.5 5L20 13.5' }),
|
|
6084
|
+
React.createElement('path', { d: 'M4 13.5h4l1.5 2.5h5L16 13.5h4' }),
|
|
6085
|
+
),
|
|
6086
|
+
),
|
|
6087
|
+
React.createElement('span', { className: 'ss-ac-emptytitle' }, t('autoCleanEmptyTitle')),
|
|
6088
|
+
React.createElement('span', { className: 'ss-ac-emptyhint' }, emptyHint),
|
|
6089
|
+
React.createElement(
|
|
6090
|
+
'div',
|
|
6091
|
+
{ className: 'ss-ac-emptyaction' },
|
|
6092
|
+
blankCount > 0 && draft.enabled
|
|
6093
|
+
? React.createElement(
|
|
6094
|
+
'button',
|
|
6095
|
+
{ type: 'button', className: 'ss-btn tiny quiet ss-ac-emptylink', onClick: onCleanBlank },
|
|
6096
|
+
`${t('autoCleanOnlyBlank')}(${blankCount})`,
|
|
6097
|
+
)
|
|
6098
|
+
: null,
|
|
6099
|
+
),
|
|
6100
|
+
);
|
|
6101
|
+
|
|
6102
|
+
const listItems = candidates.map((item) =>
|
|
6103
|
+
React.createElement(
|
|
6104
|
+
draft.enabled ? 'label' : 'div',
|
|
6105
|
+
{ className: 'ss-acitem', key: item.id },
|
|
6106
|
+
draft.enabled
|
|
6107
|
+
? React.createElement('input', {
|
|
6108
|
+
type: 'checkbox',
|
|
6109
|
+
checked: selected.has(item.id),
|
|
6110
|
+
onChange: () => onToggle(item.id),
|
|
6111
|
+
})
|
|
6112
|
+
: null,
|
|
6113
|
+
React.createElement(
|
|
6114
|
+
'span',
|
|
6115
|
+
{ className: 'ss-acitemmain' },
|
|
6116
|
+
React.createElement('span', { className: 'ss-acitemtitle' }, item.title || item.id),
|
|
6117
|
+
React.createElement(
|
|
6118
|
+
'span',
|
|
6119
|
+
{ className: 'ss-acitemmeta' },
|
|
6120
|
+
React.createElement('span', null, item.workspaceLabel || item.workspaceTitle || ''),
|
|
6121
|
+
React.createElement('span', null, fmtBytes(Number(item.sizeBytes) || 0)),
|
|
6122
|
+
React.createElement('span', null, fmtWhen(item.updatedAt)),
|
|
6123
|
+
),
|
|
6124
|
+
),
|
|
6125
|
+
React.createElement('span', { className: 'ss-acreasons' }, item.reasons.map(reasonNode)),
|
|
6126
|
+
),
|
|
6127
|
+
);
|
|
6128
|
+
|
|
6129
|
+
const preview = React.createElement(
|
|
6130
|
+
'section',
|
|
6131
|
+
{ className: 'ss-autocleancard ss-autocleancardpreview' + (draft.enabled ? '' : ' is-off') },
|
|
6132
|
+
React.createElement(
|
|
6133
|
+
'div',
|
|
6134
|
+
{ className: 'ss-ac-cardhead' },
|
|
6135
|
+
React.createElement('span', { className: 'ss-ac-cardtitle' }, t('autoCleanPreview')),
|
|
6136
|
+
React.createElement(
|
|
6137
|
+
'span',
|
|
6138
|
+
{ className: 'ss-ac-summary' },
|
|
6139
|
+
`${scannedText} · ${t('autoCleanHit').replace('{n}', String(candidates.length))} · ${fmtBytes(candidatesSize)}`,
|
|
6140
|
+
),
|
|
6141
|
+
),
|
|
6142
|
+
excludedParts.length > 0
|
|
6143
|
+
? React.createElement(
|
|
6144
|
+
'div',
|
|
6145
|
+
{ className: 'ss-ac-excluded' },
|
|
6146
|
+
t('autoCleanExcludeLine').replace('{items}', excludedParts.join(' / ')),
|
|
6147
|
+
)
|
|
6148
|
+
: null,
|
|
6149
|
+
candidates.length > 0 && draft.enabled
|
|
6150
|
+
? React.createElement(
|
|
6151
|
+
'div',
|
|
6152
|
+
{ className: 'ss-ac-toolbar' },
|
|
6153
|
+
React.createElement(
|
|
6154
|
+
'button',
|
|
6155
|
+
{ type: 'button', className: 'ss-btn quiet', onClick: onToggleAll },
|
|
6156
|
+
allSelected ? t('autoCleanClear') : t('autoCleanSelectAll'),
|
|
6157
|
+
),
|
|
6158
|
+
blankCount > 0
|
|
6159
|
+
? React.createElement(
|
|
6160
|
+
'button',
|
|
6161
|
+
{ type: 'button', className: 'ss-btn quiet', onClick: onCleanBlank },
|
|
6162
|
+
`${t('autoCleanOnlyBlank')}(${blankCount})`,
|
|
6163
|
+
)
|
|
6164
|
+
: null,
|
|
6165
|
+
)
|
|
6166
|
+
: null,
|
|
6167
|
+
candidates.length > 0
|
|
6168
|
+
? React.createElement(
|
|
6169
|
+
React.Fragment,
|
|
6170
|
+
null,
|
|
6171
|
+
React.createElement('div', { className: 'ss-aclist' }, listItems),
|
|
6172
|
+
)
|
|
6173
|
+
: emptyNode,
|
|
6174
|
+
!draft.enabled && candidates.length > 0
|
|
6175
|
+
? React.createElement('div', { className: 'ss-ac-offhint' }, t('autoCleanOffHint'))
|
|
6176
|
+
: null,
|
|
6177
|
+
);
|
|
6178
|
+
|
|
6179
|
+
const resultHasErrors = !!(result && result.errors.length > 0);
|
|
6180
|
+
const resultNode = result
|
|
6181
|
+
? React.createElement(
|
|
6182
|
+
'div',
|
|
6183
|
+
{ className: 'ss-acresult' },
|
|
6184
|
+
React.createElement(
|
|
6185
|
+
'div',
|
|
6186
|
+
{ className: 'ss-acresulthead' },
|
|
6187
|
+
React.createElement(
|
|
6188
|
+
'span',
|
|
6189
|
+
{ className: 'ss-acresulticon', 'data-tone': resultHasErrors ? 'error' : 'success' },
|
|
6190
|
+
resultHasErrors
|
|
6191
|
+
? React.createElement(AlertIcon, { size: 18 })
|
|
6192
|
+
: React.createElement(CheckCircleIcon, { size: 18 }),
|
|
6193
|
+
),
|
|
6194
|
+
React.createElement(
|
|
6195
|
+
'div',
|
|
6196
|
+
null,
|
|
6197
|
+
React.createElement('div', { className: 'ss-acresulttitle' }, t('autoCleanResultTitle')),
|
|
6198
|
+
React.createElement(
|
|
6199
|
+
'div',
|
|
6200
|
+
{ className: 'ss-acresultline' },
|
|
6201
|
+
t('autoCleanResultDone').replace('{n}', String(result.done)),
|
|
6202
|
+
),
|
|
6203
|
+
),
|
|
6204
|
+
),
|
|
6205
|
+
resultHasErrors
|
|
6206
|
+
? React.createElement(
|
|
6207
|
+
'div',
|
|
6208
|
+
{ className: 'ss-acresulterrors' },
|
|
6209
|
+
React.createElement(
|
|
6210
|
+
'div',
|
|
6211
|
+
{ className: 'ss-acresulterrline' },
|
|
6212
|
+
t('autoCleanResultFailed').replace('{n}', String(result.errors.length)),
|
|
6213
|
+
),
|
|
6214
|
+
React.createElement(
|
|
6215
|
+
'ul',
|
|
6216
|
+
null,
|
|
6217
|
+
result.errors.slice(0, 8).map((error, index) =>
|
|
6218
|
+
React.createElement(
|
|
6219
|
+
'li',
|
|
6220
|
+
{ key: index },
|
|
6221
|
+
`${error.title || error.sessionId || ''}${error.message ? ':' + error.message : ''}`,
|
|
6222
|
+
),
|
|
6223
|
+
),
|
|
6224
|
+
),
|
|
6225
|
+
result.errors.length > 8
|
|
6226
|
+
? React.createElement(
|
|
6227
|
+
'div',
|
|
6228
|
+
{ className: 'ss-acresultmore' },
|
|
6229
|
+
t('autoCleanResultMore').replace('{n}', String(result.errors.length - 8)),
|
|
6230
|
+
)
|
|
6231
|
+
: null,
|
|
6232
|
+
)
|
|
6233
|
+
: null,
|
|
6234
|
+
)
|
|
6235
|
+
: null;
|
|
6236
|
+
|
|
6237
|
+
const foot = result
|
|
6238
|
+
? React.createElement(
|
|
6239
|
+
'div',
|
|
6240
|
+
{ className: 'ss-modalfoot' },
|
|
6241
|
+
React.createElement(
|
|
6242
|
+
'button',
|
|
6243
|
+
{ type: 'button', className: 'ss-btn primary', onClick: onClose },
|
|
6244
|
+
t('autoCleanResultClose'),
|
|
6245
|
+
),
|
|
6246
|
+
)
|
|
6247
|
+
: React.createElement(
|
|
6248
|
+
'div',
|
|
6249
|
+
{ className: 'ss-modalfoot' },
|
|
6250
|
+
React.createElement(
|
|
6251
|
+
'div',
|
|
6252
|
+
{ className: 'ss-ac-footleft' },
|
|
6253
|
+
draft.enabled
|
|
6254
|
+
? React.createElement(
|
|
6255
|
+
'span',
|
|
6256
|
+
{ className: 'ss-acfootinfo' },
|
|
6257
|
+
selectedCount > 0
|
|
6258
|
+
? t('autoCleanSelected')
|
|
6259
|
+
.replace('{n}', String(selectedCount))
|
|
6260
|
+
.replace('{size}', fmtBytes(selectedSize))
|
|
6261
|
+
: '',
|
|
6262
|
+
)
|
|
6263
|
+
: React.createElement('span', { className: 'ss-acfootinfo' }, t('autoCleanOffInfo')),
|
|
6264
|
+
),
|
|
6265
|
+
draft.enabled
|
|
6266
|
+
? React.createElement(
|
|
6267
|
+
React.Fragment,
|
|
6268
|
+
null,
|
|
6269
|
+
React.createElement(
|
|
6270
|
+
'button',
|
|
6271
|
+
{ type: 'button', className: 'ss-btn', onClick: onClose, ref: cancelRef, disabled: busy },
|
|
6272
|
+
t('cancel'),
|
|
6273
|
+
),
|
|
6274
|
+
React.createElement(
|
|
6275
|
+
'button',
|
|
6276
|
+
{
|
|
6277
|
+
type: 'button',
|
|
6278
|
+
className: 'ss-btn primary',
|
|
6279
|
+
disabled: busy || selectedCount === 0,
|
|
6280
|
+
onClick: onRun,
|
|
6281
|
+
},
|
|
6282
|
+
busy ? t('autoCleanRunning') : t('autoCleanRun'),
|
|
6283
|
+
),
|
|
6284
|
+
)
|
|
6285
|
+
: React.createElement(
|
|
6286
|
+
'button',
|
|
6287
|
+
{ type: 'button', className: 'ss-btn', onClick: onClose, ref: cancelRef, disabled: busy },
|
|
6288
|
+
t('close'),
|
|
6289
|
+
),
|
|
6290
|
+
);
|
|
6291
|
+
|
|
6292
|
+
return React.createElement(
|
|
6293
|
+
'div',
|
|
6294
|
+
{
|
|
6295
|
+
className: 'ss-overlay',
|
|
6296
|
+
role: 'presentation',
|
|
6297
|
+
onMouseDown: (event) => {
|
|
6298
|
+
if (event.target === event.currentTarget && !busy) onClose();
|
|
6299
|
+
},
|
|
6300
|
+
},
|
|
6301
|
+
React.createElement(
|
|
6302
|
+
'div',
|
|
6303
|
+
{
|
|
6304
|
+
className: 'ss-modal ss-autocleanmodal' + (result ? ' is-result' : ''),
|
|
6305
|
+
role: 'dialog',
|
|
6306
|
+
'aria-modal': 'true',
|
|
6307
|
+
'aria-label': t('autoCleanTitle'),
|
|
6308
|
+
},
|
|
6309
|
+
React.createElement(
|
|
6310
|
+
'button',
|
|
6311
|
+
{
|
|
6312
|
+
type: 'button',
|
|
6313
|
+
className: 'ss-modalclose',
|
|
6314
|
+
onClick: onClose,
|
|
6315
|
+
disabled: busy,
|
|
6316
|
+
'aria-label': t('close'),
|
|
6317
|
+
},
|
|
6318
|
+
'×',
|
|
6319
|
+
),
|
|
6320
|
+
React.createElement('h3', null, t('autoCleanTitle')),
|
|
6321
|
+
summaryTipNode,
|
|
6322
|
+
React.createElement(
|
|
6323
|
+
'div',
|
|
6324
|
+
{ className: 'ss-autocleanbody' },
|
|
6325
|
+
resultNode || React.createElement(React.Fragment, null, rules, ruleSummary, preview),
|
|
6326
|
+
),
|
|
6327
|
+
foot,
|
|
6328
|
+
),
|
|
6329
|
+
);
|
|
4892
6330
|
}
|
|
4893
6331
|
|
|
4894
6332
|
function MainPanel(props) {
|
|
4895
6333
|
const { t, bridge, getSessions } = props;
|
|
6334
|
+
// 自动整理(P1-1):默认关闭,打开弹层时按当前规则只读预演,确认后再执行。
|
|
6335
|
+
const [autoCleanOpen, setAutoCleanOpen] = React.useState(false);
|
|
6336
|
+
const [autoCleanDraft, setAutoCleanDraft] = React.useState(null);
|
|
6337
|
+
const [autoCleanSelected, setAutoCleanSelected] = React.useState(() => new Set());
|
|
6338
|
+
const [autoCleanBusy, setAutoCleanBusy] = React.useState(false);
|
|
6339
|
+
const [autoCleanResult, setAutoCleanResult] = React.useState(null);
|
|
4896
6340
|
// Paint the last snapshot immediately (stale-while-revalidate) instead of an
|
|
4897
6341
|
// empty page: bootstrap decodes every session log on the host's first call.
|
|
4898
6342
|
const [boot, setBoot] = React.useState(() => readBootstrapCache());
|
|
@@ -4965,6 +6409,7 @@ function MainPanel(props) {
|
|
|
4965
6409
|
const bootJsonRef = React.useRef('');
|
|
4966
6410
|
const [hidden, setHidden] = React.useState(() => new Set());
|
|
4967
6411
|
const [inventory, setInventory] = React.useState(null);
|
|
6412
|
+
const [profileOverrides, setProfileOverrides] = React.useState([]);
|
|
4968
6413
|
const [expandedPanels, setExpandedPanels] = React.useState(() => new Set());
|
|
4969
6414
|
// Collapsing keeps the detail block mounted for one short transition so the
|
|
4970
6415
|
// grid row can animate from 1fr to 0fr before the node is removed.
|
|
@@ -4983,12 +6428,15 @@ function MainPanel(props) {
|
|
|
4983
6428
|
const [exportFormat, setExportFormat] = React.useState('md');
|
|
4984
6429
|
const toastTimer = React.useRef(null);
|
|
4985
6430
|
const [notifyPermission, setNotifyPermission] = React.useState(() => notificationPermission());
|
|
6431
|
+
const [notifyHelpOpen, setNotifyHelpOpen] = React.useState(false);
|
|
6432
|
+
const notifyHelpAnchorRef = React.useRef(null);
|
|
4986
6433
|
const [notifyBusy, setNotifyBusy] = React.useState(false);
|
|
4987
6434
|
const notifyFileRef = React.useRef(null);
|
|
4988
6435
|
const pendingSoundGroupRef = React.useRef('normal');
|
|
4989
6436
|
const notifySaveTimerRef = React.useRef(null);
|
|
4990
6437
|
const [notifyLog, setNotifyLog] = React.useState(() => readNotifyLog());
|
|
4991
6438
|
const [notifyVisible, setNotifyVisible] = React.useState(30);
|
|
6439
|
+
const [notifyCollapsed, setNotifyCollapsed] = React.useState(() => readUiPrefs().notifyCollapsed === true);
|
|
4992
6440
|
const notifyLogRef = React.useRef(null);
|
|
4993
6441
|
const notifyActionsRef = React.useRef(null);
|
|
4994
6442
|
const notifyLogLayoutRef = React.useRef({ firstId: null, scrollHeight: 0 });
|
|
@@ -5004,6 +6452,9 @@ function MainPanel(props) {
|
|
|
5004
6452
|
};
|
|
5005
6453
|
const onStorage = (event) => {
|
|
5006
6454
|
if (!event || event.key === NOTIFY_LOG_KEY) setNotifyLog(readNotifyLog());
|
|
6455
|
+
if (event && event.key === UI_PREFS_KEY) {
|
|
6456
|
+
setNotifyCollapsed(readUiPrefs().notifyCollapsed === true);
|
|
6457
|
+
}
|
|
5007
6458
|
};
|
|
5008
6459
|
window.addEventListener('dsh-keeper:notify-log', onLog);
|
|
5009
6460
|
window.addEventListener('storage', onStorage);
|
|
@@ -5014,6 +6465,76 @@ function MainPanel(props) {
|
|
|
5014
6465
|
};
|
|
5015
6466
|
}, []);
|
|
5016
6467
|
|
|
6468
|
+
// The permission is granted outside the app (OS settings / site settings), so
|
|
6469
|
+
// re-read it whenever the window regains focus or the tab becomes visible.
|
|
6470
|
+
React.useEffect(() => {
|
|
6471
|
+
const refresh = () => setNotifyPermission(notificationPermission());
|
|
6472
|
+
const onVisible = () => {
|
|
6473
|
+
if (document.visibilityState === 'visible') refresh();
|
|
6474
|
+
};
|
|
6475
|
+
window.addEventListener('focus', refresh);
|
|
6476
|
+
document.addEventListener('visibilitychange', onVisible);
|
|
6477
|
+
return () => {
|
|
6478
|
+
window.removeEventListener('focus', refresh);
|
|
6479
|
+
document.removeEventListener('visibilitychange', onVisible);
|
|
6480
|
+
};
|
|
6481
|
+
}, []);
|
|
6482
|
+
|
|
6483
|
+
React.useEffect(() => {
|
|
6484
|
+
if (notifyHelpOpen && notifyPermission !== 'denied') setNotifyHelpOpen(false);
|
|
6485
|
+
}, [notifyHelpOpen, notifyPermission]);
|
|
6486
|
+
|
|
6487
|
+
React.useEffect(() => {
|
|
6488
|
+
if (!notifyHelpOpen) return undefined;
|
|
6489
|
+
const anchor = notifyHelpAnchorRef.current;
|
|
6490
|
+
if (!anchor) {
|
|
6491
|
+
setNotifyHelpOpen(false);
|
|
6492
|
+
return undefined;
|
|
6493
|
+
}
|
|
6494
|
+
const platform = notifyHelpPlatform();
|
|
6495
|
+
const steps =
|
|
6496
|
+
platform === 'win'
|
|
6497
|
+
? [t('notifyHelpWinStep1'), t('notifyHelpWinStep2'), t('notifyHelpWinStep3')]
|
|
6498
|
+
: platform === 'mac'
|
|
6499
|
+
? [t('notifyHelpMacStep1'), t('notifyHelpMacStep2'), t('notifyHelpMacStep3')]
|
|
6500
|
+
: [t('notifyHelpWebStep1'), t('notifyHelpWebStep2'), t('notifyHelpWebStep3')];
|
|
6501
|
+
const actions = [];
|
|
6502
|
+
if (platform === 'win') {
|
|
6503
|
+
actions.push({
|
|
6504
|
+
label: t('notifyHelpCopyPath'),
|
|
6505
|
+
onClick: () => {
|
|
6506
|
+
copyPlainText('ms-settings:notifications').then((ok) => {
|
|
6507
|
+
if (ok) notifyNote(anchor, t('notifyHelpCopied'));
|
|
6508
|
+
});
|
|
6509
|
+
},
|
|
6510
|
+
});
|
|
6511
|
+
}
|
|
6512
|
+
actions.push({
|
|
6513
|
+
label: t('notifyRecheck'),
|
|
6514
|
+
primary: true,
|
|
6515
|
+
onClick: () => {
|
|
6516
|
+
const next = notificationPermission();
|
|
6517
|
+
setNotifyPermission(next);
|
|
6518
|
+
if (next === 'granted') {
|
|
6519
|
+
notifyNote(anchor, t('notifyPermissionGrantedToast'), 'success');
|
|
6520
|
+
help.close();
|
|
6521
|
+
setNotifyHelpOpen(false);
|
|
6522
|
+
} else {
|
|
6523
|
+
notifyNote(anchor, t('notifyRecheckHelp'), 'warning');
|
|
6524
|
+
}
|
|
6525
|
+
},
|
|
6526
|
+
});
|
|
6527
|
+
const help = openNotifyHelpCard({
|
|
6528
|
+
anchor,
|
|
6529
|
+
title: t('notifyHelpTitle'),
|
|
6530
|
+
steps,
|
|
6531
|
+
actions,
|
|
6532
|
+
closeLabel: t('close'),
|
|
6533
|
+
onClose: () => setNotifyHelpOpen(false),
|
|
6534
|
+
});
|
|
6535
|
+
return () => help.close();
|
|
6536
|
+
}, [notifyHelpOpen]);
|
|
6537
|
+
|
|
5017
6538
|
React.useEffect(() => {
|
|
5018
6539
|
const el = notifyLogRef.current;
|
|
5019
6540
|
const prev = notifyLogLayoutRef.current;
|
|
@@ -5034,10 +6555,11 @@ function MainPanel(props) {
|
|
|
5034
6555
|
if (!logEl || !actionsEl) return undefined;
|
|
5035
6556
|
const sync = () => {
|
|
5036
6557
|
const row = logEl.querySelector('.ss-notifylogrow');
|
|
5037
|
-
if (!row) {
|
|
6558
|
+
if (!row || notifyCollapsed || !row.getClientRects().length) {
|
|
5038
6559
|
actionsEl.style.paddingRight = '';
|
|
5039
6560
|
return;
|
|
5040
6561
|
}
|
|
6562
|
+
actionsEl.style.paddingRight = '';
|
|
5041
6563
|
const delta = actionsEl.getBoundingClientRect().right - row.getBoundingClientRect().right;
|
|
5042
6564
|
actionsEl.style.paddingRight = delta > 0 ? `${Math.round(delta)}px` : '';
|
|
5043
6565
|
};
|
|
@@ -5065,7 +6587,9 @@ function MainPanel(props) {
|
|
|
5065
6587
|
logEl.removeEventListener('scroll', sync);
|
|
5066
6588
|
window.removeEventListener('resize', sync);
|
|
5067
6589
|
};
|
|
5068
|
-
}, [notifyLog, notifyVisible, tab]);
|
|
6590
|
+
}, [notifyLog, notifyVisible, tab, notifyCollapsed]);
|
|
6591
|
+
|
|
6592
|
+
|
|
5069
6593
|
|
|
5070
6594
|
React.useEffect(
|
|
5071
6595
|
() => () => {
|
|
@@ -5446,6 +6970,14 @@ function MainPanel(props) {
|
|
|
5446
6970
|
.catch(() => {
|
|
5447
6971
|
if (alive) setInventory({ supported: false, items: [] });
|
|
5448
6972
|
});
|
|
6973
|
+
bridge
|
|
6974
|
+
.api('profileOverrides', {})
|
|
6975
|
+
.then((value) => {
|
|
6976
|
+
if (alive) setProfileOverrides(value && Array.isArray(value.overrides) ? value.overrides : []);
|
|
6977
|
+
})
|
|
6978
|
+
.catch(() => {
|
|
6979
|
+
if (alive) setProfileOverrides([]);
|
|
6980
|
+
});
|
|
5449
6981
|
return () => {
|
|
5450
6982
|
alive = false;
|
|
5451
6983
|
};
|
|
@@ -5950,6 +7482,131 @@ function MainPanel(props) {
|
|
|
5950
7482
|
});
|
|
5951
7483
|
};
|
|
5952
7484
|
|
|
7485
|
+
// ---- 自动整理 ----
|
|
7486
|
+
const autoCleanSettings = React.useMemo(
|
|
7487
|
+
() => normalizeAutoCleanSettings(settings.autoClean),
|
|
7488
|
+
[settings.autoClean],
|
|
7489
|
+
);
|
|
7490
|
+
|
|
7491
|
+
const autoCleanWorkspaces = React.useMemo(() => {
|
|
7492
|
+
const list = Array.isArray(boot?.workspaces) ? boot.workspaces : [];
|
|
7493
|
+
const seen = new Set();
|
|
7494
|
+
const out = [];
|
|
7495
|
+
const language = String((bridge && bridge.getLocaleId && bridge.getLocaleId()) || '').toLowerCase();
|
|
7496
|
+
const chinese = language.indexOf('zh') === 0;
|
|
7497
|
+
for (const workspace of list) {
|
|
7498
|
+
const id = String(workspace?.id ?? '');
|
|
7499
|
+
if (!id || seen.has(id)) continue;
|
|
7500
|
+
seen.add(id);
|
|
7501
|
+
const title = String(workspace?.title || id);
|
|
7502
|
+
const label = title === 'default-workspace' && chinese ? t('defaultWorkspace') : title;
|
|
7503
|
+
out.push({ id, label });
|
|
7504
|
+
}
|
|
7505
|
+
return out;
|
|
7506
|
+
}, [boot, t]);
|
|
7507
|
+
|
|
7508
|
+
const activeSessionId = React.useMemo(() => {
|
|
7509
|
+
const snapshot = getSessions && typeof getSessions === 'function' ? getSessions() : null;
|
|
7510
|
+
const list = snapshot && typeof snapshot.getSnapshot === 'function' ? snapshot.getSnapshot() : null;
|
|
7511
|
+
const byId = list && list.byId ? list.byId : {};
|
|
7512
|
+
const found = Object.values(byId).find((row) => row && (row.retainedBy?.mainView ?? 0) > 0);
|
|
7513
|
+
return found ? found.id : null;
|
|
7514
|
+
}, [sessions, getSessions]);
|
|
7515
|
+
|
|
7516
|
+
const autoCleanScope = React.useMemo(
|
|
7517
|
+
() => summarizeAutoCleanScope(sessions, activeSessionId, autoCleanDraft || autoCleanSettings),
|
|
7518
|
+
[sessions, activeSessionId, autoCleanDraft, autoCleanSettings],
|
|
7519
|
+
);
|
|
7520
|
+
|
|
7521
|
+
// 规则修改即时保存到 host 的 state.json(与设置页一致,跨浏览器生效)。
|
|
7522
|
+
const saveAutoClean = async (patch) => {
|
|
7523
|
+
try {
|
|
7524
|
+
const value = await bridge.api('saveSettings', { settings: { autoClean: patch } });
|
|
7525
|
+
if (value?.state?.settings) {
|
|
7526
|
+
setBoot((current) => (current ? { ...current, state: value.state } : current));
|
|
7527
|
+
}
|
|
7528
|
+
} catch (error) {
|
|
7529
|
+
showActionNote(null, error?.message || String(error), true);
|
|
7530
|
+
}
|
|
7531
|
+
};
|
|
7532
|
+
|
|
7533
|
+
const openAutoClean = () => {
|
|
7534
|
+
const normalized = normalizeAutoCleanSettings(settings.autoClean);
|
|
7535
|
+
// Excluded workspaces are a per-run choice; every open starts with none checked.
|
|
7536
|
+
const next = { ...normalized, excludedWorkspaces: [] };
|
|
7537
|
+
const candidates = buildAutoCleanCandidates(sessions, activeSessionId, next);
|
|
7538
|
+
setAutoCleanDraft(next);
|
|
7539
|
+
setAutoCleanSelected(new Set(candidates.map((item) => item.id)));
|
|
7540
|
+
setAutoCleanResult(null);
|
|
7541
|
+
setAutoCleanOpen(true);
|
|
7542
|
+
};
|
|
7543
|
+
|
|
7544
|
+
const patchAutoClean = (patch) => {
|
|
7545
|
+
setAutoCleanDraft((current) => {
|
|
7546
|
+
const base = current || normalizeAutoCleanSettings(settings.autoClean);
|
|
7547
|
+
const next = {
|
|
7548
|
+
...base,
|
|
7549
|
+
...patch,
|
|
7550
|
+
excludedWorkspaces: patch.excludedWorkspaces ? [...patch.excludedWorkspaces] : [...base.excludedWorkspaces],
|
|
7551
|
+
};
|
|
7552
|
+
const persist = { ...next, excludedWorkspaces: [] };
|
|
7553
|
+
void saveAutoClean(persist);
|
|
7554
|
+
return next;
|
|
7555
|
+
});
|
|
7556
|
+
};
|
|
7557
|
+
|
|
7558
|
+
const autoCleanPreview = autoCleanDraft
|
|
7559
|
+
? buildAutoCleanCandidates(sessions, activeSessionId, autoCleanDraft)
|
|
7560
|
+
: [];
|
|
7561
|
+
const autoCleanBadgeCount = autoCleanSettings.enabled
|
|
7562
|
+
? buildAutoCleanCandidates(sessions, activeSessionId, autoCleanSettings).length
|
|
7563
|
+
: 0;
|
|
7564
|
+
|
|
7565
|
+
const toggleAutoCleanItem = (id) => {
|
|
7566
|
+
setAutoCleanSelected((current) => {
|
|
7567
|
+
const next = new Set(current);
|
|
7568
|
+
if (next.has(id)) next.delete(id);
|
|
7569
|
+
else next.add(id);
|
|
7570
|
+
return next;
|
|
7571
|
+
});
|
|
7572
|
+
};
|
|
7573
|
+
|
|
7574
|
+
const toggleAllAutoClean = () => {
|
|
7575
|
+
const all = autoCleanPreview.length > 0 && autoCleanPreview.every((item) => autoCleanSelected.has(item.id));
|
|
7576
|
+
setAutoCleanSelected(all ? new Set() : new Set(autoCleanPreview.map((item) => item.id)));
|
|
7577
|
+
};
|
|
7578
|
+
|
|
7579
|
+
const runAutoClean = async () => {
|
|
7580
|
+
if (autoCleanBusy || autoCleanSelected.size === 0) return;
|
|
7581
|
+
if (!autoCleanDraft || !autoCleanDraft.enabled) return;
|
|
7582
|
+
const rows = autoCleanPreview.filter((item) => autoCleanSelected.has(item.id));
|
|
7583
|
+
const mode = autoCleanDraft?.action === 'trash' ? 'trash' : 'archive';
|
|
7584
|
+
if (rows.length > 100) {
|
|
7585
|
+
showActionNote(null, t('autoCleanTooMany'), true);
|
|
7586
|
+
return;
|
|
7587
|
+
}
|
|
7588
|
+
setAutoCleanBusy(true);
|
|
7589
|
+
try {
|
|
7590
|
+
const value = await bridge.api('deleteSessions', { sessionIds: rows.map((row) => row.id), mode });
|
|
7591
|
+
const doneRows = Array.isArray(value?.done) ? value.done : [];
|
|
7592
|
+
const done = doneRows.length;
|
|
7593
|
+
const errors = (Array.isArray(value?.errors) ? value.errors : []).map((error) => {
|
|
7594
|
+
const row = rows.find((item) => item.id === error.sessionId);
|
|
7595
|
+
return { ...error, title: row ? row.title : '' };
|
|
7596
|
+
});
|
|
7597
|
+
setAutoCleanResult({ done, errors });
|
|
7598
|
+
const message = done > 0
|
|
7599
|
+
? t(mode === 'trash' ? 'autoCleanDoneTrashed' : 'autoCleanDoneArchived').replace('{n}', String(done))
|
|
7600
|
+
: t('autoCleanFailed');
|
|
7601
|
+
notifyNote(null, message, errors.length > 0 ? (done > 0 ? 'warning' : 'error') : 'success');
|
|
7602
|
+
refresh();
|
|
7603
|
+
} catch (error) {
|
|
7604
|
+
showActionNote(null, error?.message || String(error), true);
|
|
7605
|
+
} finally {
|
|
7606
|
+
setAutoCleanBusy(false);
|
|
7607
|
+
}
|
|
7608
|
+
};
|
|
7609
|
+
|
|
5953
7610
|
const groupKeyOf = (group) => String(group.id || group.title || '');
|
|
5954
7611
|
// The built-in default workspace is titled "default-workspace" by the host;
|
|
5955
7612
|
// in the Chinese UI show its localized name and keep the raw title on hover.
|
|
@@ -6313,7 +7970,7 @@ function MainPanel(props) {
|
|
|
6313
7970
|
null,
|
|
6314
7971
|
React.createElement(
|
|
6315
7972
|
'div',
|
|
6316
|
-
{ className: 'ss-toolbar' },
|
|
7973
|
+
{ className: 'ss-toolbar ss-sessiontoolbar' },
|
|
6317
7974
|
React.createElement('input', {
|
|
6318
7975
|
className: 'ss-input',
|
|
6319
7976
|
type: 'search',
|
|
@@ -6375,35 +8032,64 @@ function MainPanel(props) {
|
|
|
6375
8032
|
)
|
|
6376
8033
|
: null,
|
|
6377
8034
|
),
|
|
6378
|
-
React.createElement('button', { type: 'button', className: 'ss-btn quiet', disabled: busy, onClick: refresh }, t('refresh')),
|
|
6379
8035
|
React.createElement(
|
|
6380
|
-
'
|
|
6381
|
-
{
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
8036
|
+
'div',
|
|
8037
|
+
{ className: 'ss-sessionactions' },
|
|
8038
|
+
React.createElement(
|
|
8039
|
+
'button',
|
|
8040
|
+
{
|
|
8041
|
+
type: 'button',
|
|
8042
|
+
className: 'ss-btn quiet ss-iconbtn',
|
|
8043
|
+
disabled: busy,
|
|
8044
|
+
'aria-label': t('refresh'),
|
|
8045
|
+
onClick: (event) => {
|
|
8046
|
+
refresh();
|
|
8047
|
+
notifyNote(event.currentTarget, t('refreshed'));
|
|
8048
|
+
},
|
|
6387
8049
|
},
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
8050
|
+
React.createElement(ResetIcon, { size: 15 }),
|
|
8051
|
+
),
|
|
8052
|
+
React.createElement(
|
|
8053
|
+
'button',
|
|
8054
|
+
{
|
|
8055
|
+
type: 'button',
|
|
8056
|
+
className: 'ss-btn quiet ss-icontextbtn',
|
|
8057
|
+
title: t('quickJump')
|
|
8058
|
+
+ (qjKeys.length > 0 ? ' (' + formatShortcutKeys(qjKeys) + ')' : '')
|
|
8059
|
+
+ ' · '
|
|
8060
|
+
+ t('quickJumpKeysHint'),
|
|
8061
|
+
onClick: () => {
|
|
8062
|
+
if (bridge && typeof bridge.quickJump === 'function') bridge.quickJump();
|
|
8063
|
+
},
|
|
8064
|
+
},
|
|
8065
|
+
React.createElement(JumpIcon, { size: 15 }),
|
|
8066
|
+
t('quickJump'),
|
|
8067
|
+
),
|
|
8068
|
+
React.createElement(
|
|
8069
|
+
'button',
|
|
8070
|
+
{
|
|
8071
|
+
type: 'button',
|
|
8072
|
+
className: 'ss-btn',
|
|
8073
|
+
disabled: busy,
|
|
8074
|
+
onClick: openAutoClean,
|
|
8075
|
+
},
|
|
8076
|
+
t('autoClean'),
|
|
8077
|
+
autoCleanBadgeCount > 0
|
|
8078
|
+
? React.createElement(
|
|
8079
|
+
'span',
|
|
8080
|
+
{ className: 'ss-btnbadge' },
|
|
8081
|
+
autoCleanBadgeCount > 99 ? '99+' : String(autoCleanBadgeCount),
|
|
8082
|
+
)
|
|
8083
|
+
: null,
|
|
8084
|
+
),
|
|
6402
8085
|
),
|
|
6403
8086
|
),
|
|
6404
8087
|
React.createElement(
|
|
6405
8088
|
'div',
|
|
6406
|
-
{ className: 'ss-
|
|
8089
|
+
{ className: 'ss-sessionfilters' },
|
|
8090
|
+
React.createElement(
|
|
8091
|
+
'div',
|
|
8092
|
+
{ className: 'ss-scopefilter', role: 'group', 'aria-label': t('sessionFilterLabel') },
|
|
6407
8093
|
[
|
|
6408
8094
|
['all', t('scopeAll')],
|
|
6409
8095
|
['running', t('running')],
|
|
@@ -6479,16 +8165,13 @@ function MainPanel(props) {
|
|
|
6479
8165
|
),
|
|
6480
8166
|
),
|
|
6481
8167
|
)
|
|
6482
|
-
:
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
? React.createElement('span', null, '· ' + t('blank') + ' ' + String(blankSessions.length))
|
|
6490
|
-
: null,
|
|
6491
|
-
),
|
|
8168
|
+
: (t('total')
|
|
8169
|
+
.replace('{n}', String(sessions.length))
|
|
8170
|
+
.replace('{size}', fmtBytes(totalSize))
|
|
8171
|
+
+ (blankSessions.length > 0
|
|
8172
|
+
? ' · ' + t('blank') + ' ' + String(blankSessions.length)
|
|
8173
|
+
: '')),
|
|
8174
|
+
),
|
|
6492
8175
|
),
|
|
6493
8176
|
React.createElement(
|
|
6494
8177
|
'div',
|
|
@@ -6763,10 +8446,25 @@ function MainPanel(props) {
|
|
|
6763
8446
|
return statusFilter === 'enabled' ? enabled : !enabled;
|
|
6764
8447
|
};
|
|
6765
8448
|
|
|
8449
|
+
// DSH-internal virtual nodes (for example cordis:include) have no bundle
|
|
8450
|
+
// metadata and use a loader-builtin module name prefix; the third-party
|
|
8451
|
+
// fallback must not claim them. readOnlyReason alone says nothing about
|
|
8452
|
+
// provenance, so it is not used here.
|
|
8453
|
+
const isInternalNode = (item) =>
|
|
8454
|
+
Boolean(
|
|
8455
|
+
item &&
|
|
8456
|
+
item.official !== true &&
|
|
8457
|
+
!item.availability &&
|
|
8458
|
+
!item.source &&
|
|
8459
|
+
!item.bundle &&
|
|
8460
|
+
/^(?:cordis|dsh|plugin):/i.test(String(item.moduleName || '')),
|
|
8461
|
+
);
|
|
8462
|
+
|
|
6766
8463
|
const originKeyOf = (item) => {
|
|
6767
8464
|
if (!item) return 'builtin';
|
|
6768
8465
|
if (item.readOnlyReason === 'preset-managed') return 'preset';
|
|
6769
8466
|
if (isHostBundle(item)) return 'builtin';
|
|
8467
|
+
if (isInternalNode(item)) return 'builtin';
|
|
6770
8468
|
if (item.official === true) return 'official';
|
|
6771
8469
|
if (/^@deepseek-ai\//i.test(String(item.moduleName || ''))) return 'official';
|
|
6772
8470
|
if (item.source && /^link:|^file:|^\.\.?[\\/]|^[a-z]:[\\/]/i.test(item.source)) return 'local';
|
|
@@ -6802,53 +8500,29 @@ function MainPanel(props) {
|
|
|
6802
8500
|
return source;
|
|
6803
8501
|
};
|
|
6804
8502
|
|
|
6805
|
-
const
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
// Shipped optional bundles and the official on-demand catalog.
|
|
6812
|
-
if (item.official === true) return t('panelOfficial');
|
|
6813
|
-
// Preset compositions reference DeepSeek scoped packages without bundle metadata.
|
|
6814
|
-
if (/^@deepseek-ai\//i.test(String(item.moduleName || ''))) return t('panelOfficial');
|
|
6815
|
-
if (item.source && /^link:|^file:|^\.\.?[\\/]|^[a-z]:[\\/]/i.test(item.source)) return t('panelLocal');
|
|
6816
|
-
if (Array.isArray(item.presets) && item.presets.length > 0) return t('panelPreset');
|
|
6817
|
-
return t('panelThirdParty');
|
|
8503
|
+
const ORIGIN_LABELS = {
|
|
8504
|
+
builtin: 'panelBuiltin',
|
|
8505
|
+
official: 'panelOfficial',
|
|
8506
|
+
local: 'panelLocal',
|
|
8507
|
+
preset: 'panelPreset',
|
|
8508
|
+
thirdparty: 'panelThirdParty',
|
|
6818
8509
|
};
|
|
6819
8510
|
|
|
8511
|
+
const panelOrigin = (item) => t(ORIGIN_LABELS[originKeyOf(item)] || 'panelThirdParty');
|
|
8512
|
+
|
|
6820
8513
|
// Bundles the installation itself ships (core tools, services and built-in
|
|
6821
|
-
// panels) all carry the DSH version; that
|
|
6822
|
-
// under the name while the origin/compatibility chips live on the right.
|
|
8514
|
+
// panels) all carry the DSH version; that stays as the inline meta version.
|
|
6823
8515
|
const isHostBundle = (item) => Boolean(item && item.availability === 'installation');
|
|
6824
8516
|
|
|
6825
|
-
const panelOriginTone = (item) => {
|
|
6826
|
-
if (!item || isHostBundle(item)) return 'off';
|
|
6827
|
-
if (item.readOnlyReason === 'preset-managed') return 'off';
|
|
6828
|
-
if (item.official === true) return 'scope-global';
|
|
6829
|
-
if (/^@deepseek-ai\//i.test(String(item.moduleName || ''))) return 'scope-global';
|
|
6830
|
-
if (item.source && /^link:|^file:|^\.\.?[\\/]|^[a-z]:[\\/]/i.test(item.source)) return 'off';
|
|
6831
|
-
return '';
|
|
6832
|
-
};
|
|
6833
|
-
|
|
6834
|
-
const renderPanelMeta = (item) => {
|
|
6835
|
-
if (!item || !item.version) return null;
|
|
6836
|
-
return React.createElement('span', { className: 'ss-meta' }, 'v' + item.version);
|
|
6837
|
-
};
|
|
6838
|
-
|
|
6839
|
-
// 列表与详情必须使用同一套来源判定:无 item 的宿主内置行也要显示「内置」,
|
|
6840
|
-
// 不能因为拿不到 inventory 行就把来源徽标整个省略。
|
|
6841
|
-
const panelOriginChip = (item) =>
|
|
6842
|
-
React.createElement('span', { className: 'ss-tag ' + panelOriginTone(item) }, panelOrigin(item));
|
|
6843
|
-
|
|
6844
8517
|
const compatInfo = (panelId, item) => {
|
|
6845
8518
|
const own = panelId === PANEL_ID || (item && item.bundle === 'dsh-keeper-plugin');
|
|
6846
8519
|
if (own) {
|
|
6847
8520
|
const state = compatibilityState(boot);
|
|
6848
8521
|
const tone = state.satisfied === true ? 'on' : state.satisfied === false ? 'failed' : 'warn';
|
|
6849
|
-
|
|
8522
|
+
const reason = state.satisfied === true ? '' : compatibilityReasonLabel(boot, t);
|
|
8523
|
+
return { text: compatibilityLabel(boot, t), reason, tone, range: state.range || '' };
|
|
6850
8524
|
}
|
|
6851
|
-
if (!item || isHostBundle(item)) {
|
|
8525
|
+
if (!item || isHostBundle(item) || isInternalNode(item)) {
|
|
6852
8526
|
return { text: t('compatOk'), reason: t('compatHostHint'), tone: 'on', range: '' };
|
|
6853
8527
|
}
|
|
6854
8528
|
const preset = item.readOnlyReason === 'preset-managed';
|
|
@@ -6880,12 +8554,13 @@ function MainPanel(props) {
|
|
|
6880
8554
|
};
|
|
6881
8555
|
|
|
6882
8556
|
const renderPanelInlineMeta = (panelId, item) => {
|
|
6883
|
-
const
|
|
6884
|
-
const
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
8557
|
+
const version = item && item.version ? 'v' + item.version : '';
|
|
8558
|
+
const origin = panelOrigin(item);
|
|
8559
|
+
return React.createElement(
|
|
8560
|
+
'span',
|
|
8561
|
+
{ className: 'ss-meta ss-panelinline' },
|
|
8562
|
+
version ? version + ' · ' + origin : origin,
|
|
8563
|
+
);
|
|
6889
8564
|
};
|
|
6890
8565
|
|
|
6891
8566
|
const panelStatus = (item) => {
|
|
@@ -6914,14 +8589,30 @@ function MainPanel(props) {
|
|
|
6914
8589
|
const panelPhaseNode = (item) => {
|
|
6915
8590
|
const phase = item && item.fiberPhase;
|
|
6916
8591
|
const known = ['pending', 'loading', 'active', 'failed', 'unloading'];
|
|
8592
|
+
const disabled = !!(item && item.enabled === false && !phase);
|
|
6917
8593
|
const tone = !item
|
|
6918
8594
|
? 'builtin'
|
|
6919
8595
|
: phase
|
|
6920
8596
|
? (known.includes(phase) ? phase : 'unknown')
|
|
6921
|
-
:
|
|
8597
|
+
: disabled
|
|
6922
8598
|
? 'notloaded'
|
|
6923
8599
|
: 'unknown';
|
|
6924
|
-
|
|
8600
|
+
const state = React.createElement(
|
|
8601
|
+
'span',
|
|
8602
|
+
{ key: 'state', className: `ss-phase ss-phase-${tone}` },
|
|
8603
|
+
panelPhaseText(item),
|
|
8604
|
+
);
|
|
8605
|
+
if (!disabled) return state;
|
|
8606
|
+
return React.createElement(
|
|
8607
|
+
'span',
|
|
8608
|
+
{ className: 'ss-phasewrap' },
|
|
8609
|
+
state,
|
|
8610
|
+
React.createElement(
|
|
8611
|
+
'span',
|
|
8612
|
+
{ key: 'reason', className: 'ss-phasereason' },
|
|
8613
|
+
`(${panelDisabledReasonText(item)})`,
|
|
8614
|
+
),
|
|
8615
|
+
);
|
|
6925
8616
|
};
|
|
6926
8617
|
|
|
6927
8618
|
const panelReadOnlyText = (item) => {
|
|
@@ -6929,9 +8620,41 @@ function MainPanel(props) {
|
|
|
6929
8620
|
if (!reason) return '—';
|
|
6930
8621
|
if (reason === 'management-required') return t('panelStateReadOnly');
|
|
6931
8622
|
if (reason === 'unaddressable') return t('panelStateUnaddressable');
|
|
8623
|
+
if (reason === 'preset-managed') return t('panelStatePresetManaged');
|
|
6932
8624
|
return String(reason);
|
|
6933
8625
|
};
|
|
6934
8626
|
|
|
8627
|
+
const panelPatchOverride = (item) => {
|
|
8628
|
+
if (!item || !profileOverrides.length) return null;
|
|
8629
|
+
const ids = new Set();
|
|
8630
|
+
const add = (value) => {
|
|
8631
|
+
if (typeof value === 'string' && value) ids.add(value);
|
|
8632
|
+
};
|
|
8633
|
+
add(item.entryId);
|
|
8634
|
+
add(item.key);
|
|
8635
|
+
add(item.id);
|
|
8636
|
+
let cursor = item.entryId || item.id || '';
|
|
8637
|
+
while (cursor.includes(':')) {
|
|
8638
|
+
cursor = cursor.slice(cursor.indexOf(':') + 1);
|
|
8639
|
+
add(cursor);
|
|
8640
|
+
}
|
|
8641
|
+
return profileOverrides.find((row) => row && ids.has(row.id)) || null;
|
|
8642
|
+
};
|
|
8643
|
+
|
|
8644
|
+
const panelDisabledReasonText = (item) => {
|
|
8645
|
+
if (!item) return '—';
|
|
8646
|
+
const reason = item.readOnlyReason;
|
|
8647
|
+
if (reason === 'management-required') return t('panelReasonManaged');
|
|
8648
|
+
if (reason === 'preset-managed') return t('panelReasonPreset');
|
|
8649
|
+
if (reason === 'unaddressable') return t('panelReasonUnaddressable');
|
|
8650
|
+
const override = panelPatchOverride(item);
|
|
8651
|
+
if (override) {
|
|
8652
|
+
if (override.conditional) return t('panelReasonConditional');
|
|
8653
|
+
return override.disabled ? t('panelReasonManualDisabled') : t('panelReasonDefaultDisabled');
|
|
8654
|
+
}
|
|
8655
|
+
return t('panelReasonDefaultDisabled');
|
|
8656
|
+
};
|
|
8657
|
+
|
|
6935
8658
|
const DETAIL_ANIM_MS = 280;
|
|
6936
8659
|
const clearDetailTimer = (id) => {
|
|
6937
8660
|
const timer = detailTimersRef.current.get(id);
|
|
@@ -7362,6 +9085,13 @@ function MainPanel(props) {
|
|
|
7362
9085
|
}
|
|
7363
9086
|
if (item) {
|
|
7364
9087
|
const toggleable = canTogglePlugin(item);
|
|
9088
|
+
const uninstallable = canUninstallPlugin(item);
|
|
9089
|
+
if (!uninstallable) {
|
|
9090
|
+
nodes.push(React.createElement('span', { key: 'uninstall', className: 'ss-tag off', title: uninstallReason(item) }, t('cannotUninstall')));
|
|
9091
|
+
}
|
|
9092
|
+
nodes.push(
|
|
9093
|
+
React.createElement('span', { key: 'divider', className: 'ss-rowdivider', 'aria-hidden': 'true' }),
|
|
9094
|
+
);
|
|
7365
9095
|
nodes.push(
|
|
7366
9096
|
React.createElement(
|
|
7367
9097
|
'button',
|
|
@@ -7373,20 +9103,22 @@ function MainPanel(props) {
|
|
|
7373
9103
|
title: isSelfEntry(item) ? t('selfPlugin') : item.readOnlyReason ? t('readonlyPlugin') : undefined,
|
|
7374
9104
|
onClick: () => togglePluginEnabled(item),
|
|
7375
9105
|
},
|
|
9106
|
+
React.createElement(item.enabled === true ? BanIcon : CheckCircleIcon, {
|
|
9107
|
+
size: 14,
|
|
9108
|
+
className: 'ss-btnicon ' + (item.enabled === true ? 'ss-icon-muted' : 'ss-icon-success'),
|
|
9109
|
+
}),
|
|
7376
9110
|
item.enabled === true ? t('disablePlugin') : t('enablePlugin'),
|
|
7377
9111
|
),
|
|
7378
9112
|
);
|
|
7379
|
-
if (
|
|
9113
|
+
if (uninstallable) {
|
|
7380
9114
|
nodes.push(
|
|
7381
9115
|
React.createElement(
|
|
7382
9116
|
'button',
|
|
7383
9117
|
{ key: 'uninstall', type: 'button', className: 'ss-btn tiny danger', disabled: busy, onClick: () => askUninstallPlugin(item) },
|
|
7384
|
-
React.createElement(
|
|
9118
|
+
React.createElement(TrashIcon, { size: 14, className: 'ss-btnicon' }),
|
|
7385
9119
|
t('uninstallPlugin'),
|
|
7386
9120
|
),
|
|
7387
9121
|
);
|
|
7388
|
-
} else {
|
|
7389
|
-
nodes.push(React.createElement('span', { key: 'uninstall', className: 'ss-tag off', title: uninstallReason(item) }, t('cannotUninstall')));
|
|
7390
9122
|
}
|
|
7391
9123
|
} else {
|
|
7392
9124
|
nodes.push(React.createElement('span', { key: 'uninstall', className: 'ss-tag off', title: uninstallReason(item) }, t('cannotUninstall')));
|
|
@@ -7579,7 +9311,7 @@ function MainPanel(props) {
|
|
|
7579
9311
|
React.createElement(Switch, {
|
|
7580
9312
|
checked:
|
|
7581
9313
|
typeof override.checked === 'boolean' ? override.checked : !hiddenIds.has(id),
|
|
7582
|
-
label,
|
|
9314
|
+
label: t('panelEntryToggle').replace('{name}', label),
|
|
7583
9315
|
title: override.title || t('panelEntryHint'),
|
|
7584
9316
|
disabled: busy || override.disabled === true,
|
|
7585
9317
|
onChange: () => togglePanel(id),
|
|
@@ -7905,7 +9637,7 @@ function MainPanel(props) {
|
|
|
7905
9637
|
...managementControls(item, panel.id),
|
|
7906
9638
|
React.createElement(Switch, {
|
|
7907
9639
|
checked: !hiddenIds.has(panel.id),
|
|
7908
|
-
label: panel.label || panel.id,
|
|
9640
|
+
label: t('panelEntryToggle').replace('{name}', panel.label || panel.id),
|
|
7909
9641
|
title: t('panelEntryHint'),
|
|
7910
9642
|
disabled: busy,
|
|
7911
9643
|
onChange: () => togglePanel(panel.id),
|
|
@@ -8124,23 +9856,44 @@ function MainPanel(props) {
|
|
|
8124
9856
|
}
|
|
8125
9857
|
};
|
|
8126
9858
|
|
|
8127
|
-
|
|
9859
|
+
// Status feedback on the notification page uses the shared top-center note
|
|
9860
|
+
// (same as the plugin page's 全部显示 / save actions), not the bottom toast.
|
|
9861
|
+
const notifyNote = (target, text, tone) => {
|
|
9862
|
+
if (typeof showActionNote === 'function') showActionNote(target || null, text, tone);
|
|
9863
|
+
else setToast({ text });
|
|
9864
|
+
};
|
|
9865
|
+
|
|
9866
|
+
const grantNotifications = async (event) => {
|
|
8128
9867
|
setNotifyBusy(true);
|
|
8129
9868
|
try {
|
|
8130
9869
|
const permission = await requestNotificationPermission();
|
|
8131
9870
|
setNotifyPermission(permission);
|
|
8132
|
-
if (permission === 'granted')
|
|
8133
|
-
else if (permission === 'denied')
|
|
9871
|
+
if (permission === 'granted') notifyNote(event && event.currentTarget, t('notifyPermissionGrantedToast'), 'success');
|
|
9872
|
+
else if (permission === 'denied') notifyNote(event && event.currentTarget, t('notifyPermissionDeniedToast'), 'warning');
|
|
8134
9873
|
} finally {
|
|
8135
9874
|
setNotifyBusy(false);
|
|
8136
9875
|
}
|
|
8137
9876
|
};
|
|
8138
9877
|
|
|
8139
|
-
const
|
|
9878
|
+
const recheckNotifications = (event) => {
|
|
9879
|
+
const next = notificationPermission();
|
|
9880
|
+
setNotifyPermission(next);
|
|
9881
|
+
const text = next === 'granted'
|
|
9882
|
+
? t('notifyPermissionGrantedToast')
|
|
9883
|
+
: next === 'denied' ? t('notifyRecheckDenied') : t('notifyRecheckDefault');
|
|
9884
|
+
notifyNote(event && event.currentTarget, text, next === 'granted' ? 'success' : 'warning');
|
|
9885
|
+
return next;
|
|
9886
|
+
};
|
|
9887
|
+
|
|
9888
|
+
const sendTestNotification = (event) => {
|
|
8140
9889
|
const title = t('notifyTestTitle');
|
|
8141
9890
|
const body = t('notifyTestBody');
|
|
8142
9891
|
const delivered = showDesktopNotification(title, body, 'dsh-keeper-test', () => notifyOpenSession(''));
|
|
8143
|
-
|
|
9892
|
+
notifyNote(
|
|
9893
|
+
event && event.currentTarget,
|
|
9894
|
+
delivered ? t('notifyTestSent') : t('notifyTestFailed'),
|
|
9895
|
+
delivered ? 'warning' : 'error',
|
|
9896
|
+
);
|
|
8144
9897
|
// The test button is a preview: it always pops the notification and plays the
|
|
8145
9898
|
// tone, even while every reminder channel is switched off.
|
|
8146
9899
|
void playNotificationSound(bridge, 'done', { ...notifySettings, enabled: true, system: true, sound: 'system' });
|
|
@@ -8161,7 +9914,7 @@ function MainPanel(props) {
|
|
|
8161
9914
|
const uploadNotifySound = async (group, file) => {
|
|
8162
9915
|
if (!file) return;
|
|
8163
9916
|
if (typeof file.size === 'number' && file.size > 2 * 1024 * 1024) {
|
|
8164
|
-
|
|
9917
|
+
notifyNote(null, t('notifySoundTooLarge'), true);
|
|
8165
9918
|
return;
|
|
8166
9919
|
}
|
|
8167
9920
|
setNotifyBusy(true);
|
|
@@ -8173,7 +9926,7 @@ function MainPanel(props) {
|
|
|
8173
9926
|
[group]: { name: result && result.name ? result.name : file.name },
|
|
8174
9927
|
};
|
|
8175
9928
|
await updateNotify({ sounds: nextSounds });
|
|
8176
|
-
|
|
9929
|
+
notifyNote(null, t('notifySoundSaved'));
|
|
8177
9930
|
void playNotificationSound(bridge, group === 'interrupt' ? 'error' : 'done', {
|
|
8178
9931
|
...notifySettings,
|
|
8179
9932
|
sounds: nextSounds,
|
|
@@ -8193,7 +9946,7 @@ function MainPanel(props) {
|
|
|
8193
9946
|
await bridge.api('clearNotificationSound', { kind: group });
|
|
8194
9947
|
const nextSounds = { ...notifySettings.sounds, [group]: { name: '' } };
|
|
8195
9948
|
await updateNotify({ sounds: nextSounds });
|
|
8196
|
-
|
|
9949
|
+
notifyNote(null, t('notifySoundResetDone'));
|
|
8197
9950
|
} catch (error) {
|
|
8198
9951
|
setToast({
|
|
8199
9952
|
text: (t('notifySoundSaveFailed') || 'save failed') + ': ' + (error && error.message ? error.message : String(error)),
|
|
@@ -8205,14 +9958,22 @@ function MainPanel(props) {
|
|
|
8205
9958
|
|
|
8206
9959
|
const renderNotifyTab = () => {
|
|
8207
9960
|
const permission = notifyPermission;
|
|
9961
|
+
const permissionLabel =
|
|
9962
|
+
permission === 'granted'
|
|
9963
|
+
? t('notifyStatusGranted')
|
|
9964
|
+
: permission === 'denied'
|
|
9965
|
+
? t('notifyStatusDenied')
|
|
9966
|
+
: permission === 'unsupported'
|
|
9967
|
+
? t('notifyStatusUnsupported')
|
|
9968
|
+
: t('notifyStatusDefault');
|
|
8208
9969
|
const permissionText =
|
|
8209
9970
|
permission === 'granted'
|
|
8210
|
-
? t('
|
|
9971
|
+
? t('notifyStatusGrantedText')
|
|
8211
9972
|
: permission === 'denied'
|
|
8212
|
-
? t('
|
|
9973
|
+
? t('notifyStatusDeniedText')
|
|
8213
9974
|
: permission === 'unsupported'
|
|
8214
|
-
? t('
|
|
8215
|
-
: t('
|
|
9975
|
+
? t('notifyStatusUnsupportedText')
|
|
9976
|
+
: t('notifyStatusDefaultText');
|
|
8216
9977
|
const soundOn = notifySettings.sound !== 'none';
|
|
8217
9978
|
// The 提醒事件 card is gone: task-state events are always reminded, so the
|
|
8218
9979
|
// only remaining state is whether any channel (banner / sound) is on.
|
|
@@ -8393,7 +10154,7 @@ function MainPanel(props) {
|
|
|
8393
10154
|
React.createElement('div', { className: 'ss-hint ss-notifyintro' }, t('notifySubtitle')),
|
|
8394
10155
|
React.createElement(
|
|
8395
10156
|
'div',
|
|
8396
|
-
{ className: 'ss-card ss-notifycard' },
|
|
10157
|
+
{ className: 'ss-card ss-notifycard' + (notifyCollapsed ? ' ss-notifycard-collapsed' : '') },
|
|
8397
10158
|
React.createElement(
|
|
8398
10159
|
'h4',
|
|
8399
10160
|
null,
|
|
@@ -8408,8 +10169,41 @@ function MainPanel(props) {
|
|
|
8408
10169
|
t('notifyUnreadN').split('{n}')[1],
|
|
8409
10170
|
)
|
|
8410
10171
|
: null,
|
|
10172
|
+
notifyCollapsed && notifyLog.length > 0
|
|
10173
|
+
? React.createElement(
|
|
10174
|
+
'span',
|
|
10175
|
+
{ className: 'ss-notifycollapsedcount' },
|
|
10176
|
+
t('notifyCollapsedCount').replace('{n}', String(notifyLog.length)),
|
|
10177
|
+
)
|
|
10178
|
+
: null,
|
|
10179
|
+
notifyCollapsed || notifyLog.length > 0
|
|
10180
|
+
? React.createElement(
|
|
10181
|
+
'button',
|
|
10182
|
+
{
|
|
10183
|
+
type: 'button',
|
|
10184
|
+
className: 'ss-notifytoggle',
|
|
10185
|
+
'aria-expanded': !notifyCollapsed,
|
|
10186
|
+
onClick: () => {
|
|
10187
|
+
const next = !notifyCollapsed;
|
|
10188
|
+
setNotifyCollapsed(next);
|
|
10189
|
+
writeUiPrefs({ notifyCollapsed: next });
|
|
10190
|
+
},
|
|
10191
|
+
},
|
|
10192
|
+
React.createElement(ChevronDownIcon, {
|
|
10193
|
+
size: 12,
|
|
10194
|
+
className: 'ss-notifychevron' + (notifyCollapsed ? '' : ' open'),
|
|
10195
|
+
}),
|
|
10196
|
+
React.createElement('span', null, notifyCollapsed ? t('notifyExpand') : t('notifyCollapse')),
|
|
10197
|
+
)
|
|
10198
|
+
: null,
|
|
8411
10199
|
),
|
|
8412
|
-
React.createElement(
|
|
10200
|
+
React.createElement(
|
|
10201
|
+
'div',
|
|
10202
|
+
{ className: 'ss-notifybody' },
|
|
10203
|
+
React.createElement(
|
|
10204
|
+
'div',
|
|
10205
|
+
{ className: 'ss-notifybodyinner' },
|
|
10206
|
+
React.createElement('div', { className: 'ss-hint' }, t('notifyCenterHint')),
|
|
8413
10207
|
row(
|
|
8414
10208
|
t('notifyRecordLabel'),
|
|
8415
10209
|
t('notifyRecordHint'),
|
|
@@ -8568,46 +10362,66 @@ function MainPanel(props) {
|
|
|
8568
10362
|
'span',
|
|
8569
10363
|
{ className: 'ss-notifytotal' },
|
|
8570
10364
|
t('notifyTotalN').replace('{n}', String(notifyLog.length)),
|
|
8571
|
-
notifyShown < notifyLog.length
|
|
10365
|
+
notifyShown < notifyLog.length && !notifyCollapsed
|
|
8572
10366
|
? ' · ' + t('notifyShowingRecentN').replace('{n}', String(notifyShown))
|
|
8573
10367
|
: '',
|
|
8574
10368
|
)
|
|
8575
10369
|
: null,
|
|
8576
10370
|
),
|
|
10371
|
+
),
|
|
10372
|
+
),
|
|
8577
10373
|
),
|
|
8578
10374
|
React.createElement(
|
|
8579
10375
|
'div',
|
|
8580
10376
|
{ className: 'ss-card ss-notifycard' },
|
|
8581
|
-
React.createElement('h4', null, t('
|
|
8582
|
-
React.createElement(
|
|
8583
|
-
'div',
|
|
8584
|
-
{ className: 'ss-kpis ss-permissionstate' },
|
|
8585
|
-
React.createElement('span', { className: `ss-permission ${permission}` }, permissionText),
|
|
8586
|
-
),
|
|
10377
|
+
React.createElement('h4', null, t('notifyDesktopTitle')),
|
|
8587
10378
|
React.createElement(
|
|
8588
10379
|
'div',
|
|
8589
|
-
{
|
|
8590
|
-
|
|
8591
|
-
'
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
|
|
8596
|
-
onClick: grantNotifications,
|
|
8597
|
-
},
|
|
8598
|
-
t('notifyRequestPermission'),
|
|
8599
|
-
),
|
|
10380
|
+
{
|
|
10381
|
+
className: 'ss-permstrip' + (notifySettings.enabled ? '' : ' off'),
|
|
10382
|
+
role: 'status',
|
|
10383
|
+
},
|
|
10384
|
+
React.createElement('span', { className: `ss-dot ss-permdot ${permission}` }),
|
|
10385
|
+
React.createElement('span', { className: `ss-permstate ${permission}` }, permissionLabel),
|
|
10386
|
+
React.createElement('span', { className: 'ss-permtext' }, permissionText),
|
|
8600
10387
|
React.createElement(
|
|
8601
|
-
'
|
|
8602
|
-
{
|
|
8603
|
-
|
|
10388
|
+
'div',
|
|
10389
|
+
{ className: 'ss-permactions' },
|
|
10390
|
+
React.createElement(
|
|
10391
|
+
'button',
|
|
10392
|
+
{ type: 'button', className: 'ss-btn quiet', disabled: notifyBusy, onClick: recheckNotifications },
|
|
10393
|
+
t('notifyRecheck'),
|
|
10394
|
+
),
|
|
10395
|
+
permission === 'granted'
|
|
10396
|
+
? React.createElement(
|
|
10397
|
+
'button',
|
|
10398
|
+
{ type: 'button', className: 'ss-btn quiet', onClick: (event) => sendTestNotification(event) },
|
|
10399
|
+
t('notifyTestShort'),
|
|
10400
|
+
)
|
|
10401
|
+
: null,
|
|
10402
|
+
permission === 'default'
|
|
10403
|
+
? React.createElement(
|
|
10404
|
+
'button',
|
|
10405
|
+
{ type: 'button', className: 'ss-btn', disabled: notifyBusy, onClick: (event) => grantNotifications(event) },
|
|
10406
|
+
t('notifyRequestPermission'),
|
|
10407
|
+
)
|
|
10408
|
+
: null,
|
|
10409
|
+
permission === 'denied'
|
|
10410
|
+
? React.createElement(
|
|
10411
|
+
'button',
|
|
10412
|
+
{
|
|
10413
|
+
type: 'button',
|
|
10414
|
+
className: 'ss-btn',
|
|
10415
|
+
ref: notifyHelpAnchorRef,
|
|
10416
|
+
'aria-haspopup': 'dialog',
|
|
10417
|
+
'aria-expanded': notifyHelpOpen,
|
|
10418
|
+
onClick: () => setNotifyHelpOpen((open) => !open),
|
|
10419
|
+
},
|
|
10420
|
+
t('notifyHelp'),
|
|
10421
|
+
)
|
|
10422
|
+
: null,
|
|
8604
10423
|
),
|
|
8605
10424
|
),
|
|
8606
|
-
),
|
|
8607
|
-
React.createElement(
|
|
8608
|
-
'div',
|
|
8609
|
-
{ className: 'ss-card ss-notifycard' },
|
|
8610
|
-
React.createElement('h4', null, t('notifyTitle')),
|
|
8611
10425
|
row(
|
|
8612
10426
|
iconLabel(React.createElement(BellIcon), t('notifyEnabled')),
|
|
8613
10427
|
t('notifyEnabledHint'),
|
|
@@ -8991,6 +10805,34 @@ function MainPanel(props) {
|
|
|
8991
10805
|
onSetDefault: saveExportDefault,
|
|
8992
10806
|
})
|
|
8993
10807
|
: null,
|
|
10808
|
+
autoCleanOpen && autoCleanDraft
|
|
10809
|
+
? React.createElement(AutoCleanDialog, {
|
|
10810
|
+
t,
|
|
10811
|
+
draft: autoCleanDraft,
|
|
10812
|
+
workspaces: autoCleanWorkspaces,
|
|
10813
|
+
scope: autoCleanScope,
|
|
10814
|
+
candidates: autoCleanPreview,
|
|
10815
|
+
selected: autoCleanSelected,
|
|
10816
|
+
blankCount: blankSessions.length,
|
|
10817
|
+
busy: autoCleanBusy,
|
|
10818
|
+
result: autoCleanResult,
|
|
10819
|
+
onToggle: toggleAutoCleanItem,
|
|
10820
|
+
onToggleAll: toggleAllAutoClean,
|
|
10821
|
+
onPatch: patchAutoClean,
|
|
10822
|
+
onRun: runAutoClean,
|
|
10823
|
+
onClose: () => {
|
|
10824
|
+
if (!autoCleanBusy) {
|
|
10825
|
+
setAutoCleanOpen(false);
|
|
10826
|
+
setAutoCleanResult(null);
|
|
10827
|
+
}
|
|
10828
|
+
},
|
|
10829
|
+
onCleanBlank: () => {
|
|
10830
|
+
setAutoCleanOpen(false);
|
|
10831
|
+
setAutoCleanResult(null);
|
|
10832
|
+
askCleanBlank();
|
|
10833
|
+
},
|
|
10834
|
+
})
|
|
10835
|
+
: null,
|
|
8994
10836
|
showBackTop
|
|
8995
10837
|
? React.createElement(
|
|
8996
10838
|
Tip,
|
|
@@ -9030,7 +10872,6 @@ function SettingsPage(props) {
|
|
|
9030
10872
|
const [confirm, setConfirm] = React.useState(null);
|
|
9031
10873
|
const [settingsDraft, setSettingsDraft] = React.useState(null);
|
|
9032
10874
|
const [trashDraft, setTrashDraft] = React.useState(null);
|
|
9033
|
-
const compat = compatibilityState(boot);
|
|
9034
10875
|
|
|
9035
10876
|
React.useEffect(() => {
|
|
9036
10877
|
let alive = true;
|
|
@@ -9065,7 +10906,7 @@ function SettingsPage(props) {
|
|
|
9065
10906
|
const rowPreviewPref = settings.rowPreview ?? { enabled: true, delay: 400 };
|
|
9066
10907
|
const hidden = new Set(boot?.state?.hiddenPanels ?? []);
|
|
9067
10908
|
const paths = boot?.paths ?? {};
|
|
9068
|
-
const version = boot?.version ?? '0.1.
|
|
10909
|
+
const version = boot?.version ?? '0.1.8';
|
|
9069
10910
|
const trash = Array.isArray(trashDraft) ? trashDraft : (Array.isArray(boot?.trash) ? boot.trash : []);
|
|
9070
10911
|
const trashCount = trash.length;
|
|
9071
10912
|
|
|
@@ -9340,7 +11181,6 @@ function SettingsPage(props) {
|
|
|
9340
11181
|
'div',
|
|
9341
11182
|
{ className: 'ss-settingshead' },
|
|
9342
11183
|
React.createElement('h2', { className: 'ss-title' }, t('settingsTitle')),
|
|
9343
|
-
React.createElement('div', { className: 'ss-sub' }, t('settingsSubtitle')),
|
|
9344
11184
|
),
|
|
9345
11185
|
!boot
|
|
9346
11186
|
? React.createElement('div', { className: 'ss-empty' }, t('loading'))
|
|
@@ -9573,17 +11413,6 @@ function SettingsPage(props) {
|
|
|
9573
11413
|
{ className: 'ss-card', style: { marginTop: 20 } },
|
|
9574
11414
|
React.createElement('h4', null, t('about')),
|
|
9575
11415
|
React.createElement('div', { className: 'ss-kpis', style: { marginBottom: 8 } }, t('version').replace('{v}', String(version))),
|
|
9576
|
-
React.createElement('div', { className: 'ss-kpis', style: { marginBottom: 4 } }, t('dshVersion')),
|
|
9577
|
-
React.createElement('div', { className: 'ss-mono', style: { marginBottom: 8 } }, compat.version || '—'),
|
|
9578
|
-
React.createElement('div', { className: 'ss-kpis', style: { marginBottom: 4 } }, t('compatibility')),
|
|
9579
|
-
React.createElement(
|
|
9580
|
-
'div',
|
|
9581
|
-
{
|
|
9582
|
-
className: 'ss-mono',
|
|
9583
|
-
style: compat.satisfied === false ? { color: 'var(--dsw-alias-state-error-primary)' } : undefined,
|
|
9584
|
-
},
|
|
9585
|
-
compatibilityLabel(boot, t),
|
|
9586
|
-
),
|
|
9587
11416
|
),
|
|
9588
11417
|
),
|
|
9589
11418
|
confirm
|