diff --git a/src/ui/session-list.js b/src/ui/session-list.js index 25a3e71..c021ca1 100644 --- a/src/ui/session-list.js +++ b/src/ui/session-list.js @@ -14,10 +14,20 @@ function describeSpec(spec) { return parts.join(' '); } +/** + * Kurzbezeichnung der Erkennungsquelle eines Eintrags - beim Sortieren + * wertvoll, weil Barcode exakt ist und Texterkennung fehleranfaelliger. + */ +function describeSource(source) { + if (source === 'barcode') return 'per Barcode'; + if (source === 'ocr') return 'per Texterkennung'; + return 'unsicher'; +} + /** * Vollbild-Liste aller Stapel der laufenden Sitzung. * @param {HTMLElement} root - * @param {{stacks: Array<{id: string, count: number, spec: object}>, entries: Array<{entryId: number, spec: object, stackId: string}>}} session + * @param {{stacks: Array<{id: string, count: number, spec: object}>, entries: Array<{entryId: number, spec: object, stackId: string, source: string}>}} session * @param {{onMove: (entryId: number, stackId: string) => void, onRemove: (entryId: number) => void, onEndSession: () => void, onClose: () => void}} callbacks */ export function renderSessionList(root, session, { onMove, onRemove, onEndSession, onClose }) { @@ -58,6 +68,13 @@ export function renderSessionList(root, session, { onMove, onRemove, onEndSessio label.textContent = entry.spec.partNumber ?? describeSpec(entry.spec); row.appendChild(label); + const sourceLabel = document.createElement('span'); + sourceLabel.style.fontSize = '12px'; + sourceLabel.style.opacity = '0.7'; + sourceLabel.style.textAlign = 'right'; + sourceLabel.textContent = describeSource(entry.source); + row.appendChild(sourceLabel); + // Bedienflaechen muessen mindestens 56px hoch sein - auch die Auswahl, // nicht nur die Schaltflaechen. const select = document.createElement('select');