Fix menu link click error and charts failing after the JSON editor #14
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-navlink-and-chart-loading"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two front-end fixes.
Menu link click error
Every click on a menu link threw
Cannot read properties of null (reading 'click').FluentNavMenuhadCustomToggle="true"(left over from the project template), which makes everyFluentNavLinkrundocument.getElementById('navmenu-toggle').click(), but the app has no such element. Removed it; the ☰ button is Fluent's own collapse button and is unaffected.Charts failing after the JSON editor
Opening Analyse (also Strom, Wasser) after the JSON editor without a full reload failed with
Cannot read properties of undefined (reading 'defaults')and terminated the circuit. Monaco's AMD loader leaves a globaldefine(); Chart.js and the treemap plugin are UMD bundles that then register as AMD modules instead of settingwindow.Chart.charts.jsnow hidesdefinewhile loading them (the same thing Plotly.Blazor's loader does), through one shared loading promise so concurrently created charts can't restore it wrongly. CLAUDE.md note added.Testing (Playwright/Chrome against a second app instance, real data, no saves)
dotnet test160 passed🤖 Generated with Claude Code
- NavMenu: drop CustomToggle="true" (left over from the project template). It made every nav link run document.getElementById('navmenu-toggle').click(), but there is no such element, so each click threw a TypeError. - charts.js: Monaco's AMD loader (JSON editor) leaves a global define() and pages switch without a full reload. Chart.js and the treemap plugin are UMD bundles that then register as AMD modules instead of setting window.Chart, so Analyse, Strom and Wasser failed with "Cannot read properties of undefined (reading 'defaults')" and the circuit was terminated. define is now hidden while they load, through one shared loading promise so concurrent charts can't restore it wrongly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>