fix(installer): keep step badges green and reset state on re-run
Step status and output lines arrive on two separate Progress<T> channels, so a trailing "Running" line-message could be delivered after a step's terminal Done/Failed and downgrade the badge back to orange. Guard against that downgrade. Also reset each step's messages/status/expansion at the start of a run so re-running no longer appends to the previous run's output. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -84,6 +84,15 @@ public partial class InstallPageViewModel : ObservableObject, IInstallerPage
|
|||||||
{
|
{
|
||||||
if (IsInstalling) return;
|
if (IsInstalling) return;
|
||||||
|
|
||||||
|
// Reset per-step state so a re-run starts clean instead of appending
|
||||||
|
// output to the previous run's messages.
|
||||||
|
foreach (var s in Steps)
|
||||||
|
{
|
||||||
|
s.Messages.Clear();
|
||||||
|
s.Status = StepStatus.Pending;
|
||||||
|
s.IsExpanded = false;
|
||||||
|
}
|
||||||
|
|
||||||
IsInstalling = true;
|
IsInstalling = true;
|
||||||
IsComplete = false;
|
IsComplete = false;
|
||||||
HasErrors = false;
|
HasErrors = false;
|
||||||
@@ -96,6 +105,10 @@ public partial class InstallPageViewModel : ObservableObject, IInstallerPage
|
|||||||
var step = Steps.FirstOrDefault(s => s.Name == p.StepName);
|
var step = Steps.FirstOrDefault(s => s.Name == p.StepName);
|
||||||
if (step is null) return;
|
if (step is null) return;
|
||||||
|
|
||||||
|
// Status and output lines arrive on two separate Progress<T> channels, so a
|
||||||
|
// trailing "Running" line-message can be delivered after the step's terminal
|
||||||
|
// Done/Failed. Never let that downgrade a completed step back to Running.
|
||||||
|
if (!(step.Status is StepStatus.Done or StepStatus.Failed && p.Status is StepStatus.Running))
|
||||||
step.Status = p.Status;
|
step.Status = p.Status;
|
||||||
if (p.Message is not null)
|
if (p.Message is not null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user