Fix item ID mismatch dropping 200+ items at confirmation
- showItemsStep rendered per-category index as data-item-id - confirmItems filtered by global index, causing massive mismatch - Now assigns unique 'item_N' IDs to all items before rendering - Also preserves menuName in category confirmation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
dc3cdf98a0
commit
baf0d5dfc9
1 changed files with 4 additions and 8 deletions
|
|
@ -3093,14 +3093,10 @@
|
|||
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));
|
||||
// Assign unique IDs to all items (fixes per-category index mismatch in confirmItems)
|
||||
items.forEach((item, idx) => {
|
||||
item.id = 'item_' + idx;
|
||||
});
|
||||
|
||||
if (items.length === 0) {
|
||||
addMessage('ai', `
|
||||
|
|
|
|||
Reference in a new issue