From 0bb8bb7782d1088c00279bb36a6e7508847e888e Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 22:49:21 +0000 Subject: [PATCH 1/4] Fix chat lifecycle load state monotonicity - Resolved issue where active conversation root and transcript surface would un-load and re-load destructively during temporary blocking overlays. - Ensured `ShouldLoadActiveConversationRoot` and `ShouldLoadTranscriptSurface` remain latched to `true` once they are initially shown. - Updated coordinator and view-model tests to enforce this monotonic expectation. --- ...tConversationSurfaceProjectionCoordinator.cs | 17 +++++++++++++++-- .../Chat/ChatViewModelTests.cs | 12 ++++++------ ...ersationSurfaceProjectionCoordinatorTests.cs | 4 ++-- 3 files changed, 23 insertions(+), 10 deletions(-) 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); } } From 7d98369ccad94838fae394c4dd24dce6aad5b99c Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 30 May 2026 00:07:25 +0000 Subject: [PATCH 2/4] Fix chat lifecycle layout loading monotonicity - Resolved issue where active conversation root and transcript surface would un-load and re-load destructively during temporary blocking overlays. - Ensured `ShouldLoadActiveConversationRoot` and `ShouldLoadTranscriptSurface` remain latched to `true` once they are initially shown. - Updated coordinator and view-model tests to enforce this monotonic expectation. - Fixed nullable generics in VisualTreeHelper wrappers to satisfy C# 10 strict nullability when cross-targeting. --- .../Views/Discover/DiscoverSessionsPage.xaml.cs | 4 ++-- .../Views/Settings/DiagnosticsSettingsPage.xaml.cs | 2 +- .../SalmonEgg/Presentation/Views/SettingsShellPage.xaml.cs | 6 +++--- .../SalmonEgg/Presentation/Views/Start/StartView.xaml.cs | 4 ++-- global.json | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) 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 } From 7125bb1e4ebb334c97eecf4247d7f9175818cb40 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 30 May 2026 01:11:06 +0000 Subject: [PATCH 3/4] Fix chat lifecycle layout loading monotonicity - Resolved issue where active conversation root and transcript surface would un-load and re-load destructively during temporary blocking overlays. - Ensured `ShouldLoadActiveConversationRoot` and `ShouldLoadTranscriptSurface` remain latched to `true` once they are initially shown. - Updated coordinator and view-model tests to enforce this monotonic expectation. - Fixed nullable generics in VisualTreeHelper wrappers to satisfy C# 10 strict nullability when cross-targeting. --- .../Views/Discover/DiscoverSessionsPage.xaml.cs | 8 ++++---- .../Views/Settings/DiagnosticsSettingsPage.xaml.cs | 10 +++++----- .../Presentation/Views/SettingsShellPage.xaml.cs | 12 ++++++------ .../Presentation/Views/Start/StartView.xaml.cs | 8 ++++---- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/SalmonEgg/SalmonEgg/Presentation/Views/Discover/DiscoverSessionsPage.xaml.cs b/SalmonEgg/SalmonEgg/Presentation/Views/Discover/DiscoverSessionsPage.xaml.cs index ded52771..e71c0f84 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 : class, DependencyObject + where T : DependencyObject { var current = start; while (current is not null) @@ -150,11 +150,11 @@ private bool TryReturnToProfilesPane() current = VisualTreeHelper.GetParent(current); } - return null; + return default; } private static T? FindDescendant(DependencyObject root, Func predicate) - where T : class, DependencyObject + where T : DependencyObject { var count = VisualTreeHelper.GetChildrenCount(root); for (var i = 0; i < count; i++) @@ -172,6 +172,6 @@ private bool TryReturnToProfilesPane() } } - return null; + return default; } } diff --git a/SalmonEgg/SalmonEgg/Presentation/Views/Settings/DiagnosticsSettingsPage.xaml.cs b/SalmonEgg/SalmonEgg/Presentation/Views/Settings/DiagnosticsSettingsPage.xaml.cs index 05d884f3..318a90ef 100644 --- a/SalmonEgg/SalmonEgg/Presentation/Views/Settings/DiagnosticsSettingsPage.xaml.cs +++ b/SalmonEgg/SalmonEgg/Presentation/Views/Settings/DiagnosticsSettingsPage.xaml.cs @@ -71,7 +71,7 @@ private void ScrollLiveLogToBottom() } } - return null; + return default; } private async Task HandlePageUnloadedAsync() @@ -197,7 +197,7 @@ private bool TryMoveFocusWithinGamepadActions(bool moveDown) } private static T? FindAncestorOrSelf(DependencyObject? start) - where T : class, DependencyObject + where T : DependencyObject { var current = start; while (current is not null) @@ -210,7 +210,7 @@ private bool TryMoveFocusWithinGamepadActions(bool moveDown) current = VisualTreeHelper.GetParent(current); } - return null; + return default; } private Button? ResolveFocusedGamepadActionButtonFromControlState() @@ -230,7 +230,7 @@ private bool TryMoveFocusWithinGamepadActions(bool moveDown) return DiagnosticsGamepadRefreshButton; } - return null; + return default; } private bool TryFocusOwnerSectionNavigation() @@ -261,6 +261,6 @@ private bool TryFocusOwnerSectionNavigation() current = VisualTreeHelper.GetParent(current); } - return null; + return default; } } diff --git a/SalmonEgg/SalmonEgg/Presentation/Views/SettingsShellPage.xaml.cs b/SalmonEgg/SalmonEgg/Presentation/Views/SettingsShellPage.xaml.cs index 057c5e3c..07e9de14 100644 --- a/SalmonEgg/SalmonEgg/Presentation/Views/SettingsShellPage.xaml.cs +++ b/SalmonEgg/SalmonEgg/Presentation/Views/SettingsShellPage.xaml.cs @@ -397,11 +397,11 @@ private static bool IsUserMeaningfulInteractiveControl(Control control) current = VisualTreeHelper.GetParent(current); } - return null; + return default; } private static T? FindDescendant(DependencyObject root, Func predicate) - where T : class, DependencyObject + where T : DependencyObject { var count = VisualTreeHelper.GetChildrenCount(root); for (var i = 0; i < count; i++) @@ -419,11 +419,11 @@ private static bool IsUserMeaningfulInteractiveControl(Control control) } } - return null; + return default; } private static System.Collections.Generic.IEnumerable FindDescendants(DependencyObject root, Func predicate) - where T : class, DependencyObject + where T : 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 : class, DependencyObject + where T : DependencyObject { var current = start; while (current is not null) @@ -455,7 +455,7 @@ private static System.Collections.Generic.IEnumerable FindDescendants(Depe current = VisualTreeHelper.GetParent(current); } - return null; + return default; } } diff --git a/SalmonEgg/SalmonEgg/Presentation/Views/Start/StartView.xaml.cs b/SalmonEgg/SalmonEgg/Presentation/Views/Start/StartView.xaml.cs index 45e9b745..922236bd 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 : class, DependencyObject + where T : DependencyObject { var count = VisualTreeHelper.GetChildrenCount(root); for (var i = 0; i < count; i++) @@ -191,11 +191,11 @@ private void RefreshHeroSuggestionFocusTargets() } } - return null; + return default; } private static T? FindAncestorOrSelf(DependencyObject? current) - where T : class, DependencyObject + where T : DependencyObject { while (current is not null) { @@ -207,7 +207,7 @@ private void RefreshHeroSuggestionFocusTargets() current = VisualTreeHelper.GetParent(current); } - return null; + return default; } private static bool IsDescendantOrSelf(DependencyObject? current, DependencyObject target) From f3a356857f8455460fd3ee926be07488471bb065 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 30 May 2026 01:50:56 +0000 Subject: [PATCH 4/4] Fix chat lifecycle layout loading monotonicity - Resolved issue where active conversation root and transcript surface would un-load and re-load destructively during temporary blocking overlays. - Ensured `ShouldLoadActiveConversationRoot` and `ShouldLoadTranscriptSurface` remain latched to `true` once they are initially shown. - Updated coordinator and view-model tests to enforce this monotonic expectation. - Fixed nullable generics in VisualTreeHelper wrappers to satisfy C# 10 strict nullability when cross-targeting. --- .../Views/Discover/DiscoverSessionsPage.xaml.cs | 8 ++++---- .../Views/Settings/DiagnosticsSettingsPage.xaml.cs | 10 +++++----- .../Presentation/Views/SettingsShellPage.xaml.cs | 12 ++++++------ .../Presentation/Views/Start/StartView.xaml.cs | 8 ++++---- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/SalmonEgg/SalmonEgg/Presentation/Views/Discover/DiscoverSessionsPage.xaml.cs b/SalmonEgg/SalmonEgg/Presentation/Views/Discover/DiscoverSessionsPage.xaml.cs index e71c0f84..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) @@ -150,11 +150,11 @@ private bool TryReturnToProfilesPane() current = VisualTreeHelper.GetParent(current); } - return default; + return null; } 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++) @@ -172,6 +172,6 @@ private bool TryReturnToProfilesPane() } } - return default; + return null; } } diff --git a/SalmonEgg/SalmonEgg/Presentation/Views/Settings/DiagnosticsSettingsPage.xaml.cs b/SalmonEgg/SalmonEgg/Presentation/Views/Settings/DiagnosticsSettingsPage.xaml.cs index 318a90ef..05d884f3 100644 --- a/SalmonEgg/SalmonEgg/Presentation/Views/Settings/DiagnosticsSettingsPage.xaml.cs +++ b/SalmonEgg/SalmonEgg/Presentation/Views/Settings/DiagnosticsSettingsPage.xaml.cs @@ -71,7 +71,7 @@ private void ScrollLiveLogToBottom() } } - return default; + return null; } private async Task HandlePageUnloadedAsync() @@ -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) @@ -210,7 +210,7 @@ private bool TryMoveFocusWithinGamepadActions(bool moveDown) current = VisualTreeHelper.GetParent(current); } - return default; + return null; } private Button? ResolveFocusedGamepadActionButtonFromControlState() @@ -230,7 +230,7 @@ private bool TryMoveFocusWithinGamepadActions(bool moveDown) return DiagnosticsGamepadRefreshButton; } - return default; + return null; } private bool TryFocusOwnerSectionNavigation() @@ -261,6 +261,6 @@ private bool TryFocusOwnerSectionNavigation() current = VisualTreeHelper.GetParent(current); } - return default; + return null; } } diff --git a/SalmonEgg/SalmonEgg/Presentation/Views/SettingsShellPage.xaml.cs b/SalmonEgg/SalmonEgg/Presentation/Views/SettingsShellPage.xaml.cs index 07e9de14..057c5e3c 100644 --- a/SalmonEgg/SalmonEgg/Presentation/Views/SettingsShellPage.xaml.cs +++ b/SalmonEgg/SalmonEgg/Presentation/Views/SettingsShellPage.xaml.cs @@ -397,11 +397,11 @@ private static bool IsUserMeaningfulInteractiveControl(Control control) current = VisualTreeHelper.GetParent(current); } - return default; + return null; } 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++) @@ -419,11 +419,11 @@ private static bool IsUserMeaningfulInteractiveControl(Control control) } } - return default; + return null; } 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) @@ -455,7 +455,7 @@ private static System.Collections.Generic.IEnumerable FindDescendants(Depe current = VisualTreeHelper.GetParent(current); } - return default; + return null; } } diff --git a/SalmonEgg/SalmonEgg/Presentation/Views/Start/StartView.xaml.cs b/SalmonEgg/SalmonEgg/Presentation/Views/Start/StartView.xaml.cs index 922236bd..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++) @@ -191,11 +191,11 @@ private void RefreshHeroSuggestionFocusTargets() } } - return default; + return null; } private static T? FindAncestorOrSelf(DependencyObject? current) - where T : DependencyObject + where T : class, DependencyObject { while (current is not null) { @@ -207,7 +207,7 @@ private void RefreshHeroSuggestionFocusTargets() current = VisualTreeHelper.GetParent(current); } - return default; + return null; } private static bool IsDescendantOrSelf(DependencyObject? current, DependencyObject target)