Merge branch 'main' into feat/post-location-override
Brings the branch up to user/main, which was ahead on both content and
theme fixes. Notably e17a5dc ("block submit on unfinished photo uploads;
un-squeeze EXIF portraits in lightbox") — the branch point predated it, and
its absence is why UG1, UG2 and LD1 failed here: the upload gate and the
oriented-derivative slide dims those specs assert simply were not on this
branch. Also picks up denmark-2026 `published: true`, so the local testing
flip is no longer needed.
js/src/post-form.js auto-merged cleanly, keeping both main's upload gate and
this branch's location-override panel + lazy maplibre CSS link. The only
conflict was js/post/post-form.js, a generated bundle — resolved by
rebuilding via make build-assets rather than hand-merging minified output.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -243,6 +243,38 @@ function initPhotoConversion() {
|
||||
}
|
||||
}, true);
|
||||
|
||||
// Complete upload gate (BUG 2026-07-09: fast create submit lost the photo).
|
||||
// The form plugin's own submit guard (filepond-handler.js) only blocks the
|
||||
// PROCESSING / PROCESSING_QUEUED states. A file still being read (LOADING —
|
||||
// the "too quick" click) or one whose upload FAILED (PROCESSING_ERROR)
|
||||
// slips through it and the entry is saved without the photo — silently,
|
||||
// because an errored thumbnail still satisfies the ≥1-photo count. Block
|
||||
// submit unless every FilePond item reached PROCESSING_COMPLETE, and say
|
||||
// which case blocked it.
|
||||
form.addEventListener('submit', function (e) {
|
||||
if (!orderPond) return;
|
||||
var files = orderPond.getFiles();
|
||||
if (!files.length) return; // the ≥1-photo rule is initValidation's job
|
||||
var statuses = (window.FilePond && window.FilePond.FileStatus) || {};
|
||||
var pending = 0;
|
||||
var failed = 0;
|
||||
files.forEach(function (f) {
|
||||
if (f.status === statuses.PROCESSING_COMPLETE) return;
|
||||
if (f.status === statuses.PROCESSING_ERROR || f.status === statuses.LOAD_ERROR) failed++;
|
||||
else pending++; // LOADING, INIT, IDLE, QUEUED, PROCESSING, …
|
||||
});
|
||||
if (!pending && !failed) return;
|
||||
e.preventDefault();
|
||||
if (collapse) collapse.details.open = true; // reveal the item states
|
||||
setStatus(failed
|
||||
? 'A photo failed to upload — remove it (tap its ✕) and re-add it before posting.'
|
||||
: 'Photos are still uploading — hang on a moment.', 'err');
|
||||
var el = photoStatusEl();
|
||||
if (el && typeof el.scrollIntoView === 'function') {
|
||||
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}, true);
|
||||
|
||||
// FilePond hook: reject a HEIC item, convert it to JPEG via the lazy heic-to
|
||||
// chunk (KTD4), then re-add the JPEG through pond.addFile() so FilePond
|
||||
// uploads and page-attaches it via its own (correct) contract.
|
||||
|
||||
Reference in New Issue
Block a user