From d83ad0ec12030f11249b6133ba89443c0a3df4d1 Mon Sep 17 00:00:00 2001 From: Julian lechner Date: Thu, 24 Sep 2026 16:26:50 +0200 Subject: [PATCH] fix(menu): preview current update selection --- TODO.md | 2 +- scripts/lib/plugins.ps1 | 4 ++-- scripts/lib/plugins.sh | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/TODO.md b/TODO.md index c1e5f9a..1928a96 100644 --- a/TODO.md +++ b/TODO.md @@ -17,7 +17,7 @@ - [ ] Keep shared MCPorter servers until neither client needs them. Reconciliation processes `shared` records even when only one client is selected; uninstalling that client with an empty selection removes servers still used by the other. (`scripts/lib/managed-extensions.py:463`, `scripts/commands/uninstall.ps1:59`, `scripts/commands/uninstall.sh:77`) - [ ] Manage global packages once across clients. With `--client both`, MCPorter is installed and recorded twice; QMD's global package can be removed during a Codex-only deselection while Claude still uses its plugin. (`scripts/lib/managed-extensions.py:342`, `scripts/lib/managed-extensions.py:378`, `scripts/lib/managed-extensions.py:463`) - [x] Fix Bash `auto` semantic retrieval selection. Both `test_semantic_retrieval_device()` and its caller read `$?` after a completed `if`, losing the benchmark's exit code; an unsuitable device produces an empty choice instead of `false`. (`scripts/lib/semantic-retrieval.sh:13`, `scripts/lib/install-options.sh:52`) -- [ ] Make ordinary update dry-runs use the saved/current selection. Both menus bypass selection in dry-run and select every manifest entry, so the preview can diverge from the real update. (`scripts/lib/plugins.ps1:91`, `scripts/lib/plugins.sh:97`) +- [x] Make ordinary update dry-runs use the saved/current selection. Both menus bypass selection in dry-run and select every manifest entry, so the preview can diverge from the real update. (`scripts/lib/plugins.ps1:91`, `scripts/lib/plugins.sh:97`) - [ ] Reconcile resources whose ownership record remains but whose installation was removed manually. `ensure_cli()` and `ensure_mcporter()` return early from a ledger record without checking the actual CLI or server; normal sync cannot restore the missing resource. (`scripts/lib/managed-extensions.py:342`, `scripts/lib/managed-extensions.py:395`) - [ ] Update owned MCPorter itself on `--update`. `ensure_cli()` returns whenever its ledger record exists, so a selected MCPorter package never receives the requested update. (`scripts/lib/managed-extensions.py:342`) - [x] Keep terminal newlines in Bash-managed files that need substitution. Command substitution strips trailing newlines before Bash hashes and writes the content, while PowerShell retains them; switching installers causes needless file changes and backups. (`scripts/lib/manifest.sh:70`, `scripts/lib/manifest.ps1:75`) diff --git a/scripts/lib/plugins.ps1 b/scripts/lib/plugins.ps1 index 9aa752f..ca5f82f 100644 --- a/scripts/lib/plugins.ps1 +++ b/scripts/lib/plugins.ps1 @@ -92,7 +92,7 @@ function Select-ConfiguredPlugins { $entries = @(Get-ConfiguredPluginEntries -RepositoryRoot $RepositoryRoot) $toggleable = @($entries) $fixed = @($entries | Where-Object { $toggleable -notcontains $_ }) - if ($DryRun -or $toggleable.Count -eq 0) { return @{ Selected = $entries; Deselected = @() } } + if ($toggleable.Count -eq 0 -or ($DryRun -and $Mode -eq 'Install')) { return @{ Selected = $entries; Deselected = @() } } $referenceClients = if ($Client -eq 'Both') { @('Claude','Codex') } else { @($Client) } $installed = @{} @@ -116,7 +116,7 @@ function Select-ConfiguredPlugins { $found }) $names = @($toggleable | ForEach-Object { $_.name }) - $checked = Read-PluginToggleSelection -Names $names -Checked $checked + if (-not $DryRun) { $checked = Read-PluginToggleSelection -Names $names -Checked $checked } $selected = @() $deselected = @() diff --git a/scripts/lib/plugins.sh b/scripts/lib/plugins.sh index b89aaf1..245b192 100755 --- a/scripts/lib/plugins.sh +++ b/scripts/lib/plugins.sh @@ -107,7 +107,7 @@ select_configured_plugins() { if plugin_toggleable "$root" "$name" "$client"; then toggle_names+=("$name"); else fixed_names+=("$name"); fi done < <(get_plugin_names "$root") - if [ "$dry_run" = true ] || [ ${#toggle_names[@]} -eq 0 ]; then + if [ ${#toggle_names[@]} -eq 0 ] || { [ "$dry_run" = true ] && [ "$mode" = Install ]; }; then selected_ref=("${all_names[@]}") return 0 fi @@ -144,7 +144,7 @@ select_configured_plugins() { checked+=("$found") done - read_plugin_toggle_selection toggle_names checked + if [ "$dry_run" != true ]; then read_plugin_toggle_selection toggle_names checked; fi local i for ((i = 0; i < ${#toggle_names[@]}; i++)); do