Add source-aware inline image preview and explicit image export - #2
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
API contracts
POST /api/image-sourcesuploads and validates PNG, JPEG, BMP, or TIFF sourcesGET /api/image-sources/{source_id}/originalserves the original inlinePOST /api/image-sources/{source_id}/previewreturns a processed PNG inlinePOST /api/image-sources/{source_id}/exportcreates an explicit PNG outputGET /api/image-outputs/{output_id}serves an exported image inlineGET /api/image-outputs/{output_id}/downloaddownloads an exported imageSource and output identifiers are opaque. API responses do not expose local paths. Strict Recipe v1 validation rejects unknown or malformed fields, and image validation rejects mismatched formats, animated inputs, decompression-bomb risks, and oversized images.
UX and determinism
The source is uploaded once. Control changes trigger a 175 ms debounced preview request; superseded requests are aborted and revision checks prevent stale responses from replacing newer previews. The previous good preview stays visible while a replacement is generated. A stable seed is reused across previews and export, and export uses the same ordered Recipe v1 payload as preview. Only the explicit Export action creates an output and enables Download.
The responsive, keyboard-accessible comparison workspace supports side-by-side and stacked views from 320 px upward. Errors and status updates remain inline. The existing video panels and endpoints remain available.
Validation
Local validation completed before opening this draft:
python check.py: 123 tests passedgit diff --checkpassedGitHub Actions passed: quality in 29 seconds and browser in 1 minute 1 second.
Known limitations