fix(post-form): convert HEIC via FilePond beforeAddFile, not a custom uploader (U4)
Runtime verification showed the custom picker uploaded to Grav's flash but never attached photos to the entry — attachment needs FilePond's exact (undocumented) submit contract. Reverting to type:filepond and hooking its beforeAddFile: a HEIC item is rejected, converted to JPEG via the lazy heic-to chunk, then re-added with pond.addFile() so FilePond owns upload + page-attach (the proven path). Web-format photos pass through; conversion failures fail closed (inline status, original never added). Removes the custom photos field template + AJAX uploader. Verified end-to-end in a browser: HEIC posts as JPEG, corrupt HEIC is skipped, Submit gated while converting, draft photos-reselect hint intact. Refs R8, R9, R16, R17, AE1, AE4, KTD4.
This commit is contained in:
@@ -20,71 +20,22 @@
|
||||
min-height: 180px;
|
||||
}
|
||||
|
||||
/* ── Photo picker (U4) — functional states; Field Notes polish in U5 ── */
|
||||
.photo-picker__list {
|
||||
list-style: none;
|
||||
margin: 0.5rem 0 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
/* ── Photo HEIC-conversion feedback (U4) ────────────────────
|
||||
* FilePond renders the thumbnails/progress; these are the pre-FilePond
|
||||
* "converting…" status line and the draft photos-reselect hint (U6).
|
||||
*/
|
||||
.photo-convert-status:empty { display: none; }
|
||||
.photo-convert-status {
|
||||
font-size: var(--text-sm);
|
||||
margin-top: var(--space-2);
|
||||
}
|
||||
.photo-card {
|
||||
position: relative;
|
||||
width: 84px;
|
||||
height: 84px;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.06);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.photo-card__thumb {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
.photo-card__state {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 2px 4px;
|
||||
font-size: 0.7rem;
|
||||
line-height: 1.2;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
}
|
||||
.photo-card.is-done .photo-card__state { background: rgba(31, 107, 90, 0.85); }
|
||||
.photo-card.is-error {
|
||||
background: rgba(176, 0, 32, 0.12);
|
||||
outline: 2px solid rgba(176, 0, 32, 0.5);
|
||||
}
|
||||
.photo-card.is-error .photo-card__state { background: rgba(176, 0, 32, 0.85); }
|
||||
.photo-card.is-converting .photo-card__thumb { opacity: 0.4; }
|
||||
|
||||
/* Photo picker add button + hint (U5 polish) */
|
||||
.photo-picker__add {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
cursor: pointer;
|
||||
}
|
||||
.photo-picker.is-busy .photo-picker__add {
|
||||
opacity: 0.6;
|
||||
pointer-events: none;
|
||||
}
|
||||
.photo-picker__hint:empty { display: none; }
|
||||
.photo-picker__reauth-hint {
|
||||
.photo-reauth-hint {
|
||||
display: none;
|
||||
font-size: var(--text-sm);
|
||||
color: var(--color-ink-muted);
|
||||
margin-top: var(--space-2);
|
||||
}
|
||||
.photo-picker__reauth-hint.is-shown { display: block; }
|
||||
.photo-reauth-hint.is-shown { display: block; }
|
||||
|
||||
/* ── Field Notes styling for the new controls (U5, R11/R12) ── */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user