feat(settings): multi-version uninstall picker + default_scope editor
Some checks failed
Security / Security check (push) Failing after 2s

Two operator surfaces shipped together:

**Multi-version uninstall picker** — when more than one version
of a `(provider, name)` is installed side-by-side, both the
module-sheet "Uninstall" affordance and the store-detail
"Uninstall" affordance now ask the operator which version to
remove before calling the RPC. The hub's wire-level support for
this (UninstallModuleRequest.version) was already there; Studio
just wasn't using it. Picker pre-selects the highest version so
single-version flows still take one click.

  - `HubService.installedVersions(name)` enumerates the installed
    versions via the capabilities list.
  - `HubService.uninstallModule(name, version: ...)` forwards
    the version into the RPC.
  - `_UninstallVersionPickerDialog` (module sheet) and
    `_StoreUninstallVersionPickerDialog` (store) host the
    picker — separate widgets so each surface can evolve copy
    independently. Uses `RadioGroup<String>` for Flutter
    3.32+ deprecation compliance.

**Default scope editor** — new DEFAULT SCOPE panel in Settings
that calls the freshly-added HubAdmin RPCs
`GetDefaultScope` / `SetDefaultScope`. Operators can:

  - reorder publisher segments with up/down buttons
    (first match wins in the bare-form resolver),
  - delete entries (hub still rejects empty list — Studio
    surfaces the constraint inline),
  - add arbitrary entries via the text field,
  - add catalog-known publishers via suggestion chips
    (sorted alphabetically, populated from the catalog).

Every change persists to `~/.fai/config.yaml` via the hub
and hot-swaps the in-memory copy without a daemon restart.

Bumped pubspec to 0.48.0. dart analyze clean (No issues
found!); flutter test green (11 tests).

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-05-29 00:21:51 +02:00
parent 327bc0fea2
commit 1903babc5a
10 changed files with 750 additions and 7 deletions

View file

@ -2252,6 +2252,78 @@ abstract class AppLocalizations {
/// **'Federated upstream service — version is advisory; the upstream may break compatibility without bumping it.'**
String get storeAdvisoryVersionTooltip;
/// No description provided for @uninstallVersionPickerTitle.
///
/// In en, this message translates to:
/// **'Pick a version to uninstall'**
String get uninstallVersionPickerTitle;
/// No description provided for @uninstallVersionPickerBody.
///
/// In en, this message translates to:
/// **'Several versions of `{module}` are installed side-by-side. Select the exact version to remove — the others stay in place.'**
String uninstallVersionPickerBody(String module);
/// No description provided for @uninstallVersionPickerContinue.
///
/// In en, this message translates to:
/// **'Continue'**
String get uninstallVersionPickerContinue;
/// No description provided for @defaultScopeHeader.
///
/// In en, this message translates to:
/// **'DEFAULT SCOPE'**
String get defaultScopeHeader;
/// No description provided for @defaultScopeBlurb.
///
/// In en, this message translates to:
/// **'Ordered list of publisher segments the hub consults when a flow names a capability without an explicit `<provider>/` prefix. First match wins — promote the segments your team uses most to the top. Catalog-known publishers appear as chips; arbitrary entries are accepted for private segments.'**
String get defaultScopeBlurb;
/// No description provided for @defaultScopeAddLabel.
///
/// In en, this message translates to:
/// **'Add publisher segment'**
String get defaultScopeAddLabel;
/// No description provided for @defaultScopeAddHint.
///
/// In en, this message translates to:
/// **'e.g. acme.team'**
String get defaultScopeAddHint;
/// No description provided for @defaultScopeAddButton.
///
/// In en, this message translates to:
/// **'Add'**
String get defaultScopeAddButton;
/// No description provided for @defaultScopeSuggestions.
///
/// In en, this message translates to:
/// **'Catalog suggestions:'**
String get defaultScopeSuggestions;
/// No description provided for @defaultScopeSavedToast.
///
/// In en, this message translates to:
/// **'Default scope updated.'**
String get defaultScopeSavedToast;
/// No description provided for @defaultScopeLoadFailed.
///
/// In en, this message translates to:
/// **'Could not load default scope.'**
String get defaultScopeLoadFailed;
/// No description provided for @defaultScopeNonEmptyError.
///
/// In en, this message translates to:
/// **'Default scope cannot be empty — keep at least one segment.'**
String get defaultScopeNonEmptyError;
/// No description provided for @maintenanceHeader.
///
/// In en, this message translates to: