From 0f41791a86360c6e04812471649ba293c45e1cf6 Mon Sep 17 00:00:00 2001 From: xcv58 Date: Sat, 22 Aug 2026 23:29:16 -0400 Subject: [PATCH] Fix preferences import preview overflow --- README.md | 2 +- Sources/App/SettingsView.swift | 57 ++++++++++++------- .../preferences-import-preview-scrolling.md | 7 +++ 3 files changed, 43 insertions(+), 23 deletions(-) create mode 100644 changes/unreleased/preferences-import-preview-scrolling.md diff --git a/README.md b/README.md index f4abfd53..567b7593 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ > **Menu-bar panels:** Dashboard cards and their nested controls use shared semantic surfaces and text levels in Light, Dark, and Increased Contrast appearances, without decorative borders or shadows. The surrounding popover and its attachment arrow use one opaque semantic background so wallpaper colors do not reduce contrast. Settings includes independent Light and Dark themes, ten built-in palettes, System Default, live previews, and imports from `.itermcolors` (including `.txt`) or Base16/Base24 YAML/JSON files; themes preserve layout, typography, calendar event colors, and brand colors. -> **Preferences backup:** Export and import both let you select app preferences, plugin layout, shortcuts, automation, saved Run Links, and each plugin’s portable settings independently, with dependency notes beside every category. Workflow IDs and direct workflow Run Links are preserved; importing an individual workflow preserves its ID on a new Mac and creates a new ID only when that ID already exists. Automation rules bound to a display identifier from the current Mac are omitted with an export warning. Saved Scripts source is excluded unless each script explicitly opts in, and working directories are never included. Apple Shortcuts backup includes only per-shortcut safety policies; the destination Mac discovers its own current Shortcuts library. Permissions, caches, credentials, and other non-portable data are excluded. Missing plugins are never installed automatically: the preview lets you explicitly select catalog-verified plugins to install, while unavailable or unselected plugins and their settings are skipped. +> **Preferences backup:** Export and import both let you select app preferences, plugin layout, shortcuts, automation, saved Run Links, and each plugin’s portable settings independently, with dependency notes beside every category. Workflow IDs and direct workflow Run Links are preserved; importing an individual workflow preserves its ID on a new Mac and creates a new ID only when that ID already exists. Automation rules bound to a display identifier from the current Mac are omitted with an export warning. Saved Scripts source is excluded unless each script explicitly opts in, and working directories are never included. Apple Shortcuts backup includes only per-shortcut safety policies; the destination Mac discovers its own current Shortcuts library. Permissions, caches, credentials, and other non-portable data are excluded. Missing plugins are never installed automatically: the scrollable preview lets you explicitly select catalog-verified plugins to install, while unavailable or unselected plugins and their settings are skipped. > **Right-click action:** You can use Option + left-click on the MacTools icon to trigger the right-click action. diff --git a/Sources/App/SettingsView.swift b/Sources/App/SettingsView.swift index 0a9ae7d7..51a4eb69 100644 --- a/Sources/App/SettingsView.swift +++ b/Sources/App/SettingsView.swift @@ -1172,6 +1172,40 @@ private struct PreferencesImportPreviewSheet: View { } var body: some View { + VStack(spacing: 0) { + ScrollView { + previewContent + .padding(24) + } + + Divider() + + HStack(spacing: 12) { + if isImporting { + ProgressView() + .controlSize(.small) + } + + Spacer() + Button(AppL10n.settings("common.cancel", defaultValue: "取消"), action: onCancel) + .buttonStyle(.bordered) + .disabled(isImporting) + Button(confirmTitle) { + onImport(selectedInstallablePluginIDs, selection) + } + .buttonStyle(.borderedProminent) + .disabled(isImporting || selection.isEmpty || previewErrorMessage != nil) + } + .padding(.horizontal, 24) + .padding(.vertical, 16) + } + .frame(width: 500, height: 640) + .onChange(of: selection) { _, selection in + refreshPreview(for: selection) + } + } + + private var previewContent: some View { VStack(alignment: .leading, spacing: 18) { Text(AppL10n.preferencesBackup("preferencesBackup.preview.title", defaultValue: "导入偏好设置")) .font(PluginSettingsTheme.Typography.pageTitle) @@ -1256,29 +1290,8 @@ private struct PreferencesImportPreviewSheet: View { .font(PluginSettingsTheme.Typography.rowDescription) .foregroundStyle(.secondary) } - - HStack { - Spacer() - Button(AppL10n.settings("common.cancel", defaultValue: "取消"), action: onCancel) - .buttonStyle(.bordered) - .disabled(isImporting) - Button(confirmTitle) { - onImport(selectedInstallablePluginIDs, selection) - } - .buttonStyle(.borderedProminent) - .disabled(isImporting || selection.isEmpty || previewErrorMessage != nil) - } - - if isImporting { - ProgressView() - .controlSize(.small) - } - } - .padding(24) - .frame(width: 500) - .onChange(of: selection) { _, selection in - refreshPreview(for: selection) } + .frame(maxWidth: .infinity, alignment: .leading) } private var confirmTitle: String { diff --git a/changes/unreleased/preferences-import-preview-scrolling.md b/changes/unreleased/preferences-import-preview-scrolling.md new file mode 100644 index 00000000..df6cfc00 --- /dev/null +++ b/changes/unreleased/preferences-import-preview-scrolling.md @@ -0,0 +1,7 @@ +--- +release: app +type: fixed +area: Preferences Backup +--- + +Preference imports with many missing plugins now keep the preview controls reachable in a scrollable sheet.