Add debug logging to showItemsStep and confirmItems
This commit is contained in:
parent
682cb41ff1
commit
fb21b0c58d
1 changed files with 17 additions and 0 deletions
|
|
@ -2634,6 +2634,15 @@
|
|||
const items = config.extractedData.items || [];
|
||||
const categories = config.extractedData.categories || [];
|
||||
|
||||
// DEBUG
|
||||
console.log('=== showItemsStep DEBUG ===');
|
||||
console.log('items.length:', items.length);
|
||||
console.log('categories.length:', categories.length);
|
||||
console.log('categories:', categories);
|
||||
console.log('First 3 items:', items.slice(0, 3));
|
||||
console.log('Item IDs sample:', items.slice(0, 5).map(i => i.id));
|
||||
console.log('Item categories sample:', items.slice(0, 5).map(i => i.category));
|
||||
|
||||
if (items.length === 0) {
|
||||
addMessage('ai', `
|
||||
<p>I couldn't extract any menu items. This might happen with complex or handwritten menus.</p>
|
||||
|
|
@ -2735,10 +2744,18 @@
|
|||
}
|
||||
});
|
||||
|
||||
// DEBUG
|
||||
console.log('=== confirmItems DEBUG ===');
|
||||
console.log('checkboxes found:', checkboxes.length);
|
||||
console.log('checkedIds:', [...checkedIds].slice(0, 10));
|
||||
console.log('items before filter:', config.extractedData.items.length);
|
||||
|
||||
config.extractedData.items = config.extractedData.items.filter((item, i) =>
|
||||
checkedIds.has(item.id || i.toString())
|
||||
);
|
||||
|
||||
console.log('items after filter:', config.extractedData.items.length);
|
||||
|
||||
// Now that user has seen items, ask about uncertain modifiers
|
||||
showUncertainModifiersStep();
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue