Step 10/12 of docs/superpowers/plans/2026-05-17-files-overlay-rewrite.md.
End of Phase B.
The 19-line tombstone file at static/js/files-overlay.js had no code
since Step 4; it was kept around as a stable resolution target for the
<script> tag while the modules de-duplicated. After Step 9 made the
modules complete and stand-alone, the stub is just a wasted HTTP
request and a misleading filename in the manifest. Deleted, plus the
matching <script defer> tag in overlay_detail.html.
Final loader shape — exactly 4 script tags, all defer, all in
files-overlay/:
1. core.js — helpers, manager guard, action registry
2. editor.js — URL-addressable editor (text + binary + new-file)
3. dialogs.js — new-folder + delete-confirm + conflict
4. uploads.js — upload queue + drag-drop + zip action
Verified live on /overlays/2 in Chromium:
* Exactly 4 files-overlay script tags load (no more files-overlay.js)
* window.__filesOverlay registry has its 10 keys; askConflict +
withCollisionSuffix + handleAction + registerHandler all functions
* File tree renders (3 file rows + 1 folder row, as before)
* No legacy #files-editor-modal in DOM
* No console errors
* pytest still 580 passed, 1 skipped, 3 deselected
Phase B end-state vs. Phase A end-state:
* editor.js: 550 → 309 lines (Step 9 gutted legacy)
* files-overlay.js: 19 → 0 (deleted in this step)
* 5 new pytest tests for the /files/new + binary template
* Legacy <dialog id="files-editor-modal"> gone from
overlay_detail.html
* Editor flows (text edit, binary replace, create new) all run
through the URL-addressable modal (?modal= deep-linkable)
Phase C (steps 11–12) is server-only: extract a shared path-resolution
helper between overlay_file_content + overlay_file_edit_page, then
delete /files/content if grep confirms no remaining callers.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| alembic | ||
| l4d2web | ||
| scripts | ||
| tests | ||
| alembic.ini | ||
| pyproject.toml | ||
| README.md | ||
l4d2-web-app
Flask web app for managing L4D2 servers through user-private blueprints.
Key v1 behaviors
- Local username/password login; no public signup
- Admin-managed overlay catalog
- Private blueprints per user
- Server creation from blueprints (live-linked; no per-server blueprint overrides)
- Async job model with persisted command logs in
job_logs - Desired vs actual state model
- Live logs for jobs and servers via SSE endpoints
- Host operations go through
l4d2ctlvia a local host command runner, not directl4d2hostimports
Frontend constraints
- Server-rendered templates (Jinja)
- Vendored HTMX (
static/vendor/htmx.min.js) - Custom CSS only
- Tokenized, consistent link and accent colors
Development
From the workspace root (../):
uv sync # creates .venv, installs l4d2host + l4d2web editable, plus dev deps
uv run pytest l4d2web/tests -q
Configuration
The web app reads these settings from the environment:
DATABASE_URL: SQLAlchemy database URL, for examplesqlite:////var/lib/left4me/left4me.db.SECRET_KEY: Flask secret key used for sessions and CSRF-sensitive state.JOB_WORKER_THREADS: number of background job worker threads.
In the systemd deployment, environment is loaded from /etc/left4me/host.env and /etc/left4me/web.env.
Admin Bootstrap
Create the first admin account with the Flask CLI. Provide the password through LEFT4ME_ADMIN_PASSWORD:
LEFT4ME_ADMIN_PASSWORD='change-me' flask create-user <username> --admin