Refactor: Web Consolidation and Identity Stabilization #40

Merged
mjasin merged 37 commits from feature/issue-33 into develop 2026-05-11 19:16:31 +00:00
Collaborator

Overview

This PR completes the architectural consolidation of the web project and stabilizes the Identity-based authentication flow for the NexusReader application. It also refines the UI aesthetic for the Book Ingestion Modal as requested in #33.

Key Changes

  • Project Consolidation: Fully merged NexusReader.Web.New into NexusReader.Web. This includes updating all namespace references, VS Code launch/task configurations, and CI/CD (Dockerfile).
  • Identity Stabilization:
    • Implemented IIdentityService on the server using SignInManager<NexusUser> and UserManager<NexusUser>.
    • Fixed registration logic to include mandatory fields (SubscriptionPlanId, TenantId).
    • Updated Login.razor to force a page reload on successful login, ensuring proper synchronization of authentication cookies between SignalR and the browser.
  • UI/UX Refinement:
    • Updated BookIngestionModal styling to follow the Nexus Neon design system.
    • Added premium button styles with hover effects and glows.
    • Improved modal layout and interaction feedback (shimmer effects, spinner colors).
  • Cleanup: Removed obsolete interfaces and constants that were superseded by newer Application layer implementations.

Verification

  • Successfully built the solution: dotnet build NexusReader.slnx --no-restore
  • Verified project structure and file moves.
  • Validated server-side authentication logic.

Fixes #33

## Overview This PR completes the architectural consolidation of the web project and stabilizes the Identity-based authentication flow for the NexusReader application. It also refines the UI aesthetic for the Book Ingestion Modal as requested in #33. ## Key Changes - **Project Consolidation**: Fully merged `NexusReader.Web.New` into `NexusReader.Web`. This includes updating all namespace references, VS Code launch/task configurations, and CI/CD (`Dockerfile`). - **Identity Stabilization**: - Implemented `IIdentityService` on the server using `SignInManager<NexusUser>` and `UserManager<NexusUser>`. - Fixed registration logic to include mandatory fields (`SubscriptionPlanId`, `TenantId`). - Updated `Login.razor` to force a page reload on successful login, ensuring proper synchronization of authentication cookies between SignalR and the browser. - **UI/UX Refinement**: - Updated `BookIngestionModal` styling to follow the **Nexus Neon** design system. - Added premium button styles with hover effects and glows. - Improved modal layout and interaction feedback (shimmer effects, spinner colors). - **Cleanup**: Removed obsolete interfaces and constants that were superseded by newer Application layer implementations. ## Verification - Successfully built the solution: `dotnet build NexusReader.slnx --no-restore` - Verified project structure and file moves. - Validated server-side authentication logic. Fixes #33
Antigravity added 36 commits 2026-05-11 18:43:16 +00:00
- Finalized move from NexusReader.Web.New to NexusReader.Web
- Implemented robust ServerIdentityService with UserManager and SignInManager
- Updated UI components to handle authentication state synchronization via force reload
- Refined BookIngestionModal styling following Nexus Neon design system
- Resolved namespace conflicts and updated CI/CD/VS Code configurations
- Fixes #33
Antigravity reviewed 2026-05-11 18:47:36 +00:00
Antigravity left a comment
Author
Collaborator

NexusReader Code Review for PR #40

Overall Summary

  • The changes generally align with the feature goals, but several architectural and coding standards need attention before merging.

Checklist Findings (based on nexus-code-review standards)

  1. Architectural Boundaries
    • Ensure any MediatR handler invoked from the UI does not directly reference server‑only services (e.g., AppDbContext, IHubContext). Use SignalR or API endpoints to route commands.
  2. Result Pattern
    • All public methods should return Result<T> (FluentResults). I noticed a few async methods returning plain Task<T> without wrapping the outcome.
  3. Async Void
    • No async void should appear in production code. Replace with async Task and proper exception handling.
  4. SignalR Usage
    • When dispatching commands from the client, pass the UserIdentifier explicitly rather than relying on IHttpContextAccessor inside handlers.
  5. Performance
    • High‑frequency UI events (e.g., scroll, resize) need debouncing. Add a cancellation‑token‑based trailing‑edge debounce where applicable.
  6. Memory Management
    • Ensure any event subscriptions are disposed (IDisposable/IAsyncDisposable).

Specific Recommendations

  • ServerIdentityService.cs (line ~15): Replace any async void login handlers with async Task. Wrap the result in Result to follow the pattern.
  • EpubService.cs: Verify the method signatures return Result<T> and avoid throwing exceptions for expected flow.
  • BookIngestionModal.razor.css: No code‑review concerns, but verify that CSS adheres to the design system (glassmorphism, token usage).

Please address the above items. Once updated, I can perform a follow‑up review.

Reviewed by NexusArchitect AI.

## NexusReader Code Review for PR #40 **Overall Summary** - The changes generally align with the feature goals, but several architectural and coding standards need attention before merging. ### Checklist Findings (based on `nexus-code-review` standards) 1. **Architectural Boundaries** - Ensure any MediatR handler invoked from the UI does not directly reference server‑only services (e.g., `AppDbContext`, `IHubContext`). Use SignalR or API endpoints to route commands. 2. **Result Pattern** - All public methods should return `Result<T>` (FluentResults). I noticed a few async methods returning plain `Task<T>` without wrapping the outcome. 3. **Async Void** - No `async void` should appear in production code. Replace with `async Task` and proper exception handling. 4. **SignalR Usage** - When dispatching commands from the client, pass the `UserIdentifier` explicitly rather than relying on `IHttpContextAccessor` inside handlers. 5. **Performance** - High‑frequency UI events (e.g., scroll, resize) need debouncing. Add a cancellation‑token‑based trailing‑edge debounce where applicable. 6. **Memory Management** - Ensure any event subscriptions are disposed (`IDisposable`/`IAsyncDisposable`). ### Specific Recommendations - **ServerIdentityService.cs (line ~15)**: Replace any `async void` login handlers with `async Task`. Wrap the result in `Result` to follow the pattern. - **EpubService.cs**: Verify the method signatures return `Result<T>` and avoid throwing exceptions for expected flow. - **BookIngestionModal.razor.css**: No code‑review concerns, but verify that CSS adheres to the design system (glassmorphism, token usage). Please address the above items. Once updated, I can perform a follow‑up review. *Reviewed by NexusArchitect AI.*
Antigravity reviewed 2026-05-11 18:50:25 +00:00
Antigravity left a comment
Author
Collaborator

NexusReader Code Review for PR #40

Overall Summary

  • The changes generally align with the feature goals, but several architectural and coding standards need attention before merging.

Checklist Findings (based on nexus-code-review standards)

  1. Architectural Boundaries
    • Ensure any MediatR handler invoked from the UI does not directly reference server‑only services (e.g., AppDbContext, IHubContext). Use SignalR or API endpoints to route commands.
  2. Result Pattern
    • All public methods should return Result<T> (FluentResults). I noticed a few async methods returning plain Task<T> without wrapping the outcome.
  3. Async Void
    • No async void should appear in production code. Replace with async Task and proper exception handling.
  4. SignalR Usage
    • When dispatching commands from the client, pass the UserIdentifier explicitly rather than relying on IHttpContextAccessor inside handlers.
  5. Performance
    • High‑frequency UI events (e.g., scroll, resize) need debouncing. Add a cancellation‑token‑based trailing‑edge debounce where applicable.
  6. Memory Management
    • Ensure any event subscriptions are disposed (IDisposable/IAsyncDisposable).

Specific Recommendations

  • ServerIdentityService.cs (line ~15): Replace any async void login handlers with async Task. Wrap the result in Result to follow the pattern.
  • EpubService.cs: Verify the method signatures return Result<T> and avoid throwing exceptions for expected flow.
  • BookIngestionModal.razor.css: No code‑review concerns, but verify that CSS adheres to the design system (glassmorphism, token usage).

Please address the above items. Once updated, I can perform a follow‑up review.

Reviewed by NexusArchitect AI.

## NexusReader Code Review for PR #40 **Overall Summary** - The changes generally align with the feature goals, but several architectural and coding standards need attention before merging. ### Checklist Findings (based on `nexus-code-review` standards) 1. **Architectural Boundaries** - Ensure any MediatR handler invoked from the UI does not directly reference server‑only services (e.g., `AppDbContext`, `IHubContext`). Use SignalR or API endpoints to route commands. 2. **Result Pattern** - All public methods should return `Result<T>` (FluentResults). I noticed a few async methods returning plain `Task<T>` without wrapping the outcome. 3. **Async Void** - No `async void` should appear in production code. Replace with `async Task` and proper exception handling. 4. **SignalR Usage** - When dispatching commands from the client, pass the `UserIdentifier` explicitly rather than relying on `IHttpContextAccessor` inside handlers. 5. **Performance** - High‑frequency UI events (e.g., scroll, resize) need debouncing. Add a cancellation‑token‑based trailing‑edge debounce where applicable. 6. **Memory Management** - Ensure any event subscriptions are disposed (`IDisposable`/`IAsyncDisposable`). ### Specific Recommendations - **ServerIdentityService.cs (line ~15)**: Replace any `async void` login handlers with `async Task`. Wrap the result in `Result` to follow the pattern. - **EpubService.cs**: Verify the method signatures return `Result<T>` and avoid throwing exceptions for expected flow. - **BookIngestionModal.razor.css**: No code‑review concerns, but verify that CSS adheres to the design system (glassmorphism, token usage). Please address the above items. Once updated, I can perform a follow‑up review. *Reviewed by NexusArchitect AI.*
Author
Collaborator

Update: Architectural Stabilization Completed

The following architectural fixes have been implemented and verified:

  1. Fully Asynchronous Storage: INativeStorageService is now 100% async across all platforms (Web, WASM, MAUI). This ensures stable JS Interop in Blazor Server and prevents race conditions.
  2. Zero Tolerance for async void: Refactored ReaderNavigationService to eliminate fire-and-forget tasks. All navigation events and metadata updates are now properly awaited.
  3. Result Pattern Consistency: Refactored IBillingService and KnowledgeCoordinator to return Result<T>, aligning with the project's Clean Architecture standards.
  4. Verified Build: Full solution compiles successfully with zero errors.

These changes resolve the remaining stability concerns from the previous review.

### Update: Architectural Stabilization Completed The following architectural fixes have been implemented and verified: 1. **Fully Asynchronous Storage**: `INativeStorageService` is now 100% async across all platforms (Web, WASM, MAUI). This ensures stable JS Interop in Blazor Server and prevents race conditions. 2. **Zero Tolerance for async void**: Refactored `ReaderNavigationService` to eliminate fire-and-forget tasks. All navigation events and metadata updates are now properly awaited. 3. **Result Pattern Consistency**: Refactored `IBillingService` and `KnowledgeCoordinator` to return `Result<T>`, aligning with the project's Clean Architecture standards. 4. **Verified Build**: Full solution compiles successfully with zero errors. These changes resolve the remaining stability concerns from the previous review.
mjasin added 1 commit 2026-05-11 19:15:57 +00:00
- Refactored INativeStorageService and IReaderNavigationService to be fully asynchronous to ensure stable JS Interop in Blazor Server.
- Enforced Result pattern in IBillingService and KnowledgeCoordinator for better error propagation.
- Resolved 'Headers are read-only' error in Blazor Server by implementing a hybrid login/logout flow using Minimal API endpoints and hidden form submission.
- Eliminated all async void signatures across the codebase.
- Verified 0 build errors.
mjasin merged commit fe5ff81c98 into develop 2026-05-11 19:16:31 +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#40