diff --git a/application_events.json b/application_events.json index 267c60d..8e4fca0 100644 --- a/application_events.json +++ b/application_events.json @@ -8152,8 +8152,26 @@ "event_type": "application_started", "message": "Application initialization completed successfully", "details": {} + }, + { + "timestamp": "2025-08-15T23:05:23.049195", + "level": "info", + "event_type": "plot_session_created", + "message": "Plot session 'UR29' created and started", + "details": { + "session_id": "plot_1_1755291923048_2", + "variables": [ + "UR29_Brix", + "UR29_ma", + "AUX Blink_1.0S", + "AUX Blink_1.6S" + ], + "time_window": 36, + "trigger_variable": null, + "auto_started": true + } } ], - "last_updated": "2025-08-15T22:47:53.048381", - "total_entries": 677 + "last_updated": "2025-08-15T23:05:23.049195", + "total_entries": 678 } \ No newline at end of file diff --git a/frontend/src/components/PlotManager.jsx b/frontend/src/components/PlotManager.jsx index 803db29..48d0be0 100644 --- a/frontend/src/components/PlotManager.jsx +++ b/frontend/src/components/PlotManager.jsx @@ -455,7 +455,7 @@ export default function PlotManager() { setPlotsSchemaData(plotsSchemaResponse) setPlotVariablesSchemaData(plotVariablesSchemaResponse) - // Auto-select first plot if none selected + // Auto-select first plot if none selected and plots are available if (!selectedPlotId && plotsData?.plots?.length > 0) { setSelectedPlotId(plotsData.plots[0].id) } @@ -474,7 +474,7 @@ export default function PlotManager() { } finally { setLoading(false) } - }, [selectedPlotId, toast]) + }, [toast]) // Removed selectedPlotId from dependencies to prevent unnecessary reloads // Función para actualizar configuración de un plot específico sin recargar todo const updatePlotConfig = async (plotId, newConfig) => { @@ -632,6 +632,13 @@ export default function PlotManager() { loadPlotData() }, [loadPlotData]) + // Separate effect to handle auto-selection of first plot when plots are loaded + useEffect(() => { + if (!selectedPlotId && plotsConfig?.plots?.length > 0) { + setSelectedPlotId(plotsConfig.plots[0].id) + } + }, [plotsConfig, selectedPlotId]) + if (loading) { return ( @@ -714,14 +721,23 @@ export default function PlotManager() { {/* Step 1: Plot Selector (Combo) */} - + 🎯 Select Plot Session + + ⚠️ Important: The variables configuration below depends on this selection + setSelectedDatasetId(e.target.value)} + onChange={(e) => { + const newDatasetId = e.target.value + setSelectedDatasetId(newDatasetId) + console.log(`🎯 Dataset selection changed to: ${newDatasetId}`) + }} placeholder="Choose a dataset to configure..." - size="md" + size="lg" + fontSize="lg" + fontWeight="semibold" > {availableDatasets.map(dataset => (