Agent code and restructuring

This commit is contained in:
2026-06-04 11:05:21 -04:00
parent 0feac0f0a0
commit 7310e4ed71
134 changed files with 3074 additions and 895 deletions
+12 -40
View File
@@ -28,44 +28,16 @@
"state": {
"type": "markdown",
"state": {
"file": "Helper Tutorial Info Improvements.md",
"file": "Tasks/Update the Reference Tables with Telerik.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Helper Tutorial Info Improvements"
}
},
{
"id": "68e1ba2b54081b9a",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Helper Tutorial Info Improvements.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": "Update the Reference Tables with Telerik"
}
}
],
"currentTab": 3
"currentTab": 1
}
],
"direction": "vertical"
@@ -122,7 +94,7 @@
}
],
"direction": "horizontal",
"width": 508.5
"width": 321.5
},
"right": {
"id": "dd7c1dc4bd54d927",
@@ -215,8 +187,8 @@
"state": {
"type": "calendar",
"state": {},
"icon": "calendar-with-checkmark",
"title": "Calendar"
"icon": "lucide-ghost",
"title": "calendar"
}
}
]
@@ -237,9 +209,14 @@
"bases:Create new base": false
}
},
"active": "b98a69cefb529fc8",
"active": "094e8bbc34e4a833",
"lastOpenFiles": [
"_Tasks Kanban.base",
"Cooldown Practice Tool.md",
"cooldown-button.md",
"Build Calculator CmdLine.md",
"Device MAUI Pages Setup.md",
"Feature Proposals.md",
"Tasks/Worker Income UI and Tests.md",
"Tasks/Update the Reference Tables with Telerik.md",
"Tasks/WebAssembly back to Azure.md",
@@ -260,11 +237,6 @@
"Tasks/Input building delay should have an effect on when a building is built. Tests against 0, 2, 4, 60.md",
"Tasks/Hotkey Tests.md",
"Tasks/Highest Alloy and Ether Tests.md",
"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",
+66
View File
@@ -0,0 +1,66 @@
---
type: Task
status: Working On
---
Tool to practice using Pyre spells and unit spells.
We are not going to reuse the already made hotkey UI because the buttons for this tool will have more complicated UI and logic.
D key for unit abilities.
V key for immortal abilities.
For example, Pillar of Heaven costs 150 Pyre and has a cooldown of 120 seconds. So one could use it every 2 minutes.
The Hotkey is R.
Perhaps one would want to do that, then click Deploy on Absolvers.
I am not sure what this accomplished from a tool perspective, besides training basic muscle memory.
So we are going to need filters for picking faction and immortal again.
If Q'Rath is selected with Orzum, the list of abilities are:
Standard
- Mobilize Q'Rath
- Smite
- Awestrike
- Windstep
- Deploy Magi
- Deploy Absolver
With Space
- Tithe Blades
- Ordained Passage
- Deploy Sentinel
- Radiant Ward
Immortal
- Summon Citadel
- Empire Unbroken
- Rook of Ira
- Pillars of the Heavens
Some of this abilities act differently.
Smite, Awestrike work on one unit at a time.
I am pretty sure Mobilize Q'Rath, Windstep, Deploy Magi, and Deploy Absolver will affect all units selected.
So I need to add the ability press selection activity for Single or Group.
Using these abilities need to depleted individual mana pools or the pyre pool.
I'll need toggles for regeneration on Pyre and Mana.
I'll also need button to fill all Pyre and Mana, refresh all abilities, or depleted all pools.
+84
View File
@@ -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
<MudThemeProvider IsDarkMode="true"/>
<MudDialogProvider/>
<MudSnackbarProvider/>
<EntityDialogPortal/>
<GlossaryDialogPortal/>
<ToastPortal/>
<SearchPortal/>
<ConfirmationDialogPortal/>
<Router AppAssembly="@typeof(IGP.Pages.Home.HomePage).Assembly">
...
</Router>
```
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)
{
<Router ...>
...
</Router>
}
@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.
@@ -1,4 +1,4 @@
---
type: Task
status: Backlog
status: Working On
---
+2 -16
View File
@@ -55,22 +55,8 @@ views:
- More Wait Tests.md
- Timeline Tests.md
Working On:
- Changing Factions and Immortal should clear out build.md
- Helper Tutorial Info Improvements.md
- Highest Alloy and Ether Tests.md
Backlog:
- Fully Test the Build Calculator.md
- Add an Ability to Favourite Data.md
- Plan Calculator.md
- Basic Build Order Sheet.md
- Update the Reference Tables with Telerik.md
- Make Examples be based on Database Information.md
- Allow to Always see Advanced Options in Calculator without pressing Space.md
- Remove Items from anywhere in the build calc timeline.md
- Spells are currently a production item in data. Make the a ability item so they don't show under production table.md
- WebAssembly back to Azure.md
- Change Ctrl + K Hotkey to something that doesn't conflict with Edge or other browsers.md
- Language Support.md
- Tasks/Update the Reference Tables with Telerik.md
Backlog: []
AI Agent Work:
- Top Borders in Calculator should change based on Selected Faction and Immortal.md
Blocked Backlog:
+111
View File
@@ -0,0 +1,111 @@
# Cooldown Button Component
A square Blazor button with a 12-second cooldown animation: when clicked, the button greys out and a circular transparency wedge dials open clockwise, progressively revealing the normal button state underneath.
---
## Visual Design
The button has two visual states:
**Idle state** A solid square button with the project's standard `--paper` background and `--primary` border. Hover inverts or brightens the paper. Click triggers a brief scale-down.
**Cooldown state** The native button fades to `opacity: 0` while an absolutely-positioned overlay covers it. The overlay uses a `conic-gradient` CSS mask to create a "dialling open" effect. A number in the centre shows the remaining seconds.
---
## Core Technique: Conic-Gradient Mask
The cooldown reveal is accomplished with a **conic-gradient mask** applied to the overlay `<div>`:
```
mask-image: conic-gradient(
transparent 0deg,
transparent {angle}deg,
#000 {angle}deg,
#000 360deg
);
```
- **`transparent`** lets the button underneath show through (revealed area)
- **`#000` (black)** fully masks the overlay, making it visible (greyed-out area)
At `angle = 0deg`, transparent covers nothing and the mask is entirely black → the overlay is fully opaque (button completely greyed out).
At `angle = 360deg`, transparent covers the full circle and black covers nothing → the overlay is fully transparent (button completely visible).
The angle animates linearly from 0 to 360 over the cooldown duration. Because `conic-gradient` starts at the 12 o'clock position and sweeps clockwise, the reveal begins at the top of the button and rotates around, like a clock hand or a dial opening.
---
## Implementation Architecture
### Component Parameters
| Parameter | Type | Default | Description |
|------------------|-------------------|---------|------------------------------------|
| `ChildContent` | `RenderFragment` | `null` | Text or content inside the button |
| `OnClick` | `EventCallback` | — | Fired when the button is clicked |
| `CooldownSeconds`| `int` | `12` | Duration of the cooldown in seconds|
| `Size` | `int` | `120` | Width and height in pixels (square)|
### Timer Loop
A `System.Timers.Timer` fires every ~33ms (≈30fps) during the cooldown:
```
OnTick:
elapsed = UtcNow - startTime
if elapsed >= CooldownSeconds → end cooldown, dispose timer
_elapsedAngle = (elapsed / CooldownSeconds) * 360
_remainingSeconds = CooldownSeconds - (int)elapsed
InvokeAsync(StateHasChanged)
```
On each tick, `_elapsedAngle` is written into the overlay's inline `style` attribute, causing Blazor to re-render the `mask-image`. The timer is disposed in `Dispose()` to prevent leaks.
### Disposal
The component implements `IDisposable` to clean up the timer when the component is removed from the render tree. This follows the same pattern used by `SearchDialogComponent` and `BuildChartComponent` elsewhere in the codebase.
---
## CSS Masking Details
Two vendor-prefixed properties are set to ensure cross-browser support:
```
mask-image: conic-gradient(...);
-webkit-mask-image: conic-gradient(...);
```
The overlay uses `pointer-events: none` and `user-select: none` so that interaction passes through to the button underneath (which is disabled and transparent).
An `rgba(22, 22, 24, 0.82)` semi-transparent background on the overlay produces the greyed-out appearance. The mask controls *where* this background is visible.
---
## Usage on the Home Page
The component is added to `Pages/Pages/Home/HomePage.razor` inside the first `PaperComponent`:
```razor
<CooldownButtonComponent CooldownSeconds="12"
Size="120"
OnClick="OnCooldownClick">
Click Me
</CooldownButtonComponent>
```
The `OnCooldownClick` handler in the page's `@code` block currently returns `Task.CompletedTask` (a no-op). This is the extension point where real work (e.g. triggering a game action, calling an API, showing a toast) would go.
---
## Adapting the Component
- **Change cooldown duration** set `CooldownSeconds` to any positive integer.
- **Change button size** set `Size` to any pixel dimension (button remains square).
- **Custom content** pass any Blazor markup as `ChildContent` (text, icons, spinners).
- **Handle the click** attach a handler to `OnClick` that returns `Task` or `void`.
The `--cooldown-size` CSS custom property is set inline on the wrapper so that the label, overlay, and button all scale together.