Improve useful default workbench context
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-06-22 23:19:35 +02:00
parent 0a5f99d255
commit aaf1299a5d
8 changed files with 96 additions and 0 deletions
@@ -143,6 +143,12 @@ export function DetectionLab({
<div className="lab-block">
<div className="ai-lab-run-surface" aria-label="Detection run controls">
<h3>Run detection</h3>
{rasterDatasets.length === 0 ? (
<div className="result-state result-state-empty">
<strong>No raster datasets available for detection.</strong>
<p>Upload or select a raster dataset in Data before running object detection.</p>
</div>
) : null}
<div className="lab-form-grid">
<label>
Raster dataset
@@ -143,6 +143,12 @@ export function SegmentationLab({
<div className="lab-block">
<div className="ai-lab-run-surface" aria-label="Segmentation run controls">
<h3>Run segmentation</h3>
{rasterDatasets.length === 0 ? (
<div className="result-state result-state-empty">
<strong>No raster datasets available for segmentation.</strong>
<p>Upload or select a raster dataset in Data before running segmentation.</p>
</div>
) : null}
<div className="lab-form-grid">
<label>
Raster dataset
+14
View File
@@ -83,6 +83,20 @@ export function useDatasetWorkflow({
}
}, [areas, selectedClipAreaId])
useEffect(() => {
if (!selectedProjectId || selectedDatasetId || datasets.length === 0) {
return
}
// Auto-open the first usable dataset so Data, Map and Exports start with real context.
const defaultDataset =
datasets.find((dataset) => isVectorDatasetType(dataset.dataset_type) && dataset.status === 'ready') ??
datasets.find((dataset) => dataset.status === 'ready') ??
datasets[0]
if (defaultDataset) {
loadDatasetDetails(selectedProjectId, defaultDataset).catch(() => null)
}
}, [datasets, isVectorDatasetType, selectedDatasetId, selectedProjectId])
const loadDatasetJobs = async (projectId: string, datasetId: string) => {
const response = await jobsApi.list(projectId, { dataset_id: datasetId, limit: 20, offset: 0 })
setJobs(response.items)