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:
2026-05-18 17:53:36 +00:00
committed by Marek Jaisński
parent f808734768
commit 541e9e1fb5
42 changed files with 2351 additions and 155 deletions
@@ -156,4 +156,106 @@
0% { transform: scale(1); opacity: 1; }
50% { transform: scale(1.1); opacity: 0.8; }
100% { transform: scale(1); opacity: 1; }
}
/* Chapter Loading Overlay and Spinners */
.loading-state.full-page {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
min-height: 400px;
gap: 1.5rem;
animation: fadeIn 0.4s ease-out;
}
.spinner-glow {
width: 60px;
height: 60px;
border: 3px solid rgba(0, 255, 153, 0.1);
border-radius: 50%;
border-top-color: var(--nexus-neon, #00ff99);
animation: spin 1s cubic-bezier(0.55, 0.055, 0.675, 0.19) infinite;
box-shadow: 0 0 15px rgba(0, 255, 153, 0.2);
}
.spinner-glow.small {
width: 36px;
height: 36px;
border-width: 2px;
}
.loading-text {
color: rgba(255, 255, 255, 0.7);
font-size: 1.1rem;
letter-spacing: 0.5px;
font-weight: 500;
}
.theme-light .loading-text {
color: rgba(0, 0, 0, 0.7);
}
.chapter-loading-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
background-color: rgba(15, 23, 42, 0.15);
backdrop-filter: blur(2px);
animation: fadeIn 0.3s ease-out;
}
.theme-light .chapter-loading-overlay {
background-color: rgba(255, 255, 255, 0.2);
}
.loader-card {
display: flex;
align-items: center;
gap: 1.25rem;
padding: 1.25rem 2rem;
border-radius: 40px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), 0 0 1px rgba(255, 255, 255, 0.1) inset;
animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.loader-text {
font-family: var(--nexus-font-sans, 'Inter', sans-serif);
font-weight: 500;
color: #ffffff;
font-size: 0.95rem;
letter-spacing: 0.2px;
}
.theme-light .loader-text {
color: #0f172a;
}
.content-blurred {
filter: blur(3px);
opacity: 0.55;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
pointer-events: none;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@keyframes scaleIn {
from { transform: scale(0.9) translateY(10px); opacity: 0; }
to { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}