debug: add comprehensive logging for image adjustment flow
Added detailed console logging across entire image adjustment pipeline: 1. ImageAdjustmentModal.handleConfirm(): - Original image dimensions - User inputs (rotation, zoom, pan, crop) - Canvas processing steps - Final blob size 2. AIOnboarding.handleImageAdjustmentConfirm(): - Adjustments received from modal - Item being updated - extractedImageBlob status before/after 3. useAIExtraction.confirmSingleItem(): - newItem being built - extractedImageBlob attached - imageProcessing attached This will help identify where values are lost or incorrect in the flow. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -135,6 +135,13 @@ export function useAIExtraction(inventory: Item[], onComplete: (itemData: any) =
|
||||
const data = extractedItems[index];
|
||||
const skipPhoto = data._skipPhoto === true; // User explicitly rejected the photo
|
||||
|
||||
console.log('=== CONFIRM SINGLE ITEM (Hook) ===');
|
||||
console.log('[Input] Item index:', index);
|
||||
console.log('[Input] Item data:', data);
|
||||
console.log('[Input] Skip photo flag:', skipPhoto);
|
||||
console.log('[Input] extractedImageBlob size:', extractedImageBlob?.size || 'null', 'bytes');
|
||||
console.log('[Input] image_processing from data:', data.image_processing);
|
||||
|
||||
const newItem = {
|
||||
name: String(data.Item || data.name || "New AI Item"),
|
||||
category: String(data.Category || data.category || "Uncategorized"),
|
||||
@@ -158,6 +165,11 @@ export function useAIExtraction(inventory: Item[], onComplete: (itemData: any) =
|
||||
})
|
||||
};
|
||||
|
||||
console.log('[Output] newItem being sent to onComplete:', newItem);
|
||||
console.log('[Output] extractedImageBlob attached:', !!newItem.extractedImageBlob);
|
||||
console.log('[Output] imageProcessing attached:', !!newItem.imageProcessing);
|
||||
console.log('=== END HOOK DEBUG ===');
|
||||
|
||||
onComplete(newItem);
|
||||
|
||||
if (extractedItems.length > 1) {
|
||||
|
||||
Reference in New Issue
Block a user