From 0708f8279b024e76c5f768099854c34d296ffe8c Mon Sep 17 00:00:00 2001 From: Benoit Lacelle Date: Thu, 21 May 2026 20:52:06 +0400 Subject: [PATCH 1/4] Upgrade mermaid, slickgrid and vue-devtools --- CLAUDE.MD | 14 +++++--- pivotable/js/e2e-tests/_url.mjs | 15 ++++++++ .../localhost8080-column-chip.spec.js | 2 +- .../localhost8080-column-filter-reset.spec.js | 2 +- ...localhost8080-drillthrough-new-tab.spec.js | 2 +- ...calhost8080-drillthrough-out-of-dt.spec.js | 2 +- .../localhost8080-drillthrough.spec.js | 2 +- .../localhost8080-endpoint-schema.spec.js | 2 +- .../localhost8080-grid-autofit.spec.js | 2 +- .../localhost8080-grid-copy-name.spec.js | 2 +- ...localhost8080-grid-scrollable-mode.spec.js | 2 +- .../localhost8080-importmap-modes.spec.js | 2 +- .../localhost8080-login-modal-basic.spec.js | 2 +- .../localhost8080-measure-dag-modal.spec.js | 2 +- .../e2e-tests/localhost8080-queries.spec.js | 2 +- .../localhost8080-query-chatbot.spec.js | 2 +- ...calhost8080-query-favorite-persist.spec.js | 2 +- .../localhost8080-query-json-modal.spec.js | 2 +- ...calhost8080-query-plan-live-states.spec.js | 2 +- .../localhost8080-query-plan-live.spec.js | 2 +- ...host8080-query-reset-after-failure.spec.js | 2 +- ...8080-query-restore-last-successful.spec.js | 2 +- .../localhost8080-register-endpoint.spec.js | 2 +- ...calhost8080-relogin-restores-query.spec.js | 2 +- .../localhost8080-token-expiry.spec.js | 2 +- pivotable/js/e2e-tests/query-pivotable.mjs | 4 ++- pivotable/js/package-lock.json | 35 ++++++++++++------- pivotable/js/package.json | 4 +-- pivotable/js/playwright.config.mjs | 6 +++- pivotable/js/pom.xml | 16 +++++---- .../js/src/main/resources/static/index.html | 8 ++--- .../static/ui/importmap-cdn-min.json | 6 ++-- .../resources/static/ui/importmap-cdn.json | 6 ++-- .../static/ui/importmap-webjars-min.json | 6 ++-- .../static/ui/importmap-webjars.json | 6 ++-- .../index-html-default-mode.spec.js | 6 ++-- pivotable/js/vite.config.js | 6 ++-- 37 files changed, 111 insertions(+), 73 deletions(-) create mode 100644 pivotable/js/e2e-tests/_url.mjs diff --git a/CLAUDE.MD b/CLAUDE.MD index 5fefde3ce..dcd1e3375 100644 --- a/CLAUDE.MD +++ b/CLAUDE.MD @@ -158,19 +158,23 @@ New executor jobs are proposed monthly by the Discovery Agent (see `.claude/disc ## Updating a JS dependency (Pivotable SPA) -JavaScript libraries served to the SPA are wired through **three distinct layers** that MUST all be updated together. Renovate (or any manual bump) typically only touches the WebJar version in `pivotable/js/pom.xml`; the other layers do **not** auto-update and a partial update silently breaks one of the four loading modes (webjars / cdn × min / dev). Before declaring a JS-dep bump done, walk through every layer: +JavaScript libraries served to the SPA are wired through **FIVE distinct layers** that MUST all be updated together. Renovate (or any manual bump) typically only touches the WebJar version in `pivotable/js/pom.xml`; the other layers do **not** auto-update and a partial update silently breaks one of the four loading modes (webjars / cdn × min / dev). Before declaring a JS-dep bump done, walk through every layer: 1. **WebJar version (`pivotable/js/pom.xml`)** — the `` of the `org.webjars[.npm]:` dependency. This is what Spring Boot serves under `/webjars///...`. -2. **All four importmaps under `pivotable/js/src/main/resources/static/ui/`** — `importmap-webjars.json`, `importmap-webjars-min.json`, `importmap-cdn.json`, `importmap-cdn-min.json`. The version segment of every URL referencing the bumped library MUST match the pom.xml version. The unit test `unit-tests/index-html-default-mode.spec.js` (`cdn importmap mirrors the webjars importmap — same keys, same versions` and `min importmaps carry the same keys and versions as their full-build counterparts`) enforces alignment between the four files but does **not** check alignment with `pom.xml`. -3. **Direct ` diff --git a/pivotable/js/src/main/resources/static/ui/js/adhoc-preferences-modal.js b/pivotable/js/src/main/resources/static/ui/js/adhoc-preferences-modal.js index 3222079fc..4817d0899 100644 --- a/pivotable/js/src/main/resources/static/ui/js/adhoc-preferences-modal.js +++ b/pivotable/js/src/main/resources/static/ui/js/adhoc-preferences-modal.js @@ -27,6 +27,14 @@ export default { // Apply once at construction so a returning user sees their saved theme immediately. document.documentElement.setAttribute("data-bs-theme", theme.value); + // Vue devtools toggle. Persisted as a plain localStorage entry (not in the pinia + // preferences store) because the bootstrap script in `index.html` has to read it + // synchronously — before Vue itself is imported — to set `__VUE_PROD_DEVTOOLS__`. + // Reaching pinia from that early point would require the runtime to already be up, + // which is precisely what we're trying to influence. + const VUE_DEVTOOLS_KEY = "adhoc.vueDevtools"; + const vueDevtools = ref(localStorage.getItem(VUE_DEVTOOLS_KEY) === "true"); + const applyAssetFlags = function () { // Build a fresh query string from the current toggle state. We intentionally drop // any other existing params — today this modal owns the full set of flags, and @@ -49,7 +57,15 @@ export default { localStorage.setItem(BS_THEME_KEY, nextTheme); }; - return { useCdn, useDev, theme, currentResourceMode, applyAssetFlags, applyTheme }; + const applyVueDevtools = function () { + localStorage.setItem(VUE_DEVTOOLS_KEY, vueDevtools.value ? "true" : "false"); + // Reload so the bootstrap re-reads the flag before Vue's ESM module evaluates. + // `__VUE_PROD_DEVTOOLS__` is captured by Vue at import time; flipping it after + // is a no-op. + location.reload(); + }; + + return { useCdn, useDev, theme, vueDevtools, currentResourceMode, applyAssetFlags, applyTheme, applyVueDevtools }; }, template: /* HTML */ `