From 0b73bafa81160c1eef1a4b6cd34e22dd01df7d06 Mon Sep 17 00:00:00 2001 From: EiSiMo Date: Thu, 23 Apr 2026 12:53:15 +0200 Subject: [PATCH] debug(lightbox): trace IIFE init, partial-fetch contents, tile clicks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lightbox still not opening on the user's side after the style.display switch. Wire console.log() at every checkpoint so we can read off DevTools where the chain breaks: - partial fetch logs how many .flat-gallery-tile / a.flat-gallery-tile elements arrived and the first 200 chars of HTML — catches stale partial caches and template regressions. - IIFE init logs whether the overlay element and each child were found. - The delegated click handler logs every tile click, the gallery tile/url counts, and the open() call. A sibling branch logs clicks *inside* the gallery that don't match a tile (catches markup drift). - open() logs the final computed display value so we can tell whether CSS still hides the overlay after the style change. - A window.error listener catches any uncaught exception that would abort app.js before our IIFE registers its handlers. All log lines are prefixed `[lazyflat.lightbox]` and tagged `DEBUG(lightbox):` in source for easy removal once it's confirmed working. Co-Authored-By: Claude Opus 4.7 (1M context) --- web/static/app.js | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/web/static/app.js b/web/static/app.js index a17e554..5a3961b 100644 --- a/web/static/app.js +++ b/web/static/app.js @@ -90,6 +90,11 @@ document.addEventListener("click", (ev) => { .then((html) => { pane.innerHTML = html; pane.dataset.loaded = "1"; + // DEBUG(lightbox): confirm fetched partial actually contains