fix(web): make album-folder import robust + add a folder picker

A real folder drag silently did nothing for a user (the logic is fine — a
simulated drop works — so a real drop was either erroring silently or not
firing). Harden it and give a guaranteed alternative:

- onDrop now captures the entries synchronously, wraps the async walk in
  try/catch, and TOASTS on any failure or empty result (no more silent no-op).
- dragEnter preventDefault + dragover dropEffect="copy" for reliable drop-target
  registration.
- New "Choose a folder" affordance (a webkitdirectory <input>) that sidesteps
  drag entirely — pick the album folder and it collects the files + prefills
  artist/album/year from the folder name. Plus "Choose files".

tsc + build clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan
2026-07-14 14:26:53 +02:00
parent 0a2a5cbdc4
commit a94ba97eee
2 changed files with 60 additions and 22 deletions
+2
View File
@@ -210,6 +210,8 @@ nav.contents .sep { flex: 1; }
font-family: var(--mono); font-size: 0.8rem; color: var(--graphite); margin-bottom: 8px;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--accent); }
.import-picks { text-align: center; font-size: 0.78rem; color: var(--graphite); margin: 6px 0 10px; }
.import-picks .linkish { font-size: inherit; }
/* ── Phase 2: page headers, list rows, tools ──────────── */
.page-head { margin: 6px 0 26px; }