chore: release v2.4
- Add theme system (Dark/Light palettes, ModernTheme, ThemeManager) - Add InputDialog, Spinner common view - Add DuplicatesCsvExportService - Refresh views, dialogs, and view models across tabs - Update localization strings (en/fr) - Tweak services (transfer, permissions, search, user access, ownership elevation, bulk operations) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,9 @@ public abstract partial class FeatureViewModelBase : ObservableRecipient
|
||||
[ObservableProperty]
|
||||
private int _progressValue;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _isIndeterminate;
|
||||
|
||||
/// <summary>
|
||||
/// Sites selected in the global toolbar picker. Updated via GlobalSitesChangedMessage.
|
||||
/// Derived VMs check this in RunOperationAsync before falling back to per-tab SiteUrl.
|
||||
@@ -46,24 +49,44 @@ public abstract partial class FeatureViewModelBase : ObservableRecipient
|
||||
IsRunning = true;
|
||||
StatusMessage = string.Empty;
|
||||
ProgressValue = 0;
|
||||
IsIndeterminate = false;
|
||||
try
|
||||
{
|
||||
var progress = new Progress<OperationProgress>(p =>
|
||||
{
|
||||
ProgressValue = p.Total > 0 ? (int)(100.0 * p.Current / p.Total) : 0;
|
||||
// Indeterminate reports (throttle waits, inner scan steps) must not
|
||||
// reset the determinate bar to 0%; only update the status message
|
||||
// and flip the bar into marquee mode. The next determinate report
|
||||
// restores % and clears the marquee flag.
|
||||
if (p.IsIndeterminate)
|
||||
{
|
||||
IsIndeterminate = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsIndeterminate = false;
|
||||
ProgressValue = p.Total > 0 ? (int)(100.0 * p.Current / p.Total) : 0;
|
||||
}
|
||||
StatusMessage = p.Message;
|
||||
WeakReferenceMessenger.Default.Send(new ProgressUpdatedMessage(p));
|
||||
});
|
||||
await RunOperationAsync(_cts.Token, progress);
|
||||
// Success path: replace any lingering "Scanning X…" with a neutral
|
||||
// completion marker so stale in-progress labels don't stick around.
|
||||
StatusMessage = TranslationSource.Instance["status.complete"];
|
||||
ProgressValue = 100;
|
||||
IsIndeterminate = false;
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
StatusMessage = TranslationSource.Instance["status.cancelled"];
|
||||
IsIndeterminate = false;
|
||||
_logger.LogInformation("Operation cancelled by user.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
StatusMessage = $"{TranslationSource.Instance["err.generic"]} {ex.Message}";
|
||||
IsIndeterminate = false;
|
||||
_logger.LogError(ex, "Operation failed.");
|
||||
}
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user