diff --git a/frontend/src/components/workflow/panels/PlaceholderPicker.jsx b/frontend/src/components/workflow/panels/PlaceholderPicker.jsx index 3434245..1259aaa 100644 --- a/frontend/src/components/workflow/panels/PlaceholderPicker.jsx +++ b/frontend/src/components/workflow/panels/PlaceholderPicker.jsx @@ -20,15 +20,25 @@ export function PlaceholderPicker({ nodes, onSelect, onClose }) { const [searchQuery, setSearchQuery] = useState('') const [systemPlaceholders, setSystemPlaceholders] = useState([]) const [loading, setLoading] = useState(true) + const [loadError, setLoadError] = useState(null) // Lade Backend-Platzhalter beim Mount useEffect(() => { async function loadPlaceholders() { try { + console.log('๐ Loading placeholders from backend...') const catalog = await api.listPlaceholders() + console.log('โ Catalog received:', catalog) + console.log('๐ Catalog keys:', Object.keys(catalog)) + // Konvertiere Katalog zu Flat-Liste const flattened = [] Object.entries(catalog).forEach(([category, items]) => { + console.log(`๐ Category "${category}": ${items?.length || 0} items`) + if (!Array.isArray(items)) { + console.warn(`โ ๏ธ Category "${category}" items is not an array:`, items) + return + } items.forEach(item => { flattened.push({ placeholder: `{{ ${item.key.trim()} }}`, @@ -39,9 +49,11 @@ export function PlaceholderPicker({ nodes, onSelect, onClose }) { }) }) }) + console.log(`โ Loaded ${flattened.length} system placeholders`) setSystemPlaceholders(flattened) } catch (e) { - console.error('Failed to load placeholders:', e) + console.error('โ Failed to load placeholders:', e) + setLoadError(e.message) } finally { setLoading(false) } @@ -188,6 +200,20 @@ export function PlaceholderPicker({ nodes, onSelect, onClose }) { > Lade Platzhalter... + ) : loadError ? ( +