From d31a08bd1559a7e0aa49db65e6d145485c96dc7e Mon Sep 17 00:00:00 2001 From: Daniel Harvey Date: Mon, 18 May 2026 23:31:10 -0400 Subject: [PATCH] fix(routing): InteractiveServer routing, WASM interactivity declared at layout level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- DeepDrftCms/Layout/CmsLayout.razor | 70 ++++++++++++++++++++++ DeepDrftCms/_Imports.razor | 1 + DeepDrftWeb.Client/Layout/MainLayout.razor | 3 +- DeepDrftWeb.Client/Routes.razor | 24 -------- DeepDrftWeb.Client/_Imports.razor | 3 +- DeepDrftWeb/Components/App.razor | 4 +- DeepDrftWeb/Components/Routes.razor | 21 +++++++ DeepDrftWeb/Components/_Imports.razor | 1 + 8 files changed, 99 insertions(+), 28 deletions(-) create mode 100644 DeepDrftCms/Layout/CmsLayout.razor delete mode 100644 DeepDrftWeb.Client/Routes.razor create mode 100644 DeepDrftWeb/Components/Routes.razor diff --git a/DeepDrftCms/Layout/CmsLayout.razor b/DeepDrftCms/Layout/CmsLayout.razor new file mode 100644 index 0000000..2a830b9 --- /dev/null +++ b/DeepDrftCms/Layout/CmsLayout.razor @@ -0,0 +1,70 @@ +@rendermode InteractiveServer +@inherits LayoutComponentBase + + + + + + + + + + Deep Drft — Admin + + + + + + + + + @Body + + + + +
+ An unhandled error has occurred. + Reload + 🗙 +
+ +@code { + // Light palette from MainLayout — keeps the CMS visually consistent with the public site. + private readonly MudTheme _theme = new() + { + PaletteLight = new PaletteLight + { + Primary = "#0D1B2A", + PrimaryDarken = "#162437", + Secondary = "#1A3C34", + Tertiary = "#3D7A68", + Background = "#FAFAF8", + BackgroundGray = "#F0F2F0", + Surface = "#FAFAF8", + AppbarBackground = "#0D1B2A", + AppbarText = "#FAFAF8", + TextPrimary = "#0D1B2A", + TextSecondary = "#8A9BB0", + Divider = "rgba(13,27,42,0.10)", + TableLines = "rgba(13,27,42,0.10)", + }, + Typography = new Typography + { + Default = new DefaultTypography { FontFamily = new[] { "DM Sans", "sans-serif" } }, + H1 = new H1Typography { FontFamily = new[] { "Cormorant Garamond", "Georgia", "serif" } }, + H2 = new H2Typography { FontFamily = new[] { "Cormorant Garamond", "Georgia", "serif" } }, + H3 = new H3Typography { FontFamily = new[] { "Cormorant Garamond", "Georgia", "serif" } }, + H4 = new H4Typography { FontFamily = new[] { "Cormorant Garamond", "Georgia", "serif" } }, + H5 = new H5Typography { FontFamily = new[] { "Cormorant Garamond", "Georgia", "serif" } }, + H6 = new H6Typography { FontFamily = new[] { "Cormorant Garamond", "Georgia", "serif" } }, + Subtitle1 = new Subtitle1Typography{ FontFamily = new[] { "Geist Mono", "monospace" } }, + Body1 = new Body1Typography { FontFamily = new[] { "DM Sans", "sans-serif" } }, + Body2 = new Body2Typography { FontFamily = new[] { "DM Sans", "sans-serif" } }, + Caption = new CaptionTypography { FontFamily = new[] { "Geist Mono", "monospace" } }, + Button = new ButtonTypography { FontFamily = new[] { "Geist Mono", "monospace" } }, + } + }; +} diff --git a/DeepDrftCms/_Imports.razor b/DeepDrftCms/_Imports.razor index b0fbed9..91228ec 100644 --- a/DeepDrftCms/_Imports.razor +++ b/DeepDrftCms/_Imports.razor @@ -12,3 +12,4 @@ @using DeepDrftData @using Models.Common @using MudBlazor +@layout DeepDrftCms.Layout.CmsLayout diff --git a/DeepDrftWeb.Client/Layout/MainLayout.razor b/DeepDrftWeb.Client/Layout/MainLayout.razor index 1e87ab1..2d0fbc4 100644 --- a/DeepDrftWeb.Client/Layout/MainLayout.razor +++ b/DeepDrftWeb.Client/Layout/MainLayout.razor @@ -1,4 +1,5 @@ -@using DeepDrftWeb.Client.Controls +@rendermode InteractiveWebAssembly +@using DeepDrftWeb.Client.Controls @using DeepDrftWeb.Client.Controls.AudioPlayerBar @using DeepDrftWeb.Client.Services @using DeepDrftWeb.Client.Common diff --git a/DeepDrftWeb.Client/Routes.razor b/DeepDrftWeb.Client/Routes.razor deleted file mode 100644 index 12510a1..0000000 --- a/DeepDrftWeb.Client/Routes.razor +++ /dev/null @@ -1,24 +0,0 @@ -@inject NavigationManager NavigationManager - - - - - - @{ - NavigationManager.NavigateTo($"account/login?returnUrl={Uri.EscapeDataString(NavigationManager.Uri)}", forceLoad: true); - } - - - - - @{ - // Routes owned by server-side assemblies (e.g. /account/*) are not visible to the - // WASM router. Force a full-page reload so the server router handles them instead. - var path = new Uri(NavigationManager.Uri).AbsolutePath; - if (path.StartsWith("/account", StringComparison.OrdinalIgnoreCase)) - { - NavigationManager.NavigateTo(NavigationManager.Uri, forceLoad: true); - } - } - - diff --git a/DeepDrftWeb.Client/_Imports.razor b/DeepDrftWeb.Client/_Imports.razor index 95d93af..d762434 100644 --- a/DeepDrftWeb.Client/_Imports.razor +++ b/DeepDrftWeb.Client/_Imports.razor @@ -10,4 +10,5 @@ @using MudBlazor @using MudBlazor.Services @using MudBlazor.ThemeManager -@using DeepDrftWeb.Client.Common \ No newline at end of file +@using DeepDrftWeb.Client.Common +@layout DeepDrftWeb.Client.Layout.MainLayout \ No newline at end of file diff --git a/DeepDrftWeb/Components/App.razor b/DeepDrftWeb/Components/App.razor index 5d10bda..ed1a4e5 100644 --- a/DeepDrftWeb/Components/App.razor +++ b/DeepDrftWeb/Components/App.razor @@ -15,11 +15,11 @@ - + - +