From cde16d2d0f14af51833dc0c692ea9172bf575ab1 Mon Sep 17 00:00:00 2001 From: Claudio Schaad Date: Fri, 30 Oct 2026 21:21:10 +0000 Subject: [PATCH] Fix menu link click error and charts failing after the JSON editor (#14) Co-authored-by: Claudio Schaad Co-committed-by: Claudio Schaad --- CLAUDE.md | 2 +- .../Components/Layout/NavMenu.razor | 2 +- Schaad.Accounting.UI/wwwroot/js/charts.js | 49 ++++++++++++------- 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 19e00f5..98801b5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -77,7 +77,7 @@ Pages live in `Schaad.Accounting.UI/Components/Pages/`. Each page typically has - `Microsoft.FluentUI.AspNetCore.Components` — UI components (FluentDataGrid, FluentDialog, etc.) - `Plotly.Blazor` — charts on the older chart pages - `BlazorMonaco` — Monaco editor for the JSON editor page; loaded on demand by `wwwroot/js/monaco.js` instead of script tags in `App.razor`. Pages are interactive one by one, so `NavigationManager.NavigateTo` and menu links run enhanced navigation, which syncs `` (removing Monaco's styles; `monaco.js` puts them back) and re-renders the page on the server. The editor therefore switches files in place and only rewrites the URL (`wwwroot/js/url.js`) -- Chart.js 4 + `chartjs-chart-treemap` — charts on the Analyse page; vendored in `wwwroot/lib/` (no CDN), wrapped by `wwwroot/js/charts.js` and `ChartJsChart.razor` +- Chart.js 4 + `chartjs-chart-treemap` — charts on the Analyse page; vendored in `wwwroot/lib/` (no CDN), wrapped by `wwwroot/js/charts.js` and `ChartJsChart.razor`; `charts.js` hides Monaco's global AMD `define` while loading them, otherwise the UMD bundles register as AMD modules and `window.Chart` stays undefined after visiting the JSON editor - `FreeSpire.PDF` — PDF parsing for bank statement imports - `Schaad.Finance.dll` / `Schaad.Finance.Api.dll` — proprietary DLLs for MT940/CAMT053 parsing and FX rate lookups (FixerIo API key in `appsettings.Development.json`) diff --git a/Schaad.Accounting.UI/Components/Layout/NavMenu.razor b/Schaad.Accounting.UI/Components/Layout/NavMenu.razor index 8d099d5..ebfb65d 100644 --- a/Schaad.Accounting.UI/Components/Layout/NavMenu.razor +++ b/Schaad.Accounting.UI/Components/Layout/NavMenu.razor @@ -5,7 +5,7 @@