diff --git a/src/Uno.UI.RemoteControl/HotReload/ClientHotReloadProcessor.Common.Status.cs b/src/Uno.UI.RemoteControl/HotReload/ClientHotReloadProcessor.Common.Status.cs index 52104dedf9ba..510370ab2471 100644 --- a/src/Uno.UI.RemoteControl/HotReload/ClientHotReloadProcessor.Common.Status.cs +++ b/src/Uno.UI.RemoteControl/HotReload/ClientHotReloadProcessor.Common.Status.cs @@ -83,7 +83,10 @@ public void ReportServerState(HotReloadState state) #if HAS_UNO_WINUI public void ReportServerStatus(HotReloadStatusMessage status) { - _serverState ??= status.State; // Do not override the state if it has already been set (debugger attached with dev-server) + if (_serverState is not HotReloadState.Disabled) + { + _serverState = status.State; // Do not override the state if it has already been set (debugger attached with dev-server) + } ImmutableInterlocked.Update(ref _serverOperations, UpdateOperations, status.Operations); NotifyStatusChanged(); diff --git a/src/Uno.UI.RemoteControl/HotReload/HotReloadStatusView.Entries.cs b/src/Uno.UI.RemoteControl/HotReload/HotReloadStatusView.Entries.cs index 597a798c8895..8ab5325325ce 100644 --- a/src/Uno.UI.RemoteControl/HotReload/HotReloadStatusView.Entries.cs +++ b/src/Uno.UI.RemoteControl/HotReload/HotReloadStatusView.Entries.cs @@ -67,11 +67,17 @@ public ServerEntry(HotReloadServerOperationData srvOp) Update(srvOp); } + /// + /// Indicates if this notification is the final one for the operation, INCLUDING application wide. + /// + public bool IsFinal { get; private set; } + public void Update(HotReloadServerOperationData srvOp) { + IsFinal = srvOp.Result is not HotReloadServerResult.Success; (IsSuccess, Icon) = srvOp.Result switch { - null => (default(bool?), EntryIcon.HotReload | EntryIcon.Loading), + null => (default, EntryIcon.HotReload | EntryIcon.Loading), HotReloadServerResult.Success or HotReloadServerResult.NoChanges => (true, EntryIcon.HotReload | EntryIcon.Success), _ => (false, EntryIcon.HotReload | EntryIcon.Error) }; diff --git a/src/Uno.UI.RemoteControl/HotReload/HotReloadStatusView.cs b/src/Uno.UI.RemoteControl/HotReload/HotReloadStatusView.cs index 386aa81505c6..641e8a4a9afb 100644 --- a/src/Uno.UI.RemoteControl/HotReload/HotReloadStatusView.cs +++ b/src/Uno.UI.RemoteControl/HotReload/HotReloadStatusView.cs @@ -103,7 +103,7 @@ public DiagnosticViewNotification? FailureNotification #endregion private readonly IDiagnosticViewContext _ctx; - private string _resultState = ResultNoneVisualStateName; + private (string state, HotReloadLogEntry? entry) _result = (ResultNoneVisualStateName, null); private Status? _hotReloadStatus; private RemoteControlStatus? _devServerStatus; @@ -242,19 +242,22 @@ EntryIcon.Warning when operationEntries.Any(op => op.IsSuccess ?? false) => Stat } // Then the "result" visual state (en send notifications). - var resultState = operationEntries switch + var result = operationEntries switch { - { Count: 0 } => ResultNoneVisualStateName, - _ when operationEntries.Any(op => op.IsSuccess is null) => ResultNoneVisualStateName, // Makes sure to restore to None while processing! - [{ IsSuccess: true }, ..] => ResultSuccessVisualStateName, - _ => ResultFailedVisualStateName + { Count: 0 } => (ResultNoneVisualStateName, default), + _ when operationEntries.Any(op => op.IsSuccess is null) => (ResultNoneVisualStateName, default), + [ServerEntry { IsFinal: true, IsSuccess: true } e, ..] => (ResultSuccessVisualStateName, e), + [ServerEntry { IsFinal: true, IsSuccess: false } e, ..] => (ResultFailedVisualStateName, e), + [ApplicationEntry { IsSuccess: true } e, ..] => (ResultSuccessVisualStateName, e), + [ApplicationEntry { IsSuccess: false } e, ..] => (ResultFailedVisualStateName, e), + _ => (ResultNoneVisualStateName, default(HotReloadLogEntry)) }; - if (resultState != _resultState) + if (result != _result) { - _resultState = resultState; - VisualStateManager.GoToState(this, resultState, useTransitions); + _result = result; + VisualStateManager.GoToState(this, _result.state, useTransitions); - var notif = resultState switch + var notif = _result.state switch { ResultNoneVisualStateName when operationEntries is { Count: > 0 } => ProcessingNotification, ResultSuccessVisualStateName => SuccessNotification, diff --git a/src/Uno.UI.Toolkit/Diagnostics/DiagnosticsOverlay.xaml b/src/Uno.UI.Toolkit/Diagnostics/DiagnosticsOverlay.xaml index 879d0f701af2..010fb46a664d 100644 --- a/src/Uno.UI.Toolkit/Diagnostics/DiagnosticsOverlay.xaml +++ b/src/Uno.UI.Toolkit/Diagnostics/DiagnosticsOverlay.xaml @@ -36,7 +36,8 @@ x:Name="Root" CornerRadius="{TemplateBinding CornerRadius}" Height="{TemplateBinding Height}" - Orientation="Horizontal"> + Orientation="Horizontal" + Spacing="4"> @@ -51,16 +52,36 @@ + + + + + + + + + + + + - - + @@ -100,6 +121,7 @@