From 2ab54a3800fc85104d823d06d03da13e7c8efc29 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Fri, 8 May 2026 20:23:04 +0200 Subject: [PATCH] =?UTF-8?q?fix(l4d2-web):=20file=20tree=20fetches=20in=20p?= =?UTF-8?q?lain=20JS=20=E2=80=94=20vendored=20htmx=20is=20a=20stub?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The vendored static/vendor/htmx.min.js turned out to be a 33-byte placeholder, so the hx-get/hx-target/hx-trigger attributes on the overlay file tree's folder buttons were inert: clicks rotated the chevron (own JS) but never fetched. Switch the lazy-load to a ~30-line plain-JS handler in static/js/file-tree.js that fetches button.dataset.filesUrl on first expand and dedupes via dataset.loaded. Update the spec/plan to match. Route + partial contracts unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../plans/2026-05-08-overlay-file-tree.md | 6 +-- .../2026-05-08-overlay-file-tree-design.md | 16 ++++---- l4d2web/static/js/file-tree.js | 41 +++++++++++++++---- l4d2web/templates/_overlay_file_node.html | 5 +-- 4 files changed, 44 insertions(+), 24 deletions(-) diff --git a/docs/superpowers/plans/2026-05-08-overlay-file-tree.md b/docs/superpowers/plans/2026-05-08-overlay-file-tree.md index f56561d..158e71f 100644 --- a/docs/superpowers/plans/2026-05-08-overlay-file-tree.md +++ b/docs/superpowers/plans/2026-05-08-overlay-file-tree.md @@ -15,7 +15,7 @@ See the design doc for rationale. Implementation-relevant summary: - New blueprint `files_bp` registered in `l4d2web/app.py` next to `overlay_bp`. - Path resolution chains through `l4d2host.paths.overlay_path()` (already validates the overlay ref + resolves under `LEFT4ME_ROOT/overlays/`) and `l4d2web.services.security.validate_overlay_ref` (rejects empty/`.`/`..`/absolute/whitespace/backslash for the sub-path component). - Listing rule: target must be a descendant of `overlay_root` after `Path.resolve()`. Download rule: real path must be a descendant of `LEFT4ME_ROOT` after `os.path.realpath()`. -- Tree shape: single recursive partial. `_overlay_file_tree.html` renders `