feat(ui/graph): optimize graph dynamics, immersive reader, and code blocks

- Fix #16: Implement D3.js transitions and active state badges for Knowledge Graph.
- Fix #12: Implement Immersive Reader Layout with Merriweather typography.
- Fix #20: Professional code block styling with high contrast and monospace fonts.
- Resolve DI runtime error in WASM by adding dummy services.
- Replace generic 'Not Found' message with Nexus preloader.
- Enforce 'no async void' architecture across UI services.
This commit is contained in:
2026-05-08 20:13:39 +02:00
parent 00c5658662
commit 06f8c823a6
33 changed files with 370 additions and 149 deletions
+20
View File
@@ -4,6 +4,9 @@ using NexusReader.Application.Abstractions.Services;
using NexusReader.Web.Client.Services;
using NexusReader.UI.Shared.Services;
using NexusReader.Application;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.AI;
using NexusReader.Data.Persistence;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
@@ -32,7 +35,24 @@ builder.Services.AddCascadingAuthenticationState();
builder.Services.AddScoped<IKnowledgeService, WasmKnowledgeService>();
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
// Dummy registrations for server-only handlers to satisfy DI validation
builder.Services.AddSingleton<IDbContextFactory<AppDbContext>>(new ThrowingDbContextFactory());
builder.Services.AddSingleton<IEmbeddingGenerator<string, Embedding<float>>>(new ThrowingEmbeddingGenerator());
builder.Services.AddApplication();
builder.Services.AddScoped<IEpubService, WasmEpubService>();
await builder.Build().RunAsync();
public class ThrowingDbContextFactory : IDbContextFactory<AppDbContext>
{
public AppDbContext CreateDbContext() => throw new NotSupportedException("DbContext cannot be used in WASM client.");
}
public class ThrowingEmbeddingGenerator : IEmbeddingGenerator<string, Embedding<float>>
{
public void Dispose() { }
public Task<GeneratedEmbeddings<Embedding<float>>> GenerateAsync(IEnumerable<string> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default)
=> throw new NotSupportedException("Embedding generation cannot be used in WASM client.");
public object? GetService(Type serviceType, object? serviceKey = null) => null;
}