feat: implement draggable sidebar resizer with persistent state and dynamic UI updates

This commit is contained in:
2026-04-27 18:33:32 +02:00
parent 39a9ca5706
commit 131981992c
4 changed files with 120 additions and 7 deletions
@@ -6,6 +6,7 @@
@inject IPlatformService PlatformService
@inject IFocusModeService FocusMode
@inject IQuizStateService QuizService
@inject IJSRuntime JS
@implements IDisposable
<div class="app-container @_platformClass @(FocusMode.IsFocusModeActive ? "focus-mode-active" : "")">
@@ -16,6 +17,8 @@
<ReaderFooter />
</div>
<div class="resizer" id="sidebar-resizer"></div>
<div class="intelligence-sidebar">
<IntelligenceToolbar />
<div class="intelligence-content">
@@ -58,6 +61,19 @@
}
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
try
{
var module = await JS.InvokeAsync<IJSObjectReference>("import", "./_content/NexusReader.UI.Shared/js/layoutResizer.js");
await module.InvokeVoidAsync("initResizer", ".app-container", "#sidebar-resizer", "--sidebar-width");
}
catch { }
}
}
public void Dispose()
{
FocusMode.OnFocusModeChanged -= StateHasChanged;