fix: CRITICAL - call onComplete synchronously with adjusted values

Root cause found: setState is async, so hookConfirmSingleItem was called
before extractedItems updated, causing it to use OLD image_processing values.

Fixed by:
1. Building the final newItem directly in handleImageAdjustmentConfirm
2. Using the UPDATED image_processing values (with user adjustments)
3. Calling onComplete synchronously with correct values
4. Not relying on async setState ordering

This ensures backend receives the user-adjusted crop_bounds and rotation_degrees,
not the original AI-detected values.

Backend logs will now show user adjustments, not original AI values.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-04-22 13:56:48 +03:00
parent 8d47732de4
commit e032d3a308
2 changed files with 47 additions and 7 deletions

File diff suppressed because one or more lines are too long