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
|
@@ -44,9 +44,8 @@ import type { ReactNode } from 'react'
|
|
|
44
44
|
import type { TranslateNS } from '../client-types.ts'
|
|
45
45
|
import type { SyncPullReport, SyncPushPreview, SyncPushReport } from '../../sync/sync-engine.ts'
|
|
46
46
|
import type { SectionId } from '../../schema/types.ts'
|
|
47
|
-
import { Badge, Banner, Button, Card, SectionTitle, Spinner } from '../common/ui.tsx'
|
|
47
|
+
import { Badge, Banner, Button, Card, Checkbox, SectionTitle, Spinner } from '../common/ui.tsx'
|
|
48
48
|
import { ErrorBanner } from '../common/ErrorBanner.tsx'
|
|
49
|
-
import { InfoHint } from '../common/InfoHint.tsx'
|
|
50
49
|
import { Select } from '../common/Select.tsx'
|
|
51
50
|
import { RefreshIcon } from '../common/Icon.tsx'
|
|
52
51
|
import { toast } from '../common/toast-store.ts'
|
|
@@ -60,13 +59,16 @@ import type {
|
|
|
60
59
|
SyncPushPayload, SyncStartResponse, SyncStatusResponse,
|
|
61
60
|
} from './sync-api.ts'
|
|
62
61
|
import { resolveSmartSync } from './sync-entry.ts'
|
|
62
|
+
import { consumeMergeDecision } from './merge-request.ts'
|
|
63
63
|
import { reportPreviewFailure } from './preview-failure.ts'
|
|
64
64
|
import { savedConfigState } from './config-save-state.ts'
|
|
65
|
+
import { formPatchFromStatus, markDirty, resetDirty } from './config-dirty.ts'
|
|
66
|
+
import { clearedChannelFormFields, prepareClear, shouldDiscardSaveResult } from './config-clear-guard.ts'
|
|
65
67
|
import {
|
|
66
68
|
channelMapOf, channelStateMap, computeGithubLoginView, computeSyncButtons, defaultChannelSyncState,
|
|
67
|
-
githubPollMessage, isClientChannel, pushReportView, readStoredChannel,
|
|
69
|
+
githubPollMessage, isClientChannel, pushPreviewBlocked, pushReportView, readStoredChannel, sectionCountsOf,
|
|
68
70
|
gistSessionsRiskKey,
|
|
69
|
-
initialSyncSections, normalizeSessionsLimit, syncSectionOptions, writeStoredChannel,
|
|
71
|
+
initialSyncSections, normalizeSessionsLimit, syncSectionOptions, writeStoredChannel, SYNC_CHANNEL_ORDER,
|
|
70
72
|
} from './sync-view.ts'
|
|
71
73
|
import type {
|
|
72
74
|
ChannelSyncState, GithubLoginPhase, SyncChannel, SyncSectionOption,
|
|
@@ -74,7 +76,7 @@ import type {
|
|
|
74
76
|
// t42:可测纯逻辑下沉到 src/ui(框架无关、node 可测);本组件只做装配。
|
|
75
77
|
import {
|
|
76
78
|
buildSelectionRequest, buildSyncChannelBody, buildSyncConfigBody, buildSyncPushBody,
|
|
77
|
-
channelBackfillFromStatus, channelRemoteReady,
|
|
79
|
+
channelBackfillFromStatus, channelRemoteReady, computeEncryptInvalid, encryptToggle,
|
|
78
80
|
githubPollDecision, hasSelectedSections, includeSecretsToggle, isGithubFlowInFlight, pickSyncPrimary, resolveInitialChannel,
|
|
79
81
|
needsSessionInventory, saveQueueOnFlush, saveQueueOnRequest, saveQueueOnSettled, toggleSectionSelection,
|
|
80
82
|
validateCloudForm, DEFAULT_S3_PROVIDER,
|
|
@@ -83,23 +85,22 @@ import {
|
|
|
83
85
|
import type { CloudFormIssue, SaveQueueState, SyncFormSnapshot } from '../../ui/sync-settings-view.ts'
|
|
84
86
|
// t42 物理拆分:渲染段各自成文件(本领域目录平铺,不新增子目录),主文件只做装配
|
|
85
87
|
import { SyncChannelEntryCard } from './SyncChannelEntryCard.tsx'
|
|
88
|
+
import { AddChannelCard } from './AddChannelCard.tsx'
|
|
86
89
|
import { ChannelConfigDialog } from './ChannelConfigDialog.tsx'
|
|
87
90
|
import { ChannelClearConfirmDialog } from './ChannelClearConfirmDialog.tsx'
|
|
88
|
-
import {
|
|
91
|
+
import { SyncSettingsDialog } from './SyncSettingsDialog.tsx'
|
|
89
92
|
import type { SelectionSection } from '../../ui/selection-model.ts'
|
|
90
93
|
import type { ExportPreviewResponse } from '../api.ts'
|
|
91
|
-
import { SecurityOptionsCard } from './SecurityOptionsCard.tsx'
|
|
92
|
-
import { DecryptPasswordCard } from './DecryptPasswordCard.tsx'
|
|
93
|
-
import { AutosyncCard } from './AutosyncCard.tsx'
|
|
94
94
|
import { WorkDirCard } from './WorkDirCard.tsx'
|
|
95
95
|
import { Collapse } from '../common/Motion.tsx'
|
|
96
96
|
import { SyncLogList } from './SyncLogList.tsx'
|
|
97
97
|
import { UnreadableSnapshotsBanner } from './UnreadableSnapshotsBanner.tsx'
|
|
98
98
|
import { SyncProbeRow } from './SyncProbeRow.tsx'
|
|
99
|
-
import { deviceLabel } from './remote-device-view.ts'
|
|
100
99
|
import { PushPreviewCard } from './PushPreviewCard.tsx'
|
|
100
|
+
import { PushReportSections } from './PushReportSections.tsx'
|
|
101
101
|
import { MergeModal } from './MergeModal.tsx'
|
|
102
102
|
import { SyncActivityBar } from './SyncActivityBar.tsx'
|
|
103
|
+
import { deviceLabel } from './remote-device-view.ts'
|
|
103
104
|
import { SyncConfirmView } from './SyncConfirmView.tsx'
|
|
104
105
|
import css from '../config-manager.module.css'
|
|
105
106
|
|
|
@@ -183,6 +184,8 @@ interface SyncUiState {
|
|
|
183
184
|
savingConfig: boolean
|
|
184
185
|
busy: 'sync' | 'push' | 'pull' | 'rollback' | null
|
|
185
186
|
pushReport: SyncPushReport | null
|
|
187
|
+
/** D-12:推送前从只读预览派生的 sectionId → 条数(预览缺失时为空 ⇒ 结果弹窗只显示分区名)。 */
|
|
188
|
+
pushSectionCounts: Record<string, number>
|
|
186
189
|
/** P0-②:push 前只读预览弹窗(preview 结果 + 打开状态;非敏感,切 tab/刷新不丢) */
|
|
187
190
|
pushPreview: PushPreviewSlice
|
|
188
191
|
/**
|
|
@@ -258,6 +261,7 @@ const initial: SyncUiState = {
|
|
|
258
261
|
savingConfig: false,
|
|
259
262
|
busy: null,
|
|
260
263
|
pushReport: null,
|
|
264
|
+
pushSectionCounts: {},
|
|
261
265
|
pullReport: null,
|
|
262
266
|
pushPreview: { preview: null, open: false },
|
|
263
267
|
confirmSession: null,
|
|
@@ -339,8 +343,13 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
339
343
|
const [mergeSeed, setMergeSeed] = useState<{ channel: SyncChannel; preview: MergePreviewResponse } | null>(null)
|
|
340
344
|
/** 一键同步阶段(null = 空闲):'preview' 拉远端快照预览、'sync' 差异确认/导入;只驱动文案 */
|
|
341
345
|
const [syncPhase, setSyncPhase] = useState<'preview' | 'sync' | null>(null)
|
|
342
|
-
/**
|
|
343
|
-
const [
|
|
346
|
+
/** issue 140:确认弹窗里的「强制推送」(内容没变也新建快照)。只影响这一次推送,不持久化。 */
|
|
347
|
+
const [forcePush, setForcePush] = useState(false)
|
|
348
|
+
/**
|
|
349
|
+
* 同步设置弹窗开关(2026-11-14 用户要求:同步分区 / 加密与密钥导出 / 解密密码三块收进
|
|
350
|
+
* 一个弹窗,页面只剩一行摘要)。瞬态 UI:改动在弹窗内即时生效并持久化,关闭即完成。
|
|
351
|
+
*/
|
|
352
|
+
const [settingsOpen, setSettingsOpen] = useState(false)
|
|
344
353
|
/**
|
|
345
354
|
* P0-3:会话单元清单(逐会话勾选的数据源)。
|
|
346
355
|
*
|
|
@@ -373,20 +382,20 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
373
382
|
|
|
374
383
|
/** 勾选会话分区 + 打开弹窗时补一次清单(清单未到货则先显示加载态)。 */
|
|
375
384
|
useEffect(() => {
|
|
376
|
-
if (!
|
|
385
|
+
if (!settingsOpen) return
|
|
377
386
|
if (!needsSessionInventory(state.byChannel[state.channel].syncSections)) return
|
|
378
387
|
void fetchSessionInventory()
|
|
379
388
|
// 只在「弹窗打开」与「是否勾了会话」变化时触发;fetchSessionInventory 自身幂等
|
|
380
389
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
381
|
-
}, [
|
|
390
|
+
}, [settingsOpen, state.byChannel[state.channel].syncSections])
|
|
382
391
|
|
|
383
392
|
/**
|
|
384
|
-
*
|
|
385
|
-
* (§8
|
|
393
|
+
* 打开同步设置弹窗:同样先切到该通道 —— 弹窗内的勾选/会话点名/加密与密码都写进**该通道**的切片。
|
|
394
|
+
* (§8 的关键修正:这些设置属于通道,不是全局一节。)
|
|
386
395
|
*/
|
|
387
|
-
const
|
|
396
|
+
const openSyncSettingsFor = (channel: SyncChannel): void => {
|
|
388
397
|
switchChannel(channel)
|
|
389
|
-
|
|
398
|
+
setSettingsOpen(true)
|
|
390
399
|
}
|
|
391
400
|
|
|
392
401
|
/** 会话点名清单(持久化;空数组 = 回到「最新 N 个」模式)。 */
|
|
@@ -457,6 +466,13 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
457
466
|
const saveTimer = useRef<ReturnType<typeof setTimeout> | null>(null)
|
|
458
467
|
/** 保存防重入状态机的纯数据(在途标记 + 待发改动;t42 起由 ui/sync-settings-view.ts 决策) */
|
|
459
468
|
const saveQueueRef = useRef<SaveQueueState>({ inFlight: false, pending: null })
|
|
469
|
+
/** P9-4/P9-5 时序守卫:用户改过但未落盘的表单字段 / 断开世代号 */
|
|
470
|
+
const dirtyRef = useRef<Set<string>>(new Set()); const epochRef = useRef(0)
|
|
471
|
+
/** 丢掉该通道还没发出去的输入(防抖 timer + 排队载荷)。keepInFlight=true 供断开前等待用(清掉 inFlight 会让等待立刻放行)。 */
|
|
472
|
+
const dropPendingSave = (keepInFlight: boolean): void => {
|
|
473
|
+
if (saveTimer.current !== null) { clearTimeout(saveTimer.current); saveTimer.current = null }
|
|
474
|
+
saveQueueRef.current = { inFlight: keepInFlight && saveQueueRef.current.inFlight, pending: null }
|
|
475
|
+
}
|
|
460
476
|
/** 正在拉取远端快照列表(按通道独立防抖/防并发) */
|
|
461
477
|
const loadingSnapshotsRef = useRef<Record<SyncChannel, boolean>>(channelMapOf(() => false))
|
|
462
478
|
|
|
@@ -496,14 +512,9 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
496
512
|
loading: false,
|
|
497
513
|
statusInfo: info,
|
|
498
514
|
channel: remembered ?? savedChannel,
|
|
499
|
-
repoUrl: info.repoUrl ?? '',
|
|
500
|
-
gitSubdir: info.subdir ?? '',
|
|
501
|
-
webdavUrl: info.webdav?.url ?? '',
|
|
502
|
-
webdavUsername: info.webdav?.username ?? '',
|
|
503
515
|
catalog,
|
|
504
516
|
byChannel: channelMapOf((ch) => ({ ...stateRef.current.byChannel[ch], ...backfill(ch) })),
|
|
505
|
-
|
|
506
|
-
...cloudFormFromStatus(info),
|
|
517
|
+
...formPatchFromStatus(info, dirtyRef.current),
|
|
507
518
|
})
|
|
508
519
|
// 独立拉取 autosync(若 status 未带按通道状态则补一次)
|
|
509
520
|
if (autoByCh === undefined) {
|
|
@@ -528,14 +539,15 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
528
539
|
const loadAutosync = async (): Promise<void> => {
|
|
529
540
|
try {
|
|
530
541
|
const all = await api.autosyncStatusAll()
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
542
|
+
for (const ch of SYNC_CHANNEL_ORDER) {
|
|
543
|
+
const st = all[ch]
|
|
544
|
+
if (st !== undefined) {
|
|
545
|
+
patchChannelState(ch, {
|
|
546
|
+
autosync: st, autosyncEnabled: st.enabled, autosyncInterval: st.interval,
|
|
547
|
+
autosyncRealtime: st.realtime ?? true,
|
|
548
|
+
})
|
|
549
|
+
}
|
|
550
|
+
}
|
|
539
551
|
} catch (err) {
|
|
540
552
|
// R-20:读取自动同步状态失败(此前写入页面最底部的共享 error Banner,常滚出视野)
|
|
541
553
|
toast.error(t('toast.autosyncLoadFailed') + t('common.labelSeparator') + redact(err instanceof Error ? err.message : String(err)))
|
|
@@ -588,7 +600,13 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
588
600
|
}
|
|
589
601
|
|
|
590
602
|
useEffect(() => {
|
|
591
|
-
void
|
|
603
|
+
void (async () => {
|
|
604
|
+
await loadStatus()
|
|
605
|
+
// P2(2026-11-14 真机事故):首页「待裁决」活动行用一次性信号把用户送到这里
|
|
606
|
+
// (merge-request.ts;取走即清空)。首页只知道「有事要裁决」,怎么把裁决视图
|
|
607
|
+
// 拉起来只有这里知道 —— 一键同步 → /sync/merge-preview → MergeModal。
|
|
608
|
+
if (consumeMergeDecision() > 0) void runSyncSmart(stateRef.current.channel)
|
|
609
|
+
})()
|
|
592
610
|
// api 为注入单例(注册时创建),生命周期内稳定;仅挂载时加载一次
|
|
593
611
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
594
612
|
}, [])
|
|
@@ -638,47 +656,54 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
638
656
|
/** 表单快照 → 请求体(t42 起组装逻辑在 ui/sync-settings-view.ts,组件只装配) */
|
|
639
657
|
const payload = (): SyncPushPayload => buildSyncChannelBody(formOf(state))
|
|
640
658
|
|
|
641
|
-
/* ------------------------------------------------
|
|
659
|
+
/* ------------------------------------------------ 通道配置持久化(全自动保存:防抖 + 卸载补发) */
|
|
642
660
|
|
|
643
661
|
/** 按给定 state 构建「保存配置」请求体;当前通道远端地址未就绪(webdav url / git repoUrl 为空)
|
|
644
662
|
* → 返回 null(无可保存内容,自动保存跳过)。password/token 仅非空携带(空 = 沿用已保存凭据)。 */
|
|
645
663
|
const buildConfigPayload = (s: SyncUiState): SyncPushPayload | null => buildSyncConfigBody(formOf(s))
|
|
646
664
|
|
|
647
|
-
/** 实际发送保存请求:成功清空已入库的 password/token
|
|
648
|
-
*
|
|
649
|
-
|
|
650
|
-
* 否则每次停顿改字段都会刷一条通知;但**失败必须始终提示**(用户的改动没落盘)。 */
|
|
651
|
-
const doSaveConfig = async (payloadToSave: SyncPushPayload, announce = false): Promise<void> => {
|
|
665
|
+
/** 实际发送保存请求:成功清空已入库的 password/token 并刷新凭据徽章;失败保留表单值以便重试。
|
|
666
|
+
* 防重入:保存中又排入新改动 → 完成后补发。成功只闪「已保存」徽章(弹窗标题行),失败必须提示。 */
|
|
667
|
+
const doSaveConfig = async (payloadToSave: SyncPushPayload): Promise<void> => {
|
|
652
668
|
// t42:防重入状态机(在途 → 记下最新待发改动并返回 'queue')在 ui/sync-settings-view.ts
|
|
653
669
|
const decision = saveQueueOnRequest(saveQueueRef.current, payloadToSave)
|
|
654
670
|
saveQueueRef.current = decision.state
|
|
655
671
|
if (decision.action === 'queue') return
|
|
656
672
|
patch({ savingConfig: true })
|
|
673
|
+
const sendEpoch = epochRef.current // P9-5:期间用户断开通道 ⇒ 这次回执描述的配置已不存在(见下)
|
|
674
|
+
let stale = false
|
|
657
675
|
try {
|
|
658
676
|
const saved = await api.saveConfig(payloadToSave)
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
677
|
+
stale = shouldDiscardSaveResult(sendEpoch, epochRef.current)
|
|
678
|
+
if (stale) {
|
|
679
|
+
// 回执作废:一个字段都不写回(清空的地址/凭据不能复活);断开前已等在途保存落定 ⇒ 宿主不会晚到写,故不做自愈 clear(反方实测:会把随后保存成功的新配置连凭据一起删掉)。
|
|
680
|
+
if (!saveQueueRef.current.inFlight) patch({ savingConfig: false })
|
|
681
|
+
} else {
|
|
682
|
+
// 基于 stateRef 计算(同步权威)后 commit 落库:即使保存完成时组件已卸载(切走 tab),
|
|
683
|
+
// savingConfig 复位与凭据清空仍镜像进 store,切回后一致
|
|
684
|
+
const s = stateRef.current
|
|
685
|
+
// 凭据清空 + 徽章合并的自包含演算下沉到 ./config-save-state.ts(本文件有行数棘轮)
|
|
686
|
+
const next: SyncUiState = { ...s, ...savedConfigState(s, saved, payloadToSave) }
|
|
687
|
+
commit(next)
|
|
688
|
+
dirtyRef.current = resetDirty() // 宿主回执即权威:落盘字段不再算「用户输入中」
|
|
689
|
+
// M-17:成功只闪「已保存」徽章(防抖保存不弹 toast,否则每次停顿都刷屏);计数 +1 让连续保存各闪一次
|
|
690
|
+
setSaveTick((n) => n + 1)
|
|
691
|
+
// 手动填入的 git token 保存成功 → 校验有效性(有效则隐藏 GitHub 登录块)。
|
|
692
|
+
// 只有 git 通道用 SYNC_CREDENTIAL_REF:云端点通道的密钥走各自的槽位,与 GitHub 登录无关。
|
|
693
|
+
if (payloadToSave.transport === 'git' && saved.credentialConfigured) void validateGithub()
|
|
672
694
|
}
|
|
673
695
|
} catch (err) {
|
|
674
|
-
// R-20
|
|
696
|
+
// R-20:保存失败**始终**提示 —— 用户的改动没有落盘,静默等于骗人
|
|
675
697
|
toast.error(t('toast.configSaveFailed') + t('common.labelSeparator') + redact(err instanceof Error ? err.message : String(err)))
|
|
676
698
|
patch({ savingConfig: false })
|
|
677
699
|
} finally {
|
|
678
|
-
// 保存期间又排入的新改动 →
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
700
|
+
// 保存期间又排入的新改动 → 立即补发(保底,不丢输入)。
|
|
701
|
+
// 回执作废时队列已由 onChannelCleared 重置、此刻可能有**新的**保存正飞 —— 再写 inFlight 会让防重入失效。
|
|
702
|
+
if (!stale) {
|
|
703
|
+
const settled = saveQueueOnSettled(saveQueueRef.current)
|
|
704
|
+
saveQueueRef.current = settled.state
|
|
705
|
+
if (settled.next !== null) void doSaveConfig(settled.next)
|
|
706
|
+
}
|
|
682
707
|
}
|
|
683
708
|
}
|
|
684
709
|
|
|
@@ -698,9 +723,8 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
698
723
|
}, SYNC_CONFIG_SAVE_DEBOUNCE_MS)
|
|
699
724
|
}
|
|
700
725
|
|
|
701
|
-
/**
|
|
702
|
-
|
|
703
|
-
const flushConfigSave = (announce = false): void => {
|
|
726
|
+
/** 立即保存(防抖到点 / 卸载补发共用):优先待发改动,否则按当前表单值。 */
|
|
727
|
+
const flushConfigSave = (): void => {
|
|
704
728
|
if (saveTimer.current !== null) {
|
|
705
729
|
clearTimeout(saveTimer.current)
|
|
706
730
|
saveTimer.current = null
|
|
@@ -708,40 +732,23 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
708
732
|
// t42:flush 取哪个载荷(优先待发改动,否则按当前表单值重建)由纯函数决策
|
|
709
733
|
const flushed = saveQueueOnFlush(saveQueueRef.current, buildConfigPayload(stateRef.current))
|
|
710
734
|
saveQueueRef.current = flushed.state
|
|
711
|
-
if (flushed.payload === null)
|
|
712
|
-
|
|
713
|
-
if (announce) toast.info(t('toast.configNothingToSave'))
|
|
714
|
-
return
|
|
715
|
-
}
|
|
716
|
-
void doSaveConfig(flushed.payload, announce)
|
|
735
|
+
if (flushed.payload === null) return // 地址还没填全:无可保存内容(表单会校验并内联报错)
|
|
736
|
+
void doSaveConfig(flushed.payload)
|
|
717
737
|
}
|
|
718
738
|
|
|
719
739
|
/* ------------------------------------------------ 断开通道配置(用户要求:配置过必须能删掉) */
|
|
720
740
|
|
|
721
|
-
/**
|
|
722
|
-
* 撤销自动保存是必须的:否则防抖到点的旧 payload 会把刚删掉的配置又写回去。 */
|
|
741
|
+
/** 断开成功后收尾:清表单残留 + 撤销在途自动保存 + 重拉 status;在途请求取消不掉 → 递增世代让回执作废。 */
|
|
723
742
|
const onChannelCleared = (channel: SyncChannel): void => {
|
|
724
743
|
setClearTarget(null)
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
// 断开 git = 删掉 SYNC_CREDENTIAL_REF
|
|
728
|
-
//
|
|
729
|
-
|
|
730
|
-
if (channel === 'git') {
|
|
731
|
-
if (githubPollTimer.current !== null) { clearTimeout(githubPollTimer.current); githubPollTimer.current = null }
|
|
732
|
-
}
|
|
744
|
+
dropPendingSave(false); epochRef.current += 1
|
|
745
|
+
dirtyRef.current = resetDirty()
|
|
746
|
+
// 断开 git = 删掉 SYNC_CREDENTIAL_REF(与手动 token 同槽位)→ 登录态必然失效:不复位 githubSignedIn 会恒隐藏
|
|
747
|
+
// 登录块(用户以为还能重新登录,真机报告);进行中的轮询一并停掉。
|
|
748
|
+
if (channel === 'git' && githubPollTimer.current !== null) { clearTimeout(githubPollTimer.current); githubPollTimer.current = null }
|
|
733
749
|
patch({
|
|
734
750
|
...(channel === 'git' ? { githubSignedIn: false, github: initialGithub } : {}),
|
|
735
|
-
...(channel
|
|
736
|
-
? { webdavUrl: '', webdavUsername: '', webdavPassword: '' }
|
|
737
|
-
: channel === 's3'
|
|
738
|
-
? {
|
|
739
|
-
s3Endpoint: '', s3Region: '', s3Bucket: '', s3Prefix: '', s3AccessKeyId: '',
|
|
740
|
-
s3Secret: '', s3PathStyle: false, s3Provider: DEFAULT_S3_PROVIDER,
|
|
741
|
-
}
|
|
742
|
-
: channel === 'gist'
|
|
743
|
-
? { gistId: '', gistApiBaseUrl: '', gistFilePrefix: '', gistToken: '' }
|
|
744
|
-
: { repoUrl: '', token: '' }),
|
|
751
|
+
...clearedChannelFormFields(channel),
|
|
745
752
|
})
|
|
746
753
|
patchChannelOf(channel, { snapshots: [], selectedSnapshotId: '' })
|
|
747
754
|
void loadStatus()
|
|
@@ -859,7 +866,7 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
859
866
|
if (phase === 'starting' || phase === 'waiting' || phase === 'polling') {
|
|
860
867
|
void runGithubCancel()
|
|
861
868
|
}
|
|
862
|
-
setChannelOpen(false)
|
|
869
|
+
dirtyRef.current = resetDirty(); setChannelOpen(false)
|
|
863
870
|
}
|
|
864
871
|
|
|
865
872
|
/**
|
|
@@ -887,11 +894,14 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
887
894
|
|
|
888
895
|
/** P0-②:确认弹窗里点「确认推送」→ 真正推送(复用既有 push 语义)。 */
|
|
889
896
|
const runPush = async (): Promise<void> => {
|
|
890
|
-
|
|
897
|
+
// D-12:条数只能取这次推送前的预览(成功分支会把 pushPreview 清空),必须在 await 之前抓。
|
|
898
|
+
const pushSectionCounts = sectionCountsOf(stateRef.current.pushPreview.preview?.sections)
|
|
899
|
+
patch({ busy: 'push', pushReport: null, pushSectionCounts })
|
|
891
900
|
try {
|
|
892
901
|
// 推送前先把加密密码落库(下次推送不必重输)
|
|
893
902
|
await persistEncryptPassword()
|
|
894
|
-
|
|
903
|
+
// issue 140:force 只在这一次请求里生效(勾选框默认关 = 内容没变就跳过)
|
|
904
|
+
const report = await api.push({ ...buildPushPayload(), ...(forcePush ? { force: true } : {}) })
|
|
895
905
|
// 成功即清空 token/webdavPassword/加密密码输入框;失败保留以便重试
|
|
896
906
|
patch({
|
|
897
907
|
busy: null, pushReport: report, pushPreview: { preview: null, open: false },
|
|
@@ -902,8 +912,16 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
902
912
|
if (report.ok) {
|
|
903
913
|
// 输入框清空,但「已保存」标记保留 —— 密码在本机凭据库里,下次留空即用
|
|
904
914
|
patchChannel({ encryptPassword: '', encryptPasswordConfirm: '' })
|
|
905
|
-
// M-19
|
|
906
|
-
|
|
915
|
+
// M-19:推送终局回执(结果弹窗关闭后不再有任何痕迹)。
|
|
916
|
+
// issue 140:没新建快照时必须说「已跳过」,不能报「已推送」。
|
|
917
|
+
// issue 146:全被冲突扣下同样不是「推送完成」,必须换文案(否则用户以为远端已更新)
|
|
918
|
+
toast.ok(
|
|
919
|
+
report.skipped === 'unchanged'
|
|
920
|
+
? t('toast.pushSkipped')
|
|
921
|
+
: report.skipped === 'all-conflicted'
|
|
922
|
+
? t('toast.pushAllConflicted')
|
|
923
|
+
: t('toast.pushDone'),
|
|
924
|
+
)
|
|
907
925
|
void loadSnapshots()
|
|
908
926
|
} else {
|
|
909
927
|
// 失败保留结果弹窗(K-15,含告警明细);同时给出不依赖弹窗的回执
|
|
@@ -1010,7 +1028,10 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1010
1028
|
|
|
1011
1029
|
/* ------------------------------------------------ 一键同步(方案 A) */
|
|
1012
1030
|
|
|
1013
|
-
/**
|
|
1031
|
+
/**
|
|
1032
|
+
* 一键同步:拉取 → 差异确认会话(先取消旧会话,再发起新会话)。
|
|
1033
|
+
* snapshotId 缺省 = 用远端最新快照(快照行选过才传具体 id)。
|
|
1034
|
+
*/
|
|
1014
1035
|
const runSync = async (snapshotId?: string): Promise<void> => {
|
|
1015
1036
|
// 清理旧的差异确认会话(避免残留临时 ZIP / 同 key 冲突)
|
|
1016
1037
|
if (state.confirmSession !== null) {
|
|
@@ -1102,6 +1123,7 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1102
1123
|
const switchChannel = (ch: SyncChannel): void => {
|
|
1103
1124
|
if (ch === state.channel || state.busy !== null) return
|
|
1104
1125
|
patch({ channel: ch })
|
|
1126
|
+
dirtyRef.current = resetDirty() // 旧通道的 dirty 不得永久屏蔽新通道的同名键
|
|
1105
1127
|
writeStoredChannel(ch) // 同步写 localStorage 立即生效(status 未带回填时的兜底)
|
|
1106
1128
|
// 异步持久化到磁盘(ui-prefs.json,随 self 分区进导出备份);失败静默降级
|
|
1107
1129
|
void api.saveUiPrefs({ lastSyncChannel: ch }).catch(() => { /* 保存失败不阻断切换 */ })
|
|
@@ -1167,9 +1189,7 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1167
1189
|
const remoteReadyOf = (channel: SyncChannel): boolean => channelRemoteReady({ ...formOf(state), channel })
|
|
1168
1190
|
/** 云端点表单的校验问题(对话框内联提示用;git/webdav 恒为空表)。 */
|
|
1169
1191
|
const cloudIssues: CloudFormIssue[] = validateCloudForm(formOf(state))
|
|
1170
|
-
|
|
1171
|
-
const remoteReady = remoteReadyOf(state.channel)
|
|
1172
|
-
const pushView = pushReportView(state.pushReport, uiT)
|
|
1192
|
+
const pushView = pushReportView(state.pushReport, uiT, state.pushSectionCounts)
|
|
1173
1193
|
const githubView = computeGithubLoginView(
|
|
1174
1194
|
state.github.phase, state.github.userCode, state.github.verificationUri, state.github.error, uiT,
|
|
1175
1195
|
)
|
|
@@ -1209,6 +1229,8 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1209
1229
|
const channelContentId = (c: SyncChannel): string => 'sync-channel-' + c
|
|
1210
1230
|
|
|
1211
1231
|
const renderChannelCard = (channel: SyncChannel): ReactNode => {
|
|
1232
|
+
// 2026-11-14:只渲染**已配置**的通道卡(判据只有 remoteReadyOf 一处),其余进 AddChannelCard
|
|
1233
|
+
if (!remoteReadyOf(channel)) return null
|
|
1212
1234
|
const cs = channelStateOf(channel)
|
|
1213
1235
|
const ready = remoteReadyOf(channel)
|
|
1214
1236
|
const busy = state.busy !== null
|
|
@@ -1232,24 +1254,21 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1232
1254
|
<Collapse open={ready && isChannelExpanded(channel)} id={channelContentId(channel)} className={css.syncChannelBody}>
|
|
1233
1255
|
{ready && (
|
|
1234
1256
|
<Card>
|
|
1235
|
-
{/*
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
内的选择行:它本来就是动作的前置条件(选哪些分区的改动才参与合并/推送)。 */}
|
|
1240
|
-
{/* ⓘ 一律跟在**相关标题/操作的右边**(同一行):单独成行会让卡片出现「孤零零一个图标」
|
|
1241
|
-
的断行。标题内联沿用 AboutPanel / EnvironmentPanel 的既有写法(零新增样式)。 */}
|
|
1257
|
+
{/* 摘要行(2026-11-14 用户要求:分区 / 加密 / 解密三块收进「同步设置」弹窗,
|
|
1258
|
+
卡内只留一行)。留下的是 push 之前**必须看见**的两个判断依据:选了多少分区、
|
|
1259
|
+
加密开没开 —— 不需要的说明文字一律不进这一行。设置仍按通道独立(§8),
|
|
1260
|
+
点按钮前先 switchChannel,弹窗里的改动写进该通道的切片。 */}
|
|
1242
1261
|
<div className={css.sectionPickerRow}>
|
|
1243
|
-
<span className={css.groupLabel}>{t('mode.title')}
|
|
1262
|
+
<span className={css.groupLabel}>{t('mode.title')}</span>
|
|
1244
1263
|
<span className={css.categoryDesc}>
|
|
1245
1264
|
{state.loadError !== null ? t('load.failed')
|
|
1246
1265
|
: state.catalog.length === 0 ? t('common.loading')
|
|
1247
1266
|
: t('mode.selectedCount', { n: String(cs.syncSections.length), total: String(state.catalog.length) })}
|
|
1248
1267
|
</span>
|
|
1249
|
-
{
|
|
1250
|
-
|
|
1251
|
-
<Button className={css.pickerBtn} onClick={() => {
|
|
1252
|
-
{t('mode.
|
|
1268
|
+
<Badge kind={cs.encrypt ? 'ok' : 'info'}>{cs.encrypt ? t('mode.encryptOn') : t('mode.encryptOff')}</Badge>
|
|
1269
|
+
{/* 这一行只剩「设置」入口:只读自检回到它服务的快照行(低频诊断与受控控件同排)。 */}
|
|
1270
|
+
<Button className={css.pickerBtn} onClick={() => { openSyncSettingsFor(channel) }} disabled={busy}>
|
|
1271
|
+
{t('mode.settingsOpen')}
|
|
1253
1272
|
</Button>
|
|
1254
1273
|
</div>
|
|
1255
1274
|
{cs.syncSections.length === 0 && <Banner kind="warn">{t('mode.atLeastOne')}</Banner>}
|
|
@@ -1322,42 +1341,11 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1322
1341
|
</span>
|
|
1323
1342
|
)}
|
|
1324
1343
|
</div>
|
|
1325
|
-
|
|
1326
|
-
{/* 自动同步行(按通道;文案与倒计时在卡内派生) */}
|
|
1327
|
-
<AutosyncCard
|
|
1328
|
-
t={t}
|
|
1329
|
-
uiT={uiT}
|
|
1330
|
-
settings={cs}
|
|
1331
|
-
busy={busy}
|
|
1332
|
-
onToggleAutosync={(enabled) => { void toggleAutosync(channel, enabled) }}
|
|
1333
|
-
onUpdateInterval={(interval) => { void updateAutosyncInterval(channel, interval) }}
|
|
1334
|
-
onUpdateOptions={(patch) => { void updateAutosyncOptions(channel, patch) }}
|
|
1335
|
-
/>
|
|
1336
1344
|
</Card>
|
|
1337
1345
|
)}
|
|
1338
|
-
{/* v3(P-IA-7 / §2.2-6
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
所有 handler 都显式传 channel(不再读 state.channel)。 */}
|
|
1342
|
-
{ready && (
|
|
1343
|
-
<SecurityOptionsCard
|
|
1344
|
-
t={t}
|
|
1345
|
-
settings={cs}
|
|
1346
|
-
onToggleEncrypt={(next) => { setEncrypt(channel, next) }}
|
|
1347
|
-
onToggleIncludeSecrets={(next) => { setIncludeSecrets(channel, next) }}
|
|
1348
|
-
onPatchSettings={(p) => { patchChannelOf(channel, p) }}
|
|
1349
|
-
onPersistEncryptPassword={() => { void persistEncryptPassword(channel) }}
|
|
1350
|
-
/>
|
|
1351
|
-
)}
|
|
1352
|
-
{ready && (
|
|
1353
|
-
<DecryptPasswordCard
|
|
1354
|
-
t={t}
|
|
1355
|
-
settings={cs}
|
|
1356
|
-
onPatchSettings={(p) => { patchChannelOf(channel, p) }}
|
|
1357
|
-
onPersistDecryptPassword={() => { void persistDecryptPassword(channel) }}
|
|
1358
|
-
onClearSavedPassword={() => { clearSavedDecryptPassword(channel) }}
|
|
1359
|
-
/>
|
|
1360
|
-
)}
|
|
1346
|
+
{/* v3(P-IA-7 / §2.2-6)的教训保留:加密与解密**属于这一条通道**。
|
|
1347
|
+
2026-11-14 起它们搬进「同步设置」弹窗(入口是上方摘要行的按钮),打开前先 switchChannel,
|
|
1348
|
+
弹窗内每个 handler 都写该通道的切片 —— 仍然不会出现「四个通道共用一份加密设置」。 */}
|
|
1361
1349
|
{/* issue #79:工作副本(git 专属;确认弹窗/宿主调用/回执全在 WorkDirCard.tsx) */}
|
|
1362
1350
|
{ready && channel === 'git' && <WorkDirCard t={t} api={api} workDir={state.statusInfo?.workDir} busy={busy} onChanged={() => { void loadStatus() }} />}
|
|
1363
1351
|
{/* issue #59:远端快照列表不完整时的常驻告知(push 报成功但列表为空时,这里是唯一线索)。
|
|
@@ -1371,7 +1359,7 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1371
1359
|
/* ------------------------------------------------ 渲染 */
|
|
1372
1360
|
return (
|
|
1373
1361
|
<div className={css.viewBody}>
|
|
1374
|
-
<SectionTitle title={t('section.label')}
|
|
1362
|
+
<SectionTitle title={t('section.label')} tooltip={t('section.description')} />
|
|
1375
1363
|
|
|
1376
1364
|
{/* M-16:页面级加载失败就地提示(此前 loadError 只写不读,宿主不可达时整页显示
|
|
1377
1365
|
「未配置」假象)。此处保留可就地重试的 ErrorBanner —— 它是**页面是否可用**
|
|
@@ -1385,13 +1373,14 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1385
1373
|
/>
|
|
1386
1374
|
)}
|
|
1387
1375
|
|
|
1388
|
-
{/*
|
|
1389
|
-
|
|
1390
|
-
|
|
1376
|
+
{/* 2026-11-14 用户要求:页面只留**已配置**的通道卡,其余通道收进末尾那张「添加通道」卡
|
|
1377
|
+
(点开选通道 → 进配置弹窗)。此前四张恒显示、理由是「配完 Git 找不到 WebDAV 会被当成
|
|
1378
|
+
bug」;那条理由现在由 AddChannelCard 承接 —— 只要还有未配置通道,它就常驻页面末尾。 */}
|
|
1391
1379
|
{renderChannelCard('git')}
|
|
1392
1380
|
{renderChannelCard('webdav')}
|
|
1393
1381
|
{renderChannelCard('s3')}
|
|
1394
1382
|
{renderChannelCard('gist')}
|
|
1383
|
+
<AddChannelCard t={t} channels={SYNC_CHANNEL_ORDER.filter((c) => !remoteReadyOf(c))} onPick={openChannelDialogFor} />
|
|
1395
1384
|
{/* 通道配置弹窗(渲染段拆到 ChannelConfigDialog,t42):只配置**打开它的那条通道**,弹窗内不提供切换 */}
|
|
1396
1385
|
<ChannelConfigDialog
|
|
1397
1386
|
open={channelOpen}
|
|
@@ -1402,22 +1391,21 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1402
1391
|
cloudIssues={cloudIssues}
|
|
1403
1392
|
busy={state.busy !== null}
|
|
1404
1393
|
savingConfig={state.savingConfig}
|
|
1405
|
-
remoteReady={remoteReady}
|
|
1406
1394
|
statusInfo={state.statusInfo}
|
|
1407
1395
|
githubSignedIn={state.githubSignedIn}
|
|
1408
1396
|
saveTick={saveTick}
|
|
1409
1397
|
githubView={githubView}
|
|
1410
1398
|
onClose={closeChannelDialog}
|
|
1411
|
-
onFormChange={(p) => { patch(p); scheduleConfigSave() }}
|
|
1399
|
+
onFormChange={(p) => { dirtyRef.current = markDirty(dirtyRef.current, Object.keys(p)); patch(p); scheduleConfigSave() }}
|
|
1412
1400
|
onGithubStart={() => { void runGithubStart() }}
|
|
1413
1401
|
onGithubCancel={() => { void runGithubCancel() }}
|
|
1414
|
-
onSave={() => { flushConfigSave(true) }}
|
|
1415
1402
|
/>
|
|
1416
1403
|
{/* 断开通道配置的二次确认:**独立于配置弹窗**(不在弹窗里嵌套弹窗 —— Radix 遮罩层
|
|
1417
1404
|
嵌套会让内层点不动,见 Modal.tsx 的说明)。确认成功后由 onChannelCleared 统一收尾。 */}
|
|
1418
1405
|
{clearTarget !== null && (
|
|
1419
1406
|
<ChannelClearConfirmDialog
|
|
1420
1407
|
open channel={clearTarget} api={api} t={t}
|
|
1408
|
+
beforeClear={() => prepareClear({ cancelPendingSave: () => dropPendingSave(true), isBusy: () => saveQueueRef.current.inFlight, busyMessage: t('channel.clearBusy') })}
|
|
1421
1409
|
onCancel={() => { setClearTarget(null) }}
|
|
1422
1410
|
onCleared={() => { onChannelCleared(clearTarget) }}
|
|
1423
1411
|
/>
|
|
@@ -1427,9 +1415,12 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1427
1415
|
与页面级各渲染一次(重复表达),且页面级那张绑定的是隐式的「当前通道」。
|
|
1428
1416
|
分区选择现在只存在于它所属的通道卡内(§2.2-6、不变量 §3-19)。 */}
|
|
1429
1417
|
|
|
1430
|
-
{/*
|
|
1431
|
-
|
|
1432
|
-
|
|
1418
|
+
{/* 同步设置弹窗(渲染段拆到 SyncSettingsDialog / SyncSecuritySection)。
|
|
1419
|
+
2026-11-14 用户要求:分区 / 自动同步 / 加密与密钥导出 / 解密密码四块收进这一个弹窗,
|
|
1420
|
+
页面只留一行摘要。内含三个页签:「同步内容」(分区 + 会话点名)/「自动同步」
|
|
1421
|
+
(整块复用 AutosyncCard)/「加密与密码」;通道卡只保留快照行与两枚方向按钮。 */}
|
|
1422
|
+
<SyncSettingsDialog
|
|
1423
|
+
open={settingsOpen}
|
|
1433
1424
|
t={t}
|
|
1434
1425
|
cmT={cmT}
|
|
1435
1426
|
uiT={uiT}
|
|
@@ -1446,17 +1437,24 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1446
1437
|
onSessionsLimit={(value) => { setSessionsLimit(state.channel, value) }}
|
|
1447
1438
|
onSessionsInclude={(ids) => { setSessionsInclude(state.channel, ids) }}
|
|
1448
1439
|
onToggleDeletePlugins={(next) => { setDeletePlugins(state.channel, next) }}
|
|
1449
|
-
|
|
1440
|
+
busy={state.busy !== null}
|
|
1441
|
+
onToggleAutosync={(enabled) => { void toggleAutosync(state.channel, enabled) }}
|
|
1442
|
+
onUpdateAutosyncInterval={(interval) => { void updateAutosyncInterval(state.channel, interval) }}
|
|
1443
|
+
onUpdateAutosyncOptions={(patchOptions) => { void updateAutosyncOptions(state.channel, patchOptions) }}
|
|
1444
|
+
settings={chState}
|
|
1445
|
+
{...(state.statusInfo?.pendingMerge === undefined ? {} : { pendingMerge: state.statusInfo.pendingMerge })}
|
|
1446
|
+
onToggleEncrypt={(next) => { setEncrypt(state.channel, next) }}
|
|
1447
|
+
onToggleIncludeSecrets={(next) => { setIncludeSecrets(state.channel, next) }}
|
|
1448
|
+
onPatchSettings={(patchSettings) => { patchChannelOf(state.channel, patchSettings) }}
|
|
1449
|
+
onPersistEncryptPassword={() => { void persistEncryptPassword(state.channel) }}
|
|
1450
|
+
onPersistDecryptPassword={() => { void persistDecryptPassword(state.channel) }}
|
|
1451
|
+
onClearSavedPassword={() => { clearSavedDecryptPassword(state.channel) }}
|
|
1452
|
+
onClose={() => { setSettingsOpen(false) }}
|
|
1450
1453
|
/>
|
|
1451
1454
|
{/* v3:页面级的加密/解密/快照列表卡已移入各自的通道卡(见 renderChannelCard)。 */}
|
|
1452
|
-
{/*
|
|
1453
|
-
|
|
1454
|
-
<
|
|
1455
|
-
<Button size="sm" onClick={() => { runStore.patch({ panel: 'library', library: { sourceFilter: 'remote-snapshot' } }) }}>
|
|
1456
|
-
{t('history.remoteMovedAction')}
|
|
1457
|
-
</Button>
|
|
1458
|
-
</div>
|
|
1459
|
-
<SyncLogList api={api} t={t} />
|
|
1455
|
+
{/* 同步记录(只留操作日志)。2026-11-14 用户要求删掉原先那条「在产物库查看远端快照」
|
|
1456
|
+
指路按钮:远端快照本来就在产物库的来源页签里,页面不必另递一只手指过去。 */}
|
|
1457
|
+
<SyncLogList api={api} t={t} sectionName={(id) => sectionName(id as SectionId)} />
|
|
1460
1458
|
|
|
1461
1459
|
{/* P0-②:push 前只读预览确认弹窗(「将推送什么」→ 确认后才真正上传;Radix Modal) */}
|
|
1462
1460
|
<Modal
|
|
@@ -1474,6 +1472,14 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1474
1472
|
/>
|
|
1475
1473
|
<Modal.Body scroll>
|
|
1476
1474
|
<PushPreviewCard preview={state.pushPreview.preview} t={t} uiT={uiT} sectionName={sectionName} />
|
|
1475
|
+
{/* issue 140:内容没变时缺省不新建快照(远端不再堆重复快照)。要「就算一样也新建」
|
|
1476
|
+
必须在这里显式勾选 —— 与 agent 侧的 force 是同一个开关,只是给了等价入口。 */}
|
|
1477
|
+
<Checkbox
|
|
1478
|
+
checked={forcePush}
|
|
1479
|
+
onChange={setForcePush}
|
|
1480
|
+
disabled={state.busy === 'push'}
|
|
1481
|
+
label={t('syncflow.pushForce')}
|
|
1482
|
+
/>
|
|
1477
1483
|
</Modal.Body>
|
|
1478
1484
|
<Modal.Footer>
|
|
1479
1485
|
<Button
|
|
@@ -1486,6 +1492,7 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1486
1492
|
<Button
|
|
1487
1493
|
variant="primary"
|
|
1488
1494
|
loading={state.busy === 'push'}
|
|
1495
|
+
disabled={state.busy === 'push' || pushPreviewBlocked(state.pushPreview.preview, forcePush)}
|
|
1489
1496
|
onClick={() => { void runPush() }}
|
|
1490
1497
|
>
|
|
1491
1498
|
{t('syncflow.pushConfirm')}
|
|
@@ -1507,20 +1514,16 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1507
1514
|
/>
|
|
1508
1515
|
<Modal.Body scroll style={{ maxHeight: '70vh' }}>
|
|
1509
1516
|
{pushView !== null && (<>
|
|
1510
|
-
<Banner kind={pushView.kind === 'ok' ? 'ok' : 'error'}>{pushView.headline}</Banner>
|
|
1517
|
+
<Banner kind={pushView.kind === 'ok' ? 'ok' : pushView.kind === 'skipped' ? 'info' : 'error'}>{pushView.headline}</Banner>
|
|
1511
1518
|
{pushView.sections.length > 0 && (
|
|
1512
|
-
<
|
|
1513
|
-
|
|
1514
|
-
<div className={css.statRow}>
|
|
1515
|
-
{pushView.sections.map((s) => <Badge key={s} kind="info">{s}</Badge>)}
|
|
1516
|
-
</div>
|
|
1517
|
-
</div>
|
|
1519
|
+
<PushReportSections sections={pushView.sections} counts={pushView.counts}
|
|
1520
|
+
sectionName={(id) => sectionName(id as SectionId)} label={t('sections.title')} />
|
|
1518
1521
|
)}
|
|
1519
1522
|
{pushView.warnings.length > 0 && (
|
|
1520
1523
|
<div>
|
|
1521
1524
|
<span className={css.fieldLabel}>{t('warnings.title')}</span>
|
|
1522
1525
|
<ul className={css.warnList}>
|
|
1523
|
-
{pushView.warnings.map((w, i) => <li key={i}>{w}</li>)}
|
|
1526
|
+
{pushView.warnings.map((w, i) => <li key={i}>{redact(w)}</li>)}
|
|
1524
1527
|
</ul>
|
|
1525
1528
|
</div>
|
|
1526
1529
|
)}
|
|
@@ -1561,23 +1564,23 @@ export function SyncPanel({ api, t, cmT }: SyncPanelProps) {
|
|
|
1561
1564
|
onClose={cancelConfirm}
|
|
1562
1565
|
closeDisabled={state.busy === 'sync'}
|
|
1563
1566
|
/>
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1567
|
+
{state.confirmSession !== null && (
|
|
1568
|
+
<SyncConfirmView
|
|
1569
|
+
api={api}
|
|
1570
|
+
syncSessionId={state.confirmSession.syncSessionId}
|
|
1571
|
+
snapshotId={state.confirmSession.snapshotId}
|
|
1572
|
+
items={state.confirmSession.items}
|
|
1573
|
+
needsReview={state.confirmSession.needsReview}
|
|
1574
|
+
compatibility={state.confirmSession.compatibility}
|
|
1575
|
+
t={t}
|
|
1576
|
+
decisions={state.confirmDecisions}
|
|
1577
|
+
onDecisionsChange={(d) => { patch({ confirmDecisions: d }) }}
|
|
1578
|
+
onCancel={cancelConfirm}
|
|
1579
|
+
onRollbackDone={onRollbackApplied}
|
|
1580
|
+
remoteChannelBody={buildSyncChannelBody(formOf(state))}
|
|
1581
|
+
sectionName={(id) => sectionName(id as SectionId)}
|
|
1582
|
+
/>
|
|
1583
|
+
)}
|
|
1581
1584
|
</Modal>
|
|
1582
1585
|
</div>
|
|
1583
1586
|
)
|