Add image type breakdown to setup wizard summary

This commit is contained in:
John Mizerek 2026-02-12 20:44:42 -08:00
parent 1a7c342ac9
commit f882e84704

View file

@ -890,6 +890,10 @@
<span class="summary-stat-label">Menu Items</span>
<span class="summary-stat-value" id="summaryItems">0</span>
</div>
<div class="summary-stat" id="summaryImagesRow">
<span class="summary-stat-label">Images</span>
<span class="summary-stat-value" id="summaryImages" style="font-size: 13px; text-align: right;"></span>
</div>
</div>
</div>
@ -2610,6 +2614,24 @@
document.getElementById('summaryModifiers').textContent = modifiers.length;
document.getElementById('summaryItems').textContent = items.length;
// Count images by type
const itemsWithImageUrl = items.filter(item => item.imageUrl).length;
const manuallyMatchedImages = Object.keys(config.itemImages || {}).length;
const hasHeaderImage = config.headerImageFile != null;
const imageParts = [];
if (itemsWithImageUrl > 0) imageParts.push(`${itemsWithImageUrl} item`);
if (manuallyMatchedImages > 0) imageParts.push(`${manuallyMatchedImages} matched`);
if (hasHeaderImage) imageParts.push('1 header');
const imagesRow = document.getElementById('summaryImagesRow');
if (imageParts.length > 0) {
document.getElementById('summaryImages').textContent = imageParts.join(', ');
imagesRow.style.display = '';
} else {
imagesRow.style.display = 'none';
}
// In add-menu mode, hide menu name/hours/community meal (already set during menu creation)
if (config.menuId) {
document.getElementById('menuNameInput').parentElement.style.display = 'none';
@ -2630,6 +2652,8 @@
}
}
const imagesSummary = imageParts.length > 0 ? `<li>${imageParts.join(', ')} images</li>` : '';
addMessage('ai', `
<p>Your menu is ready to save!</p>
${config.menuId && config.menuName
@ -2639,6 +2663,7 @@
<li>${categories.length} categories</li>
<li>${modifiers.length} modifier templates</li>
<li>${items.length} menu items</li>
${imagesSummary}
</ul>
<p>Click "Save Menu" below to add everything to your Payfrit account.</p>
`);