feat(ui): live stats panel in occurrence list sidebar#1308
Conversation
Adds an OccurrenceStats panel above the filter sections on the occurrence list page. Consumes the /occurrences/stats/model-agreement/ endpoint, threading the same active filter array the list view sends so the numbers always reflect the current result set. Shows two metrics: verified occurrences % and human-model agreement rate % (rank-level / under-order agreement). Co-Authored-By: Claude <noreply@anthropic.com>
✅ Deploy Preview for antenna-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
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)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |

Summary
Frontend consumer for the
/occurrences/stats/model-agreement/endpoint added in #1307. Adds a Stats panel at the top of the occurrence list sidebar, above the filter sections.OccurrenceStatscomponent (ui/src/pages/occurrences/occurrence-stats.tsx)occurrences.tsx, threading the same active filter array the list view sends touseOccurrences— so the stats always match the current result set (taxon, deployment, date, verification status, default filters, etc.)verified_pctagreed_under_order_pct(rank-level / under-order agreement)Stacked on the backend branch — base is
feat/human-model-agreement-endpoint(#1307), notmain. Rebase/retarget tomainonce #1307 merges.Filter parity
The panel reuses the list view's
filtersarray verbatim and converts it to query params with the same active/error rules asgetFetchUrl(value?.length && !error). The endpoint accepts the full occurrence-list filter set (#1307), so the numbers stay consistent with the visible results.Test plan
tsc --noEmit— no errors in touched fileseslint+prettierclean on new/modified files0%(45 verified / 43,149 → rounds to 0), HUMAN-MODEL AGREEMENT RATE71%.?apply_defaults=false, list went 43,149 → 93,019, and the Stats panel re-queried with the same param (recomputed from the loading skeleton). Same filter array drives both list and stats.Toolchain note for reviewers
The worktree
ui/has nonode_modules. Installing under the host's Node 22 breaks the dev server (nova-ui-kit dereferences a React-18 internal removed in React 19 at tailwind-config eval). Use the repo-pinned Node 18 (.nvmrc→ 18.12.0):nvm use 18.12.0 && yarn install && yarn start. Under Node 18 it boots cleanly.🤖 Generated with Claude Code