fix(routing): InteractiveServer routing, WASM interactivity declared at layout level

Routes moves to InteractiveServer so the server router always sees all
assemblies (including AuthBlocksWeb). MainLayout declares
@rendermode InteractiveWebAssembly — the single source of WASM
interactivity for all public pages. CmsLayout in DeepDrftCms provides
a server-rendered admin shell without the audio dock. Assembly-level
_Imports.razor files set the default layout for each group; no per-page
rendermode declarations needed. Routes.razor moves to the server host
(its correct home) carrying the full AdditionalAssemblies list.
This commit is contained in:
Daniel Harvey
2026-05-18 23:31:10 -04:00
parent 8e7347f498
commit d31a08bd15
8 changed files with 99 additions and 28 deletions
+2 -2
View File
@@ -15,11 +15,11 @@
<link rel="stylesheet" href="styles/deepdrft-styles.css" />
<ImportMap />
<link rel="icon" type="image/ico" href="deepdrft-logo.ico" />
<HeadOutlet @rendermode="InteractiveAuto" />
<HeadOutlet @rendermode="InteractiveServer" />
</head>
<body>
<Routes @rendermode="InteractiveAuto" />
<Routes @rendermode="InteractiveServer" />
<script src="_framework/blazor.web.js"></script>
<script src=@Assets["_content/MudBlazor/MudBlazor.min.js"]></script>
<script type="module">
+21
View File
@@ -0,0 +1,21 @@
<Router AppAssembly="typeof(App).Assembly"
AdditionalAssemblies="new[] { typeof(DeepDrftWeb.Client._Imports).Assembly, typeof(DeepDrftCms._Imports).Assembly, typeof(AuthBlocksWeb._Imports).Assembly }">
<Found Context="routeData">
<AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(DeepDrftWeb.Client.Layout.MainLayout)">
<NotAuthorized>
@{
NavigationManager.NavigateTo($"account/login?returnUrl={Uri.EscapeDataString(NavigationManager.Uri)}", forceLoad: true);
}
</NotAuthorized>
</AuthorizeRouteView>
<FocusOnNavigate RouteData="routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="typeof(DeepDrftWeb.Client.Layout.MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
@inject NavigationManager NavigationManager
+1
View File
@@ -1,6 +1,7 @@
@using System.Net.Http
@using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using static Microsoft.AspNetCore.Components.Web.RenderMode