dsh-keeper-plugin 0.1.6 → 0.1.7
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 +134 -64
- package/client.js +1839 -275
- package/index.js +124 -2
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -83,7 +83,7 @@ const DICT = {
|
|
|
83
83
|
quickJumpOpenTab: '打开{name}',
|
|
84
84
|
quickJumpSettings: '打开 DSH 管家设置',
|
|
85
85
|
quickJumpRefresh: '刷新数据',
|
|
86
|
-
quickJumpKeysHint: '
|
|
86
|
+
quickJumpKeysHint: '可在「设置 → DSH 管家 → 快捷键」修改',
|
|
87
87
|
quickJumpChipAll: '全部',
|
|
88
88
|
quickJumpChipActions: '管家',
|
|
89
89
|
quickJumpChipSettings: '设置',
|
|
@@ -107,7 +107,7 @@ const DICT = {
|
|
|
107
107
|
shortcutEmptyText: '点击录制',
|
|
108
108
|
shortcutSaveFailed: '快捷键保存失败:{message}',
|
|
109
109
|
notifyTitle: '任务状态通知',
|
|
110
|
-
notifySubtitle: '
|
|
110
|
+
notifySubtitle: '设置任务提醒方式、静音规则,并查看通知历史。',
|
|
111
111
|
notifyEnabled: '启用通知',
|
|
112
112
|
notifyEnabledHint: '关闭后不再发送任何提醒。',
|
|
113
113
|
notifyChannels: '提醒方式',
|
|
@@ -170,11 +170,25 @@ const DICT = {
|
|
|
170
170
|
notifyUntitled: '未命名会话',
|
|
171
171
|
notifyEmpty: '暂时没有新的提醒。',
|
|
172
172
|
notifyCenter: '通知中心',
|
|
173
|
-
notifyCenterEmpty: '
|
|
173
|
+
notifyCenterEmpty: '还没有通知。任务结束、失败或等待输入时会出现在这里。',
|
|
174
174
|
notifyCenterHint: '记录只保存在本机;点击条目可打开对应会话。',
|
|
175
|
+
unreadDotAria: '有未读通知',
|
|
176
|
+
notifyRecordLabel: '记录通知历史',
|
|
177
|
+
notifyRecordHint: '关闭后不再记录新的提醒;已有记录保留,横幅与提示音不受影响。',
|
|
178
|
+
notifyRecordOffEmpty: '通知历史已关闭。',
|
|
179
|
+
notifyRetentionLabel: '保留时长',
|
|
180
|
+
notifyRetentionHint: '超过该时长的记录会自动清理,最多 500 条。',
|
|
181
|
+
notifyRetention7: '7 天',
|
|
182
|
+
notifyRetention30: '30 天',
|
|
183
|
+
notifyRetention90: '90 天',
|
|
184
|
+
notifyRetentionForever: '永久',
|
|
175
185
|
notifyMarkAllRead: '全部标为已读',
|
|
176
186
|
notifyClearHistory: '清空记录',
|
|
177
187
|
notifyUnreadN: '{n} 条未读',
|
|
188
|
+
notifyLoadedN: '已加载 {n} 条',
|
|
189
|
+
notifyLoadedAll: '已全部加载',
|
|
190
|
+
notifyTotalN: '共 {n} 条记录',
|
|
191
|
+
notifyShowingRecentN: '显示最近 {n} 条',
|
|
178
192
|
notifyMutedTag: '已静音',
|
|
179
193
|
quietTitle: '静音规则',
|
|
180
194
|
quietEnabled: '启用免打扰时段',
|
|
@@ -182,7 +196,7 @@ const DICT = {
|
|
|
182
196
|
quietStart: '开始时间',
|
|
183
197
|
quietEnd: '结束时间',
|
|
184
198
|
muteDone: '静音「任务完成」提醒',
|
|
185
|
-
muteDoneHint: '
|
|
199
|
+
muteDoneHint: '只静音「任务完成」这一类提醒;「失败/异常打断」「等待操作」不受影响,照常提醒。适合长任务跑完不想被打断、但出问题仍要知道的场景。',
|
|
186
200
|
muteWorkspaces: '按工作区静音',
|
|
187
201
|
muteWorkspacesHint: '勾选的工作区里产生的提醒只写入通知中心,不弹横幅、不响提示音;未勾选的工作区不受影响。适合把某个工作区当作后台批量处理时使用。',
|
|
188
202
|
noWorkspaces: '还没有工作区。',
|
|
@@ -224,6 +238,13 @@ const DICT = {
|
|
|
224
238
|
archiveSessionHint: '归档后从列表隐藏,可在归档筛选里找回',
|
|
225
239
|
unarchiveSessionHint: '取消归档,重新显示在会话列表',
|
|
226
240
|
trashSessionHint: '先移入回收站,彻底删除前还可恢复',
|
|
241
|
+
rowPreviewFoot: '点击标题打开会话;右侧按钮可直接{actions}。',
|
|
242
|
+
rowPreviewEnabled: '会话行悬停预览',
|
|
243
|
+
rowPreviewEnabledHint: '悬停会话行时显示摘要卡片;关闭后不再弹出。',
|
|
244
|
+
rowPreviewDelay: '预览延迟',
|
|
245
|
+
rowPreviewDelayHint: '悬停多久后显示卡片,时间越短越灵敏。',
|
|
246
|
+
rowPreviewDelayValue: '{ms} 毫秒',
|
|
247
|
+
rowPreviewUpdated: '更新于 {time}',
|
|
227
248
|
exportSessionHint: '选择格式后导出该会话',
|
|
228
249
|
emptyTrash: '清空回收站',
|
|
229
250
|
trashEmptied: '回收站已清空',
|
|
@@ -240,7 +261,7 @@ const DICT = {
|
|
|
240
261
|
messagesN: '{n} 条消息',
|
|
241
262
|
workspaceGroup: '{n} 个会话',
|
|
242
263
|
defaultWorkspace: '默认工作区',
|
|
243
|
-
total: '共 {n} 个会话 · {size}',
|
|
264
|
+
total: '共 {n} 个会话 · 占用 {size}',
|
|
244
265
|
movedToTrash: '已移入回收站 {n} 项',
|
|
245
266
|
archivedMsg: '已归档 {n} 项',
|
|
246
267
|
restoredMsg: '已恢复 {n} 项',
|
|
@@ -256,6 +277,9 @@ const DICT = {
|
|
|
256
277
|
confirmDeleteBody: '将永久删除 {n} 个会话(约 {size}),并清理其日志、缓存与索引。此操作不可撤销,删除后重启也不会恢复。',
|
|
257
278
|
confirmTrashTitle: '移入回收站?',
|
|
258
279
|
confirmTrashBody: '将把 {n} 个会话(约 {size})移入回收站,可随时恢复。',
|
|
280
|
+
confirmClearNotifyTitle: '清空通知历史?',
|
|
281
|
+
confirmClearNotifyBody: '将清除当前保存的通知历史与已读状态,此操作不可撤销。',
|
|
282
|
+
confirmClearNotifyAction: '清空',
|
|
259
283
|
deleteFailedTitle: '部分会话未删除',
|
|
260
284
|
purgeFailedTitle: '部分会话未彻底删除',
|
|
261
285
|
purgePartial: '已彻底删除 {ok} 个,{fail} 个失败',
|
|
@@ -313,6 +337,7 @@ const DICT = {
|
|
|
313
337
|
panelCopied: '已复制 id',
|
|
314
338
|
panelBuiltin: '内置',
|
|
315
339
|
panelOfficial: '官方',
|
|
340
|
+
panelPreset: '预设',
|
|
316
341
|
panelThirdParty: '第三方',
|
|
317
342
|
panelLocal: '本地插件',
|
|
318
343
|
panelStateActive: '已启用',
|
|
@@ -322,7 +347,7 @@ const DICT = {
|
|
|
322
347
|
panelStateUnaddressable: '不可寻址(由 DSH 内部管理)',
|
|
323
348
|
panelPhasePending: '等待加载',
|
|
324
349
|
panelPhaseLoading: '加载中',
|
|
325
|
-
panelPhaseActive: '
|
|
350
|
+
panelPhaseActive: '已启用',
|
|
326
351
|
panelPhaseFailed: '加载失败',
|
|
327
352
|
panelPhaseUnloading: '卸载中',
|
|
328
353
|
panelPhaseNotLoaded: '未加载',
|
|
@@ -374,6 +399,7 @@ const DICT = {
|
|
|
374
399
|
scopeConditional: '条件启用',
|
|
375
400
|
scopeDefaultPreset: '默认',
|
|
376
401
|
scopeFilterLabel: '按作用域筛选',
|
|
402
|
+
originAll: '全部来源',
|
|
377
403
|
statusEnabled: '已启用',
|
|
378
404
|
statusDisabled: '已禁用',
|
|
379
405
|
enablePlugin: '启用',
|
|
@@ -390,7 +416,9 @@ const DICT = {
|
|
|
390
416
|
actionFailed: '操作失败:{msg}',
|
|
391
417
|
presetLean: '精简侧栏',
|
|
392
418
|
presetAll: '全部显示',
|
|
393
|
-
resetPanels: '
|
|
419
|
+
resetPanels: '恢复侧栏入口显示',
|
|
420
|
+
resetPanelsHint: '仅恢复侧栏入口显示,不影响其他设置。',
|
|
421
|
+
resetPanelsAllShown: '所有侧栏入口都已显示。',
|
|
394
422
|
conflictTitle: '入口名称冲突',
|
|
395
423
|
conflictBody: '以下入口使用了相同名称,隐藏其中一个会同时隐藏同名的另一个:{names}',
|
|
396
424
|
entryHidden: '「DSH 管家」入口当前已隐藏,你仍可从设置页恢复。',
|
|
@@ -439,9 +467,22 @@ const DICT = {
|
|
|
439
467
|
resetSettingsDone: '已恢复默认设置',
|
|
440
468
|
about: '关于',
|
|
441
469
|
version: '版本 {v}',
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
470
|
+
dshVersion: '当前 DSH 版本',
|
|
471
|
+
compatibility: '兼容性',
|
|
472
|
+
compatRange: '兼容范围',
|
|
473
|
+
compatOk: '兼容',
|
|
474
|
+
compatBad: '需要 DSH {range},当前 {version}',
|
|
475
|
+
compatUnknown: '未知',
|
|
476
|
+
compatUndeclared: '未声明',
|
|
477
|
+
compatReason: '原因',
|
|
478
|
+
compatReasonOk: '已声明兼容范围 {range},当前 DSH 版本 {version} 在范围内。',
|
|
479
|
+
compatReasonMismatch: '兼容范围 {range},当前 DSH 版本 {version} 不在范围内。',
|
|
480
|
+
compatReasonNoVersion: '无法读取当前 DSH 版本,无法判断兼容性。',
|
|
481
|
+
compatReasonNoRange: '未声明兼容范围(engines.dsh),无法判断兼容性。',
|
|
482
|
+
compatReasonUnparsable: '兼容范围或版本号无法解析,无法判断兼容性。',
|
|
483
|
+
compatHostHint: '随 DSH 安装提供,视为与当前 DSH 版本兼容。',
|
|
484
|
+
compatUndeclaredHint: '该插件未声明 engines.dsh,无法判断兼容性。',
|
|
485
|
+
compatPresetHint: '由 Agent 预设提供,未声明兼容范围。',
|
|
445
486
|
settingsSaved: '设置已保存',
|
|
446
487
|
exportDefaultFormat: '默认导出格式',
|
|
447
488
|
exportDefaultFormatHint: '导出菜单打开时会预先选中这个格式。',
|
|
@@ -451,6 +492,7 @@ const DICT = {
|
|
|
451
492
|
openDataDir: '打开数据目录',
|
|
452
493
|
openDataDirHint: '在系统中打开插件数据与回收站所在目录。',
|
|
453
494
|
openDataDirFailed: '无法打开数据目录。',
|
|
495
|
+
openDataDirDone: '已在系统中打开数据目录。',
|
|
454
496
|
panelsSaved: '侧栏入口设置已保存',
|
|
455
497
|
runningHint: '会话运行中,无法删除',
|
|
456
498
|
emptyTrashDisabled: '回收站为空',
|
|
@@ -491,7 +533,7 @@ const DICT = {
|
|
|
491
533
|
quickJumpOpenTab: 'Open {name}',
|
|
492
534
|
quickJumpSettings: 'Open DSH Keeper settings',
|
|
493
535
|
quickJumpRefresh: 'Refresh data',
|
|
494
|
-
quickJumpKeysHint: 'Change it in
|
|
536
|
+
quickJumpKeysHint: 'Change it in Settings → DSH Keeper → Shortcut.',
|
|
495
537
|
quickJumpChipAll: 'All',
|
|
496
538
|
quickJumpChipActions: 'Keeper',
|
|
497
539
|
quickJumpChipSettings: 'Settings',
|
|
@@ -515,7 +557,7 @@ const DICT = {
|
|
|
515
557
|
shortcutEmptyText: 'Click to record',
|
|
516
558
|
shortcutSaveFailed: 'Failed to save shortcut: {message}',
|
|
517
559
|
notifyTitle: 'Task status notifications',
|
|
518
|
-
notifySubtitle: 'Set how task reminders arrive, tune quiet rules, and review
|
|
560
|
+
notifySubtitle: 'Set how task reminders arrive, tune quiet rules, and review notification history.',
|
|
519
561
|
notifyEnabled: 'Enable notifications',
|
|
520
562
|
notifyEnabledHint: 'Off stops all reminders.',
|
|
521
563
|
notifyChannels: 'How to notify',
|
|
@@ -581,9 +623,23 @@ const DICT = {
|
|
|
581
623
|
notifyCenter: 'Notification center',
|
|
582
624
|
notifyCenterEmpty: 'No notifications yet. Task completions, failures and pending inputs will appear here.',
|
|
583
625
|
notifyCenterHint: 'History stays on this machine; click an entry to open its session.',
|
|
626
|
+
unreadDotAria: 'Unread notifications',
|
|
627
|
+
notifyRecordLabel: 'Save notification history',
|
|
628
|
+
notifyRecordHint: 'When off, new reminders are not recorded and existing history is kept; banners and tones are unaffected.',
|
|
629
|
+
notifyRecordOffEmpty: 'Notification history is off.',
|
|
630
|
+
notifyRetentionLabel: 'Keep history',
|
|
631
|
+
notifyRetentionHint: 'Entries older than this are removed automatically; at most 500 are kept.',
|
|
632
|
+
notifyRetention7: '7 days',
|
|
633
|
+
notifyRetention30: '30 days',
|
|
634
|
+
notifyRetention90: '90 days',
|
|
635
|
+
notifyRetentionForever: 'Forever',
|
|
584
636
|
notifyMarkAllRead: 'Mark all as read',
|
|
585
637
|
notifyClearHistory: 'Clear history',
|
|
586
638
|
notifyUnreadN: '{n} unread',
|
|
639
|
+
notifyLoadedN: 'Loaded {n} more',
|
|
640
|
+
notifyLoadedAll: 'All loaded',
|
|
641
|
+
notifyTotalN: '{n} records',
|
|
642
|
+
notifyShowingRecentN: 'Showing latest {n}',
|
|
587
643
|
notifyMutedTag: 'Muted',
|
|
588
644
|
quietTitle: 'Quiet rules',
|
|
589
645
|
quietEnabled: 'Enable quiet hours',
|
|
@@ -591,7 +647,7 @@ const DICT = {
|
|
|
591
647
|
quietStart: 'Start',
|
|
592
648
|
quietEnd: 'End',
|
|
593
649
|
muteDone: 'Mute task-completion reminders',
|
|
594
|
-
muteDoneHint: 'Mutes only "task completed" reminders;
|
|
650
|
+
muteDoneHint: 'Mutes only "task completed" reminders; failures/interruptions and pending inputs still notify. Useful when you do not want to be interrupted by long runs but still need to know about problems.',
|
|
595
651
|
muteWorkspaces: 'Mute by workspace',
|
|
596
652
|
muteWorkspacesHint: 'Notifications from the selected workspaces go only to the Notification center, without banners or tones; other workspaces are unaffected. Useful when a workspace runs background batches.',
|
|
597
653
|
noWorkspaces: 'No workspaces yet.',
|
|
@@ -633,6 +689,13 @@ const DICT = {
|
|
|
633
689
|
archiveSessionHint: 'Hide from the list; restore it from the archived filter',
|
|
634
690
|
unarchiveSessionHint: 'Unarchive to show it in the session list again',
|
|
635
691
|
trashSessionHint: 'Move to trash; still restorable before purging',
|
|
692
|
+
rowPreviewFoot: 'Click the title to open; the row buttons can {actions}.',
|
|
693
|
+
rowPreviewEnabled: 'Session row hover preview',
|
|
694
|
+
rowPreviewEnabledHint: 'Show a summary card while hovering a session row. Turn off to stop it.',
|
|
695
|
+
rowPreviewDelay: 'Preview delay',
|
|
696
|
+
rowPreviewDelayHint: 'How long to hover before the card appears; shorter is more responsive.',
|
|
697
|
+
rowPreviewDelayValue: '{ms} ms',
|
|
698
|
+
rowPreviewUpdated: 'Updated {time}',
|
|
636
699
|
exportSessionHint: 'Choose a format and export this session',
|
|
637
700
|
emptyTrash: 'Empty trash',
|
|
638
701
|
trashEmptied: 'Trash emptied',
|
|
@@ -649,7 +712,7 @@ const DICT = {
|
|
|
649
712
|
messagesN: '{n} messages',
|
|
650
713
|
workspaceGroup: '{n} sessions',
|
|
651
714
|
defaultWorkspace: 'Default workspace',
|
|
652
|
-
total: '{n} sessions · {size}',
|
|
715
|
+
total: '{n} sessions · {size} used',
|
|
653
716
|
movedToTrash: 'Moved {n} to trash',
|
|
654
717
|
archivedMsg: 'Archived {n}',
|
|
655
718
|
restoredMsg: 'Restored {n}',
|
|
@@ -665,6 +728,9 @@ const DICT = {
|
|
|
665
728
|
confirmDeleteBody: 'This permanently deletes {n} sessions ({size}) and clears their transcript, caches and index. It cannot be undone and will not come back after a restart.',
|
|
666
729
|
confirmTrashTitle: 'Move to trash?',
|
|
667
730
|
confirmTrashBody: 'Move {n} sessions ({size}) to the trash? You can restore them later.',
|
|
731
|
+
confirmClearNotifyTitle: 'Clear notification history?',
|
|
732
|
+
confirmClearNotifyBody: 'This clears the notification history and read state saved on this device. It cannot be undone.',
|
|
733
|
+
confirmClearNotifyAction: 'Clear',
|
|
668
734
|
deleteFailedTitle: 'Some sessions were not deleted',
|
|
669
735
|
purgeFailedTitle: 'Some sessions were not purged',
|
|
670
736
|
purgePartial: '{ok} purged, {fail} failed',
|
|
@@ -722,6 +788,7 @@ const DICT = {
|
|
|
722
788
|
panelCopied: 'Panel id copied',
|
|
723
789
|
panelBuiltin: 'Built-in',
|
|
724
790
|
panelOfficial: 'Official',
|
|
791
|
+
panelPreset: 'Preset',
|
|
725
792
|
panelThirdParty: 'Third-party',
|
|
726
793
|
panelLocal: 'Local plugin',
|
|
727
794
|
panelStateActive: 'Enabled',
|
|
@@ -783,6 +850,7 @@ const DICT = {
|
|
|
783
850
|
scopeConditional: 'Conditional',
|
|
784
851
|
scopeDefaultPreset: 'default',
|
|
785
852
|
scopeFilterLabel: 'Filter by scope',
|
|
853
|
+
originAll: 'All origins',
|
|
786
854
|
statusEnabled: 'Enabled',
|
|
787
855
|
statusDisabled: 'Disabled',
|
|
788
856
|
enablePlugin: 'Enable',
|
|
@@ -799,7 +867,9 @@ const DICT = {
|
|
|
799
867
|
actionFailed: 'Action failed: {msg}',
|
|
800
868
|
presetLean: 'Minimal sidebar',
|
|
801
869
|
presetAll: 'Show all',
|
|
802
|
-
resetPanels: '
|
|
870
|
+
resetPanels: 'Restore sidebar entries',
|
|
871
|
+
resetPanelsHint: 'Only restores sidebar entry visibility; other settings are unchanged.',
|
|
872
|
+
resetPanelsAllShown: 'All sidebar entries are already shown.',
|
|
803
873
|
conflictTitle: 'Duplicate entry names',
|
|
804
874
|
conflictBody: 'These entries share a name, so hiding one also hides the other: {names}',
|
|
805
875
|
entryHidden: 'The DSH Keeper entry is hidden. You can restore it from Settings.',
|
|
@@ -848,9 +918,22 @@ const DICT = {
|
|
|
848
918
|
resetSettingsDone: 'Defaults restored',
|
|
849
919
|
about: 'About',
|
|
850
920
|
version: 'Version {v}',
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
921
|
+
dshVersion: 'Current DSH version',
|
|
922
|
+
compatibility: 'Compatibility',
|
|
923
|
+
compatRange: 'Compatibility range',
|
|
924
|
+
compatOk: 'Compatible',
|
|
925
|
+
compatBad: 'Requires DSH {range}; running {version}',
|
|
926
|
+
compatUnknown: 'Unknown',
|
|
927
|
+
compatUndeclared: 'Not declared',
|
|
928
|
+
compatReason: 'Reason',
|
|
929
|
+
compatReasonOk: 'Declares {range}; running DSH {version} is within range.',
|
|
930
|
+
compatReasonMismatch: 'Declares {range}; running DSH {version} is outside the range.',
|
|
931
|
+
compatReasonNoVersion: 'Cannot read the running DSH version, so compatibility cannot be determined.',
|
|
932
|
+
compatReasonNoRange: 'No engines.dsh range is declared, so compatibility cannot be determined.',
|
|
933
|
+
compatReasonUnparsable: 'The range or version could not be parsed.',
|
|
934
|
+
compatHostHint: 'Shipped with DSH; treated as compatible with the running version.',
|
|
935
|
+
compatUndeclaredHint: 'This plugin does not declare engines.dsh, so compatibility cannot be determined.',
|
|
936
|
+
compatPresetHint: 'Provided by an Agent preset; no standalone compatibility range is declared.',
|
|
854
937
|
settingsSaved: 'Settings saved',
|
|
855
938
|
exportDefaultFormat: 'Default export format',
|
|
856
939
|
exportDefaultFormatHint: 'The export dialog preselects this format.',
|
|
@@ -861,6 +944,7 @@ const DICT = {
|
|
|
861
944
|
openDataDir: 'Open data directory',
|
|
862
945
|
openDataDirHint: 'Open the folder that stores plugin data and the trash.',
|
|
863
946
|
openDataDirFailed: 'Could not open the data directory.',
|
|
947
|
+
openDataDirDone: 'Opened the data folder.',
|
|
864
948
|
panelsSaved: 'Sidebar entry settings saved',
|
|
865
949
|
runningHint: 'The session is running; it cannot be deleted',
|
|
866
950
|
emptyTrashDisabled: 'Trash is empty',
|
|
@@ -870,6 +954,11 @@ const DICT = {
|
|
|
870
954
|
|
|
871
955
|
const CSS = `
|
|
872
956
|
.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
|
+
.ss-launcherwrap{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none}
|
|
958
|
+
.ss-launcherdot{position:absolute;top:-1px;right:-1px;width:6px;height:6px;border-radius:50%;pointer-events:none}
|
|
959
|
+
.ss-launcherdot[data-state=done]{background:var(--dsw-alias-state-success-primary)}
|
|
960
|
+
.ss-launcherdot[data-state=warning]{background:var(--dsw-alias-state-warn-primary)}
|
|
961
|
+
.ss-launcherdot[data-state=error]{background:var(--dsw-alias-state-error-primary)}
|
|
873
962
|
.ss-page{max-width:1040px;margin:0 auto;padding:26px 32px 72px}
|
|
874
963
|
.ss-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}
|
|
875
964
|
.ss-headmain{display:flex;gap:12px;align-items:center;min-width:0}
|
|
@@ -894,20 +983,22 @@ const CSS = `
|
|
|
894
983
|
.ss-btn.quiet{background:var(--ss-surface);border-color:var(--dsw-alias-border-l1);color:var(--dsw-alias-label-primary)}
|
|
895
984
|
.ss-btn.quiet:hover:not(:disabled){background:var(--ss-surface-hover);border-color:var(--dsw-alias-border-l2)}
|
|
896
985
|
.ss-btn.tiny{height:24px;padding:0 9px;font-size:11px;border-radius:6px}
|
|
986
|
+
.ss-btn .ss-btnicon{vertical-align:-2.5px;margin-right:4px;flex:none}
|
|
897
987
|
.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}
|
|
898
988
|
.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)}
|
|
899
989
|
.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)}
|
|
900
990
|
.ss-tag.failed{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 13%,transparent);border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 34%,transparent)}
|
|
901
|
-
.ss-tag.
|
|
991
|
+
.ss-tag.warn{color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 12%,transparent);border-color:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 34%,transparent)}
|
|
992
|
+
.ss-tag.off{color:color-mix(in srgb, var(--dsw-alias-label-secondary) 72%, transparent)}
|
|
902
993
|
.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)}
|
|
903
|
-
.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-
|
|
994
|
+
.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)}
|
|
904
995
|
.ss-scopefilter{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin:0 0 12px}
|
|
905
996
|
.ss-filterbar{display:flex;align-items:center;gap:8px;margin:0 0 12px;padding-right:8px}
|
|
906
997
|
.ss-filterbar .ss-scopefilter{margin:0;flex:1;min-width:0}
|
|
907
998
|
.ss-expandall{flex:none}
|
|
908
999
|
.ss-filterdivider{flex:none;width:1px;height:18px;margin:0 2px;background:var(--dsw-alias-border-l2)}
|
|
909
1000
|
.ss-chip.active{background:var(--ss-surface-hover);border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);font-weight:600}
|
|
910
|
-
.ss-card.ss-plugincard{padding:0 14px;border:0}
|
|
1001
|
+
.ss-card.ss-plugincard{padding:0 14px;border:1px solid var(--dsw-alias-border-l1);border-top:0;border-radius:0 0 10px 10px;overflow:hidden}
|
|
911
1002
|
.ss-card.ss-plugincard.ss-plugincard-collapsed{padding-bottom:16px}
|
|
912
1003
|
.ss-card.ss-plugincard>.ss-sectiontitle:first-child{margin-top:10px}
|
|
913
1004
|
.ss-band{height:8px;margin:12px -14px 10px;background:var(--ss-surface);border-radius:6px}
|
|
@@ -922,9 +1013,11 @@ const CSS = `
|
|
|
922
1013
|
.ss-tabscroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable}
|
|
923
1014
|
.ss-tabscroll::-webkit-scrollbar{width:5px}
|
|
924
1015
|
.ss-tabscroll::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:8px}
|
|
1016
|
+
.ss-tabscroll::-webkit-scrollbar-thumb:hover{background:var(--dsw-alias-border-l3)}
|
|
925
1017
|
.ss-tabscroll::-webkit-scrollbar-track{background:transparent}
|
|
926
1018
|
.ss-root::-webkit-scrollbar{width:5px}
|
|
927
1019
|
.ss-root::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:8px}
|
|
1020
|
+
.ss-root::-webkit-scrollbar-thumb:hover{background:var(--dsw-alias-border-l3)}
|
|
928
1021
|
.ss-root::-webkit-scrollbar-track{background:transparent}
|
|
929
1022
|
.ss-root::-webkit-scrollbar-button,
|
|
930
1023
|
.ss-tabscroll::-webkit-scrollbar-button,
|
|
@@ -948,9 +1041,21 @@ const CSS = `
|
|
|
948
1041
|
.ss-panelslist>.ss-plugincard{box-sizing:border-box;width:100%;max-width:968px;margin-left:auto;margin-right:auto}
|
|
949
1042
|
.ss-panelslist::-webkit-scrollbar{width:5px}
|
|
950
1043
|
.ss-panelslist::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:8px}
|
|
1044
|
+
.ss-panelslist::-webkit-scrollbar-thumb:hover{background:var(--dsw-alias-border-l3)}
|
|
951
1045
|
.ss-panelslist::-webkit-scrollbar-track{background:transparent}
|
|
952
1046
|
.ss-chip{appearance:none;display:inline-flex;align-items:center;justify-content:center;height:26px;padding:0 10px;border-radius:7px;border:1px solid var(--dsw-alias-border-l1);background:var(--ss-surface);color:var(--dsw-alias-label-primary);font-size:12px;font-family:inherit;cursor:pointer;white-space:nowrap;transition:background .15s ease,border-color .15s ease}
|
|
953
1047
|
.ss-chip:hover:not(:disabled){background:var(--ss-surface-hover);border-color:var(--dsw-alias-border-l2)}
|
|
1048
|
+
.ss-filterbar .ss-chip{background:transparent;border-color:transparent;color:var(--dsw-alias-label-secondary);font-weight:400}
|
|
1049
|
+
.ss-filterbar .ss-chip:hover:not(:disabled):not(.active){background:var(--ss-surface-hover);border-color:transparent;color:var(--dsw-alias-label-primary)}
|
|
1050
|
+
.ss-filterbar .ss-chip.active{background:var(--ss-surface-hover);border-color:var(--dsw-alias-border-l1);color:var(--dsw-alias-label-primary);font-weight:500}
|
|
1051
|
+
.ss-filterbar .ss-chip.ss-expandall{background:var(--ss-surface-hover);border-color:var(--dsw-alias-border-l1);color:var(--dsw-alias-label-primary);font-weight:400}
|
|
1052
|
+
.ss-filterbar .ss-chip.ss-expandall:hover:not(:disabled){background:color-mix(in srgb, var(--dsw-alias-label-primary) 15%, var(--dsw-alias-bg-base));border-color:var(--dsw-alias-border-l2)}
|
|
1053
|
+
.ss-filterbar .ss-chip.ss-expandall:active:not(:disabled){background:color-mix(in srgb, var(--dsw-alias-label-primary) 12%, var(--dsw-alias-bg-base))}
|
|
1054
|
+
.ss-plugintoolbar{position:sticky;top:0;z-index:2;box-sizing:border-box;width:100%;max-width:968px;margin:0 auto;background:var(--dsw-alias-bg-base)}
|
|
1055
|
+
.ss-plugintoolbarcard{box-sizing:border-box;width:100%;padding:12px 14px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);border-radius:10px 10px 0 0}
|
|
1056
|
+
.ss-plugintoolbar .ss-searchrow{margin:0;padding-right:0}
|
|
1057
|
+
.ss-plugintoolbar .ss-input{background:color-mix(in srgb, var(--dsw-alias-label-primary) 4%, var(--dsw-alias-bg-base));border-color:var(--dsw-alias-border-l2);padding:7px 10px}
|
|
1058
|
+
.ss-plugintoolbar .ss-filterbar{margin:12px 0 0;padding-right:0}
|
|
954
1059
|
.ss-chip:disabled{opacity:.5;cursor:not-allowed}
|
|
955
1060
|
.ss-tabs{display:flex;gap:2px;border-bottom:1px solid var(--dsw-alias-border-l1);margin-bottom:16px}
|
|
956
1061
|
.ss-tab{appearance:none;background:none;border:none;border-bottom:2px solid transparent;color:var(--dsw-alias-label-secondary);padding:8px 12px;font-size:13px;font-family:inherit;cursor:pointer;transition:color .18s ease,border-color .18s ease}
|
|
@@ -958,7 +1063,7 @@ const CSS = `
|
|
|
958
1063
|
.ss-tab.active{color:var(--dsw-alias-label-primary);border-bottom-color:var(--dsw-alias-brand-primary)}
|
|
959
1064
|
.ss-toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:12px}
|
|
960
1065
|
.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}
|
|
961
|
-
.ss-input:focus,.ss-input:focus-visible{border-color:color-mix(in srgb,var(--dsw-alias-
|
|
1066
|
+
.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}
|
|
962
1067
|
.ss-searchrow{display:flex;align-items:center;gap:8px;margin:12px 0 10px;padding-right:8px}
|
|
963
1068
|
.ss-searchrow .ss-input{flex:1;min-width:0}
|
|
964
1069
|
.ss-backtop{position:fixed;right:28px;bottom:28px;z-index:6;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-elevation-prominent,0 6px 18px rgba(0,0,0,.28));cursor:pointer;transition:background .15s ease,transform .1s ease}
|
|
@@ -1066,6 +1171,9 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1066
1171
|
.ss-modalclose:hover{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary)}
|
|
1067
1172
|
.ss-modalclose:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
|
|
1068
1173
|
.ss-modal h3{margin:0 0 8px;font-size:15px;color:var(--dsw-alias-label-primary)}
|
|
1174
|
+
.ss-modal h3.ss-modaltitle-withicon{display:flex;align-items:center;gap:8px}
|
|
1175
|
+
.ss-modalicon-badge{flex:0 0 auto;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;background:color-mix(in srgb,var(--dsw-alias-label-primary) 8%,transparent);color:inherit}
|
|
1176
|
+
.ss-modalicon-badge.danger{background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 14%,transparent);color:var(--dsw-alias-state-error-primary)}
|
|
1069
1177
|
.ss-modal p{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.65;margin:0 0 18px}
|
|
1070
1178
|
.ss-modalbody{display:flex;flex-direction:column;gap:4px;margin:-8px 0 18px;padding:10px 12px;border-radius:8px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.6;word-break:break-word}
|
|
1071
1179
|
.ss-previewtoggle{align-self:flex-start;margin-top:2px;padding:0;border:none;background:none;color:var(--dsw-alias-state-business-primary);font-family:inherit;font-size:12px;cursor:pointer}
|
|
@@ -1104,6 +1212,8 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1104
1212
|
.ss-fieldicon svg{flex:none;opacity:.8}
|
|
1105
1213
|
.ss-fieldlabel small{display:block;color:var(--dsw-alias-label-secondary);font-size:11px;margin-top:3px;max-width:520px;line-height:1.55}
|
|
1106
1214
|
.ss-radios{display:flex;flex-direction:column;gap:6px;white-space:nowrap}
|
|
1215
|
+
.ss-fieldstack .ss-fieldlabel{width:100%}
|
|
1216
|
+
.ss-radios-inline{flex-direction:row;flex-wrap:wrap;gap:4px 18px;white-space:normal;margin-top:8px}
|
|
1107
1217
|
.ss-radio{display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;color:var(--dsw-alias-label-primary);white-space:nowrap}
|
|
1108
1218
|
.ss-radio input{accent-color:var(--dsw-alias-brand-primary);width:14px;height:14px;margin:0}
|
|
1109
1219
|
.ss-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;color:var(--dsw-alias-label-secondary);word-break:break-all}
|
|
@@ -1117,6 +1227,7 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1117
1227
|
.ss-panellabel{font-size:12px;color:var(--dsw-alias-label-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
1118
1228
|
.ss-panelid{font-size:10px;color:var(--dsw-alias-label-secondary);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
|
|
1119
1229
|
.ss-meta{font-size:10px;line-height:15px;color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
1230
|
+
.ss-panelinline{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap;white-space:normal;overflow:visible}
|
|
1120
1231
|
.ss-badge.ok{color:var(--dsw-alias-state-success-primary);border-color:color-mix(in srgb,var(--dsw-alias-state-success-primary) 35%,transparent)}
|
|
1121
1232
|
.ss-badge.error{color:var(--dsw-alias-state-error-primary);border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 40%,transparent)}
|
|
1122
1233
|
.ss-badge.muted{color:var(--dsw-alias-label-secondary);opacity:.85}
|
|
@@ -1137,8 +1248,9 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1137
1248
|
.ss-detail-anim.closing{pointer-events:none}
|
|
1138
1249
|
.ss-detail-anim > *{min-width:0;min-height:0}
|
|
1139
1250
|
@keyframes ss-detail-in{from{grid-template-rows:0fr}to{grid-template-rows:1fr}}
|
|
1140
|
-
.ss-detailgrid{display:grid;grid-template-columns:
|
|
1251
|
+
.ss-detailgrid{display:grid;grid-template-columns:minmax(0,0.94fr) minmax(0,1.06fr);gap:6px 12px}
|
|
1141
1252
|
.ss-detailrow{display:flex;gap:8px;font-size:11px;line-height:18px;min-width:0;align-items:center;min-height:18px}
|
|
1253
|
+
.ss-detailrow:last-child .ss-detailval{white-space:normal;overflow:visible;text-overflow:clip}
|
|
1142
1254
|
.ss-detailkey{flex:none;min-width:64px;color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary))}
|
|
1143
1255
|
.ss-detailval{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary)}
|
|
1144
1256
|
.ss-phase-pending{color:var(--dsw-alias-label-secondary)}
|
|
@@ -1153,8 +1265,17 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1153
1265
|
.ss-detaildescrow{display:flex;align-items:flex-start;gap:8px;margin-top:8px}
|
|
1154
1266
|
.ss-detaildescrow .ss-detaildesc{margin-top:0;flex:1;min-width:0}
|
|
1155
1267
|
.ss-detaildescrow .ss-btn{flex:none}
|
|
1268
|
+
.ss-detaildivider{border-top:1px solid var(--dsw-alias-border-l1);margin:10px 0 8px}
|
|
1156
1269
|
.ss-detailactions{display:flex;gap:8px;margin-top:10px}
|
|
1157
1270
|
.ss-detailvalnode{display:flex;align-items:center;gap:8px;min-width:0}
|
|
1271
|
+
.ss-compatval{display:inline-flex;align-items:center;min-width:0;white-space:normal}
|
|
1272
|
+
.ss-compattext{min-width:0;white-space:normal}
|
|
1273
|
+
.ss-compatlabel{font-weight:500}
|
|
1274
|
+
.ss-compatreason{color:var(--dsw-alias-label-primary);font-weight:400}
|
|
1275
|
+
.ss-compat-on{color:var(--dsw-alias-state-success-primary)}
|
|
1276
|
+
.ss-compat-failed{color:var(--dsw-alias-state-error-primary)}
|
|
1277
|
+
.ss-compat-warn{color:var(--dsw-alias-state-warn-primary)}
|
|
1278
|
+
.ss-compat-off{color:var(--dsw-alias-label-secondary)}
|
|
1158
1279
|
.ss-idline{display:inline-flex;align-items:center;gap:6px;min-width:0}
|
|
1159
1280
|
.ss-idtext{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
1160
1281
|
.ss-copyid{flex:none;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;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}
|
|
@@ -1162,6 +1283,12 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1162
1283
|
.ss-copyid:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}
|
|
1163
1284
|
.ss-tip{display:inline-flex;align-items:safe center;gap:8px;position:fixed;z-index:100;width:max-content;box-sizing:border-box;max-width:min(50vw,calc(100vw - 24px));max-height:calc(100vh - 24px);overflow:auto;padding:3px 7px;border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-tooltip-bg,var(--dsw-alias-bg-overlay));color:var(--dsw-static-neutral-bluish-00,#fff);font-size:13px;line-height:20px;white-space:pre-line;overflow-wrap:break-word;pointer-events:none;animation:ss-tip-in .15s var(--ds-ease-in-out,ease)}
|
|
1164
1285
|
@keyframes ss-tip-in{from{opacity:0}}
|
|
1286
|
+
.ss-rowpreview{position:fixed;z-index:100;width:max-content;max-width:min(460px,calc(100vw - 24px));box-sizing:border-box;padding:10px 12px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font-size:12px;line-height:1.5;box-shadow:0 8px 24px rgba(0,0,0,.35);pointer-events:none;visibility:hidden}
|
|
1287
|
+
.ss-rowpreview .ss-rp-title{font-weight:600;font-size:12.5px;margin-bottom:6px;white-space:pre-wrap;overflow-wrap:break-word}
|
|
1288
|
+
.ss-rowpreview .ss-rp-path{color:var(--dsw-alias-label-secondary);font-size:11px;margin-bottom:6px;overflow-wrap:break-word}
|
|
1289
|
+
.ss-rowpreview .ss-rp-line{display:flex;flex-wrap:wrap;gap:8px;align-items:center;color:var(--dsw-alias-label-secondary);font-size:11px}
|
|
1290
|
+
.ss-rowpreview .ss-rp-sep{height:1px;background:var(--dsw-alias-border-l1);margin:8px 0}
|
|
1291
|
+
.ss-rowpreview .ss-rp-foot{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
1165
1292
|
.ss-others{margin-top:18px}
|
|
1166
1293
|
.ss-others-head{width:100%;display:flex;align-items:center;gap:6px;padding:6px 4px;border:none;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;font-weight:600;text-align:left;cursor:pointer;border-radius:var(--dsw-radius-md)}
|
|
1167
1294
|
.ss-others-head:hover{color:var(--dsw-alias-label-primary);background:var(--ss-surface-hover,var(--dsw-alias-interactive-bg-hover))}
|
|
@@ -1169,6 +1296,11 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1169
1296
|
.ss-othercard{margin-top:4px}
|
|
1170
1297
|
.ss-hint{font-size:11px;color:var(--dsw-alias-label-secondary);margin-top:8px;line-height:1.55}
|
|
1171
1298
|
/* --- motion: short fades, within the host's own 150-200ms easing range --- */
|
|
1299
|
+
.ss-actionnote{position:fixed;z-index:1400;left:0;top:0;pointer-events:none;padding:6px 12px;border-radius:8px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-overlay);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)}
|
|
1300
|
+
.ss-actionnote.show{transform:translate(-50%,0)}
|
|
1301
|
+
.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.is-error{color:var(--dsw-alias-state-error-primary);border-color:var(--dsw-alias-state-error-primary)}
|
|
1303
|
+
|
|
1172
1304
|
@keyframes ss-fade-in{from{opacity:0}to{opacity:1}}
|
|
1173
1305
|
.ss-fade{animation:ss-fade-in .16s ease-out both}
|
|
1174
1306
|
.ss-sessionssummary{display:flex;align-items:center;flex-wrap:wrap;gap:14px;min-height:32px;margin:2px 2px 12px;font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
@@ -1185,7 +1317,7 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1185
1317
|
/* --- settings page: lives inside the host settings dialog, so the dialog's
|
|
1186
1318
|
own surface, padding and type scale apply instead of our app-shell layout --- */
|
|
1187
1319
|
.ss-settings{background:transparent;height:auto;overflow:visible;font-size:14px;line-height:22px;--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))}
|
|
1188
|
-
.ss-settings .ss-page{max-width:none;margin:0;padding:0 0 24px;gap:0}
|
|
1320
|
+
.ss-settings .ss-page{max-width:none;margin:0;padding:0 0 24px;gap:0;animation:none}
|
|
1189
1321
|
.ss-settings .ss-settingshead{margin:0 0 14px}
|
|
1190
1322
|
.ss-settings .ss-title{font-size:18px;line-height:26px;font-weight:600;letter-spacing:0;margin:0}
|
|
1191
1323
|
.ss-settings .ss-sub{font-size:13px;line-height:20px;margin-top:4px}
|
|
@@ -1193,6 +1325,13 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1193
1325
|
.ss-settings .ss-field:first-of-type{padding-top:6px}
|
|
1194
1326
|
.ss-settings .ss-fieldlabel{font-size:14px;line-height:22px}
|
|
1195
1327
|
.ss-settings .ss-fieldlabel small{font-size:13px;line-height:20px;margin-top:2px;max-width:560px}
|
|
1328
|
+
.ss-previewmodule .ss-field{border-bottom:none}
|
|
1329
|
+
.ss-previewmodule .ss-field:first-of-type{padding-top:16px}
|
|
1330
|
+
.ss-previewmodule .ss-field:last-child{border-bottom:1px solid var(--dsw-alias-border-l1)}
|
|
1331
|
+
.ss-previewmodule .ss-field + .ss-field{padding-top:8px}
|
|
1332
|
+
.ss-previewmodule .ss-field + .ss-field .ss-fieldlabel{padding-left:0}
|
|
1333
|
+
.ss-previewmodule .ss-previewdelay{flex-direction:column;align-items:flex-start;gap:6px}
|
|
1334
|
+
.ss-previewmodule .ss-radiosrow{display:flex;flex-direction:row;flex-wrap:wrap;gap:16px;padding-top:2px}
|
|
1196
1335
|
.ss-settings .ss-radio{font-size:14px;line-height:22px;gap:9px}
|
|
1197
1336
|
.ss-settings .ss-radio input{width:15px;height:15px}
|
|
1198
1337
|
.ss-settings .ss-card{background:transparent;border:0;border-radius:0;padding:4px 0 0;margin:6px 0 0}
|
|
@@ -1203,14 +1342,26 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1203
1342
|
.ss-settings .ss-kpis{font-size:13px;line-height:22px;gap:10px}
|
|
1204
1343
|
.ss-settings .ss-kpis b{font-weight:600}
|
|
1205
1344
|
.ss-notifyactions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}
|
|
1206
|
-
.ss-
|
|
1345
|
+
.ss-notifytotal{margin-left:auto;font-size:12px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums}
|
|
1346
|
+
.ss-notifywrap{position:relative;margin-top:10px}
|
|
1347
|
+
.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
|
+
@keyframes ss-hint-in{from{opacity:0;transform:translate(-50%,4px)}to{opacity:1;transform:translate(-50%,0)}}
|
|
1349
|
+
@keyframes ss-hint-out{to{opacity:0}}
|
|
1350
|
+
.ss-notifycard .ss-field:last-of-type,.ss-notifycard .ss-fieldstack{border-bottom:none}
|
|
1207
1351
|
.ss-notifycard .ss-hint{margin-top:8px}
|
|
1208
1352
|
.ss-notifycard .ss-radios{padding:4px 0 2px}
|
|
1209
1353
|
.ss-notifycard .ss-fieldlabel small{color:var(--dsw-alias-label-tertiary)}
|
|
1210
1354
|
.ss-notifycard .ss-hint{color:var(--dsw-alias-label-tertiary)}
|
|
1211
1355
|
.ss-notifyfooter{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:16px 0 6px}
|
|
1212
1356
|
.ss-notifyintro{margin:0 0 10px}
|
|
1213
|
-
.ss-notifylog{display:flex;flex-direction:column;gap:4px;margin-top:10px;max-height:300px;overflow:auto}
|
|
1357
|
+
.ss-notifylog{display:flex;flex-direction:column;gap:4px;margin-top:10px;max-height:300px;overflow:auto;padding-right:4px;scrollbar-gutter:stable}
|
|
1358
|
+
.ss-notifylog::-webkit-scrollbar{width:5px}
|
|
1359
|
+
.ss-notifylog::-webkit-scrollbar-track,.ss-notifylog::-webkit-scrollbar-track-piece{background:transparent}
|
|
1360
|
+
.ss-notifylog::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:8px}
|
|
1361
|
+
.ss-notifylog::-webkit-scrollbar-thumb:hover{background:var(--dsw-alias-border-l3)}
|
|
1362
|
+
.ss-notifylog::-webkit-scrollbar-button,.ss-notifylog::-webkit-scrollbar-button:single-button,
|
|
1363
|
+
.ss-notifylog::-webkit-scrollbar-button:vertical:start:decrement,.ss-notifylog::-webkit-scrollbar-button:vertical:end:increment{display:none;width:0;height:0;background:transparent}
|
|
1364
|
+
.ss-notifylog::-webkit-scrollbar-corner{background:transparent}
|
|
1214
1365
|
.ss-notifylogempty{margin-top:10px;opacity:.6}
|
|
1215
1366
|
.ss-notifylogrow{display:flex;align-items:flex-start;gap:10px;width:100%;text-align:left;padding:8px 10px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--dsw-alias-label-primary);cursor:pointer;font:inherit;box-sizing:border-box}
|
|
1216
1367
|
.ss-notifylogrow:hover{background:var(--dsw-alias-bg-layer-1)}
|
|
@@ -1264,7 +1415,9 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1264
1415
|
.ss-soundbtn:disabled{opacity:.45;cursor:default}
|
|
1265
1416
|
.ss-soundbtn:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:1px}
|
|
1266
1417
|
.ss-settings .ss-mono{font-size:12px;line-height:18px}
|
|
1267
|
-
.ss-settings .ss-btn{height:
|
|
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)}
|
|
1420
|
+
.ss-settings .ss-btn.ghost{background:var(--ss-surface);border-color:transparent;color:var(--dsw-alias-label-primary)}
|
|
1268
1421
|
.ss-settings .ss-toolbar{gap:10px;padding-top:4px}
|
|
1269
1422
|
.ss-settings .ss-hint{font-size:12px;line-height:18px;margin-top:10px}
|
|
1270
1423
|
/* --- settings navigation icon. DSH 0.2.2 exposes the keyed slot
|
|
@@ -1273,15 +1426,20 @@ body[data-ds-dark-theme] .ss-rank-3{color:#ecc94b}
|
|
|
1273
1426
|
/* --- quick jump palette (session-wide Ctrl+Alt+K) --- */
|
|
1274
1427
|
.ss-qj-overlay{position:fixed;inset:0;z-index:1300;background:rgba(0,0,0,.45);display:flex;align-items:flex-start;justify-content:center;padding:12vh 24px 24px}
|
|
1275
1428
|
.ss-qj-panel{width:min(620px,100%);max-height:70vh;display:flex;flex-direction:column;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.35);overflow:hidden}
|
|
1276
|
-
.ss-qj-head{padding:12px 16px
|
|
1429
|
+
.ss-qj-head{padding:12px 16px 16px;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
1277
1430
|
.ss-qj-input{margin:0 12px 8px;padding:8px 10px;border-radius:8px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font-family:inherit;font-size:13px;line-height:20px;box-sizing:border-box}
|
|
1278
|
-
.ss-qj-input:focus{
|
|
1279
|
-
.ss-qj-chips{display:flex;flex-wrap:wrap;gap:6px;padding:0 12px 8px}
|
|
1280
|
-
.ss-qj-chip{font-size:11px;line-height:18px;padding:1px 9px;border-radius:999px;border:1px solid
|
|
1281
|
-
.ss-qj-chip:hover{color:var(--dsw-alias-label-primary);
|
|
1282
|
-
.ss-qj-chip.on{border-color:var(--dsw-alias-
|
|
1431
|
+
.ss-qj-input:focus,.ss-qj-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}
|
|
1432
|
+
.ss-qj-chips{display:flex;flex-wrap:wrap;gap:6px;padding:0 12px 8px;border-bottom:1px solid var(--dsw-alias-border-l1)}
|
|
1433
|
+
.ss-qj-chip{font-size:11px;line-height:18px;padding:1px 9px;border-radius:999px;border:1px solid transparent;background:transparent;color:var(--dsw-alias-label-secondary);font-weight:400;cursor:pointer}
|
|
1434
|
+
.ss-qj-chip:hover{color:var(--dsw-alias-label-primary);background:color-mix(in srgb,var(--dsw-alias-label-primary) 11%,var(--dsw-alias-bg-base))}
|
|
1435
|
+
.ss-qj-chip.on{border-color:var(--dsw-alias-border-l1);color:var(--dsw-alias-label-primary);background:color-mix(in srgb,var(--dsw-alias-label-primary) 11%,var(--dsw-alias-bg-base));font-weight:500}
|
|
1283
1436
|
.ss-qj-loading{padding:8px;text-align:center;font-size:11px;color:var(--dsw-alias-label-tertiary)}
|
|
1284
|
-
.ss-qj-list{flex:1;min-height:0;overflow:auto;padding:
|
|
1437
|
+
.ss-qj-list{flex:1;min-height:0;overflow:auto;padding:4px 8px 8px;scrollbar-gutter:stable}
|
|
1438
|
+
.ss-qj-list::-webkit-scrollbar{width:5px}
|
|
1439
|
+
.ss-qj-list::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:8px}
|
|
1440
|
+
.ss-qj-list::-webkit-scrollbar-thumb:hover{background:var(--dsw-alias-border-l3)}
|
|
1441
|
+
.ss-qj-list::-webkit-scrollbar-track{background:transparent}
|
|
1442
|
+
.ss-qj-list::-webkit-scrollbar-button,.ss-qj-list::-webkit-scrollbar-button:single-button{display:none;width:0;height:0;background:transparent}
|
|
1285
1443
|
.ss-qj-item{display:flex;gap:12px;align-items:center;width:100%;padding:8px;border:none;border-radius:8px;background:transparent;color:var(--dsw-alias-label-primary);font-family:inherit;font-size:13px;line-height:20px;text-align:left;cursor:pointer}
|
|
1286
1444
|
.ss-qj-item:hover,.ss-qj-item.active{background:var(--dsw-alias-bg-layer-2)}
|
|
1287
1445
|
.ss-qj-item:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
|
|
@@ -1372,6 +1530,327 @@ function fmtDate(value) {
|
|
|
1372
1530
|
}
|
|
1373
1531
|
}
|
|
1374
1532
|
|
|
1533
|
+
/* --------------------------------------------------------- semver helpers */
|
|
1534
|
+
|
|
1535
|
+
function parseSemverText(value) {
|
|
1536
|
+
const match = String(value ?? '')
|
|
1537
|
+
.trim()
|
|
1538
|
+
.match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/);
|
|
1539
|
+
if (!match) return null;
|
|
1540
|
+
return {
|
|
1541
|
+
major: Number(match[1]),
|
|
1542
|
+
minor: Number(match[2]),
|
|
1543
|
+
patch: Number(match[3]),
|
|
1544
|
+
pre: match[4] ? match[4].split('.') : [],
|
|
1545
|
+
};
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
function compareSemverText(left, right) {
|
|
1549
|
+
for (const key of ['major', 'minor', 'patch']) {
|
|
1550
|
+
if (left[key] !== right[key]) return left[key] < right[key] ? -1 : 1;
|
|
1551
|
+
}
|
|
1552
|
+
if (left.pre.length === 0 && right.pre.length === 0) return 0;
|
|
1553
|
+
if (left.pre.length === 0) return 1;
|
|
1554
|
+
if (right.pre.length === 0) return -1;
|
|
1555
|
+
const length = Math.max(left.pre.length, right.pre.length);
|
|
1556
|
+
for (let index = 0; index < length; index += 1) {
|
|
1557
|
+
const a = left.pre[index];
|
|
1558
|
+
const b = right.pre[index];
|
|
1559
|
+
if (a === undefined) return -1;
|
|
1560
|
+
if (b === undefined) return 1;
|
|
1561
|
+
const aNumber = /^\d+$/.test(a);
|
|
1562
|
+
const bNumber = /^\d+$/.test(b);
|
|
1563
|
+
if (aNumber && bNumber) {
|
|
1564
|
+
const diff = Number(a) - Number(b);
|
|
1565
|
+
if (diff !== 0) return diff < 0 ? -1 : 1;
|
|
1566
|
+
} else if (aNumber !== bNumber) {
|
|
1567
|
+
return aNumber ? -1 : 1;
|
|
1568
|
+
} else if (a !== b) {
|
|
1569
|
+
return a < b ? -1 : 1;
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
return 0;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
function semverSatisfiesText(version, range) {
|
|
1576
|
+
const current = parseSemverText(version);
|
|
1577
|
+
if (!current || !range) return null;
|
|
1578
|
+
for (const alternative of String(range).split('||')) {
|
|
1579
|
+
const parts = alternative.trim().split(/\s+/).filter(Boolean);
|
|
1580
|
+
if (parts.length === 0) continue;
|
|
1581
|
+
let matched = true;
|
|
1582
|
+
for (const part of parts) {
|
|
1583
|
+
const parsed = part.match(/^(>=|<=|>|<|=|\^|~)?(.+)$/);
|
|
1584
|
+
if (!parsed) {
|
|
1585
|
+
matched = false;
|
|
1586
|
+
break;
|
|
1587
|
+
}
|
|
1588
|
+
const operator = parsed[1] ?? '=';
|
|
1589
|
+
const target = parseSemverText(parsed[2]);
|
|
1590
|
+
if (!target) {
|
|
1591
|
+
matched = false;
|
|
1592
|
+
break;
|
|
1593
|
+
}
|
|
1594
|
+
if (operator === '^' || operator === '~') {
|
|
1595
|
+
const upper =
|
|
1596
|
+
operator === '^'
|
|
1597
|
+
? target.major > 0
|
|
1598
|
+
? { major: target.major + 1, minor: 0, patch: 0, pre: [] }
|
|
1599
|
+
: target.minor > 0
|
|
1600
|
+
? { major: 0, minor: target.minor + 1, patch: 0, pre: [] }
|
|
1601
|
+
: { major: 0, minor: 0, patch: target.patch + 1, pre: [] }
|
|
1602
|
+
: { major: target.major, minor: target.minor + 1, patch: 0, pre: [] };
|
|
1603
|
+
if (compareSemverText(current, target) < 0 || compareSemverText(current, upper) >= 0) {
|
|
1604
|
+
matched = false;
|
|
1605
|
+
break;
|
|
1606
|
+
}
|
|
1607
|
+
continue;
|
|
1608
|
+
}
|
|
1609
|
+
const comparison = compareSemverText(current, target);
|
|
1610
|
+
const passed =
|
|
1611
|
+
operator === '>='
|
|
1612
|
+
? comparison >= 0
|
|
1613
|
+
: operator === '>'
|
|
1614
|
+
? comparison > 0
|
|
1615
|
+
: operator === '<='
|
|
1616
|
+
? comparison <= 0
|
|
1617
|
+
: operator === '<'
|
|
1618
|
+
? comparison < 0
|
|
1619
|
+
: comparison === 0;
|
|
1620
|
+
if (!passed) {
|
|
1621
|
+
matched = false;
|
|
1622
|
+
break;
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
if (matched) return true;
|
|
1626
|
+
}
|
|
1627
|
+
return false;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
function detectClientDshVersion(boot) {
|
|
1631
|
+
try {
|
|
1632
|
+
const wire = globalThis.__DSH_BOOT__;
|
|
1633
|
+
const releaseVersion = wire && wire.release && wire.release.version;
|
|
1634
|
+
if (typeof releaseVersion === 'string' && releaseVersion) return releaseVersion;
|
|
1635
|
+
} catch {
|
|
1636
|
+
/* ignore */
|
|
1637
|
+
}
|
|
1638
|
+
if (boot && typeof boot.dshVersion === 'string' && boot.dshVersion) return boot.dshVersion;
|
|
1639
|
+
return '';
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
function compatibilityState(boot) {
|
|
1643
|
+
const version = detectClientDshVersion(boot);
|
|
1644
|
+
const range = boot && typeof boot.engineRange === 'string' ? boot.engineRange : '';
|
|
1645
|
+
let satisfied = null;
|
|
1646
|
+
let reason = 'unknown';
|
|
1647
|
+
if (!version) {
|
|
1648
|
+
reason = 'missing-version';
|
|
1649
|
+
} else if (!range) {
|
|
1650
|
+
reason = 'missing-range';
|
|
1651
|
+
} else {
|
|
1652
|
+
const result = semverSatisfiesText(version, range);
|
|
1653
|
+
if (result === true) {
|
|
1654
|
+
satisfied = true;
|
|
1655
|
+
reason = 'ok';
|
|
1656
|
+
} else if (result === false) {
|
|
1657
|
+
satisfied = false;
|
|
1658
|
+
reason = 'mismatch';
|
|
1659
|
+
} else {
|
|
1660
|
+
reason = 'unparsable';
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
return { version, range, satisfied, reason };
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
function compatibilityLabel(boot, t) {
|
|
1667
|
+
const { version, range, satisfied } = compatibilityState(boot);
|
|
1668
|
+
if (satisfied === true) return t('compatOk');
|
|
1669
|
+
if (satisfied === false) {
|
|
1670
|
+
return t('compatBad').replace('{range}', range).replace('{version}', version);
|
|
1671
|
+
}
|
|
1672
|
+
return t('compatUnknown');
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
function compatibilityReasonLabel(boot, t) {
|
|
1676
|
+
const state = compatibilityState(boot);
|
|
1677
|
+
if (state.reason === 'ok') {
|
|
1678
|
+
return t('compatReasonOk').replace('{range}', state.range).replace('{version}', state.version);
|
|
1679
|
+
}
|
|
1680
|
+
if (state.reason === 'mismatch') {
|
|
1681
|
+
return t('compatReasonMismatch').replace('{range}', state.range).replace('{version}', state.version);
|
|
1682
|
+
}
|
|
1683
|
+
if (state.reason === 'missing-version') return t('compatReasonNoVersion');
|
|
1684
|
+
if (state.reason === 'missing-range') return t('compatReasonNoRange');
|
|
1685
|
+
return t('compatReasonUnparsable');
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
/* ------------------------------------------------ session row hover preview */
|
|
1689
|
+
|
|
1690
|
+
const ROW_PREVIEW_DELAY = 400;
|
|
1691
|
+
let rowPreviewEl = null;
|
|
1692
|
+
let rowPreviewTimer = 0;
|
|
1693
|
+
let rowPreviewPointer = { x: 0, y: 0 };
|
|
1694
|
+
let rowPreviewRow = null;
|
|
1695
|
+
let rowPreviewSession = null;
|
|
1696
|
+
let rowPreviewGroup = '';
|
|
1697
|
+
|
|
1698
|
+
function ensureRowPreviewEl() {
|
|
1699
|
+
if (rowPreviewEl && typeof document !== 'undefined' && document.body && document.body.contains(rowPreviewEl)) return rowPreviewEl;
|
|
1700
|
+
if (typeof document === 'undefined' || !document.body) return null;
|
|
1701
|
+
const el = document.createElement('div');
|
|
1702
|
+
el.className = 'ss-rowpreview';
|
|
1703
|
+
el.setAttribute('role', 'tooltip');
|
|
1704
|
+
el.style.visibility = 'hidden';
|
|
1705
|
+
document.body.appendChild(el);
|
|
1706
|
+
rowPreviewEl = el;
|
|
1707
|
+
const hideOnViewport = () => hideRowPreview();
|
|
1708
|
+
window.addEventListener('scroll', hideOnViewport, true);
|
|
1709
|
+
window.addEventListener('resize', hideOnViewport);
|
|
1710
|
+
return el;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
function hideRowPreview() {
|
|
1714
|
+
if (rowPreviewTimer) {
|
|
1715
|
+
clearTimeout(rowPreviewTimer);
|
|
1716
|
+
rowPreviewTimer = 0;
|
|
1717
|
+
}
|
|
1718
|
+
rowPreviewRow = null;
|
|
1719
|
+
rowPreviewSession = null;
|
|
1720
|
+
rowPreviewGroup = '';
|
|
1721
|
+
if (rowPreviewEl) rowPreviewEl.style.visibility = 'hidden';
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
function rowPreviewActionsLeft(rowEl) {
|
|
1725
|
+
try {
|
|
1726
|
+
const actions = rowEl && rowEl.querySelector('.ss-rowactions');
|
|
1727
|
+
if (actions) return actions.getBoundingClientRect().left - 8;
|
|
1728
|
+
} catch {
|
|
1729
|
+
/* ignore */
|
|
1730
|
+
}
|
|
1731
|
+
return typeof window !== 'undefined' ? window.innerWidth - 8 : 0;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
function placeRowPreview(pointer) {
|
|
1735
|
+
if (!rowPreviewEl) return;
|
|
1736
|
+
const vw = (typeof window !== 'undefined' && window.innerWidth) || 0;
|
|
1737
|
+
const vh = (typeof window !== 'undefined' && window.innerHeight) || 0;
|
|
1738
|
+
const bw = rowPreviewEl.offsetWidth || 0;
|
|
1739
|
+
const bh = rowPreviewEl.offsetHeight || 0;
|
|
1740
|
+
const actionsLeft = rowPreviewActionsLeft(rowPreviewRow);
|
|
1741
|
+
const rowRect =
|
|
1742
|
+
rowPreviewRow && typeof rowPreviewRow.getBoundingClientRect === 'function'
|
|
1743
|
+
? rowPreviewRow.getBoundingClientRect()
|
|
1744
|
+
: null;
|
|
1745
|
+
/* 窄屏:按钮区左侧放不下整张卡片时,改为锚定在行的下方/上方,避免压住右侧按钮 */
|
|
1746
|
+
if (rowRect && actionsLeft - 8 < bw + 8) {
|
|
1747
|
+
let left = Math.max(8, Math.min(rowRect.left, Math.max(8, vw - bw - 8)));
|
|
1748
|
+
let top = rowRect.bottom + 6;
|
|
1749
|
+
if (top + bh > vh - 8) top = Math.max(8, rowRect.top - bh - 6);
|
|
1750
|
+
top = Math.max(8, Math.min(top, Math.max(8, vh - bh - 8)));
|
|
1751
|
+
rowPreviewEl.style.left = `${Math.round(left)}px`;
|
|
1752
|
+
rowPreviewEl.style.top = `${Math.round(top)}px`;
|
|
1753
|
+
rowPreviewEl.style.visibility = 'visible';
|
|
1754
|
+
return;
|
|
1755
|
+
}
|
|
1756
|
+
let left = (pointer.x || 0) - bw / 2;
|
|
1757
|
+
left = Math.min(left, actionsLeft - bw);
|
|
1758
|
+
left = Math.max(8, Math.min(left, Math.max(8, vw - bw - 8)));
|
|
1759
|
+
let top = (pointer.y || 0) - bh - 10;
|
|
1760
|
+
if (top < 8) top = (pointer.y || 0) + 10;
|
|
1761
|
+
top = Math.max(8, Math.min(top, Math.max(8, vh - bh - 8)));
|
|
1762
|
+
rowPreviewEl.style.left = `${Math.round(left)}px`;
|
|
1763
|
+
rowPreviewEl.style.top = `${Math.round(top)}px`;
|
|
1764
|
+
rowPreviewEl.style.visibility = 'visible';
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
function fillRowPreview(session, t, groupTitle, actionsText) {
|
|
1768
|
+
const el = ensureRowPreviewEl();
|
|
1769
|
+
if (!el) return;
|
|
1770
|
+
el.textContent = '';
|
|
1771
|
+
const title = document.createElement('div');
|
|
1772
|
+
title.className = 'ss-rp-title';
|
|
1773
|
+
title.textContent = session.title || session.id || '';
|
|
1774
|
+
el.appendChild(title);
|
|
1775
|
+
const pathText = [groupTitle, session.workspacePath].filter(Boolean).join(' · ');
|
|
1776
|
+
if (pathText) {
|
|
1777
|
+
const path = document.createElement('div');
|
|
1778
|
+
path.className = 'ss-rp-path';
|
|
1779
|
+
path.textContent = pathText;
|
|
1780
|
+
el.appendChild(path);
|
|
1781
|
+
}
|
|
1782
|
+
const line = document.createElement('div');
|
|
1783
|
+
line.className = 'ss-rp-line';
|
|
1784
|
+
const msgs = document.createElement('span');
|
|
1785
|
+
msgs.textContent = t('messagesN').replace('{n}', String(session.messageCount ?? 0));
|
|
1786
|
+
line.appendChild(msgs);
|
|
1787
|
+
const size = document.createElement('span');
|
|
1788
|
+
size.textContent = fmtBytes(session.sizeBytes);
|
|
1789
|
+
line.appendChild(size);
|
|
1790
|
+
if (session.updatedAt) {
|
|
1791
|
+
const when = document.createElement('span');
|
|
1792
|
+
when.textContent = t('rowPreviewUpdated').replace('{time}', fmtDate(session.updatedAt));
|
|
1793
|
+
line.appendChild(when);
|
|
1794
|
+
}
|
|
1795
|
+
if (session.running) {
|
|
1796
|
+
const badge = document.createElement('span');
|
|
1797
|
+
badge.className = 'ss-badge running';
|
|
1798
|
+
badge.textContent = t('running');
|
|
1799
|
+
line.appendChild(badge);
|
|
1800
|
+
}
|
|
1801
|
+
if (session.archived) {
|
|
1802
|
+
const badge = document.createElement('span');
|
|
1803
|
+
badge.className = 'ss-badge archived';
|
|
1804
|
+
badge.textContent = t('archived');
|
|
1805
|
+
line.appendChild(badge);
|
|
1806
|
+
}
|
|
1807
|
+
if (session.blank) {
|
|
1808
|
+
const badge = document.createElement('span');
|
|
1809
|
+
badge.className = 'ss-badge blank';
|
|
1810
|
+
badge.textContent = t('blank');
|
|
1811
|
+
line.appendChild(badge);
|
|
1812
|
+
}
|
|
1813
|
+
el.appendChild(line);
|
|
1814
|
+
const sep = document.createElement('div');
|
|
1815
|
+
sep.className = 'ss-rp-sep';
|
|
1816
|
+
el.appendChild(sep);
|
|
1817
|
+
const foot = document.createElement('div');
|
|
1818
|
+
foot.className = 'ss-rp-foot';
|
|
1819
|
+
foot.textContent = t('rowPreviewFoot').replace(
|
|
1820
|
+
'{actions}',
|
|
1821
|
+
actionsText || [t('open'), t('archive'), t('deleteSession'), t('exportAction')].join(' / '),
|
|
1822
|
+
);
|
|
1823
|
+
el.appendChild(foot);
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
function scheduleRowPreview(event, session, t, groupTitle, actionsText, delay) {
|
|
1827
|
+
if (!event || typeof document === 'undefined') return;
|
|
1828
|
+
hideRowPreview();
|
|
1829
|
+
if (!ensureRowPreviewEl()) return;
|
|
1830
|
+
rowPreviewSession = session;
|
|
1831
|
+
rowPreviewGroup = groupTitle || '';
|
|
1832
|
+
rowPreviewPointer = { x: event.clientX, y: event.clientY };
|
|
1833
|
+
rowPreviewRow = event.currentTarget && event.currentTarget.closest ? event.currentTarget.closest('.ss-row') : null;
|
|
1834
|
+
const wait = Number.isFinite(delay) ? delay : ROW_PREVIEW_DELAY;
|
|
1835
|
+
rowPreviewTimer = setTimeout(() => {
|
|
1836
|
+
rowPreviewTimer = 0;
|
|
1837
|
+
if (!rowPreviewSession || !rowPreviewRow || rowPreviewRow.isConnected === false) {
|
|
1838
|
+
hideRowPreview();
|
|
1839
|
+
return;
|
|
1840
|
+
}
|
|
1841
|
+
fillRowPreview(rowPreviewSession, t, rowPreviewGroup, actionsText);
|
|
1842
|
+
placeRowPreview(rowPreviewPointer);
|
|
1843
|
+
}, wait);
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
function moveRowPreview(event) {
|
|
1847
|
+
if (!event) return;
|
|
1848
|
+
rowPreviewPointer = { x: event.clientX, y: event.clientY };
|
|
1849
|
+
if (rowPreviewEl && rowPreviewEl.style.visibility === 'visible' && rowPreviewRow) {
|
|
1850
|
+
placeRowPreview(rowPreviewPointer);
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1375
1854
|
/* ------------------------------------------------------------------ icons */
|
|
1376
1855
|
|
|
1377
1856
|
function PanelIcon(props) {
|
|
@@ -1400,6 +1879,41 @@ function PanelIcon(props) {
|
|
|
1400
1879
|
);
|
|
1401
1880
|
}
|
|
1402
1881
|
|
|
1882
|
+
/**
|
|
1883
|
+
* Sidebar launcher: the panel mark plus a small unread dot. `sidebar.panellist`
|
|
1884
|
+
* has no badge channel, so the dot is drawn inside our own icon component.
|
|
1885
|
+
*/
|
|
1886
|
+
function SidebarLauncher(props) {
|
|
1887
|
+
const size = Number(props?.size) || 16;
|
|
1888
|
+
const t = props?.t;
|
|
1889
|
+
const [marker, setMarker] = React.useState(() => notifyMarker(readNotifyLog()));
|
|
1890
|
+
React.useEffect(() => {
|
|
1891
|
+
const sync = () => setMarker(notifyMarker(readNotifyLog()));
|
|
1892
|
+
sync();
|
|
1893
|
+
window.addEventListener('dsh-keeper:notify-log', sync);
|
|
1894
|
+
window.addEventListener('storage', sync);
|
|
1895
|
+
return () => {
|
|
1896
|
+
window.removeEventListener('dsh-keeper:notify-log', sync);
|
|
1897
|
+
window.removeEventListener('storage', sync);
|
|
1898
|
+
};
|
|
1899
|
+
}, []);
|
|
1900
|
+
const label = typeof t === 'function' ? t('unreadDotAria') : 'Unread notifications';
|
|
1901
|
+
return React.createElement(
|
|
1902
|
+
'span',
|
|
1903
|
+
{ className: 'ss-launcherwrap', style: { width: size, height: size } },
|
|
1904
|
+
React.createElement(PanelIcon, { size, active: Boolean(props?.active) }),
|
|
1905
|
+
marker.count > 0
|
|
1906
|
+
? React.createElement('span', {
|
|
1907
|
+
className: 'ss-launcherdot',
|
|
1908
|
+
'data-state': marker.state,
|
|
1909
|
+
role: 'status',
|
|
1910
|
+
'aria-label': label,
|
|
1911
|
+
title: label,
|
|
1912
|
+
})
|
|
1913
|
+
: null,
|
|
1914
|
+
);
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1403
1917
|
/**
|
|
1404
1918
|
* Empty-trash illustration: a quiet outline of the can, no fill so it adapts
|
|
1405
1919
|
* to both themes through currentColor.
|
|
@@ -1746,6 +2260,29 @@ function EraserIcon(props) {
|
|
|
1746
2260
|
);
|
|
1747
2261
|
}
|
|
1748
2262
|
|
|
2263
|
+
/** Partial-failure and error results. */
|
|
2264
|
+
function AlertIcon(props) {
|
|
2265
|
+
const size = Number(props?.size) || 15;
|
|
2266
|
+
return React.createElement(
|
|
2267
|
+
'svg',
|
|
2268
|
+
{
|
|
2269
|
+
width: size,
|
|
2270
|
+
height: size,
|
|
2271
|
+
viewBox: '0 0 24 24',
|
|
2272
|
+
fill: 'none',
|
|
2273
|
+
stroke: 'currentColor',
|
|
2274
|
+
strokeWidth: 1.8,
|
|
2275
|
+
strokeLinecap: 'round',
|
|
2276
|
+
strokeLinejoin: 'round',
|
|
2277
|
+
className: props?.className,
|
|
2278
|
+
'aria-hidden': 'true',
|
|
2279
|
+
},
|
|
2280
|
+
React.createElement('path', { d: 'M12 3.5 21 20H3z' }),
|
|
2281
|
+
React.createElement('path', { d: 'M12 9.5v4.5' }),
|
|
2282
|
+
React.createElement('path', { d: 'M12 17.4v.1' }),
|
|
2283
|
+
);
|
|
2284
|
+
}
|
|
2285
|
+
|
|
1749
2286
|
/** Open the data directory: a folder. */
|
|
1750
2287
|
function FolderIcon(props) {
|
|
1751
2288
|
const size = Number(props?.size) || 15;
|
|
@@ -1768,6 +2305,26 @@ function FolderIcon(props) {
|
|
|
1768
2305
|
}
|
|
1769
2306
|
|
|
1770
2307
|
/** Label with a leading icon, matching the quiet-rules rows. */
|
|
2308
|
+
function EyeIcon(props) {
|
|
2309
|
+
const size = Number(props?.size) || 15;
|
|
2310
|
+
return React.createElement(
|
|
2311
|
+
'svg',
|
|
2312
|
+
{
|
|
2313
|
+
width: size,
|
|
2314
|
+
height: size,
|
|
2315
|
+
viewBox: '0 0 24 24',
|
|
2316
|
+
fill: 'none',
|
|
2317
|
+
stroke: 'currentColor',
|
|
2318
|
+
strokeWidth: 1.8,
|
|
2319
|
+
strokeLinecap: 'round',
|
|
2320
|
+
strokeLinejoin: 'round',
|
|
2321
|
+
'aria-hidden': 'true',
|
|
2322
|
+
},
|
|
2323
|
+
React.createElement('path', { d: 'M2.5 12s3.4-6 9.5-6 9.5 6 9.5 6-3.4 6-9.5 6-9.5-6-9.5-6z' }),
|
|
2324
|
+
React.createElement('circle', { cx: '12', cy: '12', r: '2.6' }),
|
|
2325
|
+
);
|
|
2326
|
+
}
|
|
2327
|
+
|
|
1771
2328
|
function KeyboardIcon(props) {
|
|
1772
2329
|
const size = Number(props?.size) || 15;
|
|
1773
2330
|
return React.createElement(
|
|
@@ -1793,6 +2350,29 @@ function iconLabel(icon, text) {
|
|
|
1793
2350
|
return React.createElement('span', { className: 'ss-fieldicon' }, icon, text);
|
|
1794
2351
|
}
|
|
1795
2352
|
|
|
2353
|
+
function PackageMinusIcon(props) {
|
|
2354
|
+
const size = Number(props?.size) || 14;
|
|
2355
|
+
return React.createElement(
|
|
2356
|
+
'svg',
|
|
2357
|
+
{
|
|
2358
|
+
width: size,
|
|
2359
|
+
height: size,
|
|
2360
|
+
viewBox: '0 0 24 24',
|
|
2361
|
+
fill: 'none',
|
|
2362
|
+
stroke: 'currentColor',
|
|
2363
|
+
strokeWidth: 1.8,
|
|
2364
|
+
strokeLinecap: 'round',
|
|
2365
|
+
strokeLinejoin: 'round',
|
|
2366
|
+
className: props?.className,
|
|
2367
|
+
'aria-hidden': 'true',
|
|
2368
|
+
},
|
|
2369
|
+
React.createElement('path', { d: 'M12 3 4 7v10l8 4 8-4V7l-8-4Z' }),
|
|
2370
|
+
React.createElement('path', { d: 'm4 7 8 4 8-4' }),
|
|
2371
|
+
React.createElement('path', { d: 'M12 11v10' }),
|
|
2372
|
+
React.createElement('path', { d: 'M8 13.5h8', strokeWidth: 2 }),
|
|
2373
|
+
);
|
|
2374
|
+
}
|
|
2375
|
+
|
|
1796
2376
|
function GearIcon(props) {
|
|
1797
2377
|
const size = Number(props?.size) || 16;
|
|
1798
2378
|
return React.createElement(
|
|
@@ -2310,7 +2890,7 @@ function publishSettingsPatch(patch) {
|
|
|
2310
2890
|
}
|
|
2311
2891
|
|
|
2312
2892
|
function ConfirmDialog(props) {
|
|
2313
|
-
const { t, title, body, details, preview, confirmLabel, danger, onCancel, onConfirm } = props;
|
|
2893
|
+
const { t, title, body, details, preview, confirmLabel, danger, icon, iconDanger, onCancel, onConfirm } = props;
|
|
2314
2894
|
const [expanded, setExpanded] = React.useState(false);
|
|
2315
2895
|
const cancelRef = React.useRef(null);
|
|
2316
2896
|
React.useEffect(() => {
|
|
@@ -2338,7 +2918,18 @@ function ConfirmDialog(props) {
|
|
|
2338
2918
|
React.createElement(
|
|
2339
2919
|
'div',
|
|
2340
2920
|
{ className: 'ss-modal', role: 'dialog', 'aria-modal': 'true', 'aria-label': title },
|
|
2341
|
-
React.createElement(
|
|
2921
|
+
React.createElement(
|
|
2922
|
+
'h3',
|
|
2923
|
+
{ className: icon ? 'ss-modaltitle-withicon' : undefined },
|
|
2924
|
+
icon
|
|
2925
|
+
? React.createElement(
|
|
2926
|
+
'span',
|
|
2927
|
+
{ className: cx('ss-modalicon-badge', (danger || iconDanger) && 'danger') },
|
|
2928
|
+
React.createElement(icon, { size: 16 }),
|
|
2929
|
+
)
|
|
2930
|
+
: null,
|
|
2931
|
+
title,
|
|
2932
|
+
),
|
|
2342
2933
|
React.createElement('p', null, body),
|
|
2343
2934
|
(Array.isArray(details) && details.length > 0) ||
|
|
2344
2935
|
(preview && Array.isArray(preview.items) && preview.items.length > 0)
|
|
@@ -2580,6 +3171,10 @@ function normalizeNotifySettings(value) {
|
|
|
2580
3171
|
mutedWorkspaces: Array.isArray(raw.mutedWorkspaces)
|
|
2581
3172
|
? raw.mutedWorkspaces.filter((id) => typeof id === 'string' && id).slice(0, 100)
|
|
2582
3173
|
: [],
|
|
3174
|
+
// History is stored in this browser, but the switch and retention live in
|
|
3175
|
+
// the shared notification settings so every browser behaves the same.
|
|
3176
|
+
recordEnabled: raw.recordEnabled !== false,
|
|
3177
|
+
historyDays: [0, 7, 30, 90].includes(Number(raw.historyDays)) ? Number(raw.historyDays) : 30,
|
|
2583
3178
|
openOnClick: raw.openOnClick !== false,
|
|
2584
3179
|
};
|
|
2585
3180
|
}
|
|
@@ -2593,7 +3188,7 @@ function notifySettingsAreDefault(value) {
|
|
|
2593
3188
|
// Local history for the notification center. Bounded and stored in the webview
|
|
2594
3189
|
// localStorage so it survives page reloads without touching the host state.
|
|
2595
3190
|
const NOTIFY_LOG_KEY = 'dsh-keeper:notify-log';
|
|
2596
|
-
const NOTIFY_LOG_LIMIT =
|
|
3191
|
+
const NOTIFY_LOG_LIMIT = 500;
|
|
2597
3192
|
|
|
2598
3193
|
function readNotifyLog() {
|
|
2599
3194
|
try {
|
|
@@ -2616,10 +3211,65 @@ function publishNotifyLog(list) {
|
|
|
2616
3211
|
}
|
|
2617
3212
|
}
|
|
2618
3213
|
|
|
2619
|
-
function
|
|
2620
|
-
const
|
|
2621
|
-
|
|
2622
|
-
|
|
3214
|
+
function notifyRetentionCutoff(days) {
|
|
3215
|
+
const value = Number(days);
|
|
3216
|
+
return Number.isFinite(value) && value > 0 ? Date.now() - value * 86400000 : 0;
|
|
3217
|
+
}
|
|
3218
|
+
|
|
3219
|
+
function pruneNotifyLogEntries(list, days) {
|
|
3220
|
+
const cutoff = notifyRetentionCutoff(days);
|
|
3221
|
+
const kept = [];
|
|
3222
|
+
let changed = false;
|
|
3223
|
+
for (const item of Array.isArray(list) ? list : []) {
|
|
3224
|
+
if (!item || typeof item !== 'object') {
|
|
3225
|
+
changed = true;
|
|
3226
|
+
continue;
|
|
3227
|
+
}
|
|
3228
|
+
const at = Number(item.at);
|
|
3229
|
+
if (cutoff > 0 && Number.isFinite(at) && at > 0 && at < cutoff) {
|
|
3230
|
+
changed = true;
|
|
3231
|
+
continue;
|
|
3232
|
+
}
|
|
3233
|
+
kept.push(item);
|
|
3234
|
+
}
|
|
3235
|
+
return { list: kept, changed };
|
|
3236
|
+
}
|
|
3237
|
+
|
|
3238
|
+
/** Applies the retention window; read state is handled by the notifier. */
|
|
3239
|
+
function sweepNotifyLog(days) {
|
|
3240
|
+
const current = readNotifyLog();
|
|
3241
|
+
const { list, changed } = pruneNotifyLogEntries(current, days);
|
|
3242
|
+
if (!changed) return current;
|
|
3243
|
+
const next = list.slice(0, NOTIFY_LOG_LIMIT);
|
|
3244
|
+
publishNotifyLog(next);
|
|
3245
|
+
return next;
|
|
3246
|
+
}
|
|
3247
|
+
|
|
3248
|
+
/**
|
|
3249
|
+
* Merge instead of blind prepend: every window polls the host on its own, so
|
|
3250
|
+
* the same notification can be written twice, and a stale full-array write
|
|
3251
|
+
* must not drop entries another window added. Merge preserves a read flag set
|
|
3252
|
+
* by any window.
|
|
3253
|
+
*/
|
|
3254
|
+
function appendNotifyLog(entry, days) {
|
|
3255
|
+
const id = String((entry && entry.id) || '');
|
|
3256
|
+
const current = readNotifyLog();
|
|
3257
|
+
const existingAt = id ? current.findIndex((item) => item && String(item.id) === id) : -1;
|
|
3258
|
+
let next;
|
|
3259
|
+
if (existingAt >= 0) {
|
|
3260
|
+
const previous = current[existingAt];
|
|
3261
|
+
next = current.slice();
|
|
3262
|
+
next[existingAt] = {
|
|
3263
|
+
...previous,
|
|
3264
|
+
...entry,
|
|
3265
|
+
read: previous.read === true || entry.read === true,
|
|
3266
|
+
muted: previous.muted === true || entry.muted === true,
|
|
3267
|
+
};
|
|
3268
|
+
} else {
|
|
3269
|
+
next = [entry, ...current];
|
|
3270
|
+
}
|
|
3271
|
+
const { list: kept } = pruneNotifyLogEntries(next, days);
|
|
3272
|
+
publishNotifyLog(kept.slice(0, NOTIFY_LOG_LIMIT));
|
|
2623
3273
|
}
|
|
2624
3274
|
|
|
2625
3275
|
function markNotifyLogRead(ids) {
|
|
@@ -2639,6 +3289,22 @@ function notifyUnreadCount(list) {
|
|
|
2639
3289
|
return (Array.isArray(list) ? list : []).filter((item) => item && item.read !== true).length;
|
|
2640
3290
|
}
|
|
2641
3291
|
|
|
3292
|
+
/**
|
|
3293
|
+
* Sidebar marker state follows the DSH state-dot palette: a failed/interrupted
|
|
3294
|
+
* task turns it red, a pending question amber, and plain completions green.
|
|
3295
|
+
*/
|
|
3296
|
+
function notifyMarker(list) {
|
|
3297
|
+
const unread = (Array.isArray(list) ? list : []).filter((item) => item && item.read !== true);
|
|
3298
|
+
if (unread.length === 0) return { count: 0, state: 'done' };
|
|
3299
|
+
if (unread.some((item) => item.kind === 'error' || item.kind === 'stopped')) {
|
|
3300
|
+
return { count: unread.length, state: 'error' };
|
|
3301
|
+
}
|
|
3302
|
+
if (unread.some((item) => item.kind === 'ask')) {
|
|
3303
|
+
return { count: unread.length, state: 'warning' };
|
|
3304
|
+
}
|
|
3305
|
+
return { count: unread.length, state: 'done' };
|
|
3306
|
+
}
|
|
3307
|
+
|
|
2642
3308
|
function notifyClockMinutes(value) {
|
|
2643
3309
|
const match = /^([01]\d|2[0-3]):([0-5]\d)$/.exec(typeof value === 'string' ? value : '');
|
|
2644
3310
|
return match ? Number(match[1]) * 60 + Number(match[2]) : null;
|
|
@@ -2911,6 +3577,68 @@ function showDesktopNotification(title, body, tag, onClick) {
|
|
|
2911
3577
|
}
|
|
2912
3578
|
}
|
|
2913
3579
|
|
|
3580
|
+
let actionNoteEl = null;
|
|
3581
|
+
let actionNoteTimer = null;
|
|
3582
|
+
let actionNoteFadeTimer = null;
|
|
3583
|
+
function actionNoteAnchor(target) {
|
|
3584
|
+
const root = target && typeof target.closest === 'function' ? target.closest('.ss-settings') : null;
|
|
3585
|
+
let base = root;
|
|
3586
|
+
// 插件页没有 .ss-settings 包裹层:以插件主页面根容器(.ss-root.ss-main)为锚点,
|
|
3587
|
+
// 即侧边栏右侧、标题栏下方的可视页面区域;入场从该区域顶边开始下移。
|
|
3588
|
+
if (!base && typeof document !== 'undefined') {
|
|
3589
|
+
base = document.querySelector('.ss-main') || document.querySelector('.ss-page.ss-page-main') || document.querySelector('.ss-page') || null;
|
|
3590
|
+
}
|
|
3591
|
+
if (root) {
|
|
3592
|
+
let node = root.parentElement;
|
|
3593
|
+
while (node && node !== document.body) {
|
|
3594
|
+
try {
|
|
3595
|
+
const style = window.getComputedStyle(node);
|
|
3596
|
+
if (/(auto|scroll)/.test(String(style.overflowY)) && node.scrollHeight > node.clientHeight + 2) {
|
|
3597
|
+
base = node;
|
|
3598
|
+
break;
|
|
3599
|
+
}
|
|
3600
|
+
} catch {
|
|
3601
|
+
/* ignore */
|
|
3602
|
+
}
|
|
3603
|
+
node = node.parentElement;
|
|
3604
|
+
}
|
|
3605
|
+
}
|
|
3606
|
+
const rect = base && typeof base.getBoundingClientRect === 'function' ? base.getBoundingClientRect() : null;
|
|
3607
|
+
if (!rect || rect.width <= 0) return { left: window.innerWidth / 2, top: 16 };
|
|
3608
|
+
// 设置页以设置面板正中为锚点;插件页以 .ss-main 可视区域正中为锚点,
|
|
3609
|
+
// 垂直先下移 20px,配合 transform -20px 让入场起点正好落在页面顶边。
|
|
3610
|
+
return { left: rect.left + rect.width / 2, top: rect.top + 20 };
|
|
3611
|
+
}
|
|
3612
|
+
function showActionNote(target, text, error) {
|
|
3613
|
+
if (typeof document === 'undefined') return;
|
|
3614
|
+
if (!actionNoteEl) {
|
|
3615
|
+
actionNoteEl = document.createElement('div');
|
|
3616
|
+
actionNoteEl.className = 'ss-actionnote';
|
|
3617
|
+
document.body.appendChild(actionNoteEl);
|
|
3618
|
+
}
|
|
3619
|
+
clearTimeout(actionNoteTimer);
|
|
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');
|
|
3625
|
+
const position = actionNoteAnchor(target);
|
|
3626
|
+
actionNoteEl.style.left = `${position.left}px`;
|
|
3627
|
+
actionNoteEl.style.top = `${position.top}px`;
|
|
3628
|
+
void actionNoteEl.offsetWidth;
|
|
3629
|
+
actionNoteEl.classList.add('show');
|
|
3630
|
+
actionNoteTimer = setTimeout(() => {
|
|
3631
|
+
if (!actionNoteEl) return;
|
|
3632
|
+
actionNoteEl.classList.add('is-hiding');
|
|
3633
|
+
actionNoteFadeTimer = setTimeout(() => {
|
|
3634
|
+
if (!actionNoteEl) return;
|
|
3635
|
+
actionNoteEl.classList.remove('show', 'is-hiding');
|
|
3636
|
+
// 上移回到页面顶边后直接消失,不做淡出。
|
|
3637
|
+
actionNoteEl.style.display = 'none';
|
|
3638
|
+
}, 420);
|
|
3639
|
+
}, 3000);
|
|
3640
|
+
}
|
|
3641
|
+
|
|
2914
3642
|
function Toast(props) {
|
|
2915
3643
|
return React.createElement(
|
|
2916
3644
|
'div',
|
|
@@ -3025,7 +3753,99 @@ function notifyDebug(bridge, message, data) {
|
|
|
3025
3753
|
}
|
|
3026
3754
|
}
|
|
3027
3755
|
|
|
3028
|
-
|
|
3756
|
+
/* --------------------------------------------- notification attention rules */
|
|
3757
|
+
|
|
3758
|
+
/**
|
|
3759
|
+
* The log tracks attention, not just events. A record is written as read only
|
|
3760
|
+
* when it is a completion event raised while this window is focused, in the
|
|
3761
|
+
* foreground, showing the conversation (not the Keeper panel) and on the
|
|
3762
|
+
* session that conversation displays. Everything else starts unread; whenever
|
|
3763
|
+
* a window has that session on screen it marks the session's unread records
|
|
3764
|
+
* read on the next poll, so background arrivals clear when the user returns.
|
|
3765
|
+
*/
|
|
3766
|
+
|
|
3767
|
+
function notifySessionRows(ctx) {
|
|
3768
|
+
try {
|
|
3769
|
+
const sessions = ctx && ctx.sessions;
|
|
3770
|
+
const snapshot =
|
|
3771
|
+
sessions && sessions.list && typeof sessions.list.getSnapshot === 'function'
|
|
3772
|
+
? sessions.list.getSnapshot()
|
|
3773
|
+
: null;
|
|
3774
|
+
return snapshot && snapshot.byId ? Object.values(snapshot.byId) : [];
|
|
3775
|
+
} catch (error) {
|
|
3776
|
+
return [];
|
|
3777
|
+
}
|
|
3778
|
+
}
|
|
3779
|
+
|
|
3780
|
+
/** Session currently displayed by the main-view conversation, if any. */
|
|
3781
|
+
function notifyActiveSessionId(ctx) {
|
|
3782
|
+
const row = notifySessionRows(ctx).find(
|
|
3783
|
+
(item) => item && item.retainedBy && (item.retainedBy.mainView ?? 0) > 0,
|
|
3784
|
+
);
|
|
3785
|
+
return row && row.id ? String(row.id) : '';
|
|
3786
|
+
}
|
|
3787
|
+
|
|
3788
|
+
/** Focus/foreground/panel state plus the session the conversation shows. */
|
|
3789
|
+
function notifyAttentionState(ctx) {
|
|
3790
|
+
let focused = false;
|
|
3791
|
+
let visible = false;
|
|
3792
|
+
try {
|
|
3793
|
+
if (typeof document !== 'undefined') {
|
|
3794
|
+
focused = typeof document.hasFocus === 'function' && document.hasFocus();
|
|
3795
|
+
visible = document.visibilityState !== 'hidden';
|
|
3796
|
+
}
|
|
3797
|
+
} catch (error) {
|
|
3798
|
+
focused = false;
|
|
3799
|
+
visible = false;
|
|
3800
|
+
}
|
|
3801
|
+
let conversation = true;
|
|
3802
|
+
try {
|
|
3803
|
+
const layout = ctx && ctx.layout;
|
|
3804
|
+
const info =
|
|
3805
|
+
layout && layout.panelInfo && typeof layout.panelInfo.getSnapshot === 'function'
|
|
3806
|
+
? layout.panelInfo.getSnapshot()
|
|
3807
|
+
: null;
|
|
3808
|
+
// `activePanelId === null` means the main view is showing the conversation;
|
|
3809
|
+
// any open panel (including DSH Keeper) covers it.
|
|
3810
|
+
if (info && info.activePanelId != null) conversation = false;
|
|
3811
|
+
} catch (error) {
|
|
3812
|
+
conversation = true;
|
|
3813
|
+
}
|
|
3814
|
+
return { focused, visible, conversation, sessionId: notifyActiveSessionId(ctx) };
|
|
3815
|
+
}
|
|
3816
|
+
|
|
3817
|
+
function notifyAttentionHere(state, sessionId) {
|
|
3818
|
+
return Boolean(
|
|
3819
|
+
state &&
|
|
3820
|
+
state.focused &&
|
|
3821
|
+
state.visible &&
|
|
3822
|
+
state.conversation &&
|
|
3823
|
+
state.sessionId &&
|
|
3824
|
+
String(sessionId || '') === state.sessionId,
|
|
3825
|
+
);
|
|
3826
|
+
}
|
|
3827
|
+
|
|
3828
|
+
/** Blank sessions have no conversation content, so they never get a record. */
|
|
3829
|
+
function notifySessionBlank(ctx, sessionId) {
|
|
3830
|
+
if (!sessionId) return false;
|
|
3831
|
+
const row = notifySessionRows(ctx).find((item) => item && String(item.id) === sessionId);
|
|
3832
|
+
return Boolean(row && row.blank === true);
|
|
3833
|
+
}
|
|
3834
|
+
|
|
3835
|
+
/** Marks every unread record of the session on screen as read. */
|
|
3836
|
+
function markAttentionSessionRead(ctx, sessionId) {
|
|
3837
|
+
if (!sessionId) return;
|
|
3838
|
+
const ids = readNotifyLog()
|
|
3839
|
+
.filter(
|
|
3840
|
+
(item) =>
|
|
3841
|
+
item && item.read !== true && String(item.sessionId || '') === String(sessionId),
|
|
3842
|
+
)
|
|
3843
|
+
.map((item) => String(item.id));
|
|
3844
|
+
if (ids.length === 0) return;
|
|
3845
|
+
markNotifyLogRead(ids);
|
|
3846
|
+
}
|
|
3847
|
+
|
|
3848
|
+
function startNotifier(bridge, t, ctx) {
|
|
3029
3849
|
if (notifierStarted) return () => {};
|
|
3030
3850
|
notifierStarted = true;
|
|
3031
3851
|
let alive = true;
|
|
@@ -3121,8 +3941,11 @@ function startNotifier(bridge, t) {
|
|
|
3121
3941
|
}
|
|
3122
3942
|
seen = true;
|
|
3123
3943
|
const settings = normalizeNotifySettings(value.settings);
|
|
3124
|
-
|
|
3125
|
-
|
|
3944
|
+
// Apply the retention window on every poll; `sweepNotifyLog` only writes
|
|
3945
|
+
// when something actually changed.
|
|
3946
|
+
sweepNotifyLog(settings.historyDays);
|
|
3947
|
+
const attention = notifyAttentionState(ctx);
|
|
3948
|
+
const focused = attention.focused;
|
|
3126
3949
|
if (items.length > 0) {
|
|
3127
3950
|
notifyDebug(bridge, 'poll-items', {
|
|
3128
3951
|
count: items.length,
|
|
@@ -3139,24 +3962,36 @@ function startNotifier(bridge, t) {
|
|
|
3139
3962
|
for (const item of items) {
|
|
3140
3963
|
if (!item || !item.id) continue;
|
|
3141
3964
|
if (Number(item.id) > Number(newest)) newest = String(item.id);
|
|
3142
|
-
// The
|
|
3143
|
-
// decide whether this one also raises a banner or a tone.
|
|
3965
|
+
// The record switch only controls the history; the mute rules below only
|
|
3966
|
+
// decide whether this one also raises a banner or a tone. Read state is
|
|
3967
|
+
// decided by the attention rule above.
|
|
3144
3968
|
const recordKey = String(item.id);
|
|
3145
3969
|
const muted = notifyItemMuted(item, settings);
|
|
3146
3970
|
if (!loggedIds.has(recordKey)) {
|
|
3147
3971
|
loggedIds.add(recordKey);
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3972
|
+
const recordSessionId = String(item.sessionId || '');
|
|
3973
|
+
if (
|
|
3974
|
+
settings.recordEnabled !== false &&
|
|
3975
|
+
!notifySessionBlank(ctx, recordSessionId)
|
|
3976
|
+
) {
|
|
3977
|
+
appendNotifyLog(
|
|
3978
|
+
{
|
|
3979
|
+
id: recordKey,
|
|
3980
|
+
kind: String(item.kind || ''),
|
|
3981
|
+
sessionId: recordSessionId,
|
|
3982
|
+
workspaceId: String(item.workspaceId || ''),
|
|
3983
|
+
title: truncateNotifyText(item.title, 80),
|
|
3984
|
+
workspace: truncateNotifyText(item.workspace, 60),
|
|
3985
|
+
summary: truncateNotifyText(item.summary, 140),
|
|
3986
|
+
at: Number(item.at) || Date.now(),
|
|
3987
|
+
muted,
|
|
3988
|
+
// Only a completion that the user actually watched counts as
|
|
3989
|
+
// read; anything arriving in the background stays unread.
|
|
3990
|
+
read: item.kind === 'done' && notifyAttentionHere(attention, recordSessionId),
|
|
3991
|
+
},
|
|
3992
|
+
settings.historyDays,
|
|
3993
|
+
);
|
|
3994
|
+
}
|
|
3160
3995
|
}
|
|
3161
3996
|
if (muted) continue;
|
|
3162
3997
|
if (!settings.enabled) continue;
|
|
@@ -3226,6 +4061,9 @@ function startNotifier(bridge, t) {
|
|
|
3226
4061
|
if (!delivered && settings.inApp && !focused) showInApp(title + (body ? ':' + body : ''));
|
|
3227
4062
|
if (settings.sound !== 'none') void playNotificationSound(bridge, kind, settings);
|
|
3228
4063
|
}
|
|
4064
|
+
if (attention.focused && attention.visible && attention.conversation && attention.sessionId) {
|
|
4065
|
+
markAttentionSessionRead(ctx, attention.sessionId);
|
|
4066
|
+
}
|
|
3229
4067
|
if (newest !== cursor) {
|
|
3230
4068
|
cursor = newest;
|
|
3231
4069
|
writeNotifyCursor(newest);
|
|
@@ -3373,6 +4211,7 @@ function createQuickJump(bridge, t) {
|
|
|
3373
4211
|
let limit = 12;
|
|
3374
4212
|
let loadingTimer = null;
|
|
3375
4213
|
let chipsEl = null;
|
|
4214
|
+
let confirmOpen = false;
|
|
3376
4215
|
const PAGE = 12;
|
|
3377
4216
|
const STEP = 10;
|
|
3378
4217
|
const MRU_KEY = 'dsh-keeper:qj-mru';
|
|
@@ -3541,6 +4380,87 @@ function createQuickJump(bridge, t) {
|
|
|
3541
4380
|
}
|
|
3542
4381
|
}
|
|
3543
4382
|
|
|
4383
|
+
function bellIconNode(size) {
|
|
4384
|
+
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
4385
|
+
svg.setAttribute('width', String(size));
|
|
4386
|
+
svg.setAttribute('height', String(size));
|
|
4387
|
+
svg.setAttribute('viewBox', '0 0 24 24');
|
|
4388
|
+
svg.setAttribute('fill', 'none');
|
|
4389
|
+
svg.setAttribute('stroke', 'currentColor');
|
|
4390
|
+
svg.setAttribute('stroke-width', '1.8');
|
|
4391
|
+
svg.setAttribute('stroke-linecap', 'round');
|
|
4392
|
+
svg.setAttribute('stroke-linejoin', 'round');
|
|
4393
|
+
svg.setAttribute('aria-hidden', 'true');
|
|
4394
|
+
for (const d of [
|
|
4395
|
+
'M18 8.6a6 6 0 0 0-12 0c0 3.4-.7 5.5-1.4 6.6a1 1 0 0 0 .9 1.5h13a1 1 0 0 0 .9-1.5c-.7-1.1-1.4-3.2-1.4-6.6Z',
|
|
4396
|
+
'M10.3 21a2 2 0 0 0 3.4 0',
|
|
4397
|
+
]) {
|
|
4398
|
+
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
4399
|
+
path.setAttribute('d', d);
|
|
4400
|
+
svg.append(path);
|
|
4401
|
+
}
|
|
4402
|
+
return svg;
|
|
4403
|
+
}
|
|
4404
|
+
|
|
4405
|
+
function askClearNotifyHistory() {
|
|
4406
|
+
if (confirmOpen) return;
|
|
4407
|
+
const overlay = document.createElement('div');
|
|
4408
|
+
overlay.className = 'ss-overlay';
|
|
4409
|
+
overlay.style.zIndex = '1350';
|
|
4410
|
+
overlay.setAttribute('role', 'presentation');
|
|
4411
|
+
const modal = document.createElement('div');
|
|
4412
|
+
modal.className = 'ss-modal';
|
|
4413
|
+
modal.setAttribute('role', 'dialog');
|
|
4414
|
+
modal.setAttribute('aria-modal', 'true');
|
|
4415
|
+
modal.setAttribute('aria-label', t('confirmClearNotifyTitle'));
|
|
4416
|
+
const heading = document.createElement('h3');
|
|
4417
|
+
heading.className = 'ss-modaltitle-withicon';
|
|
4418
|
+
const badge = document.createElement('span');
|
|
4419
|
+
badge.className = 'ss-modalicon-badge';
|
|
4420
|
+
badge.append(bellIconNode(16));
|
|
4421
|
+
heading.append(badge, document.createTextNode(t('confirmClearNotifyTitle')));
|
|
4422
|
+
const body = document.createElement('p');
|
|
4423
|
+
body.textContent = t('confirmClearNotifyBody');
|
|
4424
|
+
const foot = document.createElement('div');
|
|
4425
|
+
foot.className = 'ss-modalfoot';
|
|
4426
|
+
const cancel = document.createElement('button');
|
|
4427
|
+
cancel.type = 'button';
|
|
4428
|
+
cancel.className = 'ss-btn';
|
|
4429
|
+
cancel.textContent = t('cancel');
|
|
4430
|
+
const confirm = document.createElement('button');
|
|
4431
|
+
confirm.type = 'button';
|
|
4432
|
+
confirm.className = 'ss-btn primary';
|
|
4433
|
+
confirm.textContent = t('confirmClearNotifyAction');
|
|
4434
|
+
const dismiss = () => {
|
|
4435
|
+
confirmOpen = false;
|
|
4436
|
+
document.removeEventListener('keydown', onConfirmKey, true);
|
|
4437
|
+
overlay.remove();
|
|
4438
|
+
if (input && typeof input.focus === 'function') input.focus();
|
|
4439
|
+
};
|
|
4440
|
+
const onConfirmKey = (event) => {
|
|
4441
|
+
if (event.key !== 'Escape') return;
|
|
4442
|
+
event.preventDefault();
|
|
4443
|
+
event.stopPropagation();
|
|
4444
|
+
dismiss();
|
|
4445
|
+
};
|
|
4446
|
+
overlay.addEventListener('mousedown', (event) => {
|
|
4447
|
+
if (event.target === overlay) dismiss();
|
|
4448
|
+
});
|
|
4449
|
+
cancel.addEventListener('click', dismiss);
|
|
4450
|
+
confirm.addEventListener('click', () => {
|
|
4451
|
+
dismiss();
|
|
4452
|
+
clearNotifyLog();
|
|
4453
|
+
notify(t('quickJumpHistoryCleared'));
|
|
4454
|
+
});
|
|
4455
|
+
foot.append(cancel, confirm);
|
|
4456
|
+
modal.append(heading, body, foot);
|
|
4457
|
+
overlay.append(modal);
|
|
4458
|
+
document.body.append(overlay);
|
|
4459
|
+
confirmOpen = true;
|
|
4460
|
+
document.addEventListener('keydown', onConfirmKey, true);
|
|
4461
|
+
cancel.focus();
|
|
4462
|
+
}
|
|
4463
|
+
|
|
3544
4464
|
function copySessionId(sessionId) {
|
|
3545
4465
|
const id = String(sessionId ?? '');
|
|
3546
4466
|
if (!id) return;
|
|
@@ -3606,7 +4526,7 @@ function createQuickJump(bridge, t) {
|
|
|
3606
4526
|
},
|
|
3607
4527
|
},
|
|
3608
4528
|
{ kind: 'action', id: 'notify:read', label: t('quickJumpMarkRead'), run: () => { markNotifyLogRead(); notify(t('quickJumpMarkedRead')); } },
|
|
3609
|
-
{ kind: 'action', id: 'notify:clear', label: t('quickJumpClearHistory'), run: () =>
|
|
4529
|
+
{ kind: 'action', id: 'notify:clear', label: t('quickJumpClearHistory'), run: () => askClearNotifyHistory() },
|
|
3610
4530
|
{ kind: 'action', id: 'data:open', label: t('quickJumpOpenDataDir'), run: () => { void openDataDirectory(); } },
|
|
3611
4531
|
{ kind: 'action', id: 'refresh', label: t('quickJumpRefresh'), run: () => { void reload(true); } },
|
|
3612
4532
|
];
|
|
@@ -3780,7 +4700,7 @@ function createQuickJump(bridge, t) {
|
|
|
3780
4700
|
}
|
|
3781
4701
|
|
|
3782
4702
|
function onKeyDown(event) {
|
|
3783
|
-
if (!root) return;
|
|
4703
|
+
if (!root || confirmOpen) return;
|
|
3784
4704
|
if (event.key === 'Escape') {
|
|
3785
4705
|
event.preventDefault();
|
|
3786
4706
|
event.stopPropagation();
|
|
@@ -3972,7 +4892,7 @@ function createQuickJump(bridge, t) {
|
|
|
3972
4892
|
}
|
|
3973
4893
|
|
|
3974
4894
|
function MainPanel(props) {
|
|
3975
|
-
const { t, bridge } = props;
|
|
4895
|
+
const { t, bridge, getSessions } = props;
|
|
3976
4896
|
// Paint the last snapshot immediately (stale-while-revalidate) instead of an
|
|
3977
4897
|
// empty page: bootstrap decodes every session log on the host's first call.
|
|
3978
4898
|
const [boot, setBoot] = React.useState(() => readBootstrapCache());
|
|
@@ -4011,6 +4931,7 @@ function MainPanel(props) {
|
|
|
4011
4931
|
const [panelQuery, setPanelQuery] = React.useState('');
|
|
4012
4932
|
const [scopeFilter, setScopeFilter] = React.useState('all');
|
|
4013
4933
|
const [statusFilter, setStatusFilter] = React.useState('all');
|
|
4934
|
+
const [originFilter, setOriginFilter] = React.useState('all');
|
|
4014
4935
|
const [copiedId, setCopiedId] = React.useState(null);
|
|
4015
4936
|
const [othersOpen, setOthersOpen] = React.useState(false);
|
|
4016
4937
|
const [showBackTop, setShowBackTop] = React.useState(false);
|
|
@@ -4067,6 +4988,15 @@ function MainPanel(props) {
|
|
|
4067
4988
|
const pendingSoundGroupRef = React.useRef('normal');
|
|
4068
4989
|
const notifySaveTimerRef = React.useRef(null);
|
|
4069
4990
|
const [notifyLog, setNotifyLog] = React.useState(() => readNotifyLog());
|
|
4991
|
+
const [notifyVisible, setNotifyVisible] = React.useState(30);
|
|
4992
|
+
const notifyLogRef = React.useRef(null);
|
|
4993
|
+
const notifyActionsRef = React.useRef(null);
|
|
4994
|
+
const notifyLogLayoutRef = React.useRef({ firstId: null, scrollHeight: 0 });
|
|
4995
|
+
const notifyShown = Math.min(notifyVisible, notifyLog.length);
|
|
4996
|
+
const [notifyHint, setNotifyHint] = React.useState(null);
|
|
4997
|
+
const notifyHintTimerRef = React.useRef(null);
|
|
4998
|
+
const notifyHintKeyRef = React.useRef(0);
|
|
4999
|
+
const notifyLoadAtRef = React.useRef(0);
|
|
4070
5000
|
|
|
4071
5001
|
React.useEffect(() => {
|
|
4072
5002
|
const onLog = (event) => {
|
|
@@ -4084,6 +5014,94 @@ function MainPanel(props) {
|
|
|
4084
5014
|
};
|
|
4085
5015
|
}, []);
|
|
4086
5016
|
|
|
5017
|
+
React.useEffect(() => {
|
|
5018
|
+
const el = notifyLogRef.current;
|
|
5019
|
+
const prev = notifyLogLayoutRef.current;
|
|
5020
|
+
const firstId = notifyLog.length > 0 ? notifyLog[0].id : null;
|
|
5021
|
+
if (!el) {
|
|
5022
|
+
notifyLogLayoutRef.current = { firstId, scrollHeight: 0 };
|
|
5023
|
+
return;
|
|
5024
|
+
}
|
|
5025
|
+
if (prev.firstId !== null && prev.scrollHeight > 0 && firstId !== prev.firstId && el.scrollTop > 0) {
|
|
5026
|
+
el.scrollTop += el.scrollHeight - prev.scrollHeight;
|
|
5027
|
+
}
|
|
5028
|
+
notifyLogLayoutRef.current = { firstId, scrollHeight: el.scrollHeight };
|
|
5029
|
+
}, [notifyLog, notifyVisible]);
|
|
5030
|
+
|
|
5031
|
+
React.useEffect(() => {
|
|
5032
|
+
const logEl = notifyLogRef.current;
|
|
5033
|
+
const actionsEl = notifyActionsRef.current;
|
|
5034
|
+
if (!logEl || !actionsEl) return undefined;
|
|
5035
|
+
const sync = () => {
|
|
5036
|
+
const row = logEl.querySelector('.ss-notifylogrow');
|
|
5037
|
+
if (!row) {
|
|
5038
|
+
actionsEl.style.paddingRight = '';
|
|
5039
|
+
return;
|
|
5040
|
+
}
|
|
5041
|
+
const delta = actionsEl.getBoundingClientRect().right - row.getBoundingClientRect().right;
|
|
5042
|
+
actionsEl.style.paddingRight = delta > 0 ? `${Math.round(delta)}px` : '';
|
|
5043
|
+
};
|
|
5044
|
+
sync();
|
|
5045
|
+
const delays = [0, 60, 180, 400, 800].map((ms) => setTimeout(sync, ms));
|
|
5046
|
+
const interval = setInterval(sync, 250);
|
|
5047
|
+
const stopInterval = setTimeout(() => clearInterval(interval), 3000);
|
|
5048
|
+
let frame = 0;
|
|
5049
|
+
if (typeof window !== 'undefined' && typeof window.requestAnimationFrame === 'function') {
|
|
5050
|
+
frame = window.requestAnimationFrame(sync);
|
|
5051
|
+
}
|
|
5052
|
+
let observer = null;
|
|
5053
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
5054
|
+
observer = new ResizeObserver(sync);
|
|
5055
|
+
observer.observe(logEl);
|
|
5056
|
+
}
|
|
5057
|
+
logEl.addEventListener('scroll', sync, { passive: true });
|
|
5058
|
+
window.addEventListener('resize', sync);
|
|
5059
|
+
return () => {
|
|
5060
|
+
delays.forEach((id) => clearTimeout(id));
|
|
5061
|
+
clearInterval(interval);
|
|
5062
|
+
clearTimeout(stopInterval);
|
|
5063
|
+
if (frame) window.cancelAnimationFrame(frame);
|
|
5064
|
+
if (observer) observer.disconnect();
|
|
5065
|
+
logEl.removeEventListener('scroll', sync);
|
|
5066
|
+
window.removeEventListener('resize', sync);
|
|
5067
|
+
};
|
|
5068
|
+
}, [notifyLog, notifyVisible, tab]);
|
|
5069
|
+
|
|
5070
|
+
React.useEffect(
|
|
5071
|
+
() => () => {
|
|
5072
|
+
if (notifyHintTimerRef.current) clearTimeout(notifyHintTimerRef.current);
|
|
5073
|
+
},
|
|
5074
|
+
[],
|
|
5075
|
+
);
|
|
5076
|
+
|
|
5077
|
+
const showNotifyHint = (text) => {
|
|
5078
|
+
if (notifyHintTimerRef.current) clearTimeout(notifyHintTimerRef.current);
|
|
5079
|
+
notifyHintKeyRef.current += 1;
|
|
5080
|
+
setNotifyHint({ text, key: notifyHintKeyRef.current });
|
|
5081
|
+
notifyHintTimerRef.current = setTimeout(() => {
|
|
5082
|
+
notifyHintTimerRef.current = null;
|
|
5083
|
+
setNotifyHint(null);
|
|
5084
|
+
}, 1600);
|
|
5085
|
+
};
|
|
5086
|
+
|
|
5087
|
+
const loadMoreNotify = () => {
|
|
5088
|
+
if (notifyShown >= notifyLog.length) return;
|
|
5089
|
+
const now = Date.now();
|
|
5090
|
+
if (now - notifyLoadAtRef.current < 250) return;
|
|
5091
|
+
notifyLoadAtRef.current = now;
|
|
5092
|
+
const next = Math.min(notifyShown + 30, notifyLog.length);
|
|
5093
|
+
setNotifyVisible(next);
|
|
5094
|
+
showNotifyHint(
|
|
5095
|
+
next >= notifyLog.length ? t('notifyLoadedAll') : t('notifyLoadedN').replace('{n}', String(next - notifyShown)),
|
|
5096
|
+
);
|
|
5097
|
+
};
|
|
5098
|
+
|
|
5099
|
+
const handleNotifyScroll = (event) => {
|
|
5100
|
+
const el = event.currentTarget;
|
|
5101
|
+
if (!el) return;
|
|
5102
|
+
if (el.scrollTop + el.clientHeight >= el.scrollHeight - 40) loadMoreNotify();
|
|
5103
|
+
};
|
|
5104
|
+
|
|
4087
5105
|
React.useEffect(() => {
|
|
4088
5106
|
if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') return undefined;
|
|
4089
5107
|
const onSettings = (event) => {
|
|
@@ -4124,52 +5142,246 @@ function MainPanel(props) {
|
|
|
4124
5142
|
writeUiPrefs({ sessionStatusFilter });
|
|
4125
5143
|
}, [sessionStatusFilter]);
|
|
4126
5144
|
|
|
5145
|
+
// Live sync: the DSH client already owns the session catalog, so re-running
|
|
5146
|
+
// the full bootstrap every 8 seconds is unnecessary. Subscribe to the
|
|
5147
|
+
// catalog, patch running/title immediately, and ask the host for the
|
|
5148
|
+
// expensive per-session details (size, message count) only for rows that
|
|
5149
|
+
// changed. A slow reconcile keeps this correct if an event is ever missed,
|
|
5150
|
+
// and deployments without the catalog keep the old visible poll.
|
|
4127
5151
|
React.useEffect(() => {
|
|
4128
5152
|
let alive = true;
|
|
4129
|
-
let
|
|
5153
|
+
let pollTimer = null;
|
|
5154
|
+
let loadTimer = null;
|
|
5155
|
+
let detailTimer = null;
|
|
5156
|
+
let unsubscribe = null;
|
|
5157
|
+
let live = false;
|
|
5158
|
+
let latestSnapshot = null;
|
|
5159
|
+
const detailAt = new Map();
|
|
5160
|
+
const detailQueue = new Set();
|
|
5161
|
+
|
|
4130
5162
|
const load = async () => {
|
|
4131
5163
|
try {
|
|
4132
5164
|
const value = await loadBootstrap(bridge, { force: true });
|
|
4133
5165
|
if (!alive) return;
|
|
4134
5166
|
const json = JSON.stringify(value);
|
|
4135
|
-
// Only re-render when the snapshot actually changed:
|
|
4136
|
-
// not
|
|
5167
|
+
// Only re-render when the snapshot actually changed: an idle page must
|
|
5168
|
+
// not repaint on every reconcile tick.
|
|
4137
5169
|
if (json !== bootJsonRef.current) {
|
|
4138
5170
|
bootJsonRef.current = json;
|
|
4139
5171
|
setBoot(value);
|
|
4140
5172
|
setHidden(new Set(value?.state?.hiddenPanels ?? []));
|
|
4141
5173
|
}
|
|
4142
5174
|
setLoadError(null);
|
|
5175
|
+
return value;
|
|
4143
5176
|
} catch (error) {
|
|
4144
5177
|
if (alive) setLoadError(error?.message || String(error));
|
|
5178
|
+
return null;
|
|
4145
5179
|
}
|
|
4146
5180
|
};
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
5181
|
+
|
|
5182
|
+
const readCatalog = () => {
|
|
5183
|
+
try {
|
|
5184
|
+
const sessions = typeof getSessions === 'function' ? getSessions() : null;
|
|
5185
|
+
const list = sessions && sessions.list;
|
|
5186
|
+
if (!list || typeof list.getSnapshot !== 'function' || typeof list.subscribe !== 'function') return null;
|
|
5187
|
+
return list;
|
|
5188
|
+
} catch (error) {
|
|
5189
|
+
return null;
|
|
5190
|
+
}
|
|
4151
5191
|
};
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
5192
|
+
|
|
5193
|
+
const applyCatalog = (snapshot) => {
|
|
5194
|
+
if (!snapshot || !snapshot.byId) return;
|
|
5195
|
+
setBoot((prev) => {
|
|
5196
|
+
if (!prev) return prev;
|
|
5197
|
+
let changed = false;
|
|
5198
|
+
const workspaces = (prev.workspaces || []).map((workspace) => {
|
|
5199
|
+
let sessionsChanged = false;
|
|
5200
|
+
const sessions = (workspace.sessions || []).map((session) => {
|
|
5201
|
+
const summary = snapshot.byId[session.id];
|
|
5202
|
+
if (!summary) return session;
|
|
5203
|
+
const running = Boolean(summary.running);
|
|
5204
|
+
const title = typeof summary.title === 'string' && summary.title ? summary.title : session.title;
|
|
5205
|
+
if (running === session.running && title === session.title) return session;
|
|
5206
|
+
sessionsChanged = true;
|
|
5207
|
+
changed = true;
|
|
5208
|
+
return { ...session, running, title };
|
|
5209
|
+
});
|
|
5210
|
+
return sessionsChanged ? { ...workspace, sessions } : workspace;
|
|
5211
|
+
});
|
|
5212
|
+
return changed ? { ...prev, workspaces } : prev;
|
|
5213
|
+
});
|
|
5214
|
+
};
|
|
5215
|
+
|
|
5216
|
+
const applyDetails = (rows) => {
|
|
5217
|
+
if (!Array.isArray(rows) || rows.length === 0) return;
|
|
5218
|
+
const byId = new Map();
|
|
5219
|
+
for (const row of rows) {
|
|
5220
|
+
if (row && typeof row.id === 'string') byId.set(row.id, row);
|
|
4156
5221
|
}
|
|
5222
|
+
if (byId.size === 0) return;
|
|
5223
|
+
setBoot((prev) => {
|
|
5224
|
+
if (!prev) return prev;
|
|
5225
|
+
let changed = false;
|
|
5226
|
+
const workspaces = (prev.workspaces || []).map((workspace) => {
|
|
5227
|
+
let sessionsChanged = false;
|
|
5228
|
+
const sessions = (workspace.sessions || []).map((session) => {
|
|
5229
|
+
const detail = byId.get(session.id);
|
|
5230
|
+
if (!detail) return session;
|
|
5231
|
+
const summary = latestSnapshot && latestSnapshot.byId ? latestSnapshot.byId[session.id] : null;
|
|
5232
|
+
sessionsChanged = true;
|
|
5233
|
+
changed = true;
|
|
5234
|
+
return {
|
|
5235
|
+
...session,
|
|
5236
|
+
...detail,
|
|
5237
|
+
running: summary ? Boolean(summary.running) : Boolean(detail.running),
|
|
5238
|
+
};
|
|
5239
|
+
});
|
|
5240
|
+
return sessionsChanged ? { ...workspace, sessions } : workspace;
|
|
5241
|
+
});
|
|
5242
|
+
if (!changed) return prev;
|
|
5243
|
+
const next = { ...prev, workspaces };
|
|
5244
|
+
bootJsonRef.current = JSON.stringify(next);
|
|
5245
|
+
return next;
|
|
5246
|
+
});
|
|
4157
5247
|
};
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
5248
|
+
|
|
5249
|
+
const flushDetails = () => {
|
|
5250
|
+
detailTimer = null;
|
|
5251
|
+
const ids = [...detailQueue];
|
|
5252
|
+
detailQueue.clear();
|
|
5253
|
+
if (!alive || ids.length === 0) return;
|
|
5254
|
+
void (async () => {
|
|
5255
|
+
try {
|
|
5256
|
+
const value = await bridge.api('sessionDetails', { sessionIds: ids });
|
|
5257
|
+
if (!alive) return;
|
|
5258
|
+
applyDetails(value?.sessions ?? []);
|
|
5259
|
+
const now = Date.now();
|
|
5260
|
+
for (const id of ids) detailAt.set(id, now);
|
|
5261
|
+
} catch (error) {
|
|
5262
|
+
// Detail refresh is best effort; the reconcile pass retries later.
|
|
5263
|
+
}
|
|
5264
|
+
})();
|
|
5265
|
+
};
|
|
5266
|
+
|
|
5267
|
+
const queueDetail = (id, running) => {
|
|
5268
|
+
const now = Date.now();
|
|
5269
|
+
const last = detailAt.get(id) || 0;
|
|
5270
|
+
// Running sessions change constantly; 15s is enough to keep their size
|
|
5271
|
+
// and message count fresh without re-reading a growing log per event.
|
|
5272
|
+
if (now - last < (running ? 15000 : 2000)) return;
|
|
5273
|
+
detailAt.set(id, now);
|
|
5274
|
+
detailQueue.add(id);
|
|
5275
|
+
if (!detailTimer) detailTimer = setTimeout(flushDetails, 700);
|
|
5276
|
+
};
|
|
5277
|
+
|
|
5278
|
+
const scheduleLoad = () => {
|
|
5279
|
+
if (loadTimer) return;
|
|
5280
|
+
loadTimer = setTimeout(() => {
|
|
5281
|
+
loadTimer = null;
|
|
5282
|
+
void load();
|
|
5283
|
+
}, 1200);
|
|
5284
|
+
};
|
|
5285
|
+
|
|
5286
|
+
const handleCatalog = () => {
|
|
5287
|
+
if (!alive) return;
|
|
5288
|
+
if (typeof document !== 'undefined' && document.hidden) return;
|
|
5289
|
+
const list = readCatalog();
|
|
5290
|
+
if (!list) return;
|
|
5291
|
+
const snapshot = list.getSnapshot();
|
|
5292
|
+
const previous = latestSnapshot;
|
|
5293
|
+
latestSnapshot = snapshot;
|
|
5294
|
+
if (!snapshot || !Array.isArray(snapshot.ids) || !snapshot.byId) return;
|
|
5295
|
+
if (!previous || !Array.isArray(previous.ids) || !previous.byId) {
|
|
5296
|
+
scheduleLoad();
|
|
5297
|
+
return;
|
|
5298
|
+
}
|
|
5299
|
+
const previousIds = new Set(previous.ids);
|
|
5300
|
+
const ids = new Set(snapshot.ids);
|
|
5301
|
+
let structural = ids.size !== previousIds.size;
|
|
5302
|
+
if (!structural) {
|
|
5303
|
+
for (const id of ids) {
|
|
5304
|
+
if (!previousIds.has(id)) {
|
|
5305
|
+
structural = true;
|
|
5306
|
+
break;
|
|
5307
|
+
}
|
|
5308
|
+
}
|
|
5309
|
+
}
|
|
5310
|
+
// Added/removed sessions need the bootstrap (workspace and trash data);
|
|
5311
|
+
// in-place changes are patched from the catalog directly.
|
|
5312
|
+
if (structural) {
|
|
5313
|
+
scheduleLoad();
|
|
5314
|
+
return;
|
|
5315
|
+
}
|
|
5316
|
+
let rowChanged = false;
|
|
5317
|
+
for (const id of ids) {
|
|
5318
|
+
const before = previous.byId[id];
|
|
5319
|
+
const now = snapshot.byId[id];
|
|
5320
|
+
if (!now) continue;
|
|
5321
|
+
if (!before || before.running !== now.running) {
|
|
5322
|
+
rowChanged = true;
|
|
5323
|
+
queueDetail(id, Boolean(now.running));
|
|
5324
|
+
} else if (before.updatedAt !== now.updatedAt || before.title !== now.title) {
|
|
5325
|
+
queueDetail(id, Boolean(now.running));
|
|
5326
|
+
}
|
|
5327
|
+
}
|
|
5328
|
+
if (rowChanged) applyCatalog(snapshot);
|
|
5329
|
+
};
|
|
5330
|
+
|
|
5331
|
+
const startPolling = (interval) => {
|
|
5332
|
+
if (pollTimer) clearInterval(pollTimer);
|
|
5333
|
+
pollTimer = setInterval(() => {
|
|
5334
|
+
if (typeof document !== 'undefined' && document.hidden) return;
|
|
5335
|
+
if (!live && tryLive()) startPolling(300000);
|
|
5336
|
+
void load();
|
|
5337
|
+
}, interval);
|
|
5338
|
+
};
|
|
5339
|
+
|
|
5340
|
+
const tryLive = () => {
|
|
5341
|
+
const list = readCatalog();
|
|
5342
|
+
if (!list) return false;
|
|
5343
|
+
try {
|
|
5344
|
+
latestSnapshot = list.getSnapshot();
|
|
5345
|
+
unsubscribe = list.subscribe(handleCatalog);
|
|
5346
|
+
} catch (error) {
|
|
5347
|
+
unsubscribe = null;
|
|
5348
|
+
return false;
|
|
5349
|
+
}
|
|
5350
|
+
live = true;
|
|
5351
|
+
return true;
|
|
5352
|
+
};
|
|
5353
|
+
|
|
5354
|
+
// With a live catalog the fallback poll only reconciles rare drift; without
|
|
5355
|
+
// it the plugin keeps the old visible-only poll.
|
|
5356
|
+
if (tryLive()) startPolling(300000);
|
|
5357
|
+
else startPolling(60000);
|
|
5358
|
+
void load();
|
|
5359
|
+
|
|
5360
|
+
const onVisibility = () => {
|
|
5361
|
+
if (typeof document !== 'undefined' && document.hidden) return;
|
|
5362
|
+
if (!live) tryLive();
|
|
5363
|
+
const list = readCatalog();
|
|
5364
|
+
if (list) latestSnapshot = list.getSnapshot();
|
|
5365
|
+
void load();
|
|
4163
5366
|
};
|
|
4164
|
-
sync();
|
|
4165
5367
|
if (typeof document !== 'undefined' && document.addEventListener) {
|
|
4166
|
-
document.addEventListener('visibilitychange',
|
|
5368
|
+
document.addEventListener('visibilitychange', onVisibility);
|
|
4167
5369
|
}
|
|
5370
|
+
|
|
4168
5371
|
return () => {
|
|
4169
5372
|
alive = false;
|
|
4170
|
-
|
|
5373
|
+
if (unsubscribe) {
|
|
5374
|
+
try {
|
|
5375
|
+
unsubscribe();
|
|
5376
|
+
} catch (error) {
|
|
5377
|
+
/* dispose is best effort */
|
|
5378
|
+
}
|
|
5379
|
+
}
|
|
5380
|
+
if (pollTimer) clearInterval(pollTimer);
|
|
5381
|
+
if (loadTimer) clearTimeout(loadTimer);
|
|
5382
|
+
if (detailTimer) clearTimeout(detailTimer);
|
|
4171
5383
|
if (typeof document !== 'undefined' && document.removeEventListener) {
|
|
4172
|
-
document.removeEventListener('visibilitychange',
|
|
5384
|
+
document.removeEventListener('visibilitychange', onVisibility);
|
|
4173
5385
|
}
|
|
4174
5386
|
};
|
|
4175
5387
|
}, [reloadKey]);
|
|
@@ -4245,6 +5457,8 @@ function MainPanel(props) {
|
|
|
4245
5457
|
|
|
4246
5458
|
const settings = boot?.state?.settings ?? { deleteMode: 'trash', confirmPurge: true };
|
|
4247
5459
|
const deleteMode = settings.deleteMode === 'delete' ? 'delete' : 'trash';
|
|
5460
|
+
const rowPreviewPref = settings.rowPreview ?? { enabled: true, delay: 400 };
|
|
5461
|
+
const rowPreviewEnabled = rowPreviewPref.enabled !== false;
|
|
4248
5462
|
|
|
4249
5463
|
const sessions = React.useMemo(() => {
|
|
4250
5464
|
const out = [];
|
|
@@ -4361,9 +5575,9 @@ function MainPanel(props) {
|
|
|
4361
5575
|
const value = await bridge.api('setHiddenPanels', { hiddenPanels: [...next] });
|
|
4362
5576
|
setBoot((prev) => (prev ? { ...prev, state: { ...prev.state, hiddenPanels: [...next] } } : prev));
|
|
4363
5577
|
if (value?.state) setHidden(new Set(value.state.hiddenPanels ?? []));
|
|
4364
|
-
|
|
5578
|
+
showActionNote(null, t('panelsSaved'));
|
|
4365
5579
|
} catch (error) {
|
|
4366
|
-
|
|
5580
|
+
showActionNote(null, error?.message || String(error), true);
|
|
4367
5581
|
refresh();
|
|
4368
5582
|
}
|
|
4369
5583
|
};
|
|
@@ -4381,6 +5595,21 @@ function MainPanel(props) {
|
|
|
4381
5595
|
}
|
|
4382
5596
|
};
|
|
4383
5597
|
|
|
5598
|
+
// 插件页的操作反馈统一走顶部居中的 operation note(与设置页一致):
|
|
5599
|
+
// 顶部正中缓慢下移、停留 3 秒、再淡出,而不是窗口底部的 toast。
|
|
5600
|
+
const runNote = async (work) => {
|
|
5601
|
+
setBusy(true);
|
|
5602
|
+
try {
|
|
5603
|
+
const text = await work();
|
|
5604
|
+
if (text) showActionNote(null, text);
|
|
5605
|
+
refresh();
|
|
5606
|
+
} catch (error) {
|
|
5607
|
+
showActionNote(null, error?.message || String(error), true);
|
|
5608
|
+
} finally {
|
|
5609
|
+
setBusy(false);
|
|
5610
|
+
}
|
|
5611
|
+
};
|
|
5612
|
+
|
|
4384
5613
|
const deleteSessionsFromList = (ids) => {
|
|
4385
5614
|
const mode = settings.deleteMode === 'delete' ? 'delete' : 'trash';
|
|
4386
5615
|
const rows = sessions.filter((session) => ids.includes(session.id));
|
|
@@ -4418,6 +5647,7 @@ function MainPanel(props) {
|
|
|
4418
5647
|
}
|
|
4419
5648
|
setOutcome({
|
|
4420
5649
|
title: t('deleteFailedTitle'),
|
|
5650
|
+
icon: AlertIcon,
|
|
4421
5651
|
body: t('deletePartial')
|
|
4422
5652
|
.replace('{ok}', String(done.length))
|
|
4423
5653
|
.replace('{fail}', String(errors.length)),
|
|
@@ -4438,6 +5668,7 @@ function MainPanel(props) {
|
|
|
4438
5668
|
}
|
|
4439
5669
|
setConfirm({
|
|
4440
5670
|
title: t('confirmTrashTitle'),
|
|
5671
|
+
icon: TrashIcon,
|
|
4441
5672
|
body: t('confirmTrashBody')
|
|
4442
5673
|
.replace('{n}', String(rows.length || ids.length))
|
|
4443
5674
|
.replace('{size}', fmtBytes(size)),
|
|
@@ -4461,6 +5692,7 @@ function MainPanel(props) {
|
|
|
4461
5692
|
if (errors.length > 0) {
|
|
4462
5693
|
setOutcome({
|
|
4463
5694
|
title: t('deleteFailedTitle'),
|
|
5695
|
+
icon: AlertIcon,
|
|
4464
5696
|
body: t('deletePartial')
|
|
4465
5697
|
.replace('{ok}', String(done.length))
|
|
4466
5698
|
.replace('{fail}', String(errors.length)),
|
|
@@ -4477,6 +5709,7 @@ function MainPanel(props) {
|
|
|
4477
5709
|
}
|
|
4478
5710
|
setConfirm({
|
|
4479
5711
|
title: t('confirmDeleteTitle'),
|
|
5712
|
+
icon: TrashIcon,
|
|
4480
5713
|
body: t('confirmDeleteBody')
|
|
4481
5714
|
.replace('{n}', String(rows.length || ids.length))
|
|
4482
5715
|
.replace('{size}', fmtBytes(size)),
|
|
@@ -4582,6 +5815,7 @@ function MainPanel(props) {
|
|
|
4582
5815
|
if (errors.length > 0) {
|
|
4583
5816
|
setOutcome({
|
|
4584
5817
|
title: t('purgeFailedTitle'),
|
|
5818
|
+
icon: AlertIcon,
|
|
4585
5819
|
body: t('purgePartial').replace('{ok}', String(done)).replace('{fail}', String(errors.length)),
|
|
4586
5820
|
details: describeSessionErrors(errors, nameById),
|
|
4587
5821
|
});
|
|
@@ -4595,6 +5829,7 @@ function MainPanel(props) {
|
|
|
4595
5829
|
}
|
|
4596
5830
|
setConfirm({
|
|
4597
5831
|
title: t('confirmPurgeTitle'),
|
|
5832
|
+
icon: TrashIcon,
|
|
4598
5833
|
body: t('confirmPurgeBody').replace('{n}', String(rows.length)).replace('{size}', fmtBytes(size)),
|
|
4599
5834
|
details,
|
|
4600
5835
|
preview,
|
|
@@ -4628,6 +5863,7 @@ function MainPanel(props) {
|
|
|
4628
5863
|
if (errors.length > 0) {
|
|
4629
5864
|
setOutcome({
|
|
4630
5865
|
title: t('purgeFailedTitle'),
|
|
5866
|
+
icon: AlertIcon,
|
|
4631
5867
|
body: t('purgePartial').replace('{ok}', String(done)).replace('{fail}', String(errors.length)),
|
|
4632
5868
|
details: describeSessionErrors(errors, nameById),
|
|
4633
5869
|
});
|
|
@@ -4641,6 +5877,7 @@ function MainPanel(props) {
|
|
|
4641
5877
|
}
|
|
4642
5878
|
setConfirm({
|
|
4643
5879
|
title: t('confirmEmptyTitle'),
|
|
5880
|
+
icon: TrashIcon,
|
|
4644
5881
|
body: t('confirmEmptyBody').replace('{n}', String(trash.length)).replace('{size}', fmtBytes(trashSize)),
|
|
4645
5882
|
details,
|
|
4646
5883
|
preview,
|
|
@@ -4661,6 +5898,7 @@ function MainPanel(props) {
|
|
|
4661
5898
|
if (errors.length > 0) {
|
|
4662
5899
|
setOutcome({
|
|
4663
5900
|
title: t('deleteFailedTitle'),
|
|
5901
|
+
icon: AlertIcon,
|
|
4664
5902
|
body: t('cleanPartial').replace('{ok}', String(done.length)).replace('{fail}', String(errors.length)),
|
|
4665
5903
|
details: describeSessionErrors(errors, nameById),
|
|
4666
5904
|
});
|
|
@@ -4699,6 +5937,7 @@ function MainPanel(props) {
|
|
|
4699
5937
|
}
|
|
4700
5938
|
setConfirm({
|
|
4701
5939
|
title: t('cleanBlankConfirmTitle'),
|
|
5940
|
+
icon: TrashIcon,
|
|
4702
5941
|
body: t('cleanBlankConfirmBody')
|
|
4703
5942
|
.replace('{n}', String(blankSessions.length))
|
|
4704
5943
|
.replace('{size}', fmtBytes(size)),
|
|
@@ -4943,9 +6182,15 @@ function MainPanel(props) {
|
|
|
4943
6182
|
|
|
4944
6183
|
const workspaceIds = (workspace) => (workspace.sessions ?? []).map((session) => session.id);
|
|
4945
6184
|
|
|
4946
|
-
const renderSessionRow = (session) => {
|
|
6185
|
+
const renderSessionRow = (session, groupTitle = '') => {
|
|
4947
6186
|
const checked = selected.has(session.id);
|
|
4948
6187
|
const isArchived = Boolean(session.archived);
|
|
6188
|
+
const previewActions = [
|
|
6189
|
+
t('open'),
|
|
6190
|
+
isArchived ? t('unarchive') : t('archive'),
|
|
6191
|
+
listDeleteLabel,
|
|
6192
|
+
t('exportAction'),
|
|
6193
|
+
].join(' / ');
|
|
4949
6194
|
return React.createElement(
|
|
4950
6195
|
'div',
|
|
4951
6196
|
{ key: session.id, className: cx('ss-row', checked && 'selected') },
|
|
@@ -4958,36 +6203,27 @@ function MainPanel(props) {
|
|
|
4958
6203
|
}),
|
|
4959
6204
|
React.createElement(
|
|
4960
6205
|
'div',
|
|
4961
|
-
{
|
|
6206
|
+
{
|
|
6207
|
+
className: 'ss-rowmain',
|
|
6208
|
+
onMouseEnter: rowPreviewEnabled
|
|
6209
|
+
? (event) => scheduleRowPreview(event, session, t, groupTitle, previewActions, rowPreviewPref.delay)
|
|
6210
|
+
: undefined,
|
|
6211
|
+
onMouseMove: moveRowPreview,
|
|
6212
|
+
onMouseLeave: hideRowPreview,
|
|
6213
|
+
},
|
|
4962
6214
|
React.createElement(
|
|
4963
|
-
|
|
6215
|
+
'button',
|
|
4964
6216
|
{
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
`${t('sessionActionLabel')}${t('openSessionHint')}`,
|
|
4969
|
-
]
|
|
4970
|
-
.filter(Boolean)
|
|
4971
|
-
.join('\n'),
|
|
6217
|
+
type: 'button',
|
|
6218
|
+
className: 'ss-rowtitle',
|
|
6219
|
+
onClick: () => openSessionSafe(session.id),
|
|
4972
6220
|
},
|
|
4973
|
-
|
|
4974
|
-
'button',
|
|
4975
|
-
{
|
|
4976
|
-
type: 'button',
|
|
4977
|
-
className: 'ss-rowtitle',
|
|
4978
|
-
onClick: () => openSessionSafe(session.id),
|
|
4979
|
-
},
|
|
4980
|
-
session.title || session.id,
|
|
4981
|
-
),
|
|
6221
|
+
session.title || session.id,
|
|
4982
6222
|
),
|
|
4983
6223
|
React.createElement(
|
|
4984
6224
|
'div',
|
|
4985
6225
|
{ className: 'ss-rowmeta' },
|
|
4986
|
-
React.createElement(
|
|
4987
|
-
Tip,
|
|
4988
|
-
{ text: fmtDate(session.updatedAt) },
|
|
4989
|
-
React.createElement('span', null, fmtWhen(session.updatedAt)),
|
|
4990
|
-
),
|
|
6226
|
+
React.createElement('span', null, fmtWhen(session.updatedAt)),
|
|
4991
6227
|
React.createElement('span', null, t('messagesN').replace('{n}', String(session.messageCount ?? 0))),
|
|
4992
6228
|
React.createElement('span', null, fmtBytes(session.sizeBytes)),
|
|
4993
6229
|
session.running ? React.createElement('span', { className: 'ss-badge running' }, t('running')) : null,
|
|
@@ -5246,10 +6482,11 @@ function MainPanel(props) {
|
|
|
5246
6482
|
: React.createElement(
|
|
5247
6483
|
React.Fragment,
|
|
5248
6484
|
null,
|
|
5249
|
-
|
|
5250
|
-
|
|
6485
|
+
t('total')
|
|
6486
|
+
.replace('{n}', String(sessions.length))
|
|
6487
|
+
.replace('{size}', fmtBytes(totalSize)),
|
|
5251
6488
|
blankSessions.length > 0
|
|
5252
|
-
? React.createElement('span', null, t('blank') + ' ' + String(blankSessions.length))
|
|
6489
|
+
? React.createElement('span', null, '· ' + t('blank') + ' ' + String(blankSessions.length))
|
|
5253
6490
|
: null,
|
|
5254
6491
|
),
|
|
5255
6492
|
),
|
|
@@ -5350,7 +6587,7 @@ function MainPanel(props) {
|
|
|
5350
6587
|
else if (event.currentTarget.style) event.currentTarget.style.height = '';
|
|
5351
6588
|
},
|
|
5352
6589
|
},
|
|
5353
|
-
group.sessions.map(renderSessionRow),
|
|
6590
|
+
group.sessions.map((session) => renderSessionRow(session, group.title)),
|
|
5354
6591
|
);
|
|
5355
6592
|
})(),
|
|
5356
6593
|
),
|
|
@@ -5362,12 +6599,12 @@ function MainPanel(props) {
|
|
|
5362
6599
|
React.createElement(
|
|
5363
6600
|
'div',
|
|
5364
6601
|
null,
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
6602
|
+
trash.length > 0
|
|
6603
|
+
? React.createElement(
|
|
6604
|
+
'div',
|
|
6605
|
+
{ className: 'ss-toolbar' },
|
|
6606
|
+
React.createElement('span', { className: 'ss-kpis' }, t('total').replace('{n}', String(trash.length)).replace('{size}', fmtBytes(trashSize))),
|
|
6607
|
+
React.createElement(
|
|
5371
6608
|
'button',
|
|
5372
6609
|
{
|
|
5373
6610
|
type: 'button',
|
|
@@ -5383,20 +6620,20 @@ function MainPanel(props) {
|
|
|
5383
6620
|
},
|
|
5384
6621
|
},
|
|
5385
6622
|
trash.every((entry) => selected.has(entry.sessionId)) ? t('clearAll') : t('selectAll'),
|
|
5386
|
-
)
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
6623
|
+
),
|
|
6624
|
+
React.createElement(
|
|
6625
|
+
'button',
|
|
6626
|
+
{
|
|
6627
|
+
type: 'button',
|
|
6628
|
+
className: 'ss-btn danger',
|
|
6629
|
+
disabled: busy,
|
|
6630
|
+
onClick: emptyTrash,
|
|
6631
|
+
style: { marginLeft: 'auto' },
|
|
6632
|
+
},
|
|
6633
|
+
t('emptyTrash'),
|
|
6634
|
+
),
|
|
6635
|
+
)
|
|
6636
|
+
: null,
|
|
5400
6637
|
React.createElement('div', { className: 'ss-hint', style: { marginBottom: 12 } }, t('trashHint')),
|
|
5401
6638
|
trash.length === 0
|
|
5402
6639
|
? React.createElement(
|
|
@@ -5526,6 +6763,19 @@ function MainPanel(props) {
|
|
|
5526
6763
|
return statusFilter === 'enabled' ? enabled : !enabled;
|
|
5527
6764
|
};
|
|
5528
6765
|
|
|
6766
|
+
const originKeyOf = (item) => {
|
|
6767
|
+
if (!item) return 'builtin';
|
|
6768
|
+
if (item.readOnlyReason === 'preset-managed') return 'preset';
|
|
6769
|
+
if (isHostBundle(item)) return 'builtin';
|
|
6770
|
+
if (item.official === true) return 'official';
|
|
6771
|
+
if (/^@deepseek-ai\//i.test(String(item.moduleName || ''))) return 'official';
|
|
6772
|
+
if (item.source && /^link:|^file:|^\.\.?[\\/]|^[a-z]:[\\/]/i.test(item.source)) return 'local';
|
|
6773
|
+
if (Array.isArray(item.presets) && item.presets.length > 0) return 'preset';
|
|
6774
|
+
return 'thirdparty';
|
|
6775
|
+
};
|
|
6776
|
+
|
|
6777
|
+
const originMatches = (item) => originFilter === 'all' || originKeyOf(item) === originFilter;
|
|
6778
|
+
|
|
5529
6779
|
const scopeDetail = (item) => {
|
|
5530
6780
|
const scopes = scopesOf(item);
|
|
5531
6781
|
if (scopes.indexOf('global') !== -1 && scopes.indexOf('session') !== -1) return t('scopeAll');
|
|
@@ -5554,11 +6804,90 @@ function MainPanel(props) {
|
|
|
5554
6804
|
|
|
5555
6805
|
const panelOrigin = (item) => {
|
|
5556
6806
|
if (!item) return t('panelBuiltin');
|
|
6807
|
+
// Rows an Agent preset contributes and the plugin manager does not own.
|
|
6808
|
+
if (item.readOnlyReason === 'preset-managed') return t('panelPreset');
|
|
6809
|
+
// Supplied by the DSH installation itself.
|
|
6810
|
+
if (isHostBundle(item)) return t('panelBuiltin');
|
|
6811
|
+
// Shipped optional bundles and the official on-demand catalog.
|
|
5557
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');
|
|
5558
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');
|
|
5559
6817
|
return t('panelThirdParty');
|
|
5560
6818
|
};
|
|
5561
6819
|
|
|
6820
|
+
// Bundles the installation itself ships (core tools, services and built-in
|
|
6821
|
+
// panels) all carry the DSH version; that is their real version, so it stays
|
|
6822
|
+
// under the name while the origin/compatibility chips live on the right.
|
|
6823
|
+
const isHostBundle = (item) => Boolean(item && item.availability === 'installation');
|
|
6824
|
+
|
|
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
|
+
const compatInfo = (panelId, item) => {
|
|
6845
|
+
const own = panelId === PANEL_ID || (item && item.bundle === 'dsh-keeper-plugin');
|
|
6846
|
+
if (own) {
|
|
6847
|
+
const state = compatibilityState(boot);
|
|
6848
|
+
const tone = state.satisfied === true ? 'on' : state.satisfied === false ? 'failed' : 'warn';
|
|
6849
|
+
return { text: compatibilityLabel(boot, t), reason: compatibilityReasonLabel(boot, t), tone, range: state.range || '' };
|
|
6850
|
+
}
|
|
6851
|
+
if (!item || isHostBundle(item)) {
|
|
6852
|
+
return { text: t('compatOk'), reason: t('compatHostHint'), tone: 'on', range: '' };
|
|
6853
|
+
}
|
|
6854
|
+
const preset = item.readOnlyReason === 'preset-managed';
|
|
6855
|
+
return {
|
|
6856
|
+
text: t('compatUndeclared'),
|
|
6857
|
+
reason: preset ? t('compatPresetHint') : t('compatUndeclaredHint'),
|
|
6858
|
+
tone: 'off',
|
|
6859
|
+
range: '',
|
|
6860
|
+
};
|
|
6861
|
+
};
|
|
6862
|
+
|
|
6863
|
+
const panelCompatChip = (panelId, item) => {
|
|
6864
|
+
const info = compatInfo(panelId, item);
|
|
6865
|
+
return React.createElement('span', { className: 'ss-tag ' + info.tone, title: info.reason }, info.text);
|
|
6866
|
+
};
|
|
6867
|
+
|
|
6868
|
+
const compatDetailNode = (compat) => {
|
|
6869
|
+
const reason = compat.reason ? String(compat.reason).replace(/[。.]$/u, '') : '';
|
|
6870
|
+
return React.createElement(
|
|
6871
|
+
'span',
|
|
6872
|
+
{ className: 'ss-compatval ss-compat-' + compat.tone },
|
|
6873
|
+
React.createElement(
|
|
6874
|
+
'span',
|
|
6875
|
+
{ className: 'ss-compattext' },
|
|
6876
|
+
React.createElement('span', { className: 'ss-compatlabel' }, compat.text),
|
|
6877
|
+
reason ? React.createElement('span', { className: 'ss-compatreason' }, '(' + reason + ')') : null,
|
|
6878
|
+
),
|
|
6879
|
+
);
|
|
6880
|
+
};
|
|
6881
|
+
|
|
6882
|
+
const renderPanelInlineMeta = (panelId, item) => {
|
|
6883
|
+
const nodes = [];
|
|
6884
|
+
const version = renderPanelMeta(item);
|
|
6885
|
+
if (version) nodes.push(version);
|
|
6886
|
+
const origin = panelOriginChip(item);
|
|
6887
|
+
if (origin) nodes.push(origin);
|
|
6888
|
+
return React.createElement('span', { className: 'ss-meta ss-panelinline' }, nodes);
|
|
6889
|
+
};
|
|
6890
|
+
|
|
5562
6891
|
const panelStatus = (item) => {
|
|
5563
6892
|
if (!item) return null;
|
|
5564
6893
|
if (item.fiberPhase === 'failed') return { key: 'panelStateFailed', tone: 'error' };
|
|
@@ -5828,6 +7157,8 @@ function MainPanel(props) {
|
|
|
5828
7157
|
};
|
|
5829
7158
|
|
|
5830
7159
|
const panelDetails = (panel, item) => {
|
|
7160
|
+
const compat = compatInfo(panel.id, item);
|
|
7161
|
+
const compatDetail = compatDetailNode(compat);
|
|
5831
7162
|
const rows = [
|
|
5832
7163
|
[t('panelPkgFull'), (item && item.moduleName) || panel.registrant || '—'],
|
|
5833
7164
|
[t('panelEntryId'), copyIdNode(panel.id)],
|
|
@@ -5839,6 +7170,8 @@ function MainPanel(props) {
|
|
|
5839
7170
|
[t('panelLoadState'), panelPhaseNode(item)],
|
|
5840
7171
|
[t('panelReadOnly'), panelReadOnlyText(item)],
|
|
5841
7172
|
[t('panelRemovable'), removableDetail(item)],
|
|
7173
|
+
[t('compatRange'), compat.range || '—'],
|
|
7174
|
+
[t('compatibility'), compatDetail],
|
|
5842
7175
|
];
|
|
5843
7176
|
return React.createElement(
|
|
5844
7177
|
'div',
|
|
@@ -5862,6 +7195,7 @@ function MainPanel(props) {
|
|
|
5862
7195
|
),
|
|
5863
7196
|
),
|
|
5864
7197
|
),
|
|
7198
|
+
React.createElement('div', { className: 'ss-detaildivider' }),
|
|
5865
7199
|
descriptionNode(item, panel.id),
|
|
5866
7200
|
React.createElement(
|
|
5867
7201
|
'div',
|
|
@@ -5884,6 +7218,8 @@ function MainPanel(props) {
|
|
|
5884
7218
|
};
|
|
5885
7219
|
|
|
5886
7220
|
const pluginDetails = (item) => {
|
|
7221
|
+
const compat = compatInfo(null, item);
|
|
7222
|
+
const compatDetail = compatDetailNode(compat);
|
|
5887
7223
|
const rows = [
|
|
5888
7224
|
[t('panelPkgFull'), (item && item.moduleName) || '—'],
|
|
5889
7225
|
[t('panelEntryId'), copyIdNode(item && item.entryId)],
|
|
@@ -5895,6 +7231,8 @@ function MainPanel(props) {
|
|
|
5895
7231
|
[t('panelLoadState'), panelPhaseNode(item)],
|
|
5896
7232
|
[t('panelReadOnly'), panelReadOnlyText(item)],
|
|
5897
7233
|
[t('panelRemovable'), removableDetail(item)],
|
|
7234
|
+
[t('compatRange'), compat.range || '—'],
|
|
7235
|
+
[t('compatibility'), compatDetail],
|
|
5898
7236
|
];
|
|
5899
7237
|
return React.createElement(
|
|
5900
7238
|
'div',
|
|
@@ -5918,6 +7256,7 @@ function MainPanel(props) {
|
|
|
5918
7256
|
),
|
|
5919
7257
|
),
|
|
5920
7258
|
),
|
|
7259
|
+
React.createElement('div', { className: 'ss-detaildivider' }),
|
|
5921
7260
|
descriptionNode(item, item && (item.key || item.moduleName)),
|
|
5922
7261
|
);
|
|
5923
7262
|
};
|
|
@@ -5965,7 +7304,7 @@ function MainPanel(props) {
|
|
|
5965
7304
|
const togglePluginEnabled = (item) => {
|
|
5966
7305
|
if (!canTogglePlugin(item)) return;
|
|
5967
7306
|
const nextEnabled = item.enabled !== true;
|
|
5968
|
-
void
|
|
7307
|
+
void runNote(async () => {
|
|
5969
7308
|
if (item.disabledByProfile === true) {
|
|
5970
7309
|
await bridge.api('enablePluginOverride', { patchId: item.patchId || item.entryId });
|
|
5971
7310
|
return t('actionRestart');
|
|
@@ -5981,12 +7320,13 @@ function MainPanel(props) {
|
|
|
5981
7320
|
const displayName = (item && (item.bundle || item.moduleName)) || '';
|
|
5982
7321
|
setConfirm({
|
|
5983
7322
|
title: t('uninstallConfirmTitle'),
|
|
7323
|
+
icon: PackageMinusIcon,
|
|
5984
7324
|
body: t('uninstallConfirmBody').replace('{name}', displayName),
|
|
5985
7325
|
confirmLabel: t('uninstallConfirmAction'),
|
|
5986
7326
|
danger: true,
|
|
5987
7327
|
onConfirm: async () => {
|
|
5988
7328
|
setConfirm(null);
|
|
5989
|
-
await
|
|
7329
|
+
await runNote(async () => {
|
|
5990
7330
|
const result = await bridge.api('uninstallPlugin', { bundle: item.bundle, confirm: true });
|
|
5991
7331
|
if (result && result.application === 'restart-required') return t('actionRestart');
|
|
5992
7332
|
return t('uninstalledMsg').replace('{name}', displayName);
|
|
@@ -5995,9 +7335,15 @@ function MainPanel(props) {
|
|
|
5995
7335
|
});
|
|
5996
7336
|
};
|
|
5997
7337
|
|
|
5998
|
-
const managementControls = (item) => {
|
|
7338
|
+
const managementControls = (item, panelId) => {
|
|
5999
7339
|
const scope = scopeTag(item);
|
|
6000
|
-
const nodes = [
|
|
7340
|
+
const nodes = [
|
|
7341
|
+
React.createElement('span', { key: 'scope', className: `ss-tag ${scope.tone}`, title: scope.title }, t(scope.key)),
|
|
7342
|
+
];
|
|
7343
|
+
const compat = compatInfo(panelId, item);
|
|
7344
|
+
nodes.push(
|
|
7345
|
+
React.createElement('span', { key: 'compat', className: `ss-tag ${compat.tone}`, title: compat.reason }, compat.text),
|
|
7346
|
+
);
|
|
6001
7347
|
if (item && isSessionOnly(item)) {
|
|
6002
7348
|
nodes.push(
|
|
6003
7349
|
React.createElement(
|
|
@@ -6008,8 +7354,12 @@ function MainPanel(props) {
|
|
|
6008
7354
|
);
|
|
6009
7355
|
return nodes;
|
|
6010
7356
|
}
|
|
6011
|
-
|
|
6012
|
-
|
|
7357
|
+
// 没有 inventory 行的宿主内置面板:来源已在名称下方显示「内置」,
|
|
7358
|
+
// 右侧不再重复状态标签,只保留作用域、兼容性与不可卸载。
|
|
7359
|
+
if (item) {
|
|
7360
|
+
const tag = pluginTag(item);
|
|
7361
|
+
nodes.push(React.createElement('span', { key: 'tag', className: `ss-tag ${tag.tone}`, title: tag.title }, t(tag.key)));
|
|
7362
|
+
}
|
|
6013
7363
|
if (item) {
|
|
6014
7364
|
const toggleable = canTogglePlugin(item);
|
|
6015
7365
|
nodes.push(
|
|
@@ -6031,6 +7381,7 @@ function MainPanel(props) {
|
|
|
6031
7381
|
React.createElement(
|
|
6032
7382
|
'button',
|
|
6033
7383
|
{ key: 'uninstall', type: 'button', className: 'ss-btn tiny danger', disabled: busy, onClick: () => askUninstallPlugin(item) },
|
|
7384
|
+
React.createElement(PackageMinusIcon, { size: 14, className: 'ss-btnicon' }),
|
|
6034
7385
|
t('uninstallPlugin'),
|
|
6035
7386
|
),
|
|
6036
7387
|
);
|
|
@@ -6046,7 +7397,7 @@ function MainPanel(props) {
|
|
|
6046
7397
|
const renderPanelsTab = () => {
|
|
6047
7398
|
const hiddenIds = hidden;
|
|
6048
7399
|
const needle = panelQuery.trim().toLowerCase();
|
|
6049
|
-
const filtering = Boolean(needle) || scopeFilter !== 'all' || statusFilter !== 'all';
|
|
7400
|
+
const filtering = Boolean(needle) || scopeFilter !== 'all' || statusFilter !== 'all' || originFilter !== 'all';
|
|
6050
7401
|
// 默认收起;搜索/筛选时临时展开,方便直接看到命中的条目。
|
|
6051
7402
|
const othersExpanded = othersOpen || filtering;
|
|
6052
7403
|
const searchText = (...values) =>
|
|
@@ -6096,7 +7447,7 @@ function MainPanel(props) {
|
|
|
6096
7447
|
};
|
|
6097
7448
|
const visiblePanels = panels.filter((panel) => {
|
|
6098
7449
|
const item = findInventory(panel);
|
|
6099
|
-
return panelMatches(panel) && scopeMatches(item) && statusMatches(item);
|
|
7450
|
+
return panelMatches(panel) && scopeMatches(item) && statusMatches(item) && originMatches(item);
|
|
6100
7451
|
});
|
|
6101
7452
|
const matchedPluginKeys = new Set();
|
|
6102
7453
|
const registerKey = (value) => {
|
|
@@ -6147,7 +7498,7 @@ function MainPanel(props) {
|
|
|
6147
7498
|
if (identities.some((identity) => livePanelKeys.has(identity) || seenOrphans.has(identity))) continue;
|
|
6148
7499
|
const memory = identities.map((identity) => panelMemory.get(identity)).find(Boolean);
|
|
6149
7500
|
if (!memory) continue;
|
|
6150
|
-
if (!pluginMatches(item) || !scopeMatches(item) || !statusMatches(item)) continue;
|
|
7501
|
+
if (!pluginMatches(item) || !scopeMatches(item) || !statusMatches(item) || !originMatches(item)) continue;
|
|
6151
7502
|
for (const identity of identities) seenOrphans.add(identity);
|
|
6152
7503
|
orphanPanels.push({ item, memory });
|
|
6153
7504
|
registerKey(item.key);
|
|
@@ -6166,6 +7517,7 @@ function MainPanel(props) {
|
|
|
6166
7517
|
if (!Boolean(normalizeName(item.moduleName || item.entryId)) || !pluginMatches(item)) return false;
|
|
6167
7518
|
if (!scopeMatches(item)) return false;
|
|
6168
7519
|
if (!statusMatches(item)) return false;
|
|
7520
|
+
if (!originMatches(item)) return false;
|
|
6169
7521
|
const identity = normalizeName(item.entryId || item.key || item.moduleName);
|
|
6170
7522
|
if (!identity || seenOtherKeys.has(identity)) return false;
|
|
6171
7523
|
seenOtherKeys.add(identity);
|
|
@@ -6395,7 +7747,6 @@ function MainPanel(props) {
|
|
|
6395
7747
|
{ className: 'ss-toolbar' },
|
|
6396
7748
|
React.createElement('button', { type: 'button', className: 'ss-btn', disabled: busy, onClick: presetLean }, t('presetLean')),
|
|
6397
7749
|
React.createElement('button', { type: 'button', className: 'ss-btn', disabled: busy, onClick: presetAll }, t('presetAll')),
|
|
6398
|
-
React.createElement('button', { type: 'button', className: 'ss-btn ghost', disabled: busy, onClick: () => saveHidden(new Set()) }, t('resetPanels')),
|
|
6399
7750
|
hiddenIds.has(PLUGINS_PANEL_ID)
|
|
6400
7751
|
? React.createElement(
|
|
6401
7752
|
'button',
|
|
@@ -6404,75 +7755,104 @@ function MainPanel(props) {
|
|
|
6404
7755
|
)
|
|
6405
7756
|
: null,
|
|
6406
7757
|
),
|
|
6407
|
-
React.createElement(
|
|
6408
|
-
'div',
|
|
6409
|
-
{ className: 'ss-searchrow' },
|
|
6410
|
-
React.createElement('input', {
|
|
6411
|
-
className: 'ss-input',
|
|
6412
|
-
type: 'search',
|
|
6413
|
-
value: panelQuery,
|
|
6414
|
-
placeholder: t('panelsSearchPlaceholder'),
|
|
6415
|
-
'aria-label': t('panelsSearchPlaceholder'),
|
|
6416
|
-
onChange: (event) => setPanelQuery(event.target.value),
|
|
6417
|
-
}),
|
|
6418
7758
|
),
|
|
6419
7759
|
React.createElement(
|
|
6420
7760
|
'div',
|
|
6421
|
-
{ className: 'ss-
|
|
7761
|
+
{ className: 'ss-panelslist', ref: panelsListRef, onScroll: handleRootScroll },
|
|
6422
7762
|
React.createElement(
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
[
|
|
6426
|
-
['all', 'scopeAll'],
|
|
6427
|
-
['global', 'scopeGlobal'],
|
|
6428
|
-
['session', 'scopeSession'],
|
|
6429
|
-
].map(([id, key]) =>
|
|
7763
|
+
'div',
|
|
7764
|
+
{ className: 'ss-plugintoolbar' },
|
|
6430
7765
|
React.createElement(
|
|
6431
|
-
'
|
|
6432
|
-
{
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
7766
|
+
'div',
|
|
7767
|
+
{ className: 'ss-plugintoolbarcard' },
|
|
7768
|
+
React.createElement(
|
|
7769
|
+
'div',
|
|
7770
|
+
{ className: 'ss-searchrow' },
|
|
7771
|
+
React.createElement('input', {
|
|
7772
|
+
className: 'ss-input',
|
|
7773
|
+
type: 'search',
|
|
7774
|
+
value: panelQuery,
|
|
7775
|
+
placeholder: t('panelsSearchPlaceholder'),
|
|
7776
|
+
'aria-label': t('panelsSearchPlaceholder'),
|
|
7777
|
+
onChange: (event) => setPanelQuery(event.target.value),
|
|
7778
|
+
}),
|
|
6440
7779
|
),
|
|
6441
|
-
),
|
|
6442
|
-
React.createElement('span', { className: 'ss-filterdivider', 'aria-hidden': 'true' }),
|
|
6443
|
-
[
|
|
6444
|
-
['enabled', 'statusEnabled'],
|
|
6445
|
-
['disabled', 'statusDisabled'],
|
|
6446
|
-
].map(([id, key]) =>
|
|
6447
7780
|
React.createElement(
|
|
6448
|
-
'
|
|
6449
|
-
{
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
className:
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
7781
|
+
'div',
|
|
7782
|
+
{ className: 'ss-filterbar' },
|
|
7783
|
+
React.createElement(
|
|
7784
|
+
'div',
|
|
7785
|
+
{ className: 'ss-scopefilter', role: 'group', 'aria-label': t('scopeFilterLabel') },
|
|
7786
|
+
[
|
|
7787
|
+
['all', 'scopeAll'],
|
|
7788
|
+
['global', 'scopeGlobal'],
|
|
7789
|
+
['session', 'scopeSession'],
|
|
7790
|
+
].map(([id, key]) =>
|
|
7791
|
+
React.createElement(
|
|
7792
|
+
'button',
|
|
7793
|
+
{
|
|
7794
|
+
key: id,
|
|
7795
|
+
type: 'button',
|
|
7796
|
+
className: scopeFilter === id ? 'ss-chip active' : 'ss-chip',
|
|
7797
|
+
'aria-pressed': scopeFilter === id ? 'true' : 'false',
|
|
7798
|
+
onClick: () => setScopeFilter(id),
|
|
7799
|
+
},
|
|
7800
|
+
t(key),
|
|
7801
|
+
),
|
|
7802
|
+
),
|
|
7803
|
+
React.createElement('span', { className: 'ss-filterdivider', 'aria-hidden': 'true' }),
|
|
7804
|
+
[
|
|
7805
|
+
['enabled', 'statusEnabled'],
|
|
7806
|
+
['disabled', 'statusDisabled'],
|
|
7807
|
+
].map(([id, key]) =>
|
|
7808
|
+
React.createElement(
|
|
7809
|
+
'button',
|
|
7810
|
+
{
|
|
7811
|
+
key: id,
|
|
7812
|
+
type: 'button',
|
|
7813
|
+
className: statusFilter === id ? 'ss-chip active' : 'ss-chip',
|
|
7814
|
+
'aria-pressed': statusFilter === id ? 'true' : 'false',
|
|
7815
|
+
onClick: () => setStatusFilter((current) => (current === id ? 'all' : id)),
|
|
7816
|
+
},
|
|
7817
|
+
t(key),
|
|
7818
|
+
),
|
|
7819
|
+
),
|
|
7820
|
+
React.createElement('span', { className: 'ss-filterdivider', 'aria-hidden': 'true' }),
|
|
7821
|
+
[
|
|
7822
|
+
['all', 'originAll'],
|
|
7823
|
+
['builtin', 'panelBuiltin'],
|
|
7824
|
+
['official', 'panelOfficial'],
|
|
7825
|
+
['thirdparty', 'panelThirdParty'],
|
|
7826
|
+
['local', 'panelLocal'],
|
|
7827
|
+
['preset', 'panelPreset'],
|
|
7828
|
+
].map(([id, key]) =>
|
|
7829
|
+
React.createElement(
|
|
7830
|
+
'button',
|
|
7831
|
+
{
|
|
7832
|
+
key: 'origin-' + id,
|
|
7833
|
+
type: 'button',
|
|
7834
|
+
className: originFilter === id ? 'ss-chip active' : 'ss-chip',
|
|
7835
|
+
'aria-pressed': originFilter === id ? 'true' : 'false',
|
|
7836
|
+
onClick: () => setOriginFilter(id),
|
|
7837
|
+
},
|
|
7838
|
+
t(key),
|
|
7839
|
+
),
|
|
7840
|
+
),
|
|
7841
|
+
),
|
|
7842
|
+
React.createElement(
|
|
7843
|
+
'button',
|
|
7844
|
+
{
|
|
7845
|
+
type: 'button',
|
|
7846
|
+
className: 'ss-chip ss-expandall',
|
|
7847
|
+
disabled: detailKeys.length === 0,
|
|
7848
|
+
'aria-pressed': anyDetailsExpanded ? 'true' : 'false',
|
|
7849
|
+
onClick: toggleAllDetails,
|
|
7850
|
+
},
|
|
7851
|
+
t(anyDetailsExpanded ? 'collapseAllDetails' : 'expandAllDetails'),
|
|
7852
|
+
),
|
|
7853
|
+
),
|
|
6457
7854
|
),
|
|
6458
7855
|
),
|
|
6459
|
-
),
|
|
6460
|
-
React.createElement(
|
|
6461
|
-
'button',
|
|
6462
|
-
{
|
|
6463
|
-
type: 'button',
|
|
6464
|
-
className: 'ss-chip ss-expandall',
|
|
6465
|
-
disabled: detailKeys.length === 0,
|
|
6466
|
-
'aria-pressed': anyDetailsExpanded ? 'true' : 'false',
|
|
6467
|
-
onClick: toggleAllDetails,
|
|
6468
|
-
},
|
|
6469
|
-
t(anyDetailsExpanded ? 'collapseAllDetails' : 'expandAllDetails'),
|
|
6470
|
-
),
|
|
6471
|
-
),
|
|
6472
|
-
),
|
|
6473
|
-
React.createElement(
|
|
6474
|
-
'div',
|
|
6475
|
-
{ className: 'ss-panelslist', ref: panelsListRef, onScroll: handleRootScroll },
|
|
6476
7856
|
React.createElement(
|
|
6477
7857
|
'div',
|
|
6478
7858
|
{ className: cx('ss-card ss-plugincard', !othersExpanded && otherPlugins.length > 0 && 'ss-plugincard-collapsed') },
|
|
@@ -6496,9 +7876,6 @@ function MainPanel(props) {
|
|
|
6496
7876
|
: React.createElement('div', { className: 'ss-empty' }, t('loading'))
|
|
6497
7877
|
: visiblePanels.map((panel) => {
|
|
6498
7878
|
const item = findInventory(panel);
|
|
6499
|
-
const meta = [];
|
|
6500
|
-
if (item && item.version) meta.push('v' + item.version);
|
|
6501
|
-
meta.push(panelOrigin(item));
|
|
6502
7879
|
const expanded = expandedPanels.has(panel.id);
|
|
6503
7880
|
const row = React.createElement(
|
|
6504
7881
|
'div',
|
|
@@ -6522,10 +7899,10 @@ function MainPanel(props) {
|
|
|
6522
7899
|
},
|
|
6523
7900
|
},
|
|
6524
7901
|
React.createElement('span', { className: 'ss-panellabel' }, panel.label || panel.id),
|
|
6525
|
-
|
|
7902
|
+
renderPanelInlineMeta(panel.id, item),
|
|
6526
7903
|
),
|
|
6527
7904
|
),
|
|
6528
|
-
...managementControls(item),
|
|
7905
|
+
...managementControls(item, panel.id),
|
|
6529
7906
|
React.createElement(Switch, {
|
|
6530
7907
|
checked: !hiddenIds.has(panel.id),
|
|
6531
7908
|
label: panel.label || panel.id,
|
|
@@ -6561,9 +7938,6 @@ function MainPanel(props) {
|
|
|
6561
7938
|
orphanPanels.map(({ item, memory }) => {
|
|
6562
7939
|
const rowKey = 'orphan:' + normalizeName(item.entryId || item.key || item.moduleName);
|
|
6563
7940
|
const expanded = expandedPanels.has(rowKey);
|
|
6564
|
-
const meta = [];
|
|
6565
|
-
if (item.version) meta.push('v' + item.version);
|
|
6566
|
-
meta.push(panelOrigin(item));
|
|
6567
7941
|
const row = React.createElement(
|
|
6568
7942
|
'div',
|
|
6569
7943
|
{ className: 'ss-panelrow' },
|
|
@@ -6590,10 +7964,10 @@ function MainPanel(props) {
|
|
|
6590
7964
|
},
|
|
6591
7965
|
},
|
|
6592
7966
|
React.createElement('span', { className: 'ss-panellabel' }, memory.label || pluginDisplayName(item)),
|
|
6593
|
-
|
|
7967
|
+
renderPanelInlineMeta(null, item),
|
|
6594
7968
|
),
|
|
6595
7969
|
),
|
|
6596
|
-
...managementControls(item),
|
|
7970
|
+
...managementControls(item, null),
|
|
6597
7971
|
React.createElement(
|
|
6598
7972
|
Tip,
|
|
6599
7973
|
{ text: expanded ? t('panelCollapse') : t('panelExpand') },
|
|
@@ -6639,9 +8013,6 @@ function MainPanel(props) {
|
|
|
6639
8013
|
React.createElement(ChevronDownIcon, { className: othersExpanded ? 'ss-expand-icon open' : 'ss-expand-icon' }),
|
|
6640
8014
|
),
|
|
6641
8015
|
othersExpanded ? otherRows.map(({ item, stateKey }, index) => {
|
|
6642
|
-
const meta = [];
|
|
6643
|
-
if (item.version) meta.push('v' + item.version);
|
|
6644
|
-
meta.push(panelOrigin(item));
|
|
6645
8016
|
const rowKey = stateKey;
|
|
6646
8017
|
const expanded = expandedPanels.has(rowKey);
|
|
6647
8018
|
const row = React.createElement(
|
|
@@ -6666,10 +8037,10 @@ function MainPanel(props) {
|
|
|
6666
8037
|
},
|
|
6667
8038
|
},
|
|
6668
8039
|
React.createElement('span', { className: 'ss-panellabel' }, pluginDisplayName(item)),
|
|
6669
|
-
|
|
8040
|
+
renderPanelInlineMeta(null, item),
|
|
6670
8041
|
),
|
|
6671
8042
|
),
|
|
6672
|
-
...managementControls(item),
|
|
8043
|
+
...managementControls(item, null),
|
|
6673
8044
|
React.createElement(
|
|
6674
8045
|
Tip,
|
|
6675
8046
|
{ text: expanded ? t('panelCollapse') : t('panelExpand') },
|
|
@@ -7039,12 +8410,70 @@ function MainPanel(props) {
|
|
|
7039
8410
|
: null,
|
|
7040
8411
|
),
|
|
7041
8412
|
React.createElement('div', { className: 'ss-hint' }, t('notifyCenterHint')),
|
|
8413
|
+
row(
|
|
8414
|
+
t('notifyRecordLabel'),
|
|
8415
|
+
t('notifyRecordHint'),
|
|
8416
|
+
React.createElement(Switch, {
|
|
8417
|
+
checked: notifySettings.recordEnabled !== false,
|
|
8418
|
+
label: t('notifyRecordLabel'),
|
|
8419
|
+
disabled: notifyBusy,
|
|
8420
|
+
onChange: (value) => updateNotify({ recordEnabled: value }),
|
|
8421
|
+
}),
|
|
8422
|
+
),
|
|
8423
|
+
React.createElement(
|
|
8424
|
+
'div',
|
|
8425
|
+
{ className: 'ss-field ss-fieldstack' },
|
|
8426
|
+
React.createElement(
|
|
8427
|
+
'div',
|
|
8428
|
+
{ className: 'ss-fieldlabel' },
|
|
8429
|
+
t('notifyRetentionLabel'),
|
|
8430
|
+
React.createElement('small', null, t('notifyRetentionHint')),
|
|
8431
|
+
React.createElement(
|
|
8432
|
+
'div',
|
|
8433
|
+
{
|
|
8434
|
+
className: 'ss-radios ss-radios-inline',
|
|
8435
|
+
role: 'radiogroup',
|
|
8436
|
+
'aria-label': t('notifyRetentionLabel'),
|
|
8437
|
+
},
|
|
8438
|
+
[
|
|
8439
|
+
{ days: 7, label: t('notifyRetention7') },
|
|
8440
|
+
{ days: 30, label: t('notifyRetention30') },
|
|
8441
|
+
{ days: 90, label: t('notifyRetention90') },
|
|
8442
|
+
{ days: 0, label: t('notifyRetentionForever') },
|
|
8443
|
+
].map((option) =>
|
|
8444
|
+
React.createElement(
|
|
8445
|
+
'label',
|
|
8446
|
+
{ className: 'ss-radio', key: option.days },
|
|
8447
|
+
React.createElement('input', {
|
|
8448
|
+
type: 'radio',
|
|
8449
|
+
name: 'ss-notify-retention',
|
|
8450
|
+
checked: Number(notifySettings.historyDays) === option.days,
|
|
8451
|
+
disabled: notifyBusy,
|
|
8452
|
+
onChange: () => {
|
|
8453
|
+
updateNotify({ historyDays: option.days });
|
|
8454
|
+
sweepNotifyLog(option.days);
|
|
8455
|
+
setNotifyLog(readNotifyLog());
|
|
8456
|
+
},
|
|
8457
|
+
}),
|
|
8458
|
+
option.label,
|
|
8459
|
+
),
|
|
8460
|
+
),
|
|
8461
|
+
),
|
|
8462
|
+
),
|
|
8463
|
+
),
|
|
7042
8464
|
notifyLog.length === 0
|
|
7043
|
-
? React.createElement(
|
|
8465
|
+
? React.createElement(
|
|
8466
|
+
'div',
|
|
8467
|
+
{ className: 'ss-hint ss-notifylogempty' },
|
|
8468
|
+
t(notifySettings.recordEnabled === false ? 'notifyRecordOffEmpty' : 'notifyCenterEmpty'),
|
|
8469
|
+
)
|
|
7044
8470
|
: React.createElement(
|
|
7045
8471
|
'div',
|
|
7046
|
-
{ className: 'ss-
|
|
7047
|
-
|
|
8472
|
+
{ className: 'ss-notifywrap' },
|
|
8473
|
+
React.createElement(
|
|
8474
|
+
'div',
|
|
8475
|
+
{ className: 'ss-notifylog', ref: notifyLogRef, onScroll: handleNotifyScroll },
|
|
8476
|
+
notifyLog.slice(0, notifyShown).map((item) =>
|
|
7048
8477
|
React.createElement(
|
|
7049
8478
|
'button',
|
|
7050
8479
|
{
|
|
@@ -7082,9 +8511,22 @@ function MainPanel(props) {
|
|
|
7082
8511
|
),
|
|
7083
8512
|
),
|
|
7084
8513
|
),
|
|
8514
|
+
notifyHint
|
|
8515
|
+
? React.createElement(
|
|
8516
|
+
'div',
|
|
8517
|
+
{
|
|
8518
|
+
key: notifyHint.key,
|
|
8519
|
+
className: 'ss-notifyhint',
|
|
8520
|
+
role: 'status',
|
|
8521
|
+
'aria-live': 'polite',
|
|
8522
|
+
},
|
|
8523
|
+
notifyHint.text,
|
|
8524
|
+
)
|
|
8525
|
+
: null,
|
|
8526
|
+
),
|
|
7085
8527
|
React.createElement(
|
|
7086
8528
|
'div',
|
|
7087
|
-
{ className: 'ss-notifyactions' },
|
|
8529
|
+
{ className: 'ss-notifyactions', ref: notifyActionsRef },
|
|
7088
8530
|
React.createElement(
|
|
7089
8531
|
'button',
|
|
7090
8532
|
{
|
|
@@ -7105,12 +8547,32 @@ function MainPanel(props) {
|
|
|
7105
8547
|
className: 'ss-btn quiet',
|
|
7106
8548
|
disabled: notifyLog.length === 0,
|
|
7107
8549
|
onClick: () => {
|
|
7108
|
-
|
|
7109
|
-
|
|
8550
|
+
setConfirm({
|
|
8551
|
+
title: t('confirmClearNotifyTitle'),
|
|
8552
|
+
icon: BellIcon,
|
|
8553
|
+
body: t('confirmClearNotifyBody'),
|
|
8554
|
+
confirmLabel: t('confirmClearNotifyAction'),
|
|
8555
|
+
onConfirm: () => {
|
|
8556
|
+
setConfirm(null);
|
|
8557
|
+
clearNotifyLog();
|
|
8558
|
+
setNotifyVisible(30);
|
|
8559
|
+
setNotifyLog(readNotifyLog());
|
|
8560
|
+
},
|
|
8561
|
+
});
|
|
7110
8562
|
},
|
|
7111
8563
|
},
|
|
7112
8564
|
t('notifyClearHistory'),
|
|
7113
8565
|
),
|
|
8566
|
+
notifyLog.length > 0
|
|
8567
|
+
? React.createElement(
|
|
8568
|
+
'span',
|
|
8569
|
+
{ className: 'ss-notifytotal' },
|
|
8570
|
+
t('notifyTotalN').replace('{n}', String(notifyLog.length)),
|
|
8571
|
+
notifyShown < notifyLog.length
|
|
8572
|
+
? ' · ' + t('notifyShowingRecentN').replace('{n}', String(notifyShown))
|
|
8573
|
+
: '',
|
|
8574
|
+
)
|
|
8575
|
+
: null,
|
|
7114
8576
|
),
|
|
7115
8577
|
),
|
|
7116
8578
|
React.createElement(
|
|
@@ -7497,6 +8959,8 @@ function MainPanel(props) {
|
|
|
7497
8959
|
details: confirm.details ?? null,
|
|
7498
8960
|
preview: confirm.preview ?? null,
|
|
7499
8961
|
danger: confirm.danger === true,
|
|
8962
|
+
icon: confirm.icon ?? null,
|
|
8963
|
+
confirmLabel: confirm.confirmLabel,
|
|
7500
8964
|
onCancel: () => setConfirm(null),
|
|
7501
8965
|
onConfirm: confirm.onConfirm,
|
|
7502
8966
|
})
|
|
@@ -7507,6 +8971,8 @@ function MainPanel(props) {
|
|
|
7507
8971
|
title: outcome.title,
|
|
7508
8972
|
body: outcome.body,
|
|
7509
8973
|
details: outcome.details ?? null,
|
|
8974
|
+
icon: outcome.icon ?? null,
|
|
8975
|
+
iconDanger: true,
|
|
7510
8976
|
confirmLabel: t('close'),
|
|
7511
8977
|
onCancel: () => setOutcome(null),
|
|
7512
8978
|
onConfirm: () => setOutcome(null),
|
|
@@ -7562,7 +9028,9 @@ function SettingsPage(props) {
|
|
|
7562
9028
|
const [busy, setBusy] = React.useState(false);
|
|
7563
9029
|
const [toast, setToast] = React.useState(null);
|
|
7564
9030
|
const [confirm, setConfirm] = React.useState(null);
|
|
7565
|
-
const [
|
|
9031
|
+
const [settingsDraft, setSettingsDraft] = React.useState(null);
|
|
9032
|
+
const [trashDraft, setTrashDraft] = React.useState(null);
|
|
9033
|
+
const compat = compatibilityState(boot);
|
|
7566
9034
|
|
|
7567
9035
|
React.useEffect(() => {
|
|
7568
9036
|
let alive = true;
|
|
@@ -7581,7 +9049,7 @@ function SettingsPage(props) {
|
|
|
7581
9049
|
return () => {
|
|
7582
9050
|
alive = false;
|
|
7583
9051
|
};
|
|
7584
|
-
}, [
|
|
9052
|
+
}, []);
|
|
7585
9053
|
|
|
7586
9054
|
React.useEffect(() => {
|
|
7587
9055
|
if (!toast) return undefined;
|
|
@@ -7589,32 +9057,51 @@ function SettingsPage(props) {
|
|
|
7589
9057
|
return () => clearTimeout(timer);
|
|
7590
9058
|
}, [toast]);
|
|
7591
9059
|
|
|
7592
|
-
const settings =
|
|
9060
|
+
const settings = {
|
|
9061
|
+
...(boot?.state?.settings ?? { deleteMode: 'trash', confirmPurge: true }),
|
|
9062
|
+
...(settingsDraft ?? {}),
|
|
9063
|
+
};
|
|
7593
9064
|
const deleteMode = settings.deleteMode === 'delete' ? 'delete' : 'trash';
|
|
9065
|
+
const rowPreviewPref = settings.rowPreview ?? { enabled: true, delay: 400 };
|
|
7594
9066
|
const hidden = new Set(boot?.state?.hiddenPanels ?? []);
|
|
7595
9067
|
const paths = boot?.paths ?? {};
|
|
7596
|
-
const version = boot?.version ?? '0.1.
|
|
7597
|
-
const trash = Array.isArray(boot?.trash) ? boot.trash : [];
|
|
9068
|
+
const version = boot?.version ?? '0.1.7';
|
|
9069
|
+
const trash = Array.isArray(trashDraft) ? trashDraft : (Array.isArray(boot?.trash) ? boot.trash : []);
|
|
7598
9070
|
const trashCount = trash.length;
|
|
7599
9071
|
|
|
7600
|
-
const call = async (work, message) => {
|
|
7601
|
-
setBusy(true);
|
|
9072
|
+
const call = async (work, message, target) => {
|
|
7602
9073
|
try {
|
|
7603
|
-
await work();
|
|
7604
|
-
if (message)
|
|
7605
|
-
|
|
9074
|
+
const value = await work();
|
|
9075
|
+
if (message) {
|
|
9076
|
+
if (target) showActionNote(target, message, false);
|
|
9077
|
+
else setToast({ text: message });
|
|
9078
|
+
}
|
|
9079
|
+
return value;
|
|
7606
9080
|
} catch (callError) {
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
9081
|
+
const text = callError?.message || String(callError);
|
|
9082
|
+
if (target) showActionNote(target, text, true);
|
|
9083
|
+
else setToast({ text });
|
|
9084
|
+
return null;
|
|
7610
9085
|
}
|
|
7611
9086
|
};
|
|
7612
9087
|
|
|
7613
|
-
const
|
|
7614
|
-
|
|
9088
|
+
const applyServerState = (value) => {
|
|
9089
|
+
if (!value || !value.state) return;
|
|
9090
|
+
setBoot((previous) => (previous ? { ...previous, state: value.state } : previous));
|
|
9091
|
+
};
|
|
9092
|
+
|
|
9093
|
+
const saveSettings = async (patch) => {
|
|
9094
|
+
const previous = settingsDraft;
|
|
9095
|
+
// 先本地生效,避免受控开关/单选在接口返回前回弹造成闪烁;失败再回滚。
|
|
9096
|
+
setSettingsDraft((current) => ({ ...(current ?? {}), ...patch }));
|
|
9097
|
+
try {
|
|
7615
9098
|
await bridge.api('saveSettings', { settings: patch });
|
|
7616
9099
|
publishSettingsPatch(patch);
|
|
7617
|
-
}
|
|
9100
|
+
} catch (callError) {
|
|
9101
|
+
setSettingsDraft(previous);
|
|
9102
|
+
setToast({ text: callError?.message || String(callError) });
|
|
9103
|
+
}
|
|
9104
|
+
};
|
|
7618
9105
|
|
|
7619
9106
|
const setConfirmPurge = (value) => saveSettings({ confirmPurge: value });
|
|
7620
9107
|
|
|
@@ -7627,25 +9114,26 @@ function SettingsPage(props) {
|
|
|
7627
9114
|
];
|
|
7628
9115
|
const setDefaultExportFormat = (format) => saveSettings({ defaultExportFormat: format });
|
|
7629
9116
|
|
|
7630
|
-
const clearTranslations = () =>
|
|
9117
|
+
const clearTranslations = (event) =>
|
|
7631
9118
|
call(async () => {
|
|
7632
9119
|
await bridge.api('clearTranslationCache', {});
|
|
7633
|
-
}, t('translationCacheCleared'));
|
|
9120
|
+
}, t('translationCacheCleared'), event && event.currentTarget);
|
|
7634
9121
|
|
|
7635
|
-
const openDataDirectory = () =>
|
|
9122
|
+
const openDataDirectory = (event) =>
|
|
7636
9123
|
call(async () => {
|
|
7637
9124
|
const value = await bridge.api('openWorkspacePath', { path: paths.dataDir });
|
|
7638
9125
|
if (!value || value.opened !== true) throw new Error(t('openDataDirFailed'));
|
|
7639
|
-
});
|
|
9126
|
+
}, undefined, event && event.currentTarget);
|
|
7640
9127
|
|
|
7641
9128
|
const setEntryVisible = (visible) =>
|
|
7642
9129
|
call(async () => {
|
|
7643
9130
|
const next = new Set(hidden);
|
|
7644
9131
|
if (visible) next.delete(PANEL_ID);
|
|
7645
9132
|
else next.add(PANEL_ID);
|
|
7646
|
-
await bridge.api('setHiddenPanels', { hiddenPanels: [...next] });
|
|
9133
|
+
const value = await bridge.api('setHiddenPanels', { hiddenPanels: [...next] });
|
|
7647
9134
|
bridge.applyHide([...next], bridge.listPanels());
|
|
7648
|
-
|
|
9135
|
+
applyServerState(value);
|
|
9136
|
+
});
|
|
7649
9137
|
|
|
7650
9138
|
const [qjKeys, setQjKeys] = React.useState(() => (typeof bridge?.shortcutKeys === 'function' ? bridge.shortcutKeys() : []));
|
|
7651
9139
|
React.useEffect(() => {
|
|
@@ -7663,6 +9151,11 @@ function SettingsPage(props) {
|
|
|
7663
9151
|
setRecordingShortcut(false);
|
|
7664
9152
|
if (typeof bridge?.setShortcutRecording === 'function') void bridge.setShortcutRecording(false);
|
|
7665
9153
|
};
|
|
9154
|
+
// 快捷键保存/清除/重置与「恢复默认设置」「清除翻译缓存」使用同一套顶部提示。
|
|
9155
|
+
const settingsNotice = (text, error) => {
|
|
9156
|
+
const root = typeof document === 'undefined' ? null : document.querySelector('.ss-settings');
|
|
9157
|
+
showActionNote(root, text, error === true);
|
|
9158
|
+
};
|
|
7666
9159
|
React.useEffect(() => {
|
|
7667
9160
|
if (!recordingShortcut) return undefined;
|
|
7668
9161
|
if (typeof bridge?.setShortcutRecording === 'function') void bridge.setShortcutRecording(true);
|
|
@@ -7703,11 +9196,11 @@ function SettingsPage(props) {
|
|
|
7703
9196
|
stopShortcutRecording();
|
|
7704
9197
|
setShortcutCleared(false);
|
|
7705
9198
|
refreshShortcutKeys();
|
|
7706
|
-
|
|
9199
|
+
settingsNotice(t('shortcutSaved'));
|
|
7707
9200
|
},
|
|
7708
9201
|
(error) => {
|
|
7709
9202
|
stopShortcutRecording();
|
|
7710
|
-
|
|
9203
|
+
settingsNotice(t('shortcutSaveFailed').replace('{message}', String(error?.message ?? error)), true);
|
|
7711
9204
|
},
|
|
7712
9205
|
);
|
|
7713
9206
|
};
|
|
@@ -7730,9 +9223,9 @@ function SettingsPage(props) {
|
|
|
7730
9223
|
() => {
|
|
7731
9224
|
setShortcutCleared(true);
|
|
7732
9225
|
refreshShortcutKeys();
|
|
7733
|
-
|
|
9226
|
+
settingsNotice(t('shortcutCleared'));
|
|
7734
9227
|
},
|
|
7735
|
-
(error) =>
|
|
9228
|
+
(error) => settingsNotice(t('shortcutSaveFailed').replace('{message}', String(error?.message ?? error)), true),
|
|
7736
9229
|
);
|
|
7737
9230
|
};
|
|
7738
9231
|
const resetShortcutDefault = () => {
|
|
@@ -7743,25 +9236,29 @@ function SettingsPage(props) {
|
|
|
7743
9236
|
setShortcutCleared(false);
|
|
7744
9237
|
refreshShortcutKeys();
|
|
7745
9238
|
setTimeout(refreshShortcutKeys, 120);
|
|
7746
|
-
|
|
9239
|
+
settingsNotice(t('shortcutResetDone'));
|
|
7747
9240
|
},
|
|
7748
|
-
(error) =>
|
|
9241
|
+
(error) => settingsNotice(t('shortcutSaveFailed').replace('{message}', String(error?.message ?? error)), true),
|
|
7749
9242
|
);
|
|
7750
9243
|
};
|
|
7751
9244
|
|
|
7752
|
-
const resetSettings = () =>
|
|
9245
|
+
const resetSettings = (event) =>
|
|
7753
9246
|
call(async () => {
|
|
7754
|
-
await bridge.api('resetSettings', {});
|
|
7755
|
-
|
|
9247
|
+
const value = await bridge.api('resetSettings', {});
|
|
9248
|
+
setSettingsDraft(null);
|
|
9249
|
+
applyServerState(value);
|
|
9250
|
+
}, t('resetSettingsDone'), event && event.currentTarget);
|
|
7756
9251
|
|
|
7757
|
-
const resetPanels = () =>
|
|
9252
|
+
const resetPanels = (event) =>
|
|
7758
9253
|
call(async () => {
|
|
7759
|
-
await bridge.api('resetPanels', {});
|
|
9254
|
+
const value = await bridge.api('resetPanels', {});
|
|
7760
9255
|
bridge.applyHide([], bridge.listPanels());
|
|
7761
|
-
|
|
9256
|
+
applyServerState(value);
|
|
9257
|
+
}, t('panelsSaved'), event && event.currentTarget);
|
|
7762
9258
|
|
|
7763
|
-
const emptyTrashNow = () => {
|
|
9259
|
+
const emptyTrashNow = (event) => {
|
|
7764
9260
|
if (busy || trash.length === 0) return;
|
|
9261
|
+
const target = event && event.currentTarget;
|
|
7765
9262
|
const size = trash.reduce((sum, entry) => sum + (Number(entry.sizeBytes) || 0), 0);
|
|
7766
9263
|
const workspaceNames = [...new Set(trash.map((entry) => entry.workspaceTitle || entry.workspaceId || '').filter(Boolean))];
|
|
7767
9264
|
const details = [];
|
|
@@ -7779,17 +9276,18 @@ function SettingsPage(props) {
|
|
|
7779
9276
|
const errors = result?.errors ?? [];
|
|
7780
9277
|
if (errors.length > 0) {
|
|
7781
9278
|
const done = (result?.done ?? []).length;
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
9279
|
+
showActionNote(
|
|
9280
|
+
target,
|
|
9281
|
+
t('purgePartial').replace('{ok}', String(done)).replace('{fail}', String(errors.length)),
|
|
9282
|
+
true,
|
|
9283
|
+
);
|
|
7787
9284
|
} else {
|
|
7788
|
-
|
|
9285
|
+
showActionNote(target, t('trashEmptied'), false);
|
|
7789
9286
|
}
|
|
7790
|
-
|
|
9287
|
+
const doneIds = new Set((result?.done ?? []).map((item) => item.sessionId));
|
|
9288
|
+
setTrashDraft((current) => (current ?? trash).filter((entry) => !doneIds.has(entry.sessionId)));
|
|
7791
9289
|
} catch (callError) {
|
|
7792
|
-
|
|
9290
|
+
showActionNote(target, callError?.message || String(callError), true);
|
|
7793
9291
|
} finally {
|
|
7794
9292
|
setBusy(false);
|
|
7795
9293
|
}
|
|
@@ -7800,6 +9298,7 @@ function SettingsPage(props) {
|
|
|
7800
9298
|
}
|
|
7801
9299
|
setConfirm({
|
|
7802
9300
|
title: t('confirmEmptyTitle'),
|
|
9301
|
+
icon: TrashIcon,
|
|
7803
9302
|
body: t('confirmEmptyBody').replace('{n}', String(trash.length)).replace('{size}', fmtBytes(size)),
|
|
7804
9303
|
details,
|
|
7805
9304
|
preview,
|
|
@@ -7883,6 +9382,50 @@ function SettingsPage(props) {
|
|
|
7883
9382
|
onChange: (value) => setConfirmPurge(value),
|
|
7884
9383
|
}),
|
|
7885
9384
|
),
|
|
9385
|
+
React.createElement(
|
|
9386
|
+
'div',
|
|
9387
|
+
{ className: 'ss-previewmodule' },
|
|
9388
|
+
field(
|
|
9389
|
+
iconLabel(React.createElement(EyeIcon), t('rowPreviewEnabled')),
|
|
9390
|
+
t('rowPreviewEnabledHint'),
|
|
9391
|
+
React.createElement(Switch, {
|
|
9392
|
+
checked: rowPreviewPref.enabled !== false,
|
|
9393
|
+
label: t('rowPreviewEnabled'),
|
|
9394
|
+
disabled: busy,
|
|
9395
|
+
onChange: (value) => saveSettings({ rowPreview: { ...rowPreviewPref, enabled: value } }),
|
|
9396
|
+
}),
|
|
9397
|
+
),
|
|
9398
|
+
rowPreviewPref.enabled !== false
|
|
9399
|
+
? React.createElement(
|
|
9400
|
+
'div',
|
|
9401
|
+
{ className: 'ss-field ss-previewdelay' },
|
|
9402
|
+
React.createElement(
|
|
9403
|
+
'div',
|
|
9404
|
+
{ className: 'ss-fieldlabel' },
|
|
9405
|
+
t('rowPreviewDelay'),
|
|
9406
|
+
React.createElement('small', null, t('rowPreviewDelayHint')),
|
|
9407
|
+
),
|
|
9408
|
+
React.createElement(
|
|
9409
|
+
'div',
|
|
9410
|
+
{ className: 'ss-radios ss-radiosrow' },
|
|
9411
|
+
[300, 400, 600, 800].map((ms) =>
|
|
9412
|
+
React.createElement(
|
|
9413
|
+
'label',
|
|
9414
|
+
{ className: 'ss-radio', key: ms },
|
|
9415
|
+
React.createElement('input', {
|
|
9416
|
+
type: 'radio',
|
|
9417
|
+
name: 'ss-row-preview-delay',
|
|
9418
|
+
checked: rowPreviewPref.delay === ms,
|
|
9419
|
+
disabled: busy,
|
|
9420
|
+
onChange: () => saveSettings({ rowPreview: { ...rowPreviewPref, delay: ms } }),
|
|
9421
|
+
}),
|
|
9422
|
+
t('rowPreviewDelayValue').replace('{ms}', String(ms)),
|
|
9423
|
+
),
|
|
9424
|
+
),
|
|
9425
|
+
),
|
|
9426
|
+
)
|
|
9427
|
+
: null,
|
|
9428
|
+
),
|
|
7886
9429
|
field(
|
|
7887
9430
|
iconLabel(React.createElement(KeyboardIcon), t('shortcutTitle')),
|
|
7888
9431
|
t('shortcutHint'),
|
|
@@ -8012,19 +9555,35 @@ function SettingsPage(props) {
|
|
|
8012
9555
|
'div',
|
|
8013
9556
|
{ className: 'ss-toolbar', style: { marginTop: 18 } },
|
|
8014
9557
|
React.createElement('button', { type: 'button', className: 'ss-btn', disabled: busy, onClick: resetSettings }, t('resetSettings')),
|
|
8015
|
-
React.createElement(
|
|
9558
|
+
React.createElement(
|
|
9559
|
+
'button',
|
|
9560
|
+
{
|
|
9561
|
+
type: 'button',
|
|
9562
|
+
className: 'ss-btn',
|
|
9563
|
+
disabled: busy || hidden.size === 0,
|
|
9564
|
+
onClick: resetPanels,
|
|
9565
|
+
style: { marginLeft: 'auto' },
|
|
9566
|
+
title: t(hidden.size === 0 ? 'resetPanelsAllShown' : 'resetPanelsHint'),
|
|
9567
|
+
},
|
|
9568
|
+
t('resetPanels'),
|
|
9569
|
+
),
|
|
8016
9570
|
),
|
|
8017
9571
|
React.createElement(
|
|
8018
9572
|
'div',
|
|
8019
9573
|
{ className: 'ss-card', style: { marginTop: 20 } },
|
|
8020
9574
|
React.createElement('h4', null, t('about')),
|
|
8021
9575
|
React.createElement('div', { className: 'ss-kpis', style: { marginBottom: 8 } }, t('version').replace('{v}', String(version))),
|
|
8022
|
-
React.createElement('div', { className: 'ss-kpis' }, t('
|
|
8023
|
-
React.createElement('div', { className: 'ss-mono' },
|
|
8024
|
-
React.createElement('div', { className: 'ss-kpis', style: {
|
|
8025
|
-
React.createElement(
|
|
8026
|
-
|
|
8027
|
-
|
|
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
|
+
),
|
|
8028
9587
|
),
|
|
8029
9588
|
),
|
|
8030
9589
|
confirm
|
|
@@ -8035,6 +9594,7 @@ function SettingsPage(props) {
|
|
|
8035
9594
|
details: confirm.details,
|
|
8036
9595
|
preview: confirm.preview,
|
|
8037
9596
|
danger: confirm.danger === true,
|
|
9597
|
+
icon: confirm.icon ?? null,
|
|
8038
9598
|
confirmLabel: confirm.confirmLabel,
|
|
8039
9599
|
onCancel: () => setConfirm(null),
|
|
8040
9600
|
onConfirm: confirm.onConfirm,
|
|
@@ -8765,7 +10325,11 @@ let pendingTabSwitch = null;
|
|
|
8765
10325
|
label: () => t('panelName'),
|
|
8766
10326
|
locale: NS,
|
|
8767
10327
|
},
|
|
8768
|
-
(owner) => React.createElement(
|
|
10328
|
+
(owner) => React.createElement(SidebarLauncher, {
|
|
10329
|
+
size: owner?.size ?? 16,
|
|
10330
|
+
active: Boolean(owner?.active),
|
|
10331
|
+
t,
|
|
10332
|
+
}),
|
|
8769
10333
|
),
|
|
8770
10334
|
'dsh-keeper: panel launcher',
|
|
8771
10335
|
);
|
|
@@ -8777,7 +10341,7 @@ let pendingTabSwitch = null;
|
|
|
8777
10341
|
name: 'main',
|
|
8778
10342
|
key: PANEL_ID,
|
|
8779
10343
|
locale: NS,
|
|
8780
|
-
inject: () => ({ t, bridge }),
|
|
10344
|
+
inject: () => ({ t, bridge, getSessions: () => ctx.sessions }),
|
|
8781
10345
|
},
|
|
8782
10346
|
MainPanel,
|
|
8783
10347
|
),
|
|
@@ -8833,7 +10397,7 @@ let pendingTabSwitch = null;
|
|
|
8833
10397
|
}, 'dsh-keeper: hidden panel state');
|
|
8834
10398
|
|
|
8835
10399
|
// Runs for the whole app session, not only while the plugin page is mounted.
|
|
8836
|
-
ctx.effect(() => startNotifier(bridge, t), 'dsh-keeper: notification notifier');
|
|
10400
|
+
ctx.effect(() => startNotifier(bridge, t, ctx), 'dsh-keeper: notification notifier');
|
|
8837
10401
|
}
|
|
8838
10402
|
|
|
8839
10403
|
window.__ModuleLoader__.load({
|