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
|
@@ -59,8 +59,8 @@ export function ConsultCard({ report, t, title }: ConsultCardProps) {
|
|
|
59
59
|
</Banner>
|
|
60
60
|
)}
|
|
61
61
|
|
|
62
|
-
{/*
|
|
63
|
-
<div className={css.consultSection}>
|
|
62
|
+
{/* 将应用摘要(稿 D-03:144:本节自成一栏,底边与维度明细分隔) */}
|
|
63
|
+
<div className={css.consultSection + ' ' + css.consultWillApply}>
|
|
64
64
|
<div className={css.groupLabel}>{t('consult.willApply')}</div>
|
|
65
65
|
<div className={css.statRow}>
|
|
66
66
|
{view.willApply.sections.length > 0 && (
|
|
@@ -81,12 +81,13 @@ export function ConsultCard({ report, t, title }: ConsultCardProps) {
|
|
|
81
81
|
{/* 维度明细(限高内滚) */}
|
|
82
82
|
<div className={css.consultSection}>
|
|
83
83
|
<div className={css.groupLabel}>{t('consult.dimensions')}</div>
|
|
84
|
-
<div className={css.consultScroll}>
|
|
84
|
+
<div className={css.consultScroll + ' ' + css.consultDimensionScroll}>
|
|
85
85
|
{view.dimensions.map((d) => (
|
|
86
86
|
<div key={d.id} className={css.consultDimension}>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<
|
|
87
|
+
{/* 稿 D-03:161-200:维度名是纯文本(不再做成徽章),分数单独一枚按分数档位上色的徽章 */}
|
|
88
|
+
<div className={css.consultDimensionRow}>
|
|
89
|
+
<span className={css.consultDimensionName}>{d.label}</span>
|
|
90
|
+
<Badge kind={d.scoreKind}>{d.score}</Badge>
|
|
90
91
|
</div>
|
|
91
92
|
{d.issues.length > 0 && (
|
|
92
93
|
<ul className={css.reportList}>
|
|
@@ -36,8 +36,8 @@ import { RecoveryPanel } from '../recovery/RecoveryPanel.tsx'
|
|
|
36
36
|
import type { RecoveryPort } from '../../ui/types.ts'
|
|
37
37
|
import type { IncidentApi } from '../recovery/incident-api.ts'
|
|
38
38
|
import { Badge, Banner, Button, Card, Checkbox, Empty, IconButton, SectionTitle, Segmented } from '../common/ui.tsx'
|
|
39
|
+
import { ErrorBanner } from '../common/ErrorBanner.tsx'
|
|
39
40
|
import { Icon } from '../common/Icon.tsx'
|
|
40
|
-
import { InfoHint } from '../common/InfoHint.tsx'
|
|
41
41
|
import { Skeleton, SkeletonList } from '../common/Skeleton.tsx'
|
|
42
42
|
import { Select } from '../common/Select.tsx'
|
|
43
43
|
import { ConfirmDialog } from '../common/ConfirmDialog.tsx'
|
|
@@ -429,14 +429,13 @@ export function EnvironmentPanel({ api, t, recoveryApi, recoveryT, incidentApi }
|
|
|
429
429
|
t={recoveryT}
|
|
430
430
|
incidentApi={incidentApi}
|
|
431
431
|
copyT={t}
|
|
432
|
-
infoHintLabel={t('common.infoHint')}
|
|
433
432
|
diskApi={api}
|
|
434
433
|
/>
|
|
435
434
|
)}
|
|
436
435
|
|
|
437
436
|
{subView === 'list' && (
|
|
438
437
|
<>
|
|
439
|
-
<SectionTitle title={t('profiles.title')}
|
|
438
|
+
<SectionTitle title={t('profiles.title')} tooltip={t('profiles.subtitle')} />
|
|
440
439
|
|
|
441
440
|
{/* —— 运行状态:当前运行中的 profile + 本插件启动的实例(可打开 / 可停止) —— */}
|
|
442
441
|
<Card className={css.card}>
|
|
@@ -545,7 +544,7 @@ export function EnvironmentPanel({ api, t, recoveryApi, recoveryT, incidentApi }
|
|
|
545
544
|
|
|
546
545
|
{/* —— 新建档案 —— */}
|
|
547
546
|
<Card className={css.card}>
|
|
548
|
-
<div className={css.groupLabel}
|
|
547
|
+
<div className={css.groupLabel} title={t('profiles.create.hint')}>{t('profiles.create.title')}</div>
|
|
549
548
|
<div className={css.actionRow}>
|
|
550
549
|
<input
|
|
551
550
|
type="text"
|
|
@@ -574,16 +573,13 @@ export function EnvironmentPanel({ api, t, recoveryApi, recoveryT, incidentApi }
|
|
|
574
573
|
{/* —— 列表 —— */}
|
|
575
574
|
{phase === 'loading' && <SkeletonList label={t('profiles.loading')} />}
|
|
576
575
|
{phase === 'error' && (
|
|
577
|
-
<
|
|
578
|
-
{redact(state.loadError ?? t('common.unknownError'))}
|
|
579
|
-
<Button size="sm" onClick={load}>{t('common.retry')}</Button>
|
|
580
|
-
</Banner>
|
|
576
|
+
<ErrorBanner error={redact(state.loadError ?? t('common.unknownError'))} onRetry={load} t={api.t} />
|
|
581
577
|
)}
|
|
582
578
|
{phase === 'ready' && profileList.length === 0 && <Empty>{t('profiles.empty')}</Empty>}
|
|
583
579
|
{phase === 'ready' && profileList.length > 0 && (
|
|
584
580
|
<>
|
|
585
581
|
<div className={css.listHeaderRow}>
|
|
586
|
-
<span className={css.groupLabel}>{t('profiles.list.title')}
|
|
582
|
+
<span className={css.groupLabel}>{t('profiles.list.title')}</span>
|
|
587
583
|
<span className={css.cellMeta}>
|
|
588
584
|
{/* 只留计数与「需处理」:形态 / node_modules 已是每行徽章,汇总句不改变任何决定 */}
|
|
589
585
|
{t('profiles.list.count', { count: summary.total })}
|
|
@@ -607,7 +603,7 @@ export function EnvironmentPanel({ api, t, recoveryApi, recoveryT, incidentApi }
|
|
|
607
603
|
<div key={profile.name} className={css.profileRow} role="listitem" data-selected={profile.name === state.selectedName ? '' : undefined}>
|
|
608
604
|
<div className={css.profileRowHeader}>
|
|
609
605
|
{/* 整行「信息区」可点:行内只给计数,完整清单(bundle 层 / 逐条依赖 / patch 原文)在详情弹窗里 */}
|
|
610
|
-
<button type="button" className={css.profileRowMain} title={
|
|
606
|
+
<button type="button" className={css.profileRowMain} title={incomplete ? t('profiles.incomplete.hint') : undefined} onClick={() => { openDetail(profile) }}>
|
|
611
607
|
<span className={css.profileRowTitle}>
|
|
612
608
|
<span className={`${css.mono} ${css.profileRowName}`}>{profile.name}</span>
|
|
613
609
|
<span className={css.badgeRow}>
|
|
@@ -695,16 +691,14 @@ export function EnvironmentPanel({ api, t, recoveryApi, recoveryT, incidentApi }
|
|
|
695
691
|
{t('profiles.launch')}
|
|
696
692
|
</Button>
|
|
697
693
|
)}
|
|
698
|
-
{/* 2026-11-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
694
|
+
{/* 2026-11-14(W5 / 稿 P-04):复制与删除回到**文字按钮** —— 行里同时出现
|
|
695
|
+
「启动 / 停止」「复制」「删除」三处动作时,图标按钮要靠悬停才认得出哪个是删除,
|
|
696
|
+
而删除是不可恢复操作:它必须自带「危险 → 红描边 + 文字」的自解释。
|
|
697
|
+
改名仍是铅笔图标 + aria-label:它是低频操作,四颗文字按钮在 564px 画布上
|
|
698
|
+
会挤成一排,扫读反而变慢(复制/删除是每行都要扫的,改名不是)。 */}
|
|
703
699
|
{caps.duplicate && (
|
|
704
|
-
<
|
|
705
|
-
|
|
706
|
-
label={t('profiles.duplicate')}
|
|
707
|
-
title={t('profiles.duplicateHint')}
|
|
700
|
+
<Button
|
|
701
|
+
size="sm"
|
|
708
702
|
disabled={state.copying}
|
|
709
703
|
onClick={() => {
|
|
710
704
|
patch({
|
|
@@ -714,7 +708,9 @@ export function EnvironmentPanel({ api, t, recoveryApi, recoveryT, incidentApi }
|
|
|
714
708
|
error: null,
|
|
715
709
|
})
|
|
716
710
|
}}
|
|
717
|
-
|
|
711
|
+
>
|
|
712
|
+
{t('profiles.duplicate')}
|
|
713
|
+
</Button>
|
|
718
714
|
)}
|
|
719
715
|
{caps.rename && (
|
|
720
716
|
<IconButton
|
|
@@ -723,12 +719,13 @@ export function EnvironmentPanel({ api, t, recoveryApi, recoveryT, incidentApi }
|
|
|
723
719
|
onClick={() => { patch({ renameTargetName: profile.name, renameValue: profile.name, error: null }) }}
|
|
724
720
|
/>
|
|
725
721
|
)}
|
|
726
|
-
<
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
danger
|
|
722
|
+
<Button
|
|
723
|
+
size="sm"
|
|
724
|
+
variant="danger"
|
|
730
725
|
onClick={() => { patch({ deleteTargetName: profile.name, deleteCurrentConfirmed: false, error: null }) }}
|
|
731
|
-
|
|
726
|
+
>
|
|
727
|
+
{t('profiles.delete')}
|
|
728
|
+
</Button>
|
|
732
729
|
</span>
|
|
733
730
|
</div>
|
|
734
731
|
</div>
|
|
@@ -25,30 +25,25 @@ import type { ConfigManagerApi } from '../../api.ts'
|
|
|
25
25
|
import type { DiskUsageReport } from '../../../core/disk-usage.ts'
|
|
26
26
|
import { Badge, Banner, Button, Card, Checkbox, IconButton } from '../../common/ui.tsx'
|
|
27
27
|
import { SkeletonList } from '../../common/Skeleton.tsx'
|
|
28
|
-
import { InfoHint } from '../../common/InfoHint.tsx'
|
|
29
28
|
import { ConfirmDialog } from '../../common/ConfirmDialog.tsx'
|
|
30
29
|
import { RefreshIcon } from '../../common/Icon.tsx'
|
|
31
30
|
import { toast } from '../../common/toast-store.ts'
|
|
31
|
+
import { WRITE_KEY, useRecoveryWriteKey, withRecoveryWrite } from '../../recovery/use-recovery-write.ts'
|
|
32
32
|
import css from '../../config-manager.module.css'
|
|
33
33
|
|
|
34
34
|
export interface DiskUsageCardProps {
|
|
35
35
|
api: ConfigManagerApi
|
|
36
|
-
/**
|
|
37
|
-
* ⓘ 说明按钮的可访问名(主字典 `common.infoHint`)。本卡全部文案走 **UiT**(`api.t`),
|
|
38
|
-
* 与主字典键域不同、取不到该键 —— 由调用方(环境页的维护视图)显式传入,
|
|
39
|
-
* 避免在英文界面下回落到源语言硬编码。
|
|
40
|
-
*/
|
|
41
|
-
infoHintLabel: string
|
|
42
36
|
/** 回收过期备份文件后通知外层刷新备份列表(否则产物库会短暂显示已删条目) */
|
|
43
37
|
onBackupsChanged?: () => void
|
|
44
38
|
}
|
|
45
39
|
|
|
46
|
-
export function DiskUsageCard({ api,
|
|
40
|
+
export function DiskUsageCard({ api, onBackupsChanged }: DiskUsageCardProps) {
|
|
47
41
|
const t = api.t
|
|
48
42
|
const [status, setStatus] = useState<'loading' | 'ready' | 'error'>('loading')
|
|
49
43
|
const [error, setError] = useState<string | null>(null)
|
|
50
44
|
const [report, setReport] = useState<DiskUsageReport | null>(null)
|
|
51
|
-
const
|
|
45
|
+
const writeKey = useRecoveryWriteKey()
|
|
46
|
+
const busy = writeKey === WRITE_KEY.diskCleanup
|
|
52
47
|
const [includeExpired, setIncludeExpired] = useState(false)
|
|
53
48
|
const [confirmOpen, setConfirmOpen] = useState(false)
|
|
54
49
|
const mountedRef = useRef(true)
|
|
@@ -108,15 +103,13 @@ export function DiskUsageCard({ api, infoHintLabel, onBackupsChanged }: DiskUsag
|
|
|
108
103
|
*/
|
|
109
104
|
const runCleanup = (): void => {
|
|
110
105
|
if (busy) return
|
|
111
|
-
setBusy(true)
|
|
112
106
|
setConfirmOpen(false)
|
|
113
107
|
// categories 是**分区白名单**:没勾过期导出就一个导出文件都不碰(硬边界 ②)
|
|
114
108
|
const categories: Array<'tmp' | 'expired-exports'> = ['tmp']
|
|
115
109
|
if (includeExpired) categories.push('expired-exports')
|
|
116
|
-
api.cleanupDiskUsage(categories).then(
|
|
110
|
+
void withRecoveryWrite(WRITE_KEY.diskCleanup, () => api.cleanupDiskUsage(categories)).then(
|
|
117
111
|
(result) => {
|
|
118
112
|
if (!mountedRef.current) return
|
|
119
|
-
setBusy(false)
|
|
120
113
|
setReport(result.report)
|
|
121
114
|
if (includeExpired) onBackupsChanged?.()
|
|
122
115
|
// e2e-F3:呈现判定在 ui/disk-usage-view.ts(「目录不存在」不是失败);组件只按 kind 挑 toast
|
|
@@ -132,7 +125,6 @@ export function DiskUsageCard({ api, infoHintLabel, onBackupsChanged }: DiskUsag
|
|
|
132
125
|
},
|
|
133
126
|
(err) => {
|
|
134
127
|
if (!mountedRef.current) return
|
|
135
|
-
setBusy(false)
|
|
136
128
|
toast.error(redact(err instanceof Error ? err.message : String(err)))
|
|
137
129
|
},
|
|
138
130
|
)
|
|
@@ -141,8 +133,18 @@ export function DiskUsageCard({ api, infoHintLabel, onBackupsChanged }: DiskUsag
|
|
|
141
133
|
return (
|
|
142
134
|
<Card className={css.activityCard + ' ' + css.diskUsageCard}>
|
|
143
135
|
<div className={css.groupHeader}>
|
|
144
|
-
<span
|
|
145
|
-
|
|
136
|
+
<span
|
|
137
|
+
className={css.groupLabel}
|
|
138
|
+
title={exportRetentionDays !== null
|
|
139
|
+
? t('diskUsage.backupRetention', {
|
|
140
|
+
count: String(report?.backupRetention.keepLast ?? 0),
|
|
141
|
+
days: String(exportRetentionDays),
|
|
142
|
+
})
|
|
143
|
+
: undefined}
|
|
144
|
+
>{t('diskUsage.title')}</span>
|
|
145
|
+
{/* 保留期说明属「机制怎么工作」(MOVE 类):挂在标题文字的 title 上,不再常驻占一行;
|
|
146
|
+
标题旁也不再挂一颗「合计」徽章 —— 下面那行已经是合计,同一个数同一屏出现两次
|
|
147
|
+
只会让人先去比对它们。 */}
|
|
146
148
|
<span className={css.statusSpacer} />
|
|
147
149
|
<IconButton
|
|
148
150
|
icon={<RefreshIcon size={14} />}
|
|
@@ -164,102 +166,73 @@ export function DiskUsageCard({ api, infoHintLabel, onBackupsChanged }: DiskUsag
|
|
|
164
166
|
|
|
165
167
|
{status === 'ready' && vm !== null && (
|
|
166
168
|
<>
|
|
167
|
-
{/*
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
{/* 合计一行给出这张卡的两个总数(占用 + 文件数):逐行不再重复文件数(见下方行注释)。
|
|
170
|
+
统计根路径仍要可查(它决定「这些数字量的是哪里」),但它是**恒定的上下文**,
|
|
171
|
+
不是每次体检都变的结论 ⇒ 进 title,不占一行。 */}
|
|
172
|
+
<div className={css.cellMeta} title={redact(vm.summary.dataDir)}>
|
|
173
|
+
{t('diskUsage.total', { size: vm.summary.total, files: vm.summary.files })}
|
|
170
174
|
</div>
|
|
171
175
|
{/* 读不到的子区如实说明:既不显示 0,也不整卡报错(硬边界:unreadable ≠ 0) */}
|
|
172
176
|
{vm.summary.anyUnreadable && <div className={css.hint}>{t('diskUsage.partial')}</div>}
|
|
173
177
|
|
|
174
178
|
{/*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
179
|
+
* 单行式分区行(2026-11-14):这张卡渲染的是 13 个真实分区,两行式每行 44px 时
|
|
180
|
+
* 一屏只放得下 8 行,且「比大小」被拆到两行(占用在首行、策略徽章在次行)。
|
|
181
|
+
* 现在一行 = 区域名(超长省略,全名在行 title)· 过期量 · 占用 · 回收策略,
|
|
182
|
+
* 13 行一屏读完。文件数不逐行渲染(它不改变「能不能删」这个决定),
|
|
183
|
+
* 总数在合计行、逐行明细留在行 title 里。
|
|
184
|
+
* desc 进 title:它说明「这块是哪来的」,不改变「能不能删」这个决定。
|
|
180
185
|
*/}
|
|
181
186
|
<div className={css.planScroll + ' ' + css.diskUsageScroll + ' ' + css.duList} role="list">
|
|
182
187
|
{vm.rows.map((row) => (
|
|
183
|
-
<div
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
</
|
|
190
|
-
|
|
191
|
-
<span className={css.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
{row.
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
</
|
|
188
|
+
<div
|
|
189
|
+
key={row.id}
|
|
190
|
+
className={css.duRow}
|
|
191
|
+
role="listitem"
|
|
192
|
+
title={row.unreadable ? row.desc : `${row.desc} · ${row.files}`}
|
|
193
|
+
>
|
|
194
|
+
<span className={css.duRowName} title={row.label}>{row.label}</span>
|
|
195
|
+
{row.expired !== null && (
|
|
196
|
+
<span className={css.duRowNote}>{t('diskUsage.expiredHint', { size: row.expired })}</span>
|
|
197
|
+
)}
|
|
198
|
+
<span className={css.duRowSize}>
|
|
199
|
+
{row.unreadable ? t('diskUsage.unreadable') : row.size}
|
|
200
|
+
</span>
|
|
201
|
+
{row.policy === 'regenerable' && <Badge kind="ok">{t('diskUsage.policy.regenerable')}</Badge>}
|
|
202
|
+
{row.policy === 'retained' && <Badge kind="info">{t('diskUsage.policy.retained', { retention: row.retention })}</Badge>}
|
|
203
|
+
{row.policy === 'protected' && <span className={css.duRowPolicy}>{t('diskUsage.policy.protected')}</span>}
|
|
199
204
|
</div>
|
|
200
205
|
))}
|
|
201
206
|
</div>
|
|
202
207
|
|
|
203
|
-
{
|
|
204
|
-
* 遗留数据(core 只报告、**不计入**上面的合计):必须单列一块。
|
|
205
|
-
* 混进主表会让用户以为那个合计里已经算过它们(core 刻意把两者分列)。
|
|
206
|
-
*/}
|
|
207
|
-
{vm.legacy.length > 0 && (
|
|
208
|
-
<>
|
|
209
|
-
<div className={css.groupLabel}>{t('diskUsage.legacy.title')}</div>
|
|
210
|
-
{/* 只留「与上方合计的口径差」:不删、不自动清的理由由行内策略标签负责 */}
|
|
211
|
-
<div className={css.cellMeta}>{t('diskUsage.legacy.hint')}</div>
|
|
212
|
-
{vm.legacy.map((row) => (
|
|
213
|
-
<div className={css.actionRow} data-inline key={row.id}>
|
|
214
|
-
<span>
|
|
215
|
-
{row.label} <span className={css.mono}>{redact(row.relPath)}</span>
|
|
216
|
-
</span>
|
|
217
|
-
<span className={css.statusSpacer} />
|
|
218
|
-
<span className={css.cellMeta}>
|
|
219
|
-
{row.unreadable ? t('diskUsage.unreadable') : row.size + ' · ' + row.files}
|
|
220
|
-
</span>
|
|
221
|
-
{/* 行尾的 protected 标签已删(2026-11-01):本组上方的说明文字就是
|
|
222
|
-
「no longer read · never auto-deleted · not part of the total above」,
|
|
223
|
-
逐行再贴一遍只会把这一行挤到溢出(实测最后一段跑出右边界)。 */}
|
|
224
|
-
</div>
|
|
225
|
-
))}
|
|
226
|
-
</>
|
|
227
|
-
)}
|
|
228
|
-
{/* 保留期说明属「机制怎么工作」(MOVE 类):收进 ⓘ,不常驻占一行 */}
|
|
229
|
-
{exportRetentionDays !== null && (
|
|
230
|
-
<div className={css.actionRow} data-inline>
|
|
231
|
-
<InfoHint
|
|
232
|
-
text={t('diskUsage.backupRetention', {
|
|
233
|
-
count: String(report?.backupRetention.keepLast ?? 0),
|
|
234
|
-
days: String(exportRetentionDays),
|
|
235
|
-
})}
|
|
236
|
-
label={infoHintLabel}
|
|
237
|
-
/>
|
|
238
|
-
</div>
|
|
239
|
-
)}
|
|
240
|
-
|
|
241
|
-
<div className={css.groupLabel}>{t('diskUsage.clean.title')} <InfoHint text={t('diskUsage.clean.hint')} label={infoHintLabel} /></div>
|
|
208
|
+
<div className={css.groupLabel} title={t('diskUsage.clean.hint')}>{t('diskUsage.clean.title')}</div>
|
|
242
209
|
|
|
243
|
-
{
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
210
|
+
{/* 清理块三行一套(2026-11-14 用户要求重排位置与间距):清什么 / 是否连带回收过期备份 /
|
|
211
|
+
释放多少 + 动手按钮。改前每行是一条 `.actionRow[data-inline]`(margin 0)⇒ 行间零间距,
|
|
212
|
+
勾选框贴在前一行下沿;两枚体量徽章一枚紧跟文字、一枚被 spacer 顶到卡右缘 ⇒ 同一块两种摆法。
|
|
213
|
+
现在:统一行距的纵向栈,徽章一律紧跟它管辖的文案,卡右缘只留「立即清理」一颗按钮。 */}
|
|
214
|
+
<div className={css.cleanupLines}>
|
|
215
|
+
{tmpMarket !== undefined && (
|
|
216
|
+
<div className={css.cleanupScope}>
|
|
217
|
+
<span>{tmpMarket.label}</span>
|
|
218
|
+
<Badge kind={tmpMarket.bytes > 0 ? 'info' : 'ok'}>{tmpMarket.size}</Badge>
|
|
219
|
+
</div>
|
|
220
|
+
)}
|
|
248
221
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
222
|
+
{expiredExports !== undefined && (
|
|
223
|
+
<div className={css.cleanupOption}>
|
|
224
|
+
<Checkbox
|
|
225
|
+
checked={includeExpired}
|
|
226
|
+
onChange={(next) => { setIncludeExpired(next) }}
|
|
227
|
+
label={t('diskUsage.clean.includeExpired')}
|
|
228
|
+
/>
|
|
229
|
+
{/* 勾选框已经说明了「回收什么」,这里只补可回收量;紧挨着它管辖的那句话,不顶到右缘 */}
|
|
230
|
+
<Badge kind={expiredExports.bytes > 0 ? 'warn' : 'ok'}>{expiredExports.size}</Badge>
|
|
231
|
+
</div>
|
|
232
|
+
)}
|
|
233
|
+
</div>
|
|
261
234
|
|
|
262
|
-
<div className={css.
|
|
235
|
+
<div className={css.cleanupAction}>
|
|
263
236
|
<span className={css.cellMeta}>{t('diskUsage.clean.reclaimableLabel')}</span>
|
|
264
237
|
<span className={css.mono}>{formatBytes(reclaimTargets)}</span>
|
|
265
238
|
<span className={css.statusSpacer} />
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* cross-F3(t50)客户端守卫:中断的档案复制残留必须以**独立形态**呈现,且只给删除。
|
|
3
3
|
*
|
|
4
4
|
* 本仓库 React 侧无组件测试框架,沿用 `src/client/common/*.test.ts` 的**源码守卫**模式
|
|
5
|
-
* (与 report-dismiss.test.ts /
|
|
5
|
+
* (与 report-dismiss.test.ts / section-title-action.test.ts 同风格):
|
|
6
6
|
* 1. 行内形态徽章必须走 `profileShapeLabelKey(profile)`(残留行 = 「未完成的副本」,不是 generic);
|
|
7
7
|
* 2. 动作行里启动/停止、复制、改名三处必须由 `profileRowCapabilities` 的判据把守,**删除不得被把守**(它是残留行的唯一动作);
|
|
8
8
|
* 3. 残留行必须给出 dir(经 `redact()`)、来源与开始时间;
|
|
@@ -56,13 +56,12 @@ test('cross-F3 UI:动作行三处把守 + 删除不被把守', () => {
|
|
|
56
56
|
assert.match(block, /caps\.duplicate &&/, '复制按钮必须由 caps.duplicate 把守')
|
|
57
57
|
assert.match(block, /caps\.rename &&/, '改名按钮必须由 caps.rename 把守')
|
|
58
58
|
// 删除是残留行的唯一动作:它必须出现在改名把守闭合之后,本身不带任何 caps 条件。
|
|
59
|
-
// 2026-11-04
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
assert.match(block, /caps\.rename &&[\s\S]*?\n\s*\)\}\s*<IconButton[\s\S]*?label=\{t\('profiles\.delete'\)\}[\s\S]*?\bdanger\b/,
|
|
59
|
+
// 2026-11-04:删除收成图标按钮(行密度改造);2026-11-14(W5 / 稿 P-04):又回到文字按钮 ——
|
|
60
|
+
// 图标按钮与「复制」外形一致,而删除不可恢复,必须自带文字 + 红色描边(variant="danger")。
|
|
61
|
+
// 判据不变:仍是「紧跟最后一个把守闭合 + 自身不带 caps 条件」。
|
|
62
|
+
assert.match(block, /caps\.rename &&[\s\S]*?\n\s*\)\}\s*<Button[\s\S]*?variant="danger"[\s\S]*?\{t\('profiles\.delete'\)\}/,
|
|
64
63
|
'删除控件必须紧跟最后一个把守闭合、自身不带条件(残留行也要能点删除),且是危险语义')
|
|
65
|
-
const deleteStart = block.lastIndexOf('<
|
|
64
|
+
const deleteStart = block.lastIndexOf('<Button', block.indexOf("profiles.delete'"))
|
|
66
65
|
assert.ok(deleteStart > 0 && !/caps\./.test(block.slice(deleteStart)), '删除控件内部不得再夹 caps 条件')
|
|
67
66
|
})
|
|
68
67
|
|
|
@@ -72,7 +71,8 @@ test('cross-F3 UI:残留行展示来源 / 开始时间 / 目录(目录经 re
|
|
|
72
71
|
assert.match(panelSrc, /t\('profiles\.incomplete\.from', \{ name: copyFacts\.copiedFrom \}\)/, '必须显示来源档案')
|
|
73
72
|
assert.match(panelSrc, /t\('profiles\.incomplete\.startedAt', \{ time: copyStartedText \}\)/, '必须显示开始时间')
|
|
74
73
|
assert.match(panelSrc, /t\('profiles\.incomplete\.dir', \{ path: redact\(copyFacts\.dir\) \}\)/, '目录必须脱敏后展示')
|
|
75
|
-
|
|
74
|
+
// 2026-11-14:`profiles.list.hint`(「点行看详情」)判为可删的省事提示,行 tooltip 只在残留行给解释
|
|
75
|
+
assert.match(panelSrc, /title=\{incomplete \? t\('profiles\.incomplete\.hint'\) : undefined\}/, '残留行要给一段解释(tooltip)')
|
|
76
76
|
})
|
|
77
77
|
|
|
78
78
|
test('cross-F3 UI:删除确认对残留行给专属文案', () => {
|
|
@@ -42,7 +42,6 @@ import { ContentPicker } from '../common/ContentPicker.tsx'
|
|
|
42
42
|
import { SectionComposition } from '../common/SectionComposition.tsx'
|
|
43
43
|
import { sectionLabel, sectionLabeler } from '../common/section-labels.ts'
|
|
44
44
|
import { Modal } from '../common/Modal.tsx'
|
|
45
|
-
import { InfoHint } from '../common/InfoHint.tsx'
|
|
46
45
|
import { PreviewIcon } from '../common/Icon.tsx'
|
|
47
46
|
import { ErrorBanner } from '../common/ErrorBanner.tsx'
|
|
48
47
|
import { ProgressBar } from '../common/ProgressBar.tsx'
|
|
@@ -138,7 +137,7 @@ export function ExportView({ api, t }: ExportViewProps) {
|
|
|
138
137
|
} catch (err) {
|
|
139
138
|
// 请求整体失败(宿主异常 / 网络中断):本次在途分区全部计为读取失败(UI-07 的复现路径)
|
|
140
139
|
setInvFailed((prev) => [...new Set([...prev.filter((s) => !todo.includes(s)), ...todo])])
|
|
141
|
-
setInvError(
|
|
140
|
+
setInvError(redactErrorText(err))
|
|
142
141
|
} finally {
|
|
143
142
|
for (const s of todo) invInFlight.current.delete(s)
|
|
144
143
|
setInvPending((prev) => prev.filter((s) => !todo.includes(s)))
|
|
@@ -386,9 +385,6 @@ export function ExportView({ api, t }: ExportViewProps) {
|
|
|
386
385
|
<Button loading={invLoading} disabled={running} title={t('picker.title')} onClick={openPicker}>
|
|
387
386
|
{invLoading ? null : <PreviewIcon size={13} />} {t('picker.title')}
|
|
388
387
|
</Button>
|
|
389
|
-
{/* 工具栏「模式提示」属「机制怎么工作 + 省事提示」(MOVE 类):收进 ⓘ,
|
|
390
|
-
不再常驻占首屏一行(默认导出推荐分区 + 去哪里调整勾选)。 */}
|
|
391
|
-
<InfoHint text={t('export.hint')} label={t('common.infoHint')} />
|
|
392
388
|
</div>
|
|
393
389
|
{/* 公告位 = **恒定高度**槽位(.noticeSlot):出现/消失时不能改变内容流高度,
|
|
394
390
|
否则垂直居中的选择器弹窗会跳(用户实测反馈)。 */}
|
|
@@ -400,15 +396,13 @@ export function ExportView({ api, t }: ExportViewProps) {
|
|
|
400
396
|
<Checkbox
|
|
401
397
|
checked={encrypt}
|
|
402
398
|
onChange={setEncrypt}
|
|
403
|
-
label={<span className={css.categoryName}>{t('export.encrypt')}</span>}
|
|
399
|
+
label={<span className={css.categoryName} title={t('export.encryptHint')}>{t('export.encrypt')}</span>}
|
|
404
400
|
/>
|
|
405
|
-
<InfoHint text={t('export.encryptHint')} label={t('common.infoHint')} />
|
|
406
401
|
<Checkbox
|
|
407
402
|
checked={includeSecrets}
|
|
408
403
|
onChange={setIncludeSecrets}
|
|
409
|
-
label={<span className={css.categoryName}>{t('export.includeSecrets')}</span>}
|
|
404
|
+
label={<span className={css.categoryName} title={t('export.includeSecretsHint')}>{t('export.includeSecrets')}</span>}
|
|
410
405
|
/>
|
|
411
|
-
<InfoHint text={t('export.includeSecretsHint')} label={t('common.infoHint')} />
|
|
412
406
|
<span className={css.statusSpacer} />
|
|
413
407
|
</div>
|
|
414
408
|
{encrypt && (
|
|
@@ -430,11 +424,10 @@ export function ExportView({ api, t }: ExportViewProps) {
|
|
|
430
424
|
分组标题「文件名与备注(可选)」只是把字段名再念一遍,已删除。 */}
|
|
431
425
|
<div className={css.secretFields}>
|
|
432
426
|
<div className={css.field}>
|
|
433
|
-
<span className={css.fieldLabel}>
|
|
427
|
+
<span className={css.fieldLabel} title={t('export.fileNameHint')}>
|
|
434
428
|
{t('export.fileName')}
|
|
435
|
-
{/*
|
|
429
|
+
{/* 输入规则挂在字段标签的 title 上(悬停可见):非法时下面的 css.formError
|
|
436
430
|
仍常驻重申字符规则(校验错误属 KEEP ①),规则不会因此不可见。 */}
|
|
437
|
-
<InfoHint text={t('export.fileNameHint')} label={t('common.infoHint')} />
|
|
438
431
|
</span>
|
|
439
432
|
<input aria-label={t('export.fileName')}
|
|
440
433
|
type="text"
|
|
@@ -448,14 +441,12 @@ export function ExportView({ api, t }: ExportViewProps) {
|
|
|
448
441
|
}}
|
|
449
442
|
/>
|
|
450
443
|
{/* KEEP ①:校验错误仍常驻(export.fileNameInvalid 本身就重申了允许的字符集),
|
|
451
|
-
|
|
444
|
+
渲染与改前逐字一致;规则说明挂在字段标签的 title 上。 */}
|
|
452
445
|
{fileNameInvalid && <span className={css.formError}>{t('export.fileNameInvalid')}</span>}
|
|
453
446
|
</div>
|
|
454
447
|
<div className={css.field}>
|
|
455
448
|
<span className={css.fieldLabel}>
|
|
456
449
|
{t('export.note')}
|
|
457
|
-
{/* 备注说明属 MOVE 类(补充背景):收进字段标签旁的 ⓘ,不再常驻占一行 */}
|
|
458
|
-
<InfoHint text={t('export.noteHint')} label={t('common.infoHint')} />
|
|
459
450
|
</span>
|
|
460
451
|
<input aria-label={t('export.note')}
|
|
461
452
|
type="text"
|
|
@@ -539,7 +530,7 @@ export function ExportView({ api, t }: ExportViewProps) {
|
|
|
539
530
|
「无内容可导出」本身就是一条需要用户看到的状态,而不是留白)。 */}
|
|
540
531
|
<Card className={css.fillViewport}>
|
|
541
532
|
<div className={css.groupHeader}>
|
|
542
|
-
<span className={css.groupLabel}>{t('export.compositionTitle')}
|
|
533
|
+
<span className={css.groupLabel}>{t('export.compositionTitle')}</span>
|
|
543
534
|
<span className={css.statusSpacer} />
|
|
544
535
|
{compositionRows.length > 0 && (
|
|
545
536
|
/* 有未读取分区时合计只报**下限**并显式标注(F-03):宁可说「不少于」,也不虚报一个偏小的数 */
|