dsh-config-manager 0.8.2 → 0.9.0
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/lib/adapters/mcp.js +42 -13
- package/lib/adapters/messages.d.ts +1 -0
- package/lib/adapters/messages.js +2 -0
- package/lib/adapters/patch-key-guard.d.ts +23 -0
- package/lib/adapters/patch-key-guard.js +13 -0
- package/lib/adapters/plugin-data.d.ts +19 -5
- package/lib/adapters/plugin-data.js +76 -22
- package/lib/adapters/plugins.d.ts +14 -1
- package/lib/adapters/plugins.js +147 -4
- package/lib/cli/actions.d.ts +7 -105
- package/lib/cli/actions.js +16 -172
- package/lib/cli/control-state.d.ts +54 -0
- package/lib/cli/control-state.js +107 -0
- package/lib/cli/index.js +14 -0
- package/lib/cli/write-gates.d.ts +61 -0
- package/lib/cli/write-gates.js +110 -0
- package/lib/client.d.ts +104 -49
- package/lib/client.js +12536 -12006
- package/lib/core/backup.d.ts +0 -4
- package/lib/core/backup.js +21 -4
- package/lib/core/boot-rescue.d.ts +1 -1
- package/lib/core/boot-rescue.js +12 -1
- package/lib/core/boot-safety.js +37 -2
- package/lib/core/conflict-decisions.js +2 -1
- package/lib/core/exporter.js +22 -1
- package/lib/core/journal.d.ts +54 -4
- package/lib/core/journal.js +158 -35
- package/lib/core/local-plugin-host.d.ts +29 -0
- package/lib/core/local-plugin-host.js +55 -48
- package/lib/core/messages.d.ts +7 -0
- package/lib/core/messages.js +14 -0
- package/lib/core/migration-history.js +16 -9
- package/lib/core/model-tools.d.ts +2 -2
- package/lib/core/model-tools.js +14 -2
- package/lib/core/patch-secret-guard.d.ts +49 -0
- package/lib/core/patch-secret-guard.js +164 -0
- package/lib/core/reconcile.d.ts +8 -0
- package/lib/core/reconcile.js +18 -3
- package/lib/core/reinstall.d.ts +2 -0
- package/lib/core/reinstall.js +6 -2
- package/lib/core/restore.js +31 -6
- package/lib/core/section-sanitize.d.ts +32 -0
- package/lib/core/section-sanitize.js +13 -0
- package/lib/core/snapshot-diff.d.ts +30 -0
- package/lib/core/snapshot-diff.js +56 -20
- package/lib/core/startup-barrier.js +8 -2
- package/lib/core/types.d.ts +22 -0
- package/lib/core/update-check.js +51 -2
- package/lib/foreign/kernel.js +9 -2
- package/lib/foreign/read-claude-plugins.js +29 -11
- package/lib/foreign/read-dsh.js +31 -2
- package/lib/foreign/session-ir.js +50 -9
- package/lib/foreign/session-read.d.ts +8 -0
- package/lib/foreign/session-read.js +26 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/profiles/dsh-profile-io.d.ts +20 -0
- package/lib/profiles/dsh-profile-io.js +27 -0
- package/lib/profiles/dsh-profile-manager.d.ts +27 -0
- package/lib/profiles/dsh-profile-manager.js +45 -4
- package/lib/profiles/dsh-profile-runtime.d.ts +5 -1
- package/lib/profiles/dsh-profile-runtime.js +16 -3
- package/lib/profiles/process-control.d.ts +18 -1
- package/lib/profiles/process-control.js +25 -1
- package/lib/routes/profiles.js +2 -1
- package/lib/routes/sync.js +13 -1
- package/lib/schema/types.d.ts +11 -0
- package/lib/security/redaction.js +22 -6
- package/lib/sync/autosync-repeat.d.ts +27 -0
- package/lib/sync/autosync-repeat.js +23 -0
- package/lib/sync/autosync-scheduler.d.ts +34 -1
- package/lib/sync/autosync-scheduler.js +151 -43
- package/lib/sync/baseline-heal.js +7 -0
- package/lib/sync/baseline-record.d.ts +67 -0
- package/lib/sync/baseline-record.js +74 -0
- package/lib/sync/blob-store.js +13 -0
- package/lib/sync/content-diff.d.ts +39 -0
- package/lib/sync/content-diff.js +46 -0
- package/lib/sync/git/git-transport.d.ts +32 -1
- package/lib/sync/git/git-transport.js +146 -26
- package/lib/sync/github-auth.d.ts +17 -1
- package/lib/sync/github-auth.js +37 -1
- package/lib/sync/merge-apply-plan.d.ts +38 -0
- package/lib/sync/merge-apply-plan.js +76 -0
- package/lib/sync/messages.d.ts +1 -0
- package/lib/sync/messages.js +2 -0
- package/lib/sync/pending-merge.d.ts +34 -0
- package/lib/sync/pending-merge.js +53 -0
- package/lib/sync/s3/s3-transport.d.ts +14 -2
- package/lib/sync/s3/s3-transport.js +72 -48
- package/lib/sync/sync-engine.d.ts +23 -40
- package/lib/sync/sync-engine.js +115 -132
- package/lib/sync/sync-history.d.ts +7 -0
- package/lib/sync/sync-state.d.ts +28 -0
- package/lib/sync/sync-state.js +20 -0
- package/lib/sync/transport.d.ts +12 -3
- package/lib/sync/transport.js +13 -4
- package/lib/sync/webdav/webdav-transport.d.ts +19 -2
- package/lib/sync/webdav/webdav-transport.js +81 -40
- package/lib/ui/commands.js +5 -11
- package/lib/ui/dsh-profiles-view.d.ts +8 -3
- package/lib/ui/dsh-profiles-view.js +9 -5
- package/lib/ui/i18n.d.ts +2 -1
- package/lib/ui/i18n.js +4 -2
- package/lib/ui/menu-placement.js +1 -1
- package/lib/ui/migration-consult-view.d.ts +11 -0
- package/lib/ui/migration-consult-view.js +15 -0
- package/lib/ui/overview-view.d.ts +7 -0
- package/lib/ui/overview-view.js +3 -0
- package/lib/ui/report.d.ts +9 -0
- package/lib/ui/report.js +17 -4
- package/lib/ui/selection-model.d.ts +8 -0
- package/lib/ui/selection-model.js +16 -0
- package/lib/utils/patch-yaml.d.ts +39 -1
- package/lib/utils/patch-yaml.js +82 -2
- package/lib/utils/paths.d.ts +13 -0
- package/lib/utils/paths.js +35 -0
- package/lib/utils/workdir-lock.js +18 -3
- package/package.json +2 -1
- package/src/adapters/mcp.test.ts +29 -0
- package/src/adapters/mcp.ts +43 -12
- package/src/adapters/messages.ts +2 -0
- package/src/adapters/patch-key-guard.ts +29 -0
- package/src/adapters/plugin-data.test.ts +126 -0
- package/src/adapters/plugin-data.ts +97 -26
- package/src/adapters/plugins.test.ts +288 -0
- package/src/adapters/plugins.ts +141 -4
- package/src/cli/actions.test.ts +74 -1
- package/src/cli/actions.ts +27 -246
- package/src/cli/control-state.ts +143 -0
- package/src/cli/index.ts +18 -0
- package/src/cli/web/web.test.ts +27 -0
- package/src/cli/write-gates.ts +149 -0
- package/src/client/about/AboutPanel.tsx +7 -6
- package/src/client/about/release-notes-view.test.ts +17 -0
- package/src/client/about/release-notes-view.ts +49 -24
- package/src/client/chat/ChatEntryView.tsx +2 -2
- package/src/client/chat/rollback-entry-view.ts +6 -1
- package/src/client/common/CommandPalette.tsx +6 -3
- package/src/client/common/ConfirmDialog.tsx +29 -12
- package/src/client/common/ContentPicker.tsx +13 -12
- package/src/client/common/Modal.tsx +12 -5
- package/src/client/common/MoreMenu.tsx +4 -1
- package/src/client/common/RunsCenter.tsx +103 -32
- package/src/client/common/Select.tsx +2 -2
- package/src/client/common/floating-bounds.ts +1 -1
- package/src/client/common/floating-units.test.ts +1 -2
- package/src/client/common/plan-text-redaction.test.ts +188 -3
- package/src/client/common/runs-center-guard.test.ts +60 -0
- package/src/client/common/runs-center-view.test.ts +128 -0
- package/src/client/common/runs-center-view.ts +96 -0
- package/src/client/common/section-title-action.test.ts +66 -0
- package/src/client/common/ui.tsx +93 -30
- package/src/client/config-manager.module.css +1507 -272
- package/src/client/consult/ConsultCard.tsx +7 -6
- package/src/client/environment/EnvironmentPanel.tsx +20 -21
- package/src/client/environment/maintenance/DiskUsageCard.tsx +65 -91
- package/src/client/environment/profiles-incomplete-ui.test.ts +8 -8
- package/src/client/export/ExportView.tsx +7 -16
- package/src/client/history/HistoryPanel.tsx +88 -28
- package/src/client/history/history-locales.ts +3 -3
- package/src/client/home/BackupScheduleCard.tsx +35 -30
- package/src/client/home/HomePanel.tsx +45 -10
- package/src/client/import/ConflictList.tsx +13 -13
- package/src/client/import/ForeignImportView.tsx +7 -6
- package/src/client/import/ImportWizardView.tsx +2 -3
- package/src/client/import/PathMappingForm.tsx +4 -4
- package/src/client/import/PathPickerDialog.tsx +2 -1
- package/src/client/import/import-wizard-steps.tsx +51 -39
- package/src/client/import/use-import-wizard-controller.test.ts +129 -0
- package/src/client/import/use-import-wizard-controller.ts +116 -22
- package/src/client/library/ArtifactRow.tsx +2 -2
- package/src/client/library/BackupInspectView.tsx +19 -15
- package/src/client/library/LibraryActions.tsx +56 -16
- package/src/client/library/LibraryPanel.tsx +7 -7
- package/src/client/library/RestorePlanView.tsx +13 -8
- package/src/client/locales/about.ts +0 -2
- package/src/client/locales/backup.ts +10 -12
- package/src/client/locales/common.ts +2 -0
- package/src/client/locales/export.ts +5 -12
- package/src/client/locales/foreign.ts +2 -2
- package/src/client/locales/import.ts +3 -2
- package/src/client/locales/overview.ts +4 -0
- package/src/client/locales/profiles.ts +32 -4
- package/src/client/locales/restore.ts +0 -2
- package/src/client/locales/sessions.ts +0 -2
- package/src/client/locales/shell.ts +2 -2
- package/src/client/market/MarketPanel.tsx +38 -20
- package/src/client/market/MyConfigsList.tsx +34 -32
- package/src/client/market/MyConfigsLoginCard.tsx +12 -15
- package/src/client/market/MyConfigsView.tsx +5 -5
- package/src/client/market/MyConfigsWizard.tsx +7 -12
- package/src/client/market/market-locales.ts +0 -6
- package/src/client/market/my-configs-split.test.ts +2 -1
- package/src/client/nav-menu-clip-guard.test.ts +52 -0
- package/src/client/recovery/IncompleteCopiesSection.tsx +1 -3
- package/src/client/recovery/RecoveryPanel.tsx +31 -16
- package/src/client/recovery/RollbackCard.tsx +58 -16
- package/src/client/recovery/RollbackFileChanges.tsx +40 -27
- package/src/client/recovery/SessionHealthCard.tsx +2 -2
- package/src/client/recovery/SessionHealthDialog.tsx +5 -7
- package/src/client/recovery/SessionLayoutSection.tsx +3 -5
- package/src/client/recovery/recovery-locales.ts +12 -8
- package/src/client/run-store.test.ts +30 -0
- package/src/client/run-store.ts +21 -1
- package/src/client/sync/AddChannelCard.tsx +65 -0
- package/src/client/sync/AutosyncCard.tsx +182 -108
- package/src/client/sync/ChannelClearConfirmDialog.tsx +5 -1
- package/src/client/sync/ChannelConfigDialog.tsx +27 -48
- package/src/client/sync/MergePreviewView.tsx +3 -5
- package/src/client/sync/PushReportSections.tsx +35 -0
- package/src/client/sync/SyncChannelEntryCard.tsx +33 -24
- package/src/client/sync/SyncConfirmView.tsx +3 -3
- package/src/client/sync/SyncLogList.tsx +16 -5
- package/src/client/sync/SyncPanel.tsx +153 -159
- package/src/client/sync/SyncProbeRow.tsx +5 -7
- package/src/client/sync/SyncRepositoryPicker.tsx +17 -4
- package/src/client/sync/SyncSecuritySection.tsx +157 -0
- package/src/client/sync/SyncSettingsDialog.tsx +304 -0
- package/src/client/sync/SyncSettingsView.test.ts +26 -8
- package/src/client/sync/WorkDirCard.tsx +2 -4
- package/src/client/sync/config-clear-guard.test.ts +94 -0
- package/src/client/sync/config-clear-guard.ts +98 -0
- package/src/client/sync/config-dirty.test.ts +91 -0
- package/src/client/sync/config-dirty.ts +88 -0
- package/src/client/sync/history-model.test.ts +2 -0
- package/src/client/sync/history-model.ts +3 -0
- package/src/client/sync/merge-request.ts +20 -0
- package/src/client/sync/sync-api.ts +12 -0
- package/src/client/sync/sync-locales.ts +87 -47
- package/src/client/sync/sync-panel-clear.test.ts +44 -0
- package/src/client/sync/sync-view.test.ts +20 -0
- package/src/client/sync/sync-view.ts +42 -4
- package/src/core/backup.test.ts +61 -1
- package/src/core/backup.ts +21 -4
- package/src/core/boot-rescue.test.ts +35 -0
- package/src/core/boot-rescue.ts +13 -2
- package/src/core/boot-safety.test.ts +25 -0
- package/src/core/boot-safety.ts +37 -2
- package/src/core/conflict-decisions.ts +2 -1
- package/src/core/exporter.ts +21 -1
- package/src/core/journal.test.ts +183 -0
- package/src/core/journal.ts +163 -25
- package/src/core/local-plugin-host.test.ts +68 -2
- package/src/core/local-plugin-host.ts +31 -4
- package/src/core/messages.ts +14 -0
- package/src/core/migration-history.test.ts +27 -0
- package/src/core/migration-history.ts +12 -4
- package/src/core/model-tools.test.ts +67 -0
- package/src/core/model-tools.ts +16 -4
- package/src/core/patch-secret-guard.test.ts +110 -0
- package/src/core/patch-secret-guard.ts +176 -0
- package/src/core/reconcile.ts +32 -4
- package/src/core/reinstall.ts +8 -2
- package/src/core/restore.ts +32 -7
- package/src/core/section-sanitize.ts +37 -0
- package/src/core/snapshot-diff.test.ts +73 -1
- package/src/core/snapshot-diff.ts +66 -21
- package/src/core/startup-barrier.test.ts +64 -0
- package/src/core/startup-barrier.ts +8 -2
- package/src/core/types.ts +27 -1
- package/src/core/update-check.test.ts +40 -0
- package/src/core/update-check.ts +53 -2
- package/src/foreign/claude-code.test.ts +5 -0
- package/src/foreign/claude-plugins.test.ts +57 -0
- package/src/foreign/claude-sessions-bytes.test.ts +7 -1
- package/src/foreign/dsh.test.ts +23 -0
- package/src/foreign/kernel.ts +9 -2
- package/src/foreign/read-claude-plugins.ts +32 -11
- package/src/foreign/read-dsh.ts +33 -2
- package/src/foreign/session-ir.test.ts +67 -0
- package/src/foreign/session-ir.ts +54 -14
- package/src/foreign/session-read.ts +23 -0
- package/src/index.ts +1 -1
- package/src/profiles/dsh-profile-copy-rollback.test.ts +58 -4
- package/src/profiles/dsh-profile-io.ts +29 -0
- package/src/profiles/dsh-profile-manager.test.ts +30 -0
- package/src/profiles/dsh-profile-manager.ts +53 -5
- package/src/profiles/dsh-profile-runtime.test.ts +29 -7
- package/src/profiles/dsh-profile-runtime.ts +17 -3
- package/src/profiles/process-control.test.ts +97 -0
- package/src/profiles/process-control.ts +28 -1
- package/src/routes/profiles.ts +2 -1
- package/src/routes/sync.ts +13 -1
- package/src/schema/types.ts +16 -1
- package/src/security/redaction.test.ts +31 -0
- package/src/security/redaction.ts +23 -6
- package/src/sync/autosync-repeat.test.ts +58 -0
- package/src/sync/autosync-repeat.ts +55 -0
- package/src/sync/autosync-scheduler.test.ts +417 -0
- package/src/sync/autosync-scheduler.ts +154 -41
- package/src/sync/baseline-heal.ts +6 -0
- package/src/sync/baseline-record.ts +135 -0
- package/src/sync/blob-store.test.ts +16 -0
- package/src/sync/blob-store.ts +13 -0
- package/src/sync/content-diff.test.ts +95 -0
- package/src/sync/content-diff.ts +79 -0
- package/src/sync/git/git-transport.test.ts +151 -4
- package/src/sync/git/git-transport.ts +143 -27
- package/src/sync/github-auth.test.ts +26 -1
- package/src/sync/github-auth.ts +37 -1
- package/src/sync/merge-apply-plan.ts +117 -0
- package/src/sync/messages.ts +2 -0
- package/src/sync/pending-merge.ts +77 -0
- package/src/sync/s3/s3-delete-and-blob-index.test.ts +249 -0
- package/src/sync/s3/s3-transport.ts +76 -42
- package/src/sync/sync-config.test.ts +39 -12
- package/src/sync/sync-device-identity.test.ts +3 -0
- package/src/sync/sync-engine.test.ts +465 -12
- package/src/sync/sync-engine.ts +130 -135
- package/src/sync/sync-history.ts +7 -0
- package/src/sync/sync-state.ts +48 -0
- package/src/sync/transport.test.ts +13 -1
- package/src/sync/transport.ts +12 -4
- package/src/sync/webdav/webdav-delete-and-blob-index.test.ts +249 -0
- package/src/sync/webdav/webdav-transport.ts +86 -34
- package/src/ui/commands.test.ts +11 -0
- package/src/ui/commands.ts +5 -14
- package/src/ui/dsh-profiles-view.test.ts +16 -0
- package/src/ui/dsh-profiles-view.ts +11 -5
- package/src/ui/i18n.ts +4 -2
- package/src/ui/menu-placement.ts +1 -1
- package/src/ui/migration-consult-view.test.ts +20 -1
- package/src/ui/migration-consult-view.ts +17 -0
- package/src/ui/overview-view.ts +10 -0
- package/src/ui/report.test.ts +25 -1
- package/src/ui/report.ts +15 -4
- package/src/ui/selection-model.test.ts +15 -1
- package/src/ui/selection-model.ts +18 -0
- package/src/utils/js-yaml4.d.ts +35 -0
- package/src/utils/patch-yaml.test.ts +207 -1
- package/src/utils/patch-yaml.ts +98 -2
- package/src/utils/paths.test.ts +14 -1
- package/src/utils/paths.ts +35 -0
- package/src/utils/workdir-lock.test.ts +69 -0
- package/src/utils/workdir-lock.ts +17 -3
- package/lib/ui/path-mapping.d.ts +0 -38
- package/lib/ui/path-mapping.js +0 -75
- package/src/client/common/InfoHint.tsx +0 -289
- package/src/client/common/info-hint-guard.test.ts +0 -1119
- package/src/client/sync/DecryptPasswordCard.tsx +0 -48
- package/src/client/sync/SecurityOptionsCard.tsx +0 -97
- package/src/client/sync/SyncSectionPickerDialog.tsx +0 -213
- package/src/ui/path-mapping.test.ts +0 -67
- package/src/ui/path-mapping.ts +0 -103
|
@@ -14,8 +14,7 @@ import { redact } from '../../security/redaction.ts'
|
|
|
14
14
|
import { HistoryApi, type HistoryExportFormat, type HistoryListResult, type HistoryRetentionState } from './history-api.ts'
|
|
15
15
|
import type { TranslateNS } from '../client-types.ts'
|
|
16
16
|
import { Badge, Banner, Button, Card, Empty } from '../common/ui.tsx'
|
|
17
|
-
import {
|
|
18
|
-
import { SkeletonTable } from '../common/Skeleton.tsx'
|
|
17
|
+
import { Icon } from '../common/Icon.tsx'
|
|
19
18
|
import { Select } from '../common/Select.tsx'
|
|
20
19
|
import { ErrorBanner } from '../common/ErrorBanner.tsx'
|
|
21
20
|
import { toast } from '../common/toast-store.ts'
|
|
@@ -156,10 +155,63 @@ export function HistoryPanel({ historyApi, t }: HistoryPanelProps) {
|
|
|
156
155
|
}
|
|
157
156
|
}
|
|
158
157
|
|
|
158
|
+
// 加载态:**整页骨架照抄真实页的壳**(徽章行 → 清理卡 → 过滤卡 → 列表卡)。
|
|
159
|
+
// 容器类全部复用真实类,只有文字与控件换成占位条 ⇒ 数据到货时位置与高度都不跳。
|
|
160
|
+
// 2026-11-14 用户反馈:旧骨架是一张 3 列表格(SkeletonTable),真实页却是「徽章行 +
|
|
161
|
+
// 两张单行控件卡 + 分组两行式行卡」,两套几何 ⇒ 数据一到整页重排、高矮差一多半。
|
|
159
162
|
if (state.status === 'loading') {
|
|
160
163
|
return (
|
|
161
164
|
<div className={css.viewBody}>
|
|
162
|
-
<
|
|
165
|
+
<div className={css.statRow} role="status" aria-busy="true" aria-label={t('history.loading')}>
|
|
166
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonBadge} />
|
|
167
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonBadge} />
|
|
168
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonBadge} />
|
|
169
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonBadge} />
|
|
170
|
+
</div>
|
|
171
|
+
{/* 自动清理卡:标签 + 上限下拉 + 当前条数徽章 + 行尾「立即清理」 */}
|
|
172
|
+
<Card className={css.historyTightCard}>
|
|
173
|
+
<div className={css.historyControlRow}>
|
|
174
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonLabel} />
|
|
175
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonControl} />
|
|
176
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonBadge} />
|
|
177
|
+
<span className={css.statusSpacer} />
|
|
178
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonButton} />
|
|
179
|
+
</div>
|
|
180
|
+
</Card>
|
|
181
|
+
{/* 过滤 + 导出卡:三个维度下拉 + 搜索框;第二行两颗按钮 */}
|
|
182
|
+
<Card className={css.historyTightCard}>
|
|
183
|
+
<div className={css.historyControlRow}>
|
|
184
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonControl} />
|
|
185
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonControl} />
|
|
186
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonControl} />
|
|
187
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonSearch} />
|
|
188
|
+
</div>
|
|
189
|
+
<div className={css.historyControlRowEnd}>
|
|
190
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonButton} />
|
|
191
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonButton} />
|
|
192
|
+
</div>
|
|
193
|
+
</Card>
|
|
194
|
+
{/* 列表卡:组头(类型 + 条数徽章)+ 两行式行卡 */}
|
|
195
|
+
<Card>
|
|
196
|
+
<div className={css.historyGroup}>
|
|
197
|
+
<div className={css.statRow}>
|
|
198
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonBadge} />
|
|
199
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonBadgeSm} />
|
|
200
|
+
</div>
|
|
201
|
+
{[0, 1, 2, 3, 4].map((i) => (
|
|
202
|
+
<div key={i} className={css.historyRow}>
|
|
203
|
+
<div className={css.historyRowMain}>
|
|
204
|
+
<div className={css.historyMeta}>
|
|
205
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonTime} />
|
|
206
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonBadgeSm} />
|
|
207
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonSections} />
|
|
208
|
+
</div>
|
|
209
|
+
<span className={css.skeletonBar + ' ' + css.historySkeletonSummary} />
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
))}
|
|
213
|
+
</div>
|
|
214
|
+
</Card>
|
|
163
215
|
</div>
|
|
164
216
|
)
|
|
165
217
|
}
|
|
@@ -202,22 +254,21 @@ export function HistoryPanel({ historyApi, t }: HistoryPanelProps) {
|
|
|
202
254
|
|
|
203
255
|
return (
|
|
204
256
|
<div className={css.viewBody}>
|
|
205
|
-
{/* 统计徽章行(页名在 TaskShell
|
|
206
|
-
<div className={css.statRow}>
|
|
257
|
+
{/* 统计徽章行(页名在 TaskShell 头部已给一次;这里只放数据) */}
|
|
258
|
+
<div className={css.statRow} title={t('history.subtitle')}>
|
|
207
259
|
<Badge kind="info">{t('history.stats.total')}: {summary.total}</Badge>
|
|
208
260
|
<Badge kind="ok">{t('history.stats.success')}: {summary.success}</Badge>
|
|
209
261
|
<Badge kind="error">{t('history.stats.failed')}: {summary.failed}</Badge>
|
|
210
262
|
<Badge kind="warn">{t('history.stats.skipped')}: {summary.skipped}</Badge>
|
|
211
|
-
<InfoHint text={t('history.subtitle')} label={t('common.infoHint')} />
|
|
212
263
|
</div>
|
|
213
264
|
|
|
214
265
|
{/* 损坏条目:结论句 + 计数徽章同一行(计数属于「状态」,用徽章而不是第二句灰字)。 */}
|
|
215
266
|
{corrupted.length > 0 && (
|
|
216
267
|
<Banner kind="warn">
|
|
217
|
-
<
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
</
|
|
268
|
+
<Icon name="warn" size={14} />
|
|
269
|
+
<span>{t('history.corruptedBanner')}</span>
|
|
270
|
+
<span className={css.statusSpacer} />
|
|
271
|
+
<Badge kind="warn">{t('history.corruptedCount', { count: String(corrupted.length) })}</Badge>
|
|
221
272
|
</Banner>
|
|
222
273
|
)}
|
|
223
274
|
|
|
@@ -225,10 +276,10 @@ export function HistoryPanel({ historyApi, t }: HistoryPanelProps) {
|
|
|
225
276
|
分隔成独立卡。磁盘现状用徽章(状态),不写成第二句灰字;超限徽章转 warn —— 停在超限说明
|
|
226
277
|
清理还没跑到(节流 60s 或本轮刚写过),不是「已收敛」。 */}
|
|
227
278
|
{retention !== null && (
|
|
228
|
-
<Card>
|
|
229
|
-
<div className={css.
|
|
230
|
-
<span className={css.fieldLabel}>
|
|
231
|
-
{t('history.retention.label')}
|
|
279
|
+
<Card className={css.historyTightCard}>
|
|
280
|
+
<div className={css.historyControlRow}>
|
|
281
|
+
<span className={css.fieldLabel} title={t('history.retention.hint')}>
|
|
282
|
+
{t('history.retention.label')}
|
|
232
283
|
</span>
|
|
233
284
|
<Select
|
|
234
285
|
value={String(retention.maxEntries)}
|
|
@@ -238,6 +289,7 @@ export function HistoryPanel({ historyApi, t }: HistoryPanelProps) {
|
|
|
238
289
|
<Badge kind={retention.maxEntries > 0 && retention.total > retention.maxEntries ? 'warn' : 'info'}>
|
|
239
290
|
{t('history.retention.current', { count: String(retention.total) })}
|
|
240
291
|
</Badge>
|
|
292
|
+
<span className={css.statusSpacer} />
|
|
241
293
|
<Button
|
|
242
294
|
onClick={() => void applyRetention(retention.maxEntries)}
|
|
243
295
|
loading={state.retentionBusy}
|
|
@@ -250,8 +302,10 @@ export function HistoryPanel({ historyApi, t }: HistoryPanelProps) {
|
|
|
250
302
|
)}
|
|
251
303
|
|
|
252
304
|
{/* 过滤 + 导出:控件各自带维度标签(「操作类型: 全部」…),不再另起一行区块标题。 */}
|
|
253
|
-
<Card>
|
|
254
|
-
|
|
305
|
+
<Card className={css.historyTightCard}>
|
|
306
|
+
{/* 两行结构:第一行是「筛什么」(三个维度下拉 + 搜索),第二行是「拿到之后做什么」
|
|
307
|
+
(刷新 / 导出)。挤成一行的直接后果是 564px 里 7 个控件换行成两行半,读不出分组。 */}
|
|
308
|
+
<div className={css.historyControlRow}>
|
|
255
309
|
<Select
|
|
256
310
|
value={state.filter.kind ?? ''}
|
|
257
311
|
onChange={(next) => setFilter({ kind: next === '' ? undefined : next as never })}
|
|
@@ -279,13 +333,19 @@ export function HistoryPanel({ historyApi, t }: HistoryPanelProps) {
|
|
|
279
333
|
{ value: '200', label: t('history.filter.recent.200') },
|
|
280
334
|
]}
|
|
281
335
|
/>
|
|
282
|
-
<
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
336
|
+
<label className={css.historySearch}>
|
|
337
|
+
<Icon name="inspect" size={12} />
|
|
338
|
+
<input
|
|
339
|
+
className={css.historySearchInput}
|
|
340
|
+
type="search"
|
|
341
|
+
aria-label={t('history.search.placeholder')}
|
|
342
|
+
placeholder={t('history.search.placeholder')}
|
|
343
|
+
value={state.filter.query}
|
|
344
|
+
onChange={(e) => setFilter({ query: e.target.value })}
|
|
345
|
+
/>
|
|
346
|
+
</label>
|
|
347
|
+
</div>
|
|
348
|
+
<div className={css.historyControlRowEnd}>
|
|
289
349
|
<Button
|
|
290
350
|
onClick={() => void load(true)}
|
|
291
351
|
loading={state.refreshing}
|
|
@@ -329,11 +389,11 @@ function HistoryList({ groups, t }: { groups: ReturnType<typeof groupByKind>; t:
|
|
|
329
389
|
<Badge kind="info">{t(g.kindLabelKey)}</Badge>
|
|
330
390
|
<Badge kind="info">{g.count}</Badge>
|
|
331
391
|
</div>
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
392
|
+
{/* 行直接留在卡片里:每组分一个 380px 描边滚动盒,会让 564px 的面板出现
|
|
393
|
+
「框里还有框、滚动条两套」;长列表的滚动交给面板正文,卡片只负责分隔。 */}
|
|
394
|
+
{g.entries.map((e) => (
|
|
395
|
+
<HistoryRow key={e.at + e.kind} entry={e} t={t} />
|
|
396
|
+
))}
|
|
337
397
|
</div>
|
|
338
398
|
))}
|
|
339
399
|
</Card>
|
|
@@ -41,14 +41,14 @@ type CommonKey =
|
|
|
41
41
|
| 'history.retention.cleaned'
|
|
42
42
|
| 'history.retention.noop'
|
|
43
43
|
| 'history.retention.saveError'
|
|
44
|
-
/**
|
|
44
|
+
/** 说明按钮的可访问名(2026-11-14 起 ⓘ 已下线、代码不再消费;键与四本字典口径一并保留,免得下游按键取文案时缺项) */
|
|
45
45
|
| 'common.infoHint';
|
|
46
46
|
|
|
47
47
|
export type HistoryKey = KindKey | ResultKey | CommonKey;
|
|
48
48
|
|
|
49
49
|
export const zh = {
|
|
50
50
|
'common.infoHint': '查看说明',
|
|
51
|
-
'history.subtitle': '
|
|
51
|
+
'history.subtitle': '只可追加,不可修改或删除,跨重启持久。',
|
|
52
52
|
'history.empty': '暂无迁移记录。',
|
|
53
53
|
'history.loading': '加载迁移历史…',
|
|
54
54
|
'history.corruptedBanner': '检测到无法读取/可能被篡改的历史条目',
|
|
@@ -106,7 +106,7 @@ export const zh = {
|
|
|
106
106
|
|
|
107
107
|
export const en = {
|
|
108
108
|
'common.infoHint': 'Show description',
|
|
109
|
-
'history.subtitle': '
|
|
109
|
+
'history.subtitle': 'Append-only — entries cannot be edited or deleted, and persist across restarts.',
|
|
110
110
|
'history.empty': 'No migration records yet.',
|
|
111
111
|
'history.loading': 'Loading migration history…',
|
|
112
112
|
'history.corruptedBanner': 'Detected unreadable or possibly tampered history entries',
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
* 保存成功清草稿(宿主配置为权威)。
|
|
10
10
|
*
|
|
11
11
|
* 本文件是**从构建产物(lib/client.js,2026-10-02T23:33Z)还原**的:一次误用的通配删除
|
|
12
|
-
* 把它删掉了,而 git
|
|
12
|
+
* 把它删掉了,而 git 里那份是**更早的修订**(早于那批说明文案迁移),没有可直接恢复的源。
|
|
13
13
|
* 逻辑、文案键、CSS 类与调用顺序按编译产物逐段翻译,**排版与注释措辞是重建的**。
|
|
14
14
|
* 教训见 AGENTS.md「常见坑」。
|
|
15
15
|
*/
|
|
16
|
-
import { useEffect, useRef, useState } from 'react'
|
|
16
|
+
import { useEffect, useId, useRef, useState } from 'react'
|
|
17
17
|
import {
|
|
18
18
|
BACKUP_INTERVAL_OPTIONS, DEFAULT_RETENTION_POLICY, RETENTION_FIELDS, RETENTION_FIELD_LIMITS,
|
|
19
19
|
backupDraftDirty, backupRunBadgeKind, hasRetentionTiers, normalizeRetentionPolicy,
|
|
@@ -34,10 +34,9 @@ import { describeSkipReason } from '../sync/history-model.ts'
|
|
|
34
34
|
import { runStore } from '../run-store.ts'
|
|
35
35
|
import type { ConfigManagerApi } from '../api.ts'
|
|
36
36
|
import type { TranslateNS } from '../client-types.ts'
|
|
37
|
-
import { Badge, Banner, Button, Card,
|
|
37
|
+
import { Badge, Banner, Button, Card, StatusDot, Switch } from '../common/ui.tsx'
|
|
38
38
|
import { Select } from '../common/Select.tsx'
|
|
39
39
|
import { Skeleton } from '../common/Skeleton.tsx'
|
|
40
|
-
import { InfoHint } from '../common/InfoHint.tsx'
|
|
41
40
|
import { toast } from '../common/toast-store.ts'
|
|
42
41
|
import { redact } from '../../security/redaction.ts'
|
|
43
42
|
import css from '../config-manager.module.css'
|
|
@@ -66,6 +65,8 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
66
65
|
const [status, setStatus] = useState<'loading' | 'ready' | 'error'>('loading')
|
|
67
66
|
const [, setError] = useState<string | null>(null)
|
|
68
67
|
const [draft, setDraft] = useState<BackupScheduleDraft>({ enabled: false, interval: '24h' })
|
|
68
|
+
/** 开关的 id:让标题文字也能拨动(label htmlFor),与原来勾选框的点击面一致 */
|
|
69
|
+
const enabledSwitchId = useId()
|
|
69
70
|
const [saved, setSaved] = useState<BackupScheduleStatus | null>(null)
|
|
70
71
|
const [saving, setSaving] = useState(false)
|
|
71
72
|
const [running, setRunning] = useState(false)
|
|
@@ -214,9 +215,13 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
214
215
|
return (
|
|
215
216
|
<Card>
|
|
216
217
|
<div className={css.groupHeader}>
|
|
217
|
-
<span className={css.groupLabel}>{t('backupSchedule.title')}</span>
|
|
218
|
-
<InfoHint text={t('backupSchedule.hint')} label={t('common.infoHint')} />
|
|
218
|
+
<span className={css.groupLabel} title={t('backupSchedule.hint')}>{t('backupSchedule.title')}</span>
|
|
219
219
|
<span className={css.statusSpacer} />
|
|
220
|
+
{/* 次序按设计稿(2026-11-14 D-01):立即备份(ghost)在左、保存(primary)在右 ——
|
|
221
|
+
主操作收在动作行右端,与 .actionRow / .dialogFooter 的既有收尾方向一致。 */}
|
|
222
|
+
<Button size="sm" loading={running} disabled={saving || !(saved?.enabled ?? false)} onClick={runNow}>
|
|
223
|
+
{t('backupSchedule.runNow')}
|
|
224
|
+
</Button>
|
|
220
225
|
<Button
|
|
221
226
|
variant="primary"
|
|
222
227
|
size="sm"
|
|
@@ -227,9 +232,6 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
227
232
|
>
|
|
228
233
|
{t('backupSchedule.save')}
|
|
229
234
|
</Button>
|
|
230
|
-
<Button size="sm" loading={running} disabled={saving || !(saved?.enabled ?? false)} onClick={runNow}>
|
|
231
|
-
{t('backupSchedule.runNow')}
|
|
232
|
-
</Button>
|
|
233
235
|
</div>
|
|
234
236
|
|
|
235
237
|
{status === 'loading' && <Skeleton count={2} label={t('backupSchedule.loading')} />}
|
|
@@ -244,8 +246,10 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
244
246
|
{status === 'ready' && (
|
|
245
247
|
<>
|
|
246
248
|
{/* 事实行:状态 / 间隔 / 上次运行(全部取宿主权威值,不受草稿影响) */}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
+
{/* 带框卡格(D-01):`.factBox` 与 `.factGrid` 挂在同一个元素上 —— 边框由 home 私有类提供,
|
|
250
|
+
共享的 .factGrid 本体未改(它还被同步/工作目录三张卡引用)。前两格不再各自跨两列。 */}
|
|
251
|
+
<div className={`${css.factGrid} ${css.factBox}`}>
|
|
252
|
+
<div className={css.factCell}>
|
|
249
253
|
<span className={css.factLabel}>{t('snapshots.status')}</span>
|
|
250
254
|
<span className={css.factValue}>
|
|
251
255
|
<span className={css.infoValue}>
|
|
@@ -254,7 +258,7 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
254
258
|
</span>
|
|
255
259
|
</span>
|
|
256
260
|
</div>
|
|
257
|
-
<div className={css.factCell}
|
|
261
|
+
<div className={css.factCell}>
|
|
258
262
|
<span className={css.factLabel}>{t('backupSchedule.interval')}</span>
|
|
259
263
|
<span className={css.factValue}>{intervalFactText()}</span>
|
|
260
264
|
</div>
|
|
@@ -277,13 +281,17 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
277
281
|
|
|
278
282
|
{/* 设置行:开关 + 间隔(+ 自定义档的星期/时/分) */}
|
|
279
283
|
<div className={css.actionRow} style={{ marginTop: 10, marginBottom: 0 }}>
|
|
280
|
-
|
|
284
|
+
{/* 弹性开关(2026-11-14 用户要求):这里是「定时备份是否启用」这个单一布尔。
|
|
285
|
+
注意它改的是**草稿**(本卡仍是「改完点保存」),拨动即时可见、落库仍在保存时 ——
|
|
286
|
+
与「拨动即生效」的开关惯例不同,按用户明确要求保留这个位置。 */}
|
|
287
|
+
<Switch
|
|
288
|
+
id={enabledSwitchId}
|
|
281
289
|
checked={draft.enabled}
|
|
282
290
|
onChange={(checked: boolean) => { updateDraft({ ...draft, enabled: checked }) }}
|
|
283
291
|
label={t('backupSchedule.enabled')}
|
|
284
292
|
disabled={busy}
|
|
285
293
|
/>
|
|
286
|
-
{
|
|
294
|
+
<label className={css.toggleLabel} htmlFor={enabledSwitchId} title={t('backupSchedule.enabledHint')}>{t('backupSchedule.enabled')}</label>
|
|
287
295
|
{draft.enabled && (
|
|
288
296
|
<Select
|
|
289
297
|
value={draft.interval}
|
|
@@ -303,6 +311,7 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
303
311
|
disabled={busy}
|
|
304
312
|
style={{ width: 'auto' }}
|
|
305
313
|
ariaLabel={t('backupSchedule.weekday')}
|
|
314
|
+
title={t('backupSchedule.customHint')}
|
|
306
315
|
onChange={(next) => {
|
|
307
316
|
updateDraft({
|
|
308
317
|
...draft,
|
|
@@ -318,6 +327,7 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
318
327
|
disabled={busy}
|
|
319
328
|
style={{ width: 'auto' }}
|
|
320
329
|
ariaLabel={t('backupSchedule.hour')}
|
|
330
|
+
title={t('backupSchedule.customHint')}
|
|
321
331
|
onChange={(next) => {
|
|
322
332
|
updateDraft({
|
|
323
333
|
...draft,
|
|
@@ -333,6 +343,7 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
333
343
|
disabled={busy}
|
|
334
344
|
style={{ width: 'auto' }}
|
|
335
345
|
ariaLabel={t('backupSchedule.minute')}
|
|
346
|
+
title={t('backupSchedule.customHint')}
|
|
336
347
|
onChange={(next) => {
|
|
337
348
|
updateDraft({
|
|
338
349
|
...draft,
|
|
@@ -342,27 +353,29 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
342
353
|
options={MINUTE_OPTIONS.map((m) => ({ value: String(m), label: String(m).padStart(2, '0') }))}
|
|
343
354
|
/>
|
|
344
355
|
)}
|
|
345
|
-
{draft.enabled && draft.interval === 'custom' && (
|
|
346
|
-
<InfoHint text={t('backupSchedule.customHint')} label={t('common.infoHint')} />
|
|
347
|
-
)}
|
|
348
356
|
</div>
|
|
349
357
|
|
|
350
358
|
{/* 保留策略(三层):与间隔同属草稿,随「保存」一起提交 */}
|
|
351
359
|
<div className={css.groupHeader} style={{ marginTop: 12 }}>
|
|
352
|
-
<span className={css.groupLabel}>{t('retention.title')}</span>
|
|
353
|
-
<InfoHint text={t('retention.hint')} label={t('common.infoHint')} />
|
|
360
|
+
<span className={css.groupLabel} title={t('retention.hint')}>{t('retention.title')}</span>
|
|
354
361
|
<span className={css.statusSpacer} />
|
|
355
362
|
<span className={css.hint}>{!hasRetentionTiers(retentionDraft) && t('retention.tiersOff')}</span>
|
|
356
363
|
</div>
|
|
357
|
-
<div
|
|
364
|
+
<div
|
|
365
|
+
className={css.actionRow}
|
|
366
|
+
style={{ marginBottom: 0 }}
|
|
367
|
+
title={hasRetentionTiers(retentionDraft) ? t('retention.keepLastHint') + ' · ' + t('retention.keepMonthlyHint') + ' · ' + t('retention.keepYearlyHint') : undefined}
|
|
368
|
+
>
|
|
358
369
|
{RETENTION_FIELDS.map((field) => {
|
|
359
370
|
const limits = RETENTION_FIELD_LIMITS[field]
|
|
360
371
|
const unit = field === 'keepLast'
|
|
361
372
|
? t('retention.unit')
|
|
362
373
|
: field === 'keepMonthly' ? t('retention.months') : t('retention.years')
|
|
363
374
|
return (
|
|
364
|
-
|
|
365
|
-
|
|
375
|
+
/* 保留策略的三张数字卡(D-01):标题跨满整行,「数字 + 单位」压在卡右下。
|
|
376
|
+
卡格样式走 home 私有类 .retentionCard —— 共享 .field / .fieldLabel 本体未动。 */
|
|
377
|
+
<label key={field} className={css.retentionCard}>
|
|
378
|
+
<span className={css.retentionCardLabel}>
|
|
366
379
|
{field === 'keepLast'
|
|
367
380
|
? t('retention.keepLast')
|
|
368
381
|
: field === 'keepMonthly' ? t('retention.keepMonthly') : t('retention.keepYearly')}
|
|
@@ -375,7 +388,6 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
375
388
|
step={1}
|
|
376
389
|
value={retentionDraft[field]}
|
|
377
390
|
disabled={busy}
|
|
378
|
-
style={{ width: 88 }}
|
|
379
391
|
onChange={(event) => {
|
|
380
392
|
const raw = event.target.value
|
|
381
393
|
const parsed = raw === '' ? 0 : Number(raw)
|
|
@@ -386,13 +398,6 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
386
398
|
</label>
|
|
387
399
|
)
|
|
388
400
|
})}
|
|
389
|
-
{hasRetentionTiers(retentionDraft) && (
|
|
390
|
-
<InfoHint
|
|
391
|
-
text={t('retention.keepLastHint') + ' · ' + t('retention.keepMonthlyHint') + ' · ' + t('retention.keepYearlyHint')}
|
|
392
|
-
label={t('common.infoHint')}
|
|
393
|
-
/>
|
|
394
|
-
)}
|
|
395
|
-
<InfoHint text={t('retention.appliesTo')} label={t('common.infoHint')} />
|
|
396
401
|
</div>
|
|
397
402
|
|
|
398
403
|
{(saved?.consecutiveFailures ?? 0) > 0 && (
|
|
@@ -35,6 +35,7 @@ import type { TranslateNS } from '../client-types.ts'
|
|
|
35
35
|
import type { ConfigManagerKey } from '../locales.ts'
|
|
36
36
|
import { redact } from '../../security/redaction.ts'
|
|
37
37
|
import { runStore } from '../run-store.ts'
|
|
38
|
+
import { requestMergeDecision } from '../sync/merge-request.ts'
|
|
38
39
|
import type { ArtifactKind } from '../../ui/artifact-view.ts'
|
|
39
40
|
import { toast } from '../common/toast-store.ts'
|
|
40
41
|
import { isAccessModeError } from '../common/access-mode.ts'
|
|
@@ -342,6 +343,19 @@ export function HomePanel({ api, syncApi, historyApi, t, syncT, openForeignImpor
|
|
|
342
343
|
runStore.patch({ panel: 'environment' })
|
|
343
344
|
}
|
|
344
345
|
|
|
346
|
+
/**
|
|
347
|
+
* P2(2026-11-14 真机事故):待裁决行 → 同步页并直接拉起合并裁决。
|
|
348
|
+
*
|
|
349
|
+
* 首页只知道「有事等我裁决」(宿主的 pendingMerge → 徽章 pending),
|
|
350
|
+
* 怎么把裁决视图拉起来只有同步页知道(runSyncSmart → /sync/merge-preview → MergeModal)。
|
|
351
|
+
* 所以首页只发一个一次性信号(requestMergeDecision),由同步页取走后清空 ——
|
|
352
|
+
* 不进 run-store、不落盘,刷新不会凭空弹窗。
|
|
353
|
+
*/
|
|
354
|
+
const navMerge = (): void => {
|
|
355
|
+
requestMergeDecision()
|
|
356
|
+
runStore.patch({ panel: 'sync' })
|
|
357
|
+
}
|
|
358
|
+
|
|
345
359
|
/** 是否存在待处理恢复事项(null = 状态未知;决定健康段是否作为「事故恢复」入口)。 */
|
|
346
360
|
const recoveryRequired = store.recovery.status !== null
|
|
347
361
|
? toRecoveryView(store.recovery.status).recoveryRequired === true
|
|
@@ -503,11 +517,11 @@ export function HomePanel({ api, syncApi, historyApi, t, syncT, openForeignImpor
|
|
|
503
517
|
</Card>
|
|
504
518
|
) : (
|
|
505
519
|
<>
|
|
506
|
-
{/* 3. 最近活动表(**首页最后一个数据块**)。2026-11-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
<Card className={css.activityCard}>
|
|
520
|
+
{/* 3. 最近活动表(**首页最后一个数据块**)。2026-11-14:卡片重新吃满剩余高度 ——
|
|
521
|
+
用户要求「骨架铺满整页、加载完成后不位移」:高度随内容时,骨架(5 行)只占半页,
|
|
522
|
+
数据一到卡片长高、整页被推下去。现在卡片边界恒等于可用空间,行数多时列表内滚;
|
|
523
|
+
卡内空带由行本身铺满(骨架按一屏行数生成),不再是「下半截空一条」。 */}
|
|
524
|
+
<Card className={css.activityCard + ' ' + css.activityCardFill}>
|
|
511
525
|
<div className={css.activityHeader}>
|
|
512
526
|
<span className={css.activityTitle}>{t('overview.activity.title')}</span>
|
|
513
527
|
{/* 加载态不写字(2026-11-04 用户第二条):列头右侧原先挂「加载中…」,
|
|
@@ -529,8 +543,10 @@ export function HomePanel({ api, syncApi, historyApi, t, syncT, openForeignImpor
|
|
|
529
543
|
{historyState === 'loading'
|
|
530
544
|
? (
|
|
531
545
|
<div className={css.activityRows}>
|
|
532
|
-
{/* 骨架行与真实行同一 grid / 行高 /
|
|
533
|
-
|
|
546
|
+
{/* 骨架行与真实行同一 grid / 行高 / 分隔线,装在同一个滚动容器里。
|
|
547
|
+
行数按**一屏**给(16 × 38.5px ≈ 616px,覆盖 564×720 画布的活动区),
|
|
548
|
+
多出来的部分被滚动容器裁掉 —— 占位因此铺满整张卡,而不是只铺半页。 */}
|
|
549
|
+
<SkeletonActivityRows count={16} label={t('common.loading')} />
|
|
534
550
|
</div>
|
|
535
551
|
)
|
|
536
552
|
: activity.length === 0
|
|
@@ -542,8 +558,14 @@ export function HomePanel({ api, syncApi, historyApi, t, syncT, openForeignImpor
|
|
|
542
558
|
{activity.map((item, i) => {
|
|
543
559
|
const atMs = Date.parse(item.at) || 0
|
|
544
560
|
const kindText = kindLabel(item.kindKey, t)
|
|
545
|
-
|
|
546
|
-
|
|
561
|
+
const rowKey = `${item.at}-${i}`
|
|
562
|
+
// P2:待裁决行是可点的(去同步页裁决);其余行保持纯信息。
|
|
563
|
+
// 用 button 承载而不是给 div 挂 onClick —— 键盘 Tab/回车与读屏语义才能对。
|
|
564
|
+
const rowClass = item.jumpTo === 'sync'
|
|
565
|
+
? `${css.activityRow} ${css.activityRowAction}`
|
|
566
|
+
: css.activityRow
|
|
567
|
+
const cells = (
|
|
568
|
+
<>
|
|
547
569
|
<span className={css.activityTime} title={atMs > 0 ? new Date(atMs).toLocaleString() : undefined}>
|
|
548
570
|
{renderRelTime(atMs, t)}
|
|
549
571
|
</span>
|
|
@@ -561,8 +583,21 @@ export function HomePanel({ api, syncApi, historyApi, t, syncT, openForeignImpor
|
|
|
561
583
|
<CopyButton text={item.summary} label={t('overview.activity.copy')} t={t} />
|
|
562
584
|
</span>
|
|
563
585
|
<span className={css.activityBadge}>{resultNode(item.badge)}</span>
|
|
564
|
-
|
|
586
|
+
</>
|
|
565
587
|
)
|
|
588
|
+
return item.jumpTo === 'sync'
|
|
589
|
+
? (
|
|
590
|
+
<button
|
|
591
|
+
type="button"
|
|
592
|
+
className={rowClass}
|
|
593
|
+
key={rowKey}
|
|
594
|
+
onClick={navMerge}
|
|
595
|
+
title={t('overview.activity.openMerge')}
|
|
596
|
+
>
|
|
597
|
+
{cells}
|
|
598
|
+
</button>
|
|
599
|
+
)
|
|
600
|
+
: <div className={rowClass} key={rowKey}>{cells}</div>
|
|
566
601
|
})}
|
|
567
602
|
</div>
|
|
568
603
|
)}
|
|
@@ -25,7 +25,7 @@ import { ConflictCollector } from '../../ui/conflict-view.ts'
|
|
|
25
25
|
import type { ItemResolution } from '../../core/types.ts'
|
|
26
26
|
import type { TranslateNS } from '../client-types.ts'
|
|
27
27
|
import { redact } from '../../security/redaction.ts'
|
|
28
|
-
import { Banner, Chip } from '../common/ui.tsx'
|
|
28
|
+
import { Banner, Button, Chip } from '../common/ui.tsx'
|
|
29
29
|
import css from '../config-manager.module.css'
|
|
30
30
|
|
|
31
31
|
export interface ConflictListProps {
|
|
@@ -97,26 +97,26 @@ export function ConflictList({ collector, t, onChanged }: ConflictListProps) {
|
|
|
97
97
|
<div className={css.conflictList}>
|
|
98
98
|
{unresolved > 0 && <Banner kind="warn">{t('import.conflicts.unresolved', { count: String(unresolved) })}</Banner>}
|
|
99
99
|
|
|
100
|
-
{/*
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
{/* 批量决策按钮(无冲突项时禁用;均为次操作——覆盖性决策不诱导,逐项选边为主)。
|
|
101
|
+
同一行左对齐、不换行(设计稿 T-02c ④;用户 2026-11-14 明确要求):两条整批决策是并列的
|
|
102
|
+
同一档动作,横排成一组;折行会让第二条变成视觉上的次级项。 */}
|
|
103
|
+
<div className={css.conflictBulk}>
|
|
104
|
+
<Button
|
|
105
|
+
variant="ghost"
|
|
106
|
+
size="sm"
|
|
106
107
|
disabled={!hasConflicts}
|
|
107
108
|
onClick={() => { resolveAll(collector, 'keepCurrent', setTick, onChanged) }}
|
|
108
109
|
>
|
|
109
110
|
{t('import.conflicts.keepCurrentAll')}
|
|
110
|
-
</
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
data-size="sm"
|
|
111
|
+
</Button>
|
|
112
|
+
<Button
|
|
113
|
+
variant="ghost"
|
|
114
|
+
size="sm"
|
|
115
115
|
disabled={!hasConflicts}
|
|
116
116
|
onClick={() => { resolveAll(collector, 'useImported', setTick, onChanged) }}
|
|
117
117
|
>
|
|
118
118
|
{t('import.conflicts.useImportedAll')}
|
|
119
|
-
</
|
|
119
|
+
</Button>
|
|
120
120
|
</div>
|
|
121
121
|
|
|
122
122
|
{items.map((view) => {
|
|
@@ -38,9 +38,9 @@ import {
|
|
|
38
38
|
} from '../../ui/foreign-view.ts'
|
|
39
39
|
import { Badge, Banner, Button, Card, SectionTitle } from '../common/ui.tsx'
|
|
40
40
|
import { SkeletonList } from '../common/Skeleton.tsx'
|
|
41
|
-
import { InfoHint } from '../common/InfoHint.tsx'
|
|
42
41
|
import { ErrorBanner } from '../common/ErrorBanner.tsx'
|
|
43
42
|
import { redact } from '../../security/redaction.ts'
|
|
43
|
+
import { sectionLabeler } from '../common/section-labels.ts'
|
|
44
44
|
import css from '../config-manager.module.css'
|
|
45
45
|
|
|
46
46
|
export interface ForeignImportViewProps {
|
|
@@ -211,7 +211,7 @@ export function ForeignImportView({ api, t, uiT, onReady }: ForeignImportViewPro
|
|
|
211
211
|
|
|
212
212
|
return (
|
|
213
213
|
<div className={css.viewBody}>
|
|
214
|
-
<SectionTitle title={t('foreign.source.title')}
|
|
214
|
+
<SectionTitle title={t('foreign.source.title')} tooltip={t('foreign.source.hint')} />
|
|
215
215
|
|
|
216
216
|
{loadError !== null && (
|
|
217
217
|
<ErrorBanner
|
|
@@ -255,7 +255,7 @@ export function ForeignImportView({ api, t, uiT, onReady }: ForeignImportViewPro
|
|
|
255
255
|
**位置**:来源列表之后、动作行(含「开始导入」)之前 —— 既保证「导入前必读」,
|
|
256
256
|
又不把六个来源挤出首屏(t10 的 T10-F2 真机体验反馈)。 */}
|
|
257
257
|
<Card>
|
|
258
|
-
<div className={css.groupLabel}
|
|
258
|
+
<div className={css.groupLabel} title={t('foreign.lossy.hint')}>{t('foreign.lossy.title')}</div>
|
|
259
259
|
<ul className={css.skipList}>
|
|
260
260
|
{lossyRows.map((row) => (
|
|
261
261
|
<li key={row.kind} className={css.skipRow}>
|
|
@@ -264,7 +264,8 @@ export function ForeignImportView({ api, t, uiT, onReady }: ForeignImportViewPro
|
|
|
264
264
|
{row.applicable ? t('foreign.lossy.applies') : t('foreign.lossy.notApplies')}
|
|
265
265
|
</Badge>
|
|
266
266
|
)}
|
|
267
|
-
|
|
267
|
+
{/* detail 在窄画布上会被折行截断(T-03 剩余缺陷):title 兜住完整原文,不加布局、不加 CSS。 */}
|
|
268
|
+
<span className={css.skipText} title={redact(row.detail)}>
|
|
268
269
|
<strong>{redact(row.title)}</strong>{' '}
|
|
269
270
|
{redact(row.detail)}
|
|
270
271
|
</span>
|
|
@@ -303,10 +304,10 @@ export function ForeignImportView({ api, t, uiT, onReady }: ForeignImportViewPro
|
|
|
303
304
|
{/* 产包结果(成功后才出现):让用户在进向导前先看到「包里有什么」 */}
|
|
304
305
|
{produced !== null && (
|
|
305
306
|
<Card>
|
|
306
|
-
<div className={css.groupLabel}>{t('foreign.previewTitle')} <
|
|
307
|
+
<div className={css.groupLabel}>{t('foreign.previewTitle')} <span className={css.hint}>{t('foreign.previewDryRun')}</span></div>
|
|
307
308
|
<div className={css.statRow}>
|
|
308
309
|
<Badge kind="ok">
|
|
309
|
-
{t('foreign.previewSections', { sections: produced.sections.join(' · ') })}
|
|
310
|
+
{t('foreign.previewSections', { sections: produced.sections.map(sectionLabeler(t)).join(' · ') })}
|
|
310
311
|
</Badge>
|
|
311
312
|
{produced.credentialRefs.length > 0
|
|
312
313
|
? <Badge kind="warn">{t('foreign.credentialRefs', { count: String(produced.credentialRefs.length) })}</Badge>
|
|
@@ -48,7 +48,6 @@ import { runStore } from '../run-store.ts'
|
|
|
48
48
|
import {
|
|
49
49
|
Badge, Banner, Button, Card, SectionTitle, Stepper,
|
|
50
50
|
} from '../common/ui.tsx'
|
|
51
|
-
import { InfoHint } from '../common/InfoHint.tsx'
|
|
52
51
|
import { ErrorBanner, ErrorList } from '../common/ErrorBanner.tsx'
|
|
53
52
|
import { ProgressBar } from '../common/ProgressBar.tsx'
|
|
54
53
|
import type { RunProgress } from '../common/progress-view.ts'
|
|
@@ -150,7 +149,7 @@ function CompatibilityStep(props: {
|
|
|
150
149
|
const notes = compatibilityNotes(analysis.compatibilityReasons)
|
|
151
150
|
return (
|
|
152
151
|
<div className={css.viewBody}>
|
|
153
|
-
<SectionTitle title={t('import.compatibility.title')} />
|
|
152
|
+
<SectionTitle title={t('import.compatibility.title')} tooltip={t('import.compatibility.hint')} />
|
|
154
153
|
<div className={css.statRow}>
|
|
155
154
|
<Badge kind={compatibilityBadgeKind(level)}>
|
|
156
155
|
{t('import.compatibility.score', { score: t(scoreKey) })}
|
|
@@ -263,7 +262,7 @@ function ContentSelectStage(props: {
|
|
|
263
262
|
} = props
|
|
264
263
|
return (
|
|
265
264
|
<div className={css.viewBody}>
|
|
266
|
-
<SectionTitle title={t('import.picker.title')}
|
|
265
|
+
<SectionTitle title={t('import.picker.title')} tooltip={t('import.picker.hint')} />
|
|
267
266
|
<div className={css.statRow}>
|
|
268
267
|
<Badge kind={summary.willChange > 0 ? 'info' : 'ok'}>{t('import.preview.willChange', { count: String(summary.willChange) })}</Badge>
|
|
269
268
|
{summary.unchanged > 0 && <Badge kind="ok">{t('import.preview.unchanged', { count: String(summary.unchanged) })}</Badge>}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 路径映射表单(规范 §12,绑 src/ui/types.ts 的 PathMappingDraft 形状)。
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* 浏览器半不能引 node:path,所以这里只做「收集用户输入」:输入输出形状与 core 的
|
|
5
|
+
* PathMapping 完全一致(oldPrefix/newPrefix/appliesTo),实际前缀替换由 Host 侧 core 在
|
|
6
|
+
* createImportPlan 阶段执行。此前另有一份 src/ui/path-mapping.ts 的同规则实现(依赖
|
|
7
|
+
* utils/paths.ts),生产零引用,已删(审计 P10-6:同一规则只留一处)。
|
|
8
8
|
*/
|
|
9
9
|
import { useMemo, useState } from 'react'
|
|
10
10
|
import type { ChangeEvent } from 'react'
|