feat(ui): the recipe preview shows one sample and the last step at full strength - #811
Merged
Conversation
JArmandoAnaya
marked this pull request as draft
August 26, 2026 17:07
JArmandoAnaya
marked this pull request as ready for review
August 26, 2026 17:07
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
Decision (2026-08-26): the recipe editor's Preview step shows one sample asset rather than three, and its third column shows the last augmentation step chosen, applied deterministically at its declared strength, so a person can see what the transformation does; exports keep the seeded path unchanged.
What changed
feat(preprocessing): a showcase preview applies a step at its declared strengthPOST /projects/{id}/preprocessing-previewtakes a new body field,showcase: bool = False. With it true the variant's draws are fixed:hflipmirrors,rot90makes one quarter turn, brightness and contrast use the fullamount.PreprocessingRecipeService.preview(..., showcase=False)threads it intotransform_manifest(..., showcase=)for the geometry andtransformed_bytes(..., showcase=)for the pixels.Of the two shapes considered, the change spells the fixed draws as a sentinel seed rather than a
Drawsvalue.SHOWCASE_SEEDis an eight-byte constant invisionset.kernel.domain.preprocessing, and the two draw functions the drivers already call,brightness_contrast_factorsandrot90_quarter_turns, recognise it and answer the fixed draws. That keeps thePreprocessingDriverport signature and the Pillow driver untouched, and every existing determinism test passes without an edit; aDrawsvalue would have needed either a port change or the same sentinel underneath it to reach the driver. Avariant_seeddigest is always thirty-two bytes, so no export can produce the sentinel by accident, and the sentinel is only ever passed by the preview.openapi.jsonand the generated client are regenerated. The body model is not in the JSON-contract pairs (that test mirrors responses only) and stays green. Docs: the preview section and the determinism paragraph ofdocs/content/preprocessing.md, the route line indocs/content/api.md, and the driver-contract note indocs/content/architecture/backend/preprocessing-drivers.md.feat(ui): the recipe preview shows one sample and the last step at full strengthPreprocessingTabrenders one row: the first train-fold member of the newest release with a split, or the project's first asset. The third column requests a spec whose steps are the resize step, if any, followed by the last augmentation step in the draft, withvariants_per_asset: 1,variant: 1andshowcase: true; its heading names the step in the editor's own words (After horizontal flip, After brightness and contrast, After quarter turns). With no augmentation step it keeps the No augmentation placeholder and the generic heading. The second column is unchanged.usePreprocessingPreviewgains ashowcaseargument that is part of the query key and the body. The Preview step's aside reads 1 sample asset. Docs: the Pre-processing paragraph ofdocs/content/ui.md.Found, not fixed
useProjectAssets(projectId, 1)now asks for a page of one asset, so a project whose first asset is not previewable (a non-image encoding, refused asUNSUPPORTED_MEDIA) shows the refusal rather than moving to the next asset. The previous three-asset grid had the same behaviour per cell; a fallback to the next asset is a separate change.Test plan
Targeted checks run locally; CI is the exhaustive gate.