feat(files): delete files-overlay.js stub + its script tag

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>
This commit is contained in:
mwiegand 2026-05-17 16:22:12 +02:00
parent 10f93b863b
commit ddf03c6fb8
No known key found for this signature in database
2 changed files with 0 additions and 20 deletions

View file

@ -1,19 +0,0 @@
// files-overlay.js — empty stub pending deletion in Step 10 of
// docs/superpowers/plans/2026-05-17-files-overlay-rewrite.md.
//
// All behavior migrated in Phase A:
// * Helpers + manager-element detection + action-dispatch registry
// → static/js/files-overlay/core.js (Step 1)
// * Editor flows (legacy inline dialog + URL-addressable modal)
// → static/js/files-overlay/editor.js (Step 2)
// * Dialogs (new-folder, delete-confirm, conflict)
// → static/js/files-overlay/dialogs.js (Step 3)
// * Uploads (queue + progress) + drag-drop + withCollisionSuffix +
// "zip" action handler
// → static/js/files-overlay/uploads.js (Step 4)
//
// The four modules attach independently when .files-manager exists
// (each does its own document.querySelector check). This file is kept
// for the duration of Phase A so that <script src=".../files-overlay.js">
// in overlay_detail.html stays load-bearing during the transition; Step
// 10 deletes both the file and the script tag.

View file

@ -224,6 +224,5 @@
<script src="{{ url_for('static', filename='js/files-overlay/editor.js') }}" defer></script> <script src="{{ url_for('static', filename='js/files-overlay/editor.js') }}" defer></script>
<script src="{{ url_for('static', filename='js/files-overlay/dialogs.js') }}" defer></script> <script src="{{ url_for('static', filename='js/files-overlay/dialogs.js') }}" defer></script>
<script src="{{ url_for('static', filename='js/files-overlay/uploads.js') }}" defer></script> <script src="{{ url_for('static', filename='js/files-overlay/uploads.js') }}" defer></script>
<script src="{{ url_for('static', filename='js/files-overlay.js') }}" defer></script>
{% endif %} {% endif %}
{% endblock %} {% endblock %}