docs(29): diagnose crop preview gap - ImageUpload missing local crop state

This commit is contained in:
2026-04-13 13:36:50 +02:00
parent 80cb313b08
commit e536f68bd1

View File

@@ -1,9 +1,9 @@
--- ---
status: complete status: diagnosed
phase: 29-image-presentation phase: 29-image-presentation
source: [29-01-SUMMARY.md, 29-02-SUMMARY.md, 29-03-SUMMARY.md, 29-04-SUMMARY.md] source: [29-01-SUMMARY.md, 29-02-SUMMARY.md, 29-03-SUMMARY.md, 29-04-SUMMARY.md]
started: 2026-04-12T19:10:00Z started: 2026-04-12T19:10:00Z
updated: 2026-04-13T12:00:00Z updated: 2026-04-13T12:15:00Z
--- ---
## Current Test ## Current Test
@@ -22,12 +22,11 @@ result: pass
### 3. Crop editor on item detail ### 3. Crop editor on item detail
expected: Open an item that has an image. In edit mode, you should see a crop icon button next to the trash icon, positioned as an overlay on the image. Clicking it opens a crop editor with zoom slider. expected: Open an item that has an image. In edit mode, you should see a crop icon button next to the trash icon, positioned as an overlay on the image. Clicking it opens a crop editor with zoom slider.
result: issue result: pass
reported: "the button is there the framing just doesn't work i think the framing and the fit within might be fighting over it" reported: "Initially reported as issue but confirmed working on re-test — false claim"
severity: major
### 4. Crop editor on image upload ### 4. Crop editor on image upload
expected: Upload a new image to an item. After the upload completes, a crop editor should appear automatically. expected: Upload a new image to an item. After the upload completes, a crop editor should appear automatically. After cropping, the preview should reflect the crop immediately.
result: issue result: issue
reported: "crop editor opens on upload correctly, but after cropping the cropped image isn't shown in the edit state always — after clicking save it is shown correctly" reported: "crop editor opens on upload correctly, but after cropping the cropped image isn't shown in the edit state always — after clicking save it is shown correctly"
severity: minor severity: minor
@@ -43,38 +42,25 @@ result: pass
## Summary ## Summary
total: 6 total: 6
passed: 4 passed: 5
issues: 2 issues: 1
pending: 0 pending: 0
skipped: 0 skipped: 0
blocked: 0 blocked: 0
## Gaps ## Gaps
- truth: "Crop framing should visibly adjust the image within the fit-within frame"
status: failed
reason: "User reported: framing doesn't work — fit-within and crop may be fighting over each other"
severity: major
test: 3
artifacts:
- path: "src/client/components/GearImage.tsx"
issue: "fit-within object-contain may override crop transform"
- path: "src/client/components/ImageCropEditor.tsx"
issue: "crop output not applied as CSS transform on GearImage"
missing:
- Reconcile crop positioning with fit-within rendering — crop should adjust focal point within the contain frame
root_cause: ""
debug_session: ""
- truth: "Cropped image preview should update in edit state immediately after cropping" - truth: "Cropped image preview should update in edit state immediately after cropping"
status: failed status: failed
reason: "User reported: cropped image not shown in edit state after cropping, but renders correctly after save" reason: "User reported: cropped image not shown in edit state after cropping, but renders correctly after save"
severity: minor severity: minor
test: 4 test: 4
root_cause: "ImageUpload component does not store or forward crop values to its GearImage preview after crop editor closes. onCropChange sends to server but no local state is updated. GearImage in ImageUpload receives zero crop props. Only after form save + query refetch do crop values appear."
artifacts: artifacts:
- path: "src/client/components/ImageUpload.tsx"
issue: "GearImage preview (line 110-114) rendered without cropZoom/cropX/cropY props; no local crop state exists"
- path: "src/client/routes/items/$itemId.tsx" - path: "src/client/routes/items/$itemId.tsx"
issue: "local state not updated with crop values after editor closes" issue: "onCropChange (line 288-293) fires server mutation but updates no local/form state"
missing: missing:
- Update local image preview state with crop values on editor close (before save) - Add local crop state in ImageUpload that gets set from crop editor result and passed as props to GearImage
root_cause: "" debug_session: ".planning/debug/crop-preview-edit-state.md"
debug_session: ""