diff --git a/app/MindWork AI Studio/Components/Workspaces.razor.cs b/app/MindWork AI Studio/Components/Workspaces.razor.cs index f603a400..cbce4fdd 100644 --- a/app/MindWork AI Studio/Components/Workspaces.razor.cs +++ b/app/MindWork AI Studio/Components/Workspaces.razor.cs @@ -47,14 +47,17 @@ public partial class Workspaces : MSGComponentBase // - Those initial tree items cannot have children // - When assigning the tree items to the MudTreeViewItem component, we must set the Value property to the value of the item // - await this.LoadTreeItems(); + // We won't await the loading of the tree items here, + // to avoid blocking the UI thread: + _ = this.LoadTreeItems(); } #endregion private async Task LoadTreeItems() { - var workspacesNode = new TreeItemData + this.treeItems.Clear(); + this.treeItems.Add(new TreeItemData { Expanded = this.ExpandRootNodes, Expandable = true, @@ -68,9 +71,16 @@ public partial class Workspaces : MSGComponentBase Path = "root", Children = await this.LoadWorkspaces(), }, - }; - - var tempChatNode = new TreeItemData + }); + + this.treeItems.Add(new TreeItemData + { + Expandable = false, + Value = new TreeDivider(), + }); + + await this.InvokeAsync(this.StateHasChanged); + this.treeItems.Add(new TreeItemData { Expanded = this.ExpandRootNodes, Expandable = true, @@ -84,16 +94,9 @@ public partial class Workspaces : MSGComponentBase Path = "temp", Children = await this.LoadTemporaryChats(), }, - }; - - this.treeItems.Clear(); - this.treeItems.Add(workspacesNode); - this.treeItems.Add(new TreeItemData - { - Expandable = false, - Value = new TreeDivider(), }); - this.treeItems.Add(tempChatNode); + + await this.InvokeAsync(this.StateHasChanged); } private async Task>> LoadTemporaryChats() diff --git a/app/MindWork AI Studio/Pages/About.razor.cs b/app/MindWork AI Studio/Pages/About.razor.cs index d159ab53..7bc3b848 100644 --- a/app/MindWork AI Studio/Pages/About.razor.cs +++ b/app/MindWork AI Studio/Pages/About.razor.cs @@ -66,7 +66,10 @@ public partial class About : MSGComponentBase this.logPaths = await this.RustService.GetLogPaths(); await base.OnInitializedAsync(); - await this.DeterminePandocVersion(); + + // Determine the Pandoc version may take some time, so we start it here + // without waiting for the result: + _ = this.DeterminePandocVersion(); } #endregion diff --git a/app/MindWork AI Studio/Pages/Home.razor.cs b/app/MindWork AI Studio/Pages/Home.razor.cs index aece90c4..06c4f291 100644 --- a/app/MindWork AI Studio/Pages/Home.razor.cs +++ b/app/MindWork AI Studio/Pages/Home.razor.cs @@ -19,10 +19,12 @@ public partial class Home : MSGComponentBase protected override async Task OnInitializedAsync() { - await this.ReadLastChangeAsync(); await base.OnInitializedAsync(); - this.InitializeAdvantagesItems(); + + // Read the last change content asynchronously + // without blocking the UI thread: + _ = this.ReadLastChangeAsync(); } private void InitializeAdvantagesItems() @@ -61,6 +63,8 @@ public partial class Home : MSGComponentBase var latest = Changelog.LOGS.MaxBy(n => n.Build); using var response = await this.HttpClient.GetAsync($"changelog/{latest.Filename}"); this.LastChangeContent = await response.Content.ReadAsStringAsync(); + + await this.InvokeAsync(this.StateHasChanged); } private const string QUICK_START_GUIDE = diff --git a/app/MindWork AI Studio/Tools/Services/EnterpriseEnvironmentService.cs b/app/MindWork AI Studio/Tools/Services/EnterpriseEnvironmentService.cs index 432796e4..079224c6 100644 --- a/app/MindWork AI Studio/Tools/Services/EnterpriseEnvironmentService.cs +++ b/app/MindWork AI Studio/Tools/Services/EnterpriseEnvironmentService.cs @@ -32,7 +32,7 @@ public sealed class EnterpriseEnvironmentService(ILogger plugin.Id == enterpriseRemoveConfigId); diff --git a/app/MindWork AI Studio/wwwroot/changelog/v0.9.49.md b/app/MindWork AI Studio/wwwroot/changelog/v0.9.49.md index 368ab111..075ddf8c 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v0.9.49.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v0.9.49.md @@ -1,5 +1,6 @@ # v0.9.49, build 224 (2025-06-xx xx:xx UTC) - Added a library by Nils Kruthoff (`nilskruthoff`) that allows AI Studio to read PowerPoint files. This feature is not yet available in the UI, but it will soon be available. Thanks, Nils, for that great contribution. +- Improved the loading of some components that require data fetching, resulting in a more responsive UI. - Changed the timestamp display to use the local datetime format for the chats and assistants. - Upgraded to Rust 1.88.0. - Upgraded MudBlazor to version 8.8.0.