diff --git a/Device/MainRazor.razor b/Device/MainRazor.razor index c434d39..e37959b 100644 --- a/Device/MainRazor.razor +++ b/Device/MainRazor.razor @@ -2,4 +2,21 @@ - + + + + + + + Not found + +

Sorry, there's nothing at this address.

+
+
+
+ + + + + + diff --git a/Device/_Imports.razor b/Device/_Imports.razor index aeaf0e9..b72aa7b 100644 --- a/Device/_Imports.razor +++ b/Device/_Imports.razor @@ -8,6 +8,19 @@ @using IGP.Pages @using IGP.Pages.Home @using IGP.Pages.Home.Parts +@using IGP.Dialog +@using IGP.Pages.BuildCalculator +@using IGP.Pages.BuildCalculator.Parts +@using IGP.Pages.Database.Entity +@using IGP.Pages.Database.Entity.Parts +@using IGP.Pages.Database.Parts +@using IGP.Pages.EconomyComparison +@using IGP.Pages.EconomyComparison.Parts +@using IGP.Pages.MemoryTester.Parts +@using IGP.Pages.Notes +@using IGP.Pages.Notes.Parts +@using IGP.Portals +@using IGP.Utils @using Components.Display @using Components.Feedback diff --git a/Web/Dialog/ConfirmationDialogComponent.razor b/Pages/Dialog/ConfirmationDialogComponent.razor similarity index 100% rename from Web/Dialog/ConfirmationDialogComponent.razor rename to Pages/Dialog/ConfirmationDialogComponent.razor diff --git a/Web/Dialog/EntityDialogComponent.razor b/Pages/Dialog/EntityDialogComponent.razor similarity index 100% rename from Web/Dialog/EntityDialogComponent.razor rename to Pages/Dialog/EntityDialogComponent.razor diff --git a/Web/Dialog/GlossaryDialogComponent.razor b/Pages/Dialog/GlossaryDialogComponent.razor similarity index 100% rename from Web/Dialog/GlossaryDialogComponent.razor rename to Pages/Dialog/GlossaryDialogComponent.razor diff --git a/Web/Dialog/SearchDialogComponent.razor b/Pages/Dialog/SearchDialogComponent.razor similarity index 100% rename from Web/Dialog/SearchDialogComponent.razor rename to Pages/Dialog/SearchDialogComponent.razor diff --git a/Pages/Pages/Home/HomePage.razor b/Pages/Pages/Home/HomePage.razor index df1a64c..db4b189 100644 --- a/Pages/Pages/Home/HomePage.razor +++ b/Pages/Pages/Home/HomePage.razor @@ -1,6 +1,7 @@ @inherits BasePage +@page "/" @page "/immortal-home" diff --git a/Web/Portals/ConfirmationDialogPortal.razor b/Pages/Portals/ConfirmationDialogPortal.razor similarity index 100% rename from Web/Portals/ConfirmationDialogPortal.razor rename to Pages/Portals/ConfirmationDialogPortal.razor diff --git a/Web/Portals/EntityDialogPortal.razor b/Pages/Portals/EntityDialogPortal.razor similarity index 100% rename from Web/Portals/EntityDialogPortal.razor rename to Pages/Portals/EntityDialogPortal.razor diff --git a/Web/Portals/GlossaryDialogPortal.razor b/Pages/Portals/GlossaryDialogPortal.razor similarity index 100% rename from Web/Portals/GlossaryDialogPortal.razor rename to Pages/Portals/GlossaryDialogPortal.razor diff --git a/Web/Portals/SearchPortal.razor b/Pages/Portals/SearchPortal.razor similarity index 100% rename from Web/Portals/SearchPortal.razor rename to Pages/Portals/SearchPortal.razor diff --git a/Web/Portals/ToastPortal.razor b/Pages/Portals/ToastPortal.razor similarity index 100% rename from Web/Portals/ToastPortal.razor rename to Pages/Portals/ToastPortal.razor diff --git a/Pages/_Imports.razor b/Pages/_Imports.razor index 860c0b0..8e17e8a 100644 --- a/Pages/_Imports.razor +++ b/Pages/_Imports.razor @@ -53,4 +53,6 @@ @using IGP.Pages.MemoryTester.Parts @using IGP.Pages.Notes @using IGP.Pages.Notes.Parts +@using IGP.Dialog +@using IGP.Portals @using IGP.Utils diff --git a/Web/Index.razor b/Web/Index.razor deleted file mode 100644 index 891cd80..0000000 --- a/Web/Index.razor +++ /dev/null @@ -1,5 +0,0 @@ -@page "/" - -@layout PageLayout - - \ No newline at end of file diff --git a/docs/.obsidian/workspace.json b/docs/.obsidian/workspace.json index e469f30..70ff36a 100644 --- a/docs/.obsidian/workspace.json +++ b/docs/.obsidian/workspace.json @@ -42,30 +42,16 @@ "state": { "type": "markdown", "state": { - "file": "Helper Tutorial Info Improvements.md", + "file": "Device MAUI Pages Setup.md", "mode": "source", "source": false }, "icon": "lucide-file", - "title": "Helper Tutorial Info Improvements" - } - }, - { - "id": "b98a69cefb529fc8", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "Feature Proposals.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "Feature Proposals" + "title": "Device MAUI Pages Setup" } } ], - "currentTab": 3 + "currentTab": 2 } ], "direction": "vertical" @@ -237,8 +223,11 @@ "bases:Create new base": false } }, - "active": "b98a69cefb529fc8", + "active": "68e1ba2b54081b9a", "lastOpenFiles": [ + "Build Calculator CmdLine.md", + "Device MAUI Pages Setup.md", + "Feature Proposals.md", "_Tasks Kanban.base", "Tasks/Worker Income UI and Tests.md", "Tasks/Update the Reference Tables with Telerik.md", @@ -263,8 +252,6 @@ "Tasks/Get AI to Add easy Test Tasks.md", "Tasks/Helper Tutorial Info Improvements.md", "Tasks/Fix Entity Recursion Error - Parent.md", - "Tasks/Fully Test the Build Calculator.md", - "Tasks/Ensure build order gets greyed out past the attack time. Clicking the cancel button will wipe the entire greyed out timeline..md", "Tasks", "Images/Pasted image 20260601093510.png", "Images/Pasted image 20260601083333.png", diff --git a/docs/Device MAUI Pages Setup.md b/docs/Device MAUI Pages Setup.md new file mode 100644 index 0000000..833ee69 --- /dev/null +++ b/docs/Device MAUI Pages Setup.md @@ -0,0 +1,84 @@ +# Device MAUI Pages Setup + +Changes needed to get all shared pages rendering in the Device (MAUI Blazor) project. + +## How pages render + +`MainRazor.razor` has a `Router` pointing at the Pages assembly. When the URL matches a `@page` directive (e.g. `/database`), the Router renders that page component with `MainLayout`. All component references resolve from the Components or Pages project. All DI services are already registered in `MauiProgram.cs`. + +Only two things block pages from rendering currently: + +## 1. No route for `/` + +The MAUI app starts at `/`, but `HomePage` only has `@page "/immortal-home"`. Nothing matches → NotFound. + +**Fix:** Add `@page "/"` to `Pages/Pages/Home/HomePage.razor`: + +```razor +@page "/" +@page "/immortal-home" +``` + +Then remove `Web/Index.razor` — its `@page "/"` wrapper is redundant since the Pages project now provides the route directly, and `App.razor` already uses `PageLayout` as the default layout. + +## 2. Move dialog portals from Web to Pages + +Pages like `BuildCalculatorPage` and `DatabasePage` trigger dialogs via `IEntityDialogService` etc. The portal components that render the dialog UI (`EntityDialogPortal`, `GlossaryDialogPortal`, `ToastPortal`, `SearchPortal`, `ConfirmationDialogPortal`) live in `Web/Portals/`. The dialog components themselves live in `Web/Dialog/`. + +Since the Device project can't reference the Web project, these need to be moved into the Pages project so both Web and Device can use them: + +- `Web/Portals/*` → `Pages/Portals/` +- `Web/Dialog/*` → `Pages/Dialog/` + +Then add them to `Device/MainRazor.razor`: + +```razor + + + + + + + + + + + + ... + +``` + +And add the same portal rendering to `Web/App.razor` (already present, but the types now come from Pages instead of Web). + +## 3. Add storage loading gate (optional) + +The Web project's `App.razor` gates rendering behind `isLoaded` (waits for `IStorageService.Load()`). Some pages may depend on stored data. Add to `MainRazor.razor`: + +```razor +@inject IStorageService StorageService + +@if (isLoaded) +{ + + ... + +} + +@code { + private bool isLoaded; + + protected override async Task OnInitializedAsync() + { + await StorageService.Load(); + isLoaded = true; + } +} +``` + +## 4. Static assets + +Images referenced by pages (e.g. `image/hero/Build.png`) are served from `wwwroot/`. These are already copied from `Web/wwwroot/image/hero/` to `Device/wwwroot/image/hero/`. Check for additional asset references as more pages are used. + +## 5. HttpClient base address + +`MauiProgram.cs` line 73 sets `BaseAddress = new Uri("https://0.0.0.0")`. Won't resolve real API calls (e.g. markdown content loading). Needs a valid API URL for the MAUI environment.