Skip to content

Phase 2: Species Guide Overhaul - Live Data & Enhanced Filtering #4

@tkkr6895

Description

@tkkr6895

Description

Refactor the SpeciesGuide component to exclusively use the SpeciesDatabase service, eliminating all hardcoded species data. Enhance with source attribution badges, taxonomy/IUCN filters, online search fallback, species sighting recording, vernacular name contributions, and data refresh.

Implementation Tasks

  • 2.2.1 — Refactor SpeciesGuide: remove all hardcoded species data, use SpeciesDatabase service exclusively (src/components/SpeciesGuide.tsx)
  • 2.2.2 — Add "Source: GBIF" / "Source: IUCN" / "Source: IBP" badges on species cards (src/components/SpeciesGuide.tsx)
  • 2.2.3 — Add kingdom filter (Plantae, Animalia, Fungi) alongside existing category filters (src/components/SpeciesGuide.tsx)
  • 2.2.4 — Add IUCN status filter (LC, NT, VU, EN, CR) (src/components/SpeciesGuide.tsx)
  • 2.2.5 — Add online search: if local search returns no results and device is online, query GBIF/COL and display results (src/components/SpeciesGuide.tsx)
  • 2.2.6 — Connect "Record Sighting" → CaptureModal with observationType='species_sighting' + pre-filled speciesId (src/components/SpeciesGuide.tsx, src/App.tsx)
  • 2.2.7 — Add "Contribute Local Name" button → VernacularNameInput component (src/components/SpeciesGuide.tsx)
  • 2.2.8 — Add "Refresh Species Data" button triggering SpeciesDatabase.refreshData() (src/components/SpeciesGuide.tsx)

Acceptance Criteria

  • SpeciesGuide renders species entirely from SpeciesDatabase — zero inline species data
  • Source badges (GBIF/IUCN/IBP/user_contributed) visible on each species card
  • Kingdom and IUCN status filters work combinatorially with existing text search
  • Online search triggers automatically when local results are empty + device is online
  • "Record Sighting" opens CaptureModal pre-filled with species ID and sighting type
  • "Contribute Local Name" opens VernacularNameInput and saves to SpeciesDatabase
  • "Refresh Data" shows progress indicator and updates species from APIs
  • Empty states handled gracefully (no species fetched yet, offline with empty DB)

Dependencies

  • Species Database Core + Search (2.1.1–2.1.12)
  • Species Sighting Form (2.3) — for Record Sighting integration

Relevant Files

  • src/components/SpeciesGuide.tsx — primary refactor target
  • src/services/SpeciesDatabase.ts — data source
  • src/App.tsx — CaptureModal triggering
  • src/components/CaptureModal.tsx — observation type routing

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions