Skip to content

feat(ui): the recipe preview shows one sample and the last step at full strength - #811

Merged
JArmandoAnaya merged 2 commits into
mainfrom
feat/preview-showcase
Aug 27, 2026
Merged

feat(ui): the recipe preview shows one sample and the last step at full strength#811
JArmandoAnaya merged 2 commits into
mainfrom
feat/preview-showcase

Conversation

@JArmandoAnaya

Copy link
Copy Markdown
Contributor

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 strength

POST /projects/{id}/preprocessing-preview takes a new body field, showcase: bool = False. With it true the variant's draws are fixed: hflip mirrors, rot90 makes one quarter turn, brightness and contrast use the full amount. PreprocessingRecipeService.preview(..., showcase=False) threads it into transform_manifest(..., showcase=) for the geometry and transformed_bytes(..., showcase=) for the pixels.

Of the two shapes considered, the change spells the fixed draws as a sentinel seed rather than a Draws value. SHOWCASE_SEED is an eight-byte constant in visionset.kernel.domain.preprocessing, and the two draw functions the drivers already call, brightness_contrast_factors and rot90_quarter_turns, recognise it and answer the fixed draws. That keeps the PreprocessingDriver port signature and the Pillow driver untouched, and every existing determinism test passes without an edit; a Draws value would have needed either a port change or the same sentinel underneath it to reach the driver. A variant_seed digest 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.json and 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 of docs/content/preprocessing.md, the route line in docs/content/api.md, and the driver-contract note in docs/content/architecture/backend/preprocessing-drivers.md.

feat(ui): the recipe preview shows one sample and the last step at full strength

PreprocessingTab renders 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, with variants_per_asset: 1, variant: 1 and showcase: 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. usePreprocessingPreview gains a showcase argument that is part of the query key and the body. The Preview step's aside reads 1 sample asset. Docs: the Pre-processing paragraph of docs/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 as UNSUPPORTED_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.

uv run pytest tests/kernel/test_preprocessing.py tests/kernel/test_preprocessing_transform.py tests/preprocessing tests/server/test_preprocessing_recipes.py
146 passed in 3.03s
uv run pytest tests/cli/test_json_contract.py tests/architecture
193 passed in 4.00s
uv run lint-imports
Contracts: 4 kept, 0 broken.
uv run mypy src/visionset/kernel
Success: no issues found in 79 source files
uv run ruff check .
All checks passed!
pnpm --filter @visionset/ui-core exec vitest run preprocessing
      Tests  28 passed (28)
pnpm -r build && pnpm -r test && pnpm -r lint
frontend/annotator test:       Tests  1071 passed (1071)
frontend/ui-core test:       Tests  1398 passed (1398)
frontend/app test:       Tests  11 passed (11)
CI=1 pnpm --filter @visionset/app cycle
  1 passed (33.9s)
bash scripts/check.sh
check.sh: PASSED  ran=python,frontend,generated,browser  skipped=docs

@JArmandoAnaya JArmandoAnaya reopened this Aug 26, 2026
@JArmandoAnaya
JArmandoAnaya marked this pull request as draft August 26, 2026 17:07
@JArmandoAnaya
JArmandoAnaya marked this pull request as ready for review August 26, 2026 17:07
@JArmandoAnaya JArmandoAnaya reopened this Aug 27, 2026
@JArmandoAnaya
JArmandoAnaya merged commit 92d19d4 into main Aug 27, 2026
16 of 30 checks passed
@JArmandoAnaya
JArmandoAnaya deleted the feat/preview-showcase branch August 27, 2026 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant