From f6c3729874e54b629306d4a983062d5a2e144b33 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Tue, 13 Jan 2026 22:45:55 -0800 Subject: [PATCH] Deduplicate modifiers in KDS display Prevents showing the same modifier twice when data has duplicates. Co-Authored-By: Claude Opus 4.5 --- kds/kds.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kds/kds.js b/kds/kds.js index c348fb1..de9040d 100644 --- a/kds/kds.js +++ b/kds/kds.js @@ -361,12 +361,20 @@ function renderAllModifiers(modifiers, allItems) { collectLeafModifiers(modifiers); console.log(` Total leaf modifiers found: ${leafModifiers.length}`); + + // Deduplicate modifiers with the same display text + const seen = new Set(); leafModifiers.forEach(({ mod }) => { // Use ItemParentName (the category/template name) if available, otherwise just show the item name // This gives us "Drink Choice: Coke" instead of "Double Double Combo: Coke" const displayText = mod.ItemParentName ? `${mod.ItemParentName}: ${mod.ItemName}` : mod.ItemName; + + // Skip duplicates + if (seen.has(displayText)) return; + seen.add(displayText); + html += `
+ ${escapeHtml(displayText)}
`; });