feat(ai-ux): deduplicate AI queries, handle ServiceUnavailable retries, and optimize reader canvas graph prerendering (#44)
This Pull Request encapsulates all outstanding AI, Blazor InteractiveAuto lifecycle, pgvector, and Firefox authorization/session compatibility fixes. ### Key Accomplishments: 1. **Concurrent Request Deduplication (Option B):** Implemented a thread-safe active task registry in `KnowledgeService` that groups concurrent graph extraction queries for the same content, preventing duplicate AI calls completely. 2. **Resilience Strategy for Downstream Demands:** Extended the `ai-retry` resilience pipeline to automatically intercept and retry on temporary Google API `503 ServiceUnavailable` / `high demand` spikes. 3. **Interactive Graph Generation Guard (Option A):** Prevented server-side prerender-phase graph requests in the reader canvas component. 4. **Firefox Compatibility & Cookie Handler:** Implemented an authentication endpoint and hybrid hidden-form submission flow to solve login, registration, and logout redirections and cookies securely. 5. **Autoscrolling & Graph Exclusions:** Added concept-to-block smooth scrolling, active block badging, and filtered out markdown code blocks from being extracted as nodes. All unit tests compiled and passed 100% cleanly. --------- Co-authored-by: Marek Jasiński <jasins.marek@gmail.com> Reviewed-on: #44 Co-authored-by: Antigravity <antigravity@google.com> Co-committed-by: Antigravity <antigravity@google.com>
This commit was merged in pull request #44.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
@page "/"
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using NexusReader.UI.Shared.Components.Atoms
|
||||
@using NexusReader.UI.Shared.Components.Organisms
|
||||
@using NexusReader.UI.Shared.Services
|
||||
@inject IIdentityService IdentityService
|
||||
@inject NavigationManager NavigationManager
|
||||
@@ -42,57 +43,7 @@
|
||||
|
||||
<div class="main-grid">
|
||||
<!-- Current Reading Card -->
|
||||
<section class="reading-card glass-panel">
|
||||
@if (_profile?.LastReadBook != null)
|
||||
{
|
||||
<div class="card-header">
|
||||
<h3>Ostatnio czytane: @_profile.LastReadBook.Title</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="reading-thumb">
|
||||
<img src="@(_profile.LastReadBook.CoverUrl ?? "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/402px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg")" alt="Current Book" />
|
||||
</div>
|
||||
<div class="reading-info">
|
||||
<div class="progress-section">
|
||||
<span class="chapter-label">@_profile.LastReadBook.LastChapter</span>
|
||||
<div class="progress-container">
|
||||
<div class="progress-bar" style="width: @(_profile.LastReadBook.Progress.ToString("F0", System.Globalization.CultureInfo.InvariantCulture))%">
|
||||
<div class="progress-bubble">@(_profile.LastReadBook.Progress.ToString("F1"))%</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="progress-detail">Postęp: @(_profile.LastReadBook.Progress.ToString("F2"))% - @_profile.LastReadBook.Author.Name</span>
|
||||
</div>
|
||||
<p class="reading-desc">
|
||||
Kontynuuj odkrywanie wiedzy w książce "@_profile.LastReadBook.Title".
|
||||
Twój cyfrowy asystent Nexus jest gotowy do analizy kolejnych rozdziałów i generowania interaktywnych map myśli.
|
||||
</p>
|
||||
<div class="card-actions">
|
||||
<button class="btn-nexus primary" @onclick='() => NavigationManager.NavigateTo($"/reader?chapter={_profile.LastReadBook.LastChapterIndex}")'>Kontynuuj Czytanie</button>
|
||||
<button class="btn-nexus secondary" @onclick='() => NavigationManager.NavigateTo("/library")'>Moja Biblioteka</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="card-header">
|
||||
<h3>Brak aktywnych lektur</h3>
|
||||
</div>
|
||||
<div class="card-body empty-state">
|
||||
<div class="empty-icon">
|
||||
<NexusIcon Name="book-open" Size="64" />
|
||||
</div>
|
||||
<div class="reading-info">
|
||||
<p class="reading-desc">
|
||||
Nie czytasz obecnie żadnej książki. Przejdź do biblioteki, aby przesłać swój pierwszy plik EPUB i rozpocząć przygodę z Nexus Reader.
|
||||
</p>
|
||||
<div class="card-actions">
|
||||
<button class="btn-nexus primary" @onclick='() => NavigationManager.NavigateTo("/library")'>Przejdź do Biblioteki</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
<CurrentReadingWidget Book="_profile?.LastReadBook" />
|
||||
|
||||
<div class="secondary-grid">
|
||||
<!-- Knowledge Integration -->
|
||||
|
||||
Reference in New Issue
Block a user