Improve useful default workbench context
This commit is contained in:
@@ -7,6 +7,14 @@
|
||||
|
||||
# Changelog
|
||||
|
||||
## Sprint 96 useful default context (2026-06-22)
|
||||
|
||||
- Auto-open the first ready vector dataset after project data loads so Data, Map and Exports start with usable context.
|
||||
- Kept user-driven dataset selection intact; the default is only applied when no dataset is selected.
|
||||
- Added explicit Detection/Segmentation Lab guidance when no raster datasets are available.
|
||||
- Added regression coverage for useful default dataset selection and AI Lab raster prerequisite messaging.
|
||||
- No API contracts, migrations, provider fetching or AI/model behavior changed.
|
||||
|
||||
## Sprint 95 raster pipeline hardening (2026-06-22)
|
||||
|
||||
- Added a raster pipeline readiness surface to the dataset inspector.
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
|
||||
def test_dataset_workflow_selects_useful_default_dataset_after_project_load() -> None:
|
||||
hook = (ROOT / "frontend" / "src" / "hooks" / "useDatasetWorkflow.ts").read_text(encoding="utf-8")
|
||||
|
||||
assert "defaultDataset" in hook
|
||||
assert "!selectedDatasetId" in hook
|
||||
assert "isVectorDatasetType(dataset.dataset_type)" in hook
|
||||
assert "loadDatasetDetails(selectedProjectId, defaultDataset)" in hook
|
||||
assert "Auto-open the first usable dataset" in hook
|
||||
|
||||
|
||||
def test_ai_labs_explain_missing_raster_input_before_disabled_runs() -> None:
|
||||
detection_lab = (ROOT / "frontend" / "src" / "components" / "detection" / "DetectionLab.tsx").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
segmentation_lab = (ROOT / "frontend" / "src" / "components" / "segmentation" / "SegmentationLab.tsx").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
|
||||
assert "No raster datasets available for detection." in detection_lab
|
||||
assert "Upload or select a raster dataset in Data before running object detection." in detection_lab
|
||||
assert "rasterDatasets.length === 0" in detection_lab
|
||||
assert "No raster datasets available for segmentation." in segmentation_lab
|
||||
assert "Upload or select a raster dataset in Data before running segmentation." in segmentation_lab
|
||||
assert "rasterDatasets.length === 0" in segmentation_lab
|
||||
@@ -3445,3 +3445,30 @@ Limitations:
|
||||
|
||||
Next recommended pass:
|
||||
- After deploy and live validation, add a raster fixture/demo upload smoke or continue with map evidence overlay affordances for QA/QC.
|
||||
|
||||
## Sprint 96 useful default context (2026-06-22)
|
||||
|
||||
Changed:
|
||||
- Added a guarded default dataset effect in `frontend/src/hooks/useDatasetWorkflow.ts`.
|
||||
- When project data loads and no dataset is selected, the workbench now auto-opens the first ready vector dataset, falling back to any ready dataset and then the first dataset.
|
||||
- This gives Data, Map and Exports an immediately useful selected dataset/map layer context for the populated demo flow.
|
||||
- Added explicit no-raster guidance cards to Detection Lab and Segmentation Lab run controls.
|
||||
- Added `backend/tests/test_sprint96_useful_default_context.py`.
|
||||
- Updated `CHANGELOG.md`, `docs/TODO.md` and `frontend/README.md`.
|
||||
|
||||
Tested:
|
||||
- Red step: `python -m pytest backend\tests\test_sprint96_useful_default_context.py -q` failed on missing default dataset selection and no-raster AI Lab guidance.
|
||||
- `python -m pytest backend\tests\test_sprint96_useful_default_context.py -q` (`2 passed`)
|
||||
- `python -m pytest backend\tests\test_sprint39_frontend_orchestration_hooks.py backend\tests\test_sprint29_dataset_components.py backend\tests\test_sprint88_ai_lab_density.py -q` (`16 passed`)
|
||||
- `cd frontend && npm run typecheck`
|
||||
- `cd frontend && npm run build`
|
||||
|
||||
Open:
|
||||
- Full readiness, deploy and live browser validation are still pending for this pass.
|
||||
|
||||
Limitations:
|
||||
- Frontend usability/default-context hardening only; no API contract, persistence, migration, provider fetching or AI/model behavior changes.
|
||||
- Detection and segmentation remain correctly blocked without a raster dataset.
|
||||
|
||||
Next recommended pass:
|
||||
- After deploy and live validation, add a raster fixture/demo upload smoke so AI Labs and raster controls can be validated with a connected raster state.
|
||||
|
||||
@@ -367,3 +367,4 @@ This file now starts with the current implementation status. Older preparation/b
|
||||
- [x] Add latest handoff artifact cards to the Export Center for report, metadata and GeoJSON outputs.
|
||||
- [x] Add QA/QC evidence drilldown for selected checks, false-positive/negative evidence and provenance JSON.
|
||||
- [x] Add raster pipeline readiness and guardrail surfaces for metadata, CRS, preview, tile manifest and clip-AOI handoff.
|
||||
- [x] Add useful default dataset context so Data, Map and Exports are immediately usable after project/demo load.
|
||||
|
||||
@@ -4,6 +4,8 @@ React + TypeScript + MapLibre foundation for project/area/dataset workflow.
|
||||
|
||||
The workbench now uses a task-based shell instead of a single long panel stack. `App.tsx` still owns shared orchestration state, but the UI is organized into Overview, Data, Map, QA/QC, AI Labs, Exports and System workspaces with a persistent top context bar and right-side dataset inspector.
|
||||
|
||||
When project data loads and no dataset is selected yet, the workbench auto-opens the first ready vector dataset. This gives Data, Map and Exports an immediately usable default context while preserving explicit user selection once the user picks another dataset.
|
||||
|
||||
Data and Map workspaces include mobile-density CSS for file inputs, dataset action buttons, map toolbar controls, range sliders and empty-map quick actions so narrow screens avoid accidental viewport overflow.
|
||||
|
||||
Map workspace now surfaces the selected AOI, active layer and rendered feature state before controls, then separates layer controls, provenance, the MapLibre frame and the feature inspector into focused surfaces. The underlying overlay, opacity and feature-selection behavior is unchanged.
|
||||
@@ -32,6 +34,8 @@ QA/QC, exports and AI lab result panels use shared loading, error, empty and rea
|
||||
|
||||
Detection Lab and Segmentation Lab now share the same AI workspace hierarchy: model capabilities, run controls, persisted results and QA controls are separated into focused surfaces. Existing run, filter, result loading and QA callbacks remain unchanged, but the screens are denser and easier to scan on desktop and mobile.
|
||||
|
||||
AI Lab run controls explicitly explain when no raster dataset is available, instead of only showing disabled detection/segmentation run buttons.
|
||||
|
||||
## Scope implemented
|
||||
- API client layer (`src/services/api`)
|
||||
- Project and area list/create flows
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user