/claim #1162

Summary

This adds an optional historical date mode for the map/sites view so users can inspect past heat-stress conditions instead of always seeing current/latest values.

What changed

  • Added optional at filter support in GET /sites.
    • FilterSiteDto now accepts at (ISO date)
    • SitesService.find passes at through to collection data resolution
  • Extended collection-data mapping to support historical snapshots.
    • For historical mode, data is sourced from daily_data (latest row up to selected day)
    • Mapped to existing frontend marker fields (dhw, satelliteTemperature, tempAlert, tempWeeklyAlert)
  • Added map UI control to choose/clear a historical date.
    • Floating calendar control on HomeMap
    • URL query sync via ?at=YYYY-MM-DD
  • Updated sites request flow to refetch when historical date changes.
    • sitesRequest now tracks requestedAt context
    • Search component aligns prefetch with current URL date context so historical view is not overwritten

Why this is safe

  • Default behavior remains unchanged when at is not provided.
  • Historical mode only changes collection-data source path used for map/site cards.
  • Existing filters and route flow remain intact.

Validation

  • YARN_IGNORE_ENGINES=1 corepack yarn workspace api test src/utils/collections.utils.test.ts
  • YARN_IGNORE_ENGINES=1 corepack yarn workspace website test src/services/siteServices.test.ts
  • YARN_IGNORE_ENGINES=1 corepack yarn workspace api eslint src/sites/dto/filter-site.dto.ts src/sites/sites.service.ts src/utils/collections.utils.ts src/utils/collections.utils.test.ts
  • YARN_IGNORE_ENGINES=1 corepack yarn workspace website eslint --ext .ts,.tsx src/routes/HomeMap/index.tsx src/routes/HomeMap/Map/index.tsx src/common/Search/index.tsx src/store/Sites/sitesListSlice.ts src/services/siteServices.ts src/services/siteServices.test.ts

Claim

Total prize pool $50
Total paid $0
Status Pending
Submitted March 03, 2026
Last updated March 03, 2026

Contributors

LI

Liuyi Yu

@yuliuyi717-ux

100%

Sponsors

AQ

Aqualink.org

@aqualinkorg

$50