feat(ai-ux): deduplicate AI queries, handle ServiceUnavailable retries, and optimize reader canvas graph prerendering #44

Merged
mjasin merged 2 commits from fix/firefox-login-error into develop 2026-05-18 17:53:36 +00:00
Collaborator

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.

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.
Antigravity added 1 commit 2026-05-18 17:36:54 +00:00
Author
Collaborator

Great work on PR #44! 🎉

What looks solid

  • Added Description field across domain, DTOs, ingestion and UI – clean extension.
  • Introduced CurrentReadingWidget component with nice glass‑panel UI and progress handling.
  • Loading overlay & blur effect in ReaderCanvas improve UX when switching chapters.
  • KnowledgeService now deduplicates identical AI requests and explicitly sets embedding dimensions.
  • Prompt updates safely ignore raw code blocks and enforce slug IDs.
  • Replaced unsafe eval login calls with a named JS helper (nexusAuth.submitLoginForm).

⚠️ What still needs attention before merge

  1. Unit / integration tests for:
    • GetMyEbooksQuery and the updated SearchLibrarySemanticallyQueryHandler (including both 768‑dim and fallback 1536‑dim paths).
    • Ingestion flow with the new Description field.
    • CurrentReadingWidget component (null vs populated state).
    • Deep‑link routing (/reader/{bookId}?chapter=N).
  2. Mapster mapping – ensure Ebook.DescriptionUserProfileDto.Description (and LastReadBookDto.Description).
  3. Verify the JavaScript helper nexusAuth.submitLoginForm exists in wwwroot/js and is loaded.
  4. Review accessibility for any new images/tokens introduced in the Library UI.
  5. Update documentation (README/wiki) to mention the new Description field and deep‑link route.

Once the above items are covered and the CI build passes (dotnet build NexusReader.slnx --no-restore), the PR should be ready to merge.

Thanks again for the contribution! 🚀

Great work on PR #44! 🎉 ✅ **What looks solid** - Added `Description` field across domain, DTOs, ingestion and UI – clean extension. - Introduced `CurrentReadingWidget` component with nice glass‑panel UI and progress handling. - Loading overlay & blur effect in `ReaderCanvas` improve UX when switching chapters. - KnowledgeService now deduplicates identical AI requests and explicitly sets embedding dimensions. - Prompt updates safely ignore raw code blocks and enforce slug IDs. - Replaced unsafe `eval` login calls with a named JS helper (`nexusAuth.submitLoginForm`). ⚠️ **What still needs attention before merge** 1. **Unit / integration tests** for: - `GetMyEbooksQuery` and the updated `SearchLibrarySemanticallyQueryHandler` (including both 768‑dim and fallback 1536‑dim paths). - Ingestion flow with the new `Description` field. - `CurrentReadingWidget` component (null vs populated state). - Deep‑link routing (`/reader/{bookId}?chapter=N`). 2. **Mapster mapping** – ensure `Ebook.Description` ↔ `UserProfileDto.Description` (and `LastReadBookDto.Description`). 3. Verify the JavaScript helper `nexusAuth.submitLoginForm` exists in `wwwroot/js` and is loaded. 4. Review accessibility for any new images/tokens introduced in the Library UI. 5. Update documentation (README/wiki) to mention the new `Description` field and deep‑link route. Once the above items are covered and the CI build passes (`dotnet build NexusReader.slnx --no-restore`), the PR should be ready to merge. Thanks again for the contribution! 🚀
mjasin added 1 commit 2026-05-18 17:52:47 +00:00
mjasin merged commit 541e9e1fb5 into develop 2026-05-18 17:53:36 +00:00
mjasin deleted branch fix/firefox-login-error 2026-05-18 17:53:37 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mjasin/Nexus.Reader#44