From 0ecac914f27102c3e67b537f2a6a2b94dea7a0ba Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Thu, 4 Jun 2026 19:21:38 +0200 Subject: [PATCH] Made the search sticky --- .../Components/Workspaces.razor | 4 ++-- .../Components/Workspaces.razor.cs | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/MindWork AI Studio/Components/Workspaces.razor b/app/MindWork AI Studio/Components/Workspaces.razor index b93ac244..36d8efd5 100644 --- a/app/MindWork AI Studio/Components/Workspaces.razor +++ b/app/MindWork AI Studio/Components/Workspaces.razor @@ -11,9 +11,9 @@ } else { - @if (this.isSearchVisible) + @if (this.SearchVisible) { - + SearchVisibleChanged { get; set; } + private const Placement WORKSPACE_ITEM_TOOLTIP_PLACEMENT = Placement.Bottom; private readonly SemaphoreSlim treeLoadingSemaphore = new(1, 1); private readonly List> treeItems = []; @@ -41,7 +47,6 @@ public partial class Workspaces : MSGComponentBase private CancellationTokenSource? searchCancellationTokenSource; private bool isInitialLoading = true; private bool isDisposed; - private bool isSearchVisible; private bool includeThreadContents; private bool isSearchRunning; private string searchText = string.Empty; @@ -92,7 +97,7 @@ public partial class Workspaces : MSGComponentBase await this.StartPrefetchAsync(); } - private bool HasSearchQuery => this.isSearchVisible && !string.IsNullOrWhiteSpace(this.searchText); + private bool HasSearchQuery => this.SearchVisible && !string.IsNullOrWhiteSpace(this.searchText); private void BuildTreeItems(WorkspaceTreeCacheSnapshot snapshot) { @@ -410,8 +415,11 @@ public partial class Workspaces : MSGComponentBase public async Task ToggleSearchAsync() { - this.isSearchVisible = !this.isSearchVisible; - if (this.isSearchVisible) + var searchVisible = !this.SearchVisible; + this.SearchVisible = searchVisible; + await this.SearchVisibleChanged.InvokeAsync(searchVisible); + + if (this.SearchVisible) { await this.SafeStateHasChanged(); return; @@ -880,4 +888,4 @@ public partial class Workspaces : MSGComponentBase } #endregion -} \ No newline at end of file +}