diff --git a/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.backup.json b/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.backup.json index ccbd7f4..23de406 100644 --- a/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.backup.json +++ b/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.backup.json @@ -218,6 +218,10 @@ "$type": "Bookmark", "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}" + }, { "$type": "Document", "DocumentIndex": 5, @@ -264,7 +268,21 @@ "RelativeToolTip": "Components\\Pages\\Settings.razor", "ViewState": "AgIAAIsCAAAAAAAAAAArwKACAAAQAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", - "WhenOpened": "2026-05-15T16:43:26.6Z" + "WhenOpened": "2026-05-15T16:43:26.6Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "MainLayout.razor", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\MainLayout.razor", + "RelativeDocumentMoniker": "Components\\Layout\\MainLayout.razor", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\MainLayout.razor", + "RelativeToolTip": "Components\\Layout\\MainLayout.razor", + "ViewState": "AgIAAFkCAAAAAAAAAADgv2oCAAAwAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", + "WhenOpened": "2026-05-15T16:04:36.444Z", + "EditorCaption": "" }, { "$type": "Document", @@ -278,19 +296,6 @@ "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2026-06-26T13:33:25.661Z" }, - { - "$type": "Document", - "DocumentIndex": 0, - "Title": "MainLayout.razor", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\MainLayout.razor", - "RelativeDocumentMoniker": "Components\\Layout\\MainLayout.razor", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\MainLayout.razor", - "RelativeToolTip": "Components\\Layout\\MainLayout.razor", - "ViewState": "AgIAAO8BAAAAAAAAAAAiwAICAAAAAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", - "WhenOpened": "2026-05-15T16:04:36.444Z", - "EditorCaption": "" - }, { "$type": "Document", "DocumentIndex": 1, @@ -824,10 +829,6 @@ "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001642|", "WhenOpened": "2026-05-14T10:14:25.605Z" - }, - { - "$type": "Bookmark", - "Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}" } ] } diff --git a/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.json b/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.json index fed532c..a1fbfea 100644 --- a/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.json +++ b/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.json @@ -212,16 +212,12 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 7, + "SelectedChildIndex": 5, "Children": [ { "$type": "Bookmark", "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" }, - { - "$type": "Bookmark", - "Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}" - }, { "$type": "Document", "DocumentIndex": 5, @@ -268,7 +264,19 @@ "RelativeToolTip": "Components\\Pages\\Settings.razor", "ViewState": "AgIAAIsCAAAAAAAAAAArwKACAAAQAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", - "WhenOpened": "2026-05-15T16:43:26.6Z", + "WhenOpened": "2026-05-15T16:43:26.6Z" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "MainLayout.razor", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\MainLayout.razor", + "RelativeDocumentMoniker": "Components\\Layout\\MainLayout.razor", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\MainLayout.razor", + "RelativeToolTip": "Components\\Layout\\MainLayout.razor", + "ViewState": "AgIAAFkCAAAAAAAAAADgv2oCAAAwAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", + "WhenOpened": "2026-05-15T16:04:36.444Z", "EditorCaption": "" }, { @@ -283,19 +291,6 @@ "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2026-06-26T13:33:25.661Z" }, - { - "$type": "Document", - "DocumentIndex": 0, - "Title": "MainLayout.razor", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\MainLayout.razor", - "RelativeDocumentMoniker": "Components\\Layout\\MainLayout.razor", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\MainLayout.razor", - "RelativeToolTip": "Components\\Layout\\MainLayout.razor", - "ViewState": "AgIAAFUCAAAAAAAAAAAiwGECAABPAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", - "WhenOpened": "2026-05-15T16:04:36.444Z", - "EditorCaption": "" - }, { "$type": "Document", "DocumentIndex": 1, diff --git a/Components/Layout/MainLayout.razor b/Components/Layout/MainLayout.razor index c4e92c5..2a8702a 100644 --- a/Components/Layout/MainLayout.razor +++ b/Components/Layout/MainLayout.razor @@ -493,6 +493,7 @@ else private string exportFileName = string.Empty; private string exportFormat = "Html"; private long _lastThoughtScrollTicks; + private string? _lastVisitedPage; [Inject] private NavigationManager Navigation { get; set; } = default!; @@ -548,27 +549,34 @@ else protected override async Task OnAfterRenderAsync(bool firstRender) { var themeChanged = OllamaSettings.Theme != ThemeService.Theme; - + if (firstRender) { + // Restore last visited page from localStorage + _lastVisitedPage = await JS.InvokeAsync("localStorage.getItem", "last_visited_page"); + if (!string.IsNullOrEmpty(_lastVisitedPage)) + { + Navigation.NavigateTo(_lastVisitedPage); + } + await ThemeService.ApplyTheme(OllamaSettings.Theme); // Auto-login runs AFTER circuit establishment (correct scoped services) await LoadCurrentUser(); -// #if DEBUG -// if (!_isAuthenticated && Program.DebugAutoLogin) -// { -// var users = await SettingsService.GetUsersAsync(); -// var first = users.FirstOrDefault(u => u.Role == UserRole.Administrator); -// if (first != null) -// { -// await AuthService.AdminBypassLoginAsync(first.Id); -// AuthStateProvider.NotifyStateChanged(); -// await LoadCurrentUser(); -// } -// } -// #endif + // #if DEBUG + // if (!_isAuthenticated && Program.DebugAutoLogin) + // { + // var users = await SettingsService.GetUsersAsync(); + // var first = users.FirstOrDefault(u => u.Role == UserRole.Administrator); + // if (first != null) + // { + // await AuthService.AdminBypassLoginAsync(first.Id); + // AuthStateProvider.NotifyStateChanged(); + // await LoadCurrentUser(); + // } + // } + // #endif if (_isAuthenticated) { await LoadProjects(); @@ -605,9 +613,14 @@ else { await LoadProjects(); await LoadProjectContext(); - - // Save current page to localStorage - await JS.InvokeVoidAsync("localStorage.setItem", "last_visited_page", Navigation.Uri); + + if (Navigation.Uri.Contains("quick-markdown") || + Navigation.Uri.Contains("chat") || + Navigation.Uri.Contains("editor/")) + { + // Save current page to localStorage + await JS.InvokeVoidAsync("localStorage.setItem", "last_visited_page", Navigation.Uri); + } } StateHasChanged(); }