Add OrcaHello review state for machine detections - #997
Conversation
…refactored types and transforms
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.Change the |
Summary
This PR adds a client-side
useAIDetectionshook to pull live detections from the Orcahello / AIforOrcas API, in order to providing temporary scaffolding for the server-side effort in progress. At present, the Orcasound detections endpoint returns HUMAN and MACHINE detections, but lacks critical metadata from Orcahello about the 'review state' (e.g. confirmed, false positive, unknown, unreviewed -- based on the 'reviewed' and 'found' fields that are missing in Orcasound).This PR stacks on #995 which added the useSightings for live sightings data from Acartia, and includes some refactoring of the types and transforms in the
CombinedDataschema for better simplicity.The overall hook structure works like this:
useCombinedDatauseDetectionsQuery,useSightings, anduseAIDetections/utils/dataTransforms) that normalizes fields, matches feed locations, and addstypeandreviewStatecombineddataset for downstream counting and filteringtypes/DataTypes.tsincludes standardized types for raw and transformed Orcasound detections, Orcahello detections, and Acartia sightingsIn this PR, I demonstrate using the combined data hook to enrich the
ReportCountcomponent on the/listen/[feed]pages (introduced in #995). Other applications could include list filters for the/reportspage, or indicators on the candidate detail pages.