Shared image module for step and cover images (#30) #36
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MassiveDynamic/kataba!36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/30-shared-image-module"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #30.
Moves the code step and cover images share out of
src/stepImages/intosrc/images/, and removes the duplication between the two kinds. No behaviour change.files,storage,processImage,crop,cropForm,upload,href,accessandCropDialognow live insrc/images/. The shared upload rules moved tosrc/images/rules.ts;src/stepImages/stepImage.tskeeps onlyMAX_STEP_IMAGES.recropImageinsrc/images/recrop.tsreads the crop, reads the original, renders the variants, calls a swap callback, then deletes the losing image's variants.recropStepImageandrecropCoverImageonly supply their locked row swap and their error messages.src/images/storedCrop.ts(cropColumns,croppedImage) replacescropFields, the edit page's owncroppedImage/StoredImageand the inline field lists in the re-crop actions.callis nowcallServerandrunis nowchangeImages.FILE_HINT/UPLOAD_HINTwere already removed by the translation work in #3.submittedCropmoved next tocropForm, andremovingOnFailureintofiles, so the shared flow doesn't depend on the request-bound i18n.Not touched (out of scope in the issue): the empty
variants/<id>/directories left behind after deleting variants, andcoverTileImagealways declaring 960w.Testing
recropImage(real sharp, temp-dir storage, fake swap: success, image gone, failed swap, missing original, unreadable crop) and forstoredCrop.🤖 Generated with Claude Code