diff --git a/src/components/EditPanel.tsx b/src/components/EditPanel.tsx index 67e07c5..80be7df 100644 --- a/src/components/EditPanel.tsx +++ b/src/components/EditPanel.tsx @@ -188,16 +188,22 @@ export function EditPanel({ row, rowIndex, onSave, onClose, onCaptureState }: Ed return formData[field] !== (row[colIndex] !== undefined && row[colIndex] !== null ? String(row[colIndex]) : ''); }; - const handleGenerate = async (field: keyof typeof formData) => { + const handleGenerate = (field: keyof typeof formData) => { + console.log('[EditPanel] handleGenerate called for field:', field); + setError(null); // Clear any previous error setPendingGeminiField(field); }; const executeGenerate = async () => { - if (!pendingGeminiField) return; + if (!pendingGeminiField) { + console.warn('[EditPanel] executeGenerate called but no field pending'); + return; + } const field = pendingGeminiField; + console.log('[EditPanel] Starting generation for field:', field); setLoadingField(field); setError(null); - + try { let prompt = ''; const baseContext = `Article Name: ${row[COLUMNS.ARTICLE_NAME]}\nArticle Details (EN): ${formData.detailsEn || 'N/A'}\nArticle Details (DE): ${formData.detailsDe || 'N/A'}`; diff --git a/src/components/PricingView.tsx b/src/components/PricingView.tsx index 2c9f8c7..4061ba7 100644 --- a/src/components/PricingView.tsx +++ b/src/components/PricingView.tsx @@ -618,6 +618,18 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit, }; }, [pinnedColumns, columnOrder, columnWidths]); + // Calculate z-index for sticky columns (so they stack correctly) + const getStickyRank = useMemo(() => { + const pinnedOrder = columnOrder.filter(k => pinnedColumns.has(k)); + return (key: string): number | null => { + if (!pinnedColumns.has(key)) return null; + const idx = pinnedOrder.indexOf(key); + if (idx === -1) return null; + // Higher rank = on top + return pinnedOrder.length - idx + 10; + }; + }, [pinnedColumns, columnOrder]); + const isPinned = (key: string) => pinnedColumns.has(key); // ═ Unique values for dynamic pricing columns ═════════════════════════════ @@ -1120,9 +1132,9 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
| handleSort('articleNo')}>
@@ -1148,9 +1160,9 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
)}
|
- handleSort('articleName')}>
@@ -1175,9 +1187,9 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
)}
|
- handleSort('line')}>
@@ -1205,9 +1217,9 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
)}
|
- handleSort('classification')}>
@@ -1236,9 +1248,9 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
|
- handleSort('productType')}>
{isPinned('productType') && |
- handleSort('itemToLogistic')}>
{isPinned('itemToLogistic') && | handleSort(col.index)}>
@@ -1448,7 +1460,7 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
return (
handleSort(col.index)}>
| |
|---|