dsh-config-manager 0.8.2 → 0.10.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 +51 -15
- 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 +204 -6
- package/lib/adapters/prompts.js +15 -4
- package/lib/adapters/test-helpers.d.ts +15 -1
- package/lib/adapters/test-helpers.js +11 -0
- 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/help.d.ts +1 -1
- package/lib/cli/help.js +21 -14
- package/lib/cli/index.js +132 -104
- package/lib/cli/sessions-repair.js +58 -22
- package/lib/cli/web/client-script.d.ts +1 -1
- package/lib/cli/web/client-script.js +71 -5
- package/lib/cli/web/page.d.ts +9 -19
- package/lib/cli/web/page.js +277 -173
- package/lib/cli/web/routes.js +85 -25
- package/lib/cli/write-gates.d.ts +61 -0
- package/lib/cli/write-gates.js +110 -0
- package/lib/client.d.ts +196 -75
- package/lib/client.js +8139 -7487
- 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 +17 -0
- package/lib/core/messages.js +34 -0
- package/lib/core/migration-history.js +16 -9
- package/lib/core/model-tools.d.ts +2 -2
- package/lib/core/model-tools.js +20 -2
- package/lib/core/patch-chain.d.ts +65 -0
- package/lib/core/patch-chain.js +100 -0
- package/lib/core/patch-document.d.ts +32 -4
- package/lib/core/patch-document.js +48 -17
- 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 +38 -1
- 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 +9 -4
- package/lib/index.js +42 -47
- 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 +19 -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 +47 -2
- package/lib/sync/autosync-scheduler.js +217 -53
- 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/local-changes.d.ts +15 -0
- package/lib/sync/local-changes.js +39 -0
- package/lib/sync/merge-apply-plan.d.ts +38 -0
- package/lib/sync/merge-apply-plan.js +76 -0
- package/lib/sync/merge-keyed.d.ts +68 -0
- package/lib/sync/merge-keyed.js +124 -0
- package/lib/sync/messages.d.ts +1 -0
- package/lib/sync/messages.js +2 -0
- package/lib/sync/patch-line-identity.d.ts +19 -0
- package/lib/sync/patch-line-identity.js +99 -0
- package/lib/sync/pending-merge.d.ts +41 -0
- package/lib/sync/pending-merge.js +61 -0
- package/lib/sync/plugin-removals.d.ts +15 -15
- package/lib/sync/plugin-removals.js +134 -83
- package/lib/sync/push-skip.d.ts +55 -0
- package/lib/sync/push-skip.js +70 -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 +44 -51
- package/lib/sync/sync-engine.js +160 -194
- 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/sync/workspace-merge.d.ts +8 -2
- package/lib/ui/artifact-view.d.ts +1 -1
- 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/foreign-view.d.ts +14 -0
- package/lib/ui/foreign-view.js +34 -0
- package/lib/ui/i18n.d.ts +7 -1
- package/lib/ui/i18n.js +15 -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 +10 -2
- package/lib/ui/selection-model.js +23 -3
- package/lib/utils/async-once.d.ts +11 -0
- package/lib/utils/async-once.js +15 -0
- package/lib/utils/patch-chain-read.d.ts +51 -0
- package/lib/utils/patch-chain-read.js +240 -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 +3 -2
- package/src/adapters/mcp.test.ts +29 -0
- package/src/adapters/mcp.ts +52 -14
- 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 +403 -0
- package/src/adapters/plugins.ts +198 -8
- package/src/adapters/prompts.ts +15 -4
- package/src/adapters/test-helpers.ts +15 -1
- 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/help.ts +21 -14
- package/src/cli/index.ts +123 -107
- package/src/cli/sessions-repair.ts +55 -22
- package/src/cli/web/client-script.ts +71 -5
- package/src/cli/web/page.ts +327 -208
- package/src/cli/web/routes.ts +85 -25
- package/src/cli/web/web.test.ts +65 -0
- package/src/cli/write-gates.ts +149 -0
- package/src/client/ConfigManagerSection.tsx +8 -4
- package/src/client/about/AboutPanel.tsx +9 -12
- package/src/client/about/release-notes-view.test.ts +17 -0
- package/src/client/about/release-notes-view.ts +49 -24
- package/src/client/api.ts +2 -1
- 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 +24 -24
- 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 +190 -5
- 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 +1515 -270
- package/src/client/consult/ConsultCard.tsx +7 -6
- package/src/client/environment/EnvironmentPanel.tsx +22 -25
- package/src/client/environment/maintenance/DiskUsageCard.tsx +69 -96
- 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 +77 -69
- package/src/client/home/HomePanel.tsx +47 -12
- package/src/client/import/ConflictList.tsx +13 -13
- package/src/client/import/ForeignImportView.tsx +67 -9
- package/src/client/import/ImportWizardView.tsx +4 -4
- package/src/client/import/PathMappingForm.tsx +36 -9
- package/src/client/import/PathPickerDialog.tsx +2 -1
- package/src/client/import/import-wizard-split.test.ts +1 -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 +21 -15
- package/src/client/library/LibraryActions.tsx +116 -28
- package/src/client/library/LibraryPanel.tsx +14 -15
- package/src/client/library/RestorePlanView.tsx +13 -8
- package/src/client/locales/about.ts +0 -2
- package/src/client/locales/backup.ts +15 -12
- package/src/client/locales/common.ts +2 -0
- package/src/client/locales/export.ts +5 -12
- package/src/client/locales/foreign.ts +4 -2
- package/src/client/locales/import.ts +5 -2
- package/src/client/locales/overview.ts +4 -0
- package/src/client/locales/profiles.ts +32 -4
- package/src/client/locales/restore.ts +2 -2
- package/src/client/locales/sessions.ts +0 -2
- package/src/client/locales/shell.ts +2 -2
- package/src/client/market/MarketImportReview.tsx +4 -4
- package/src/client/market/MarketPanel.tsx +58 -56
- package/src/client/market/MyConfigsList.tsx +34 -32
- package/src/client/market/MyConfigsLoginCard.tsx +12 -15
- package/src/client/market/MyConfigsView.tsx +8 -15
- 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 +35 -22
- package/src/client/recovery/RollbackCard.tsx +132 -75
- 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/recovery/rollback-enabled.ts +29 -0
- package/src/client/recovery/use-recovery-write.ts +5 -0
- 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 +184 -108
- package/src/client/sync/ChannelClearConfirmDialog.tsx +5 -1
- package/src/client/sync/ChannelConfigDialog.tsx +27 -48
- package/src/client/sync/MergePreviewView.tsx +5 -7
- package/src/client/sync/PushPreviewCard.tsx +2 -1
- package/src/client/sync/PushReportSections.tsx +35 -0
- package/src/client/sync/SyncChannelEntryCard.tsx +33 -24
- package/src/client/sync/SyncConfirmView.tsx +130 -133
- package/src/client/sync/SyncLogList.tsx +29 -14
- package/src/client/sync/SyncPanel.tsx +188 -185
- 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 +293 -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 +5 -0
- package/src/client/sync/merge-request.ts +20 -0
- package/src/client/sync/sync-api.ts +13 -1
- package/src/client/sync/sync-locales.ts +95 -47
- package/src/client/sync/sync-panel-clear.test.ts +44 -0
- package/src/client/sync/sync-push-preview.test.ts +9 -0
- package/src/client/sync/sync-view.test.ts +20 -0
- package/src/client/sync/sync-view.ts +76 -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 +34 -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 +22 -4
- package/src/core/patch-chain.test.ts +83 -0
- package/src/core/patch-chain.ts +150 -0
- package/src/core/patch-document.test.ts +48 -1
- package/src/core/patch-document.ts +66 -15
- package/src/core/patch-layers.test.ts +1 -1
- 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/smoke.test.ts +2 -1
- 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 +43 -2
- 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.facade.test.ts +186 -6
- package/src/index.ts +53 -47
- 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 +19 -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/security/security.test.ts +1 -1
- package/src/sync/autosync-repeat.test.ts +58 -0
- package/src/sync/autosync-repeat.ts +55 -0
- package/src/sync/autosync-scheduler.test.ts +515 -0
- package/src/sync/autosync-scheduler.ts +225 -51
- 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/local-changes.ts +40 -0
- package/src/sync/merge-apply-plan.ts +117 -0
- package/src/sync/merge-keyed.test.ts +167 -0
- package/src/sync/merge-keyed.ts +160 -0
- package/src/sync/messages.ts +3 -0
- package/src/sync/patch-line-identity.test.ts +73 -0
- package/src/sync/patch-line-identity.ts +105 -0
- package/src/sync/pending-merge.test.ts +41 -0
- package/src/sync/pending-merge.ts +85 -0
- package/src/sync/plugin-removals.test.ts +199 -39
- package/src/sync/plugin-removals.ts +150 -64
- package/src/sync/push-skip.test.ts +326 -0
- package/src/sync/push-skip.ts +102 -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 +189 -193
- 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/sync/workspace-merge.ts +9 -2
- package/src/ui/artifact-view.ts +1 -1
- 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/foreign-view.test.ts +49 -0
- package/src/ui/foreign-view.ts +47 -0
- package/src/ui/i18n.ts +15 -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 +29 -1
- package/src/ui/selection-model.ts +25 -4
- package/src/utils/async-once.ts +14 -0
- package/src/utils/js-yaml4.d.ts +35 -0
- package/src/utils/patch-chain-read.test.ts +171 -0
- package/src/utils/patch-chain-read.ts +259 -0
- package/src/utils/patch-yaml.test.ts +215 -3
- 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,10 @@ 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
|
+
import { ErrorBanner } from '../common/ErrorBanner.tsx'
|
|
38
39
|
import { Select } from '../common/Select.tsx'
|
|
39
40
|
import { Skeleton } from '../common/Skeleton.tsx'
|
|
40
|
-
import { InfoHint } from '../common/InfoHint.tsx'
|
|
41
41
|
import { toast } from '../common/toast-store.ts'
|
|
42
42
|
import { redact } from '../../security/redaction.ts'
|
|
43
43
|
import css from '../config-manager.module.css'
|
|
@@ -64,8 +64,10 @@ export interface BackupScheduleCardProps {
|
|
|
64
64
|
|
|
65
65
|
export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupScheduleCardProps) {
|
|
66
66
|
const [status, setStatus] = useState<'loading' | 'ready' | 'error'>('loading')
|
|
67
|
-
const [, setError] = useState<string | null>(null)
|
|
67
|
+
const [error, setError] = useState<string | null>(null)
|
|
68
68
|
const [draft, setDraft] = useState<BackupScheduleDraft>({ enabled: false, interval: '24h' })
|
|
69
|
+
/** 开关的 id:让标题文字也能拨动(label htmlFor),与原来勾选框的点击面一致 */
|
|
70
|
+
const enabledSwitchId = useId()
|
|
69
71
|
const [saved, setSaved] = useState<BackupScheduleStatus | null>(null)
|
|
70
72
|
const [saving, setSaving] = useState(false)
|
|
71
73
|
const [running, setRunning] = useState(false)
|
|
@@ -101,7 +103,7 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
101
103
|
(err) => {
|
|
102
104
|
if (!mountedRef.current) return
|
|
103
105
|
setStatus('error')
|
|
104
|
-
setError(
|
|
106
|
+
setError(redactErrorText(err))
|
|
105
107
|
},
|
|
106
108
|
)
|
|
107
109
|
}
|
|
@@ -214,9 +216,13 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
214
216
|
return (
|
|
215
217
|
<Card>
|
|
216
218
|
<div className={css.groupHeader}>
|
|
217
|
-
<span className={css.groupLabel}>{t('backupSchedule.title')}</span>
|
|
218
|
-
<InfoHint text={t('backupSchedule.hint')} label={t('common.infoHint')} />
|
|
219
|
+
<span className={css.groupLabel} title={t('backupSchedule.hint')}>{t('backupSchedule.title')}</span>
|
|
219
220
|
<span className={css.statusSpacer} />
|
|
221
|
+
{/* 次序按设计稿(2026-11-14 D-01):立即备份(ghost)在左、保存(primary)在右 ——
|
|
222
|
+
主操作收在动作行右端,与 .actionRow / .dialogFooter 的既有收尾方向一致。 */}
|
|
223
|
+
<Button size="sm" loading={running} disabled={saving || !(saved?.enabled ?? false)} onClick={runNow}>
|
|
224
|
+
{t('backupSchedule.runNow')}
|
|
225
|
+
</Button>
|
|
220
226
|
<Button
|
|
221
227
|
variant="primary"
|
|
222
228
|
size="sm"
|
|
@@ -227,25 +233,21 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
227
233
|
>
|
|
228
234
|
{t('backupSchedule.save')}
|
|
229
235
|
</Button>
|
|
230
|
-
<Button size="sm" loading={running} disabled={saving || !(saved?.enabled ?? false)} onClick={runNow}>
|
|
231
|
-
{t('backupSchedule.runNow')}
|
|
232
|
-
</Button>
|
|
233
236
|
</div>
|
|
234
237
|
|
|
235
238
|
{status === 'loading' && <Skeleton count={2} label={t('backupSchedule.loading')} />}
|
|
236
239
|
|
|
237
240
|
{status === 'error' && (
|
|
238
|
-
<
|
|
239
|
-
{t('backupSchedule.error')}
|
|
240
|
-
<Button variant="primary" onClick={load}>{t('common.retry')}</Button>
|
|
241
|
-
</Banner>
|
|
241
|
+
<ErrorBanner error={error ?? t('backupSchedule.error')} onRetry={load} t={api.t} />
|
|
242
242
|
)}
|
|
243
243
|
|
|
244
244
|
{status === 'ready' && (
|
|
245
245
|
<>
|
|
246
246
|
{/* 事实行:状态 / 间隔 / 上次运行(全部取宿主权威值,不受草稿影响) */}
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
{/* 带框卡格(D-01):`.factBox` 与 `.factGrid` 挂在同一个元素上 —— 边框由 home 私有类提供,
|
|
248
|
+
共享的 .factGrid 本体未改(它还被同步/工作目录三张卡引用)。前两格不再各自跨两列。 */}
|
|
249
|
+
<div className={`${css.factGrid} ${css.factBox}`}>
|
|
250
|
+
<div className={css.factCell}>
|
|
249
251
|
<span className={css.factLabel}>{t('snapshots.status')}</span>
|
|
250
252
|
<span className={css.factValue}>
|
|
251
253
|
<span className={css.infoValue}>
|
|
@@ -254,7 +256,7 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
254
256
|
</span>
|
|
255
257
|
</span>
|
|
256
258
|
</div>
|
|
257
|
-
<div className={css.factCell}
|
|
259
|
+
<div className={css.factCell}>
|
|
258
260
|
<span className={css.factLabel}>{t('backupSchedule.interval')}</span>
|
|
259
261
|
<span className={css.factValue}>{intervalFactText()}</span>
|
|
260
262
|
</div>
|
|
@@ -277,13 +279,17 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
277
279
|
|
|
278
280
|
{/* 设置行:开关 + 间隔(+ 自定义档的星期/时/分) */}
|
|
279
281
|
<div className={css.actionRow} style={{ marginTop: 10, marginBottom: 0 }}>
|
|
280
|
-
|
|
282
|
+
{/* 弹性开关(2026-11-14 用户要求):这里是「定时备份是否启用」这个单一布尔。
|
|
283
|
+
注意它改的是**草稿**(本卡仍是「改完点保存」),拨动即时可见、落库仍在保存时 ——
|
|
284
|
+
与「拨动即生效」的开关惯例不同,按用户明确要求保留这个位置。 */}
|
|
285
|
+
<Switch
|
|
286
|
+
id={enabledSwitchId}
|
|
281
287
|
checked={draft.enabled}
|
|
282
288
|
onChange={(checked: boolean) => { updateDraft({ ...draft, enabled: checked }) }}
|
|
283
289
|
label={t('backupSchedule.enabled')}
|
|
284
290
|
disabled={busy}
|
|
285
291
|
/>
|
|
286
|
-
{
|
|
292
|
+
<label className={css.toggleLabel} htmlFor={enabledSwitchId} title={t('backupSchedule.enabledHint')}>{t('backupSchedule.enabled')}</label>
|
|
287
293
|
{draft.enabled && (
|
|
288
294
|
<Select
|
|
289
295
|
value={draft.interval}
|
|
@@ -303,6 +309,7 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
303
309
|
disabled={busy}
|
|
304
310
|
style={{ width: 'auto' }}
|
|
305
311
|
ariaLabel={t('backupSchedule.weekday')}
|
|
312
|
+
title={t('backupSchedule.customHint')}
|
|
306
313
|
onChange={(next) => {
|
|
307
314
|
updateDraft({
|
|
308
315
|
...draft,
|
|
@@ -318,6 +325,7 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
318
325
|
disabled={busy}
|
|
319
326
|
style={{ width: 'auto' }}
|
|
320
327
|
ariaLabel={t('backupSchedule.hour')}
|
|
328
|
+
title={t('backupSchedule.customHint')}
|
|
321
329
|
onChange={(next) => {
|
|
322
330
|
updateDraft({
|
|
323
331
|
...draft,
|
|
@@ -333,6 +341,7 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
333
341
|
disabled={busy}
|
|
334
342
|
style={{ width: 'auto' }}
|
|
335
343
|
ariaLabel={t('backupSchedule.minute')}
|
|
344
|
+
title={t('backupSchedule.customHint')}
|
|
336
345
|
onChange={(next) => {
|
|
337
346
|
updateDraft({
|
|
338
347
|
...draft,
|
|
@@ -342,57 +351,56 @@ export function BackupScheduleCard({ api, t, syncT, onBackupDone }: BackupSchedu
|
|
|
342
351
|
options={MINUTE_OPTIONS.map((m) => ({ value: String(m), label: String(m).padStart(2, '0') }))}
|
|
343
352
|
/>
|
|
344
353
|
)}
|
|
345
|
-
{draft.enabled && draft.interval === 'custom' && (
|
|
346
|
-
<InfoHint text={t('backupSchedule.customHint')} label={t('common.infoHint')} />
|
|
347
|
-
)}
|
|
348
354
|
</div>
|
|
349
355
|
|
|
350
|
-
{/*
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
<
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
356
|
+
{/* 保留策略(三层):与间隔同属草稿,随「保存」一起提交。
|
|
357
|
+
issue #143:这份设置同时管远程快照与定时备份 —— 所以在这里自成一段(分隔线把
|
|
358
|
+
它从上面的设置行里划出来),标题本身说明覆盖面;豁免细则仍只在悬停 title 里。
|
|
359
|
+
仍与间隔共用同一份草稿:dirty 与「保存设置」都算上它,不另开提交入口。 */}
|
|
360
|
+
<div className={css.retentionSection}>
|
|
361
|
+
<div className={css.groupHeader}>
|
|
362
|
+
<span className={css.groupLabel} title={t('retention.hint')}>{t('retention.titleScoped')}</span>
|
|
363
|
+
<span className={css.statusSpacer} />
|
|
364
|
+
<span className={css.hint}>{!hasRetentionTiers(retentionDraft) && t('retention.tiersOff')}</span>
|
|
365
|
+
</div>
|
|
366
|
+
<div
|
|
367
|
+
className={css.actionRow}
|
|
368
|
+
style={{ marginBottom: 0 }}
|
|
369
|
+
title={hasRetentionTiers(retentionDraft) ? t('retention.keepLastHint') + ' · ' + t('retention.keepMonthlyHint') + ' · ' + t('retention.keepYearlyHint') : undefined}
|
|
370
|
+
>
|
|
371
|
+
{RETENTION_FIELDS.map((field) => {
|
|
372
|
+
const limits = RETENTION_FIELD_LIMITS[field]
|
|
373
|
+
const unit = field === 'keepLast'
|
|
374
|
+
? t('retention.unit')
|
|
375
|
+
: field === 'keepMonthly' ? t('retention.months') : t('retention.years')
|
|
376
|
+
return (
|
|
377
|
+
/* 保留策略的三张数字卡(D-01):标题跨满整行,「数字 + 单位」压在卡右下。
|
|
378
|
+
卡格样式走 home 私有类 .retentionCard —— 共享 .field / .fieldLabel 本体未动。 */
|
|
379
|
+
<label key={field} className={css.retentionCard}>
|
|
380
|
+
<span className={css.retentionCardLabel}>
|
|
381
|
+
{field === 'keepLast'
|
|
382
|
+
? t('retention.keepLast')
|
|
383
|
+
: field === 'keepMonthly' ? t('retention.keepMonthly') : t('retention.keepYearly')}
|
|
384
|
+
</span>
|
|
385
|
+
<input
|
|
386
|
+
className={css.input}
|
|
387
|
+
type="number"
|
|
388
|
+
min={limits.min}
|
|
389
|
+
max={limits.max}
|
|
390
|
+
step={1}
|
|
391
|
+
value={retentionDraft[field]}
|
|
392
|
+
disabled={busy}
|
|
393
|
+
onChange={(event) => {
|
|
394
|
+
const raw = event.target.value
|
|
395
|
+
const parsed = raw === '' ? 0 : Number(raw)
|
|
396
|
+
updateRetention({ ...retentionDraft, [field]: Number.isFinite(parsed) ? parsed : 0 })
|
|
397
|
+
}}
|
|
398
|
+
/>
|
|
399
|
+
<span className={css.hint}>{unit}</span>
|
|
400
|
+
</label>
|
|
401
|
+
)
|
|
402
|
+
})}
|
|
403
|
+
</div>
|
|
396
404
|
</div>
|
|
397
405
|
|
|
398
406
|
{(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'
|
|
@@ -339,7 +340,20 @@ export function HomePanel({ api, syncApi, historyApi, t, syncT, openForeignImpor
|
|
|
339
340
|
* v1 跳到备份页的恢复子视图 —— 那条路在第 3 步之后已不存在。
|
|
340
341
|
*/
|
|
341
342
|
const navRecovery = (): void => {
|
|
342
|
-
runStore.patch({ panel: 'environment' })
|
|
343
|
+
runStore.patch({ panel: 'environment', profiles: { subView: 'maintenance' } })
|
|
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' })
|
|
343
357
|
}
|
|
344
358
|
|
|
345
359
|
/** 是否存在待处理恢复事项(null = 状态未知;决定健康段是否作为「事故恢复」入口)。 */
|
|
@@ -489,7 +503,7 @@ export function HomePanel({ api, syncApi, historyApi, t, syncT, openForeignImpor
|
|
|
489
503
|
{emptyState ? (
|
|
490
504
|
/* 首用空态:只交代顺序(备份 → 导出 → 导入),动作全交给上方工具栏 ——
|
|
491
505
|
此前这里又放了一遍「立即备份 / 远程同步」,等于同一屏两个入口。 */
|
|
492
|
-
<Card className={css.activityCard}>
|
|
506
|
+
<Card className={css.activityCard + ' ' + css.activityCardFill}>
|
|
493
507
|
<span className={css.groupLabel}>{t('overview.empty.title')}</span>
|
|
494
508
|
<div className={css.emptySteps}>
|
|
495
509
|
<Stepper
|
|
@@ -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) => {
|