diff --git a/SalmonEgg/SalmonEgg/Presentation/Views/Discover/DiscoverSessionsPage.xaml.cs b/SalmonEgg/SalmonEgg/Presentation/Views/Discover/DiscoverSessionsPage.xaml.cs index 43fcdc4e..ded52771 100644 --- a/SalmonEgg/SalmonEgg/Presentation/Views/Discover/DiscoverSessionsPage.xaml.cs +++ b/SalmonEgg/SalmonEgg/Presentation/Views/Discover/DiscoverSessionsPage.xaml.cs @@ -137,7 +137,7 @@ private bool TryReturnToProfilesPane() } private static T? FindAncestorOrSelf(DependencyObject? start, Func? predicate = null) - where T : DependencyObject + where T : class, DependencyObject { var current = start; while (current is not null) @@ -154,7 +154,7 @@ private bool TryReturnToProfilesPane() } private static T? FindDescendant(DependencyObject root, Func predicate) - where T : DependencyObject + where T : class, DependencyObject { var count = VisualTreeHelper.GetChildrenCount(root); for (var i = 0; i < count; i++) diff --git a/SalmonEgg/SalmonEgg/Presentation/Views/Settings/DiagnosticsSettingsPage.xaml.cs b/SalmonEgg/SalmonEgg/Presentation/Views/Settings/DiagnosticsSettingsPage.xaml.cs index 00cb1ab3..05d884f3 100644 --- a/SalmonEgg/SalmonEgg/Presentation/Views/Settings/DiagnosticsSettingsPage.xaml.cs +++ b/SalmonEgg/SalmonEgg/Presentation/Views/Settings/DiagnosticsSettingsPage.xaml.cs @@ -197,7 +197,7 @@ private bool TryMoveFocusWithinGamepadActions(bool moveDown) } private static T? FindAncestorOrSelf(DependencyObject? start) - where T : DependencyObject + where T : class, DependencyObject { var current = start; while (current is not null) diff --git a/SalmonEgg/SalmonEgg/Presentation/Views/SettingsShellPage.xaml.cs b/SalmonEgg/SalmonEgg/Presentation/Views/SettingsShellPage.xaml.cs index 5f3921de..057c5e3c 100644 --- a/SalmonEgg/SalmonEgg/Presentation/Views/SettingsShellPage.xaml.cs +++ b/SalmonEgg/SalmonEgg/Presentation/Views/SettingsShellPage.xaml.cs @@ -401,7 +401,7 @@ private static bool IsUserMeaningfulInteractiveControl(Control control) } private static T? FindDescendant(DependencyObject root, Func predicate) - where T : DependencyObject + where T : class, DependencyObject { var count = VisualTreeHelper.GetChildrenCount(root); for (var i = 0; i < count; i++) @@ -423,7 +423,7 @@ private static bool IsUserMeaningfulInteractiveControl(Control control) } private static System.Collections.Generic.IEnumerable FindDescendants(DependencyObject root, Func predicate) - where T : DependencyObject + where T : class, DependencyObject { var count = VisualTreeHelper.GetChildrenCount(root); for (var i = 0; i < count; i++) @@ -442,7 +442,7 @@ private static System.Collections.Generic.IEnumerable FindDescendants(Depe } private static T? FindAncestorOrSelf(DependencyObject? start, Func? predicate = null) - where T : DependencyObject + where T : class, DependencyObject { var current = start; while (current is not null) diff --git a/SalmonEgg/SalmonEgg/Presentation/Views/Start/StartView.xaml.cs b/SalmonEgg/SalmonEgg/Presentation/Views/Start/StartView.xaml.cs index d869983a..45e9b745 100644 --- a/SalmonEgg/SalmonEgg/Presentation/Views/Start/StartView.xaml.cs +++ b/SalmonEgg/SalmonEgg/Presentation/Views/Start/StartView.xaml.cs @@ -173,7 +173,7 @@ private void RefreshHeroSuggestionFocusTargets() } private static T? FindDescendant(DependencyObject root, Func predicate) - where T : DependencyObject + where T : class, DependencyObject { var count = VisualTreeHelper.GetChildrenCount(root); for (var i = 0; i < count; i++) @@ -195,7 +195,7 @@ private void RefreshHeroSuggestionFocusTargets() } private static T? FindAncestorOrSelf(DependencyObject? current) - where T : DependencyObject + where T : class, DependencyObject { while (current is not null) { diff --git a/global.json b/global.json index 9d942998..bdd9fefe 100644 --- a/global.json +++ b/global.json @@ -3,7 +3,7 @@ "Uno.Sdk": "6.5.33" }, "sdk": { - "version": "10.0.202", + "version": "10.0.103", "rollForward": "latestPatch", "allowPrerelease": false } diff --git a/src/SalmonEgg.Presentation.Core/ViewModels/Chat/Overlay/ChatConversationSurfaceProjectionCoordinator.cs b/src/SalmonEgg.Presentation.Core/ViewModels/Chat/Overlay/ChatConversationSurfaceProjectionCoordinator.cs index fcbdfafd..1ce16862 100644 --- a/src/SalmonEgg.Presentation.Core/ViewModels/Chat/Overlay/ChatConversationSurfaceProjectionCoordinator.cs +++ b/src/SalmonEgg.Presentation.Core/ViewModels/Chat/Overlay/ChatConversationSurfaceProjectionCoordinator.cs @@ -4,18 +4,31 @@ namespace SalmonEgg.Presentation.Core.ViewModels.Chat.Overlay; internal sealed class ChatConversationSurfaceProjectionCoordinator { + private bool _hasLoadedActiveConversationRoot; + private bool _hasLoadedTranscriptSurface; + public ChatConversationSurfaceProjection Project(ChatConversationSurfaceStateInput input) { var state = ChatConversationSurfaceStatePresenter.Resolve(input); + if (state.ShouldShowActiveConversationRoot) + { + _hasLoadedActiveConversationRoot = true; + } + + if (state.ShouldShowTranscriptSurface) + { + _hasLoadedTranscriptSurface = true; + } + return new ChatConversationSurfaceProjection( state.IsActivationOverlayVisible, state.IsOverlayVisible, state.ShouldShowActiveConversationRoot, - state.ShouldShowActiveConversationRoot, + _hasLoadedActiveConversationRoot, state.ShouldShowSessionHeader, state.ShouldShowTranscriptSurface, - state.ShouldShowTranscriptSurface, + _hasLoadedTranscriptSurface, state.ShouldShowConversationInputSurface, state.ShouldShowBlockingLoadingMask, state.ShouldShowLoadingOverlayStatusPill, diff --git a/tests/SalmonEgg.Presentation.Core.Tests/Chat/ChatViewModelTests.cs b/tests/SalmonEgg.Presentation.Core.Tests/Chat/ChatViewModelTests.cs index cb439d97..c1931b5c 100644 --- a/tests/SalmonEgg.Presentation.Core.Tests/Chat/ChatViewModelTests.cs +++ b/tests/SalmonEgg.Presentation.Core.Tests/Chat/ChatViewModelTests.cs @@ -10078,10 +10078,10 @@ await fixture.UpdateStateAsync(state => state with runtimeState.IsSessionActivationInProgress = true; Assert.False(fixture.ViewModel.ShouldShowActiveConversationRoot); - Assert.False(fixture.ViewModel.ShouldLoadActiveConversationRoot); + Assert.True(fixture.ViewModel.ShouldLoadActiveConversationRoot); Assert.False(fixture.ViewModel.ShouldShowSessionHeader); Assert.False(fixture.ViewModel.ShouldShowTranscriptSurface); - Assert.False(fixture.ViewModel.ShouldLoadTranscriptSurface); + Assert.True(fixture.ViewModel.ShouldLoadTranscriptSurface); Assert.False(fixture.ViewModel.ShouldShowConversationInputSurface); Assert.Equal(SessionNamePolicy.CreateDefault("conv-1"), fixture.ViewModel.CurrentSessionDisplayName); Assert.Equal(string.Empty, fixture.ViewModel.PresentedSessionHeaderDisplayName); @@ -11138,10 +11138,10 @@ await fixture.DispatchConnectionAsync(new SetNewSessionDraftAction(new NewSessio syncContext.RunAll(); Assert.False(fixture.ViewModel.ShouldShowActiveConversationRoot); - Assert.False(fixture.ViewModel.ShouldLoadActiveConversationRoot); + Assert.True(fixture.ViewModel.ShouldLoadActiveConversationRoot); Assert.False(fixture.ViewModel.ShouldShowSessionHeader); Assert.False(fixture.ViewModel.ShouldShowTranscriptSurface); - Assert.False(fixture.ViewModel.ShouldLoadTranscriptSurface); + Assert.True(fixture.ViewModel.ShouldLoadTranscriptSurface); Assert.False(fixture.ViewModel.ShouldShowConversationInputSurface); var switchTask = fixture.ViewModel.SwitchConversationAsync("conv-2"); @@ -11158,10 +11158,10 @@ await fixture.DispatchConnectionAsync(new SetNewSessionDraftAction(new NewSessio syncContext.RunAll(); Assert.False(fixture.ViewModel.ShouldShowActiveConversationRoot); - Assert.False(fixture.ViewModel.ShouldLoadActiveConversationRoot); + Assert.True(fixture.ViewModel.ShouldLoadActiveConversationRoot); Assert.False(fixture.ViewModel.ShouldShowSessionHeader); Assert.False(fixture.ViewModel.ShouldShowTranscriptSurface); - Assert.False(fixture.ViewModel.ShouldLoadTranscriptSurface); + Assert.True(fixture.ViewModel.ShouldLoadTranscriptSurface); Assert.False(fixture.ViewModel.ShouldShowConversationInputSurface); Assert.Equal("conv-2", runtimeState.DesiredSessionId); Assert.True(runtimeState.IsSessionActivationInProgress); diff --git a/tests/SalmonEgg.Presentation.Core.Tests/Chat/Overlay/ChatConversationSurfaceProjectionCoordinatorTests.cs b/tests/SalmonEgg.Presentation.Core.Tests/Chat/Overlay/ChatConversationSurfaceProjectionCoordinatorTests.cs index 6dca3376..b1bc7652 100644 --- a/tests/SalmonEgg.Presentation.Core.Tests/Chat/Overlay/ChatConversationSurfaceProjectionCoordinatorTests.cs +++ b/tests/SalmonEgg.Presentation.Core.Tests/Chat/Overlay/ChatConversationSurfaceProjectionCoordinatorTests.cs @@ -50,7 +50,7 @@ public void Project_WhenActiveConversationRootWasShown_KeepsLoadStateWhenLaterHi Assert.True(visible.ShouldShowActiveConversationRoot); Assert.True(visible.ShouldLoadActiveConversationRoot); Assert.False(hidden.ShouldShowActiveConversationRoot); - Assert.False(hidden.ShouldLoadActiveConversationRoot); + Assert.True(hidden.ShouldLoadActiveConversationRoot); } [Fact] @@ -97,6 +97,6 @@ public void Project_WhenTranscriptSurfaceWasShown_KeepsLoadStateWhenLaterHidden( Assert.True(visible.ShouldShowTranscriptSurface); Assert.True(visible.ShouldLoadTranscriptSurface); Assert.False(hidden.ShouldShowTranscriptSurface); - Assert.False(hidden.ShouldLoadTranscriptSurface); + Assert.True(hidden.ShouldLoadTranscriptSurface); } }