Skip to content

feat(deployments): show camera effort per deployment - #638

Merged
Chouffe merged 2 commits into
mainfrom
worktree-arthur+deployment-effort
Sep 25, 2026
Merged

Chouffe merged 2 commits into
mainfrom
worktree-arthur+deployment-effort

Conversation

@Chouffe

@Chouffe Chouffe commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

image
  • Show camera effort (camera-days) on the Deployments tab: per row, summed per co-located group, and study-wide in the list header. The settings popover's rounded "Duration" row becomes "Camera-days".
  • One shared helper (src/shared/effort.js) defines a deployment's effort as its interval in fractional camera-days when both dates parse and the end is after the start, otherwise null (shown as —, never 0). This is the same validity rule as validateDeploymentIntervals in the RAI effort module from feat(explore): add relative abundance index metrics #637, so per-deployment camera-days agree with Explore's effort denominator. Effort is computed in the existing activity query (no new IPC channel) and rounded to whole days only for display.
  • Every observation count and camera-days figure gets an explanatory tooltip (bold headline, scope line such as the deployment's date range or "Summed across N deployments", and a plain-language definition), so raw observation counts aren't mistaken for sequence-adjusted numbers and camera-days aren't mistaken for a population estimate.

Notes

  • The Overview KPI tile's cameraDays uses a looser SQL rule (sums julianday differences, including inverted intervals), so its total can differ from this tab on studies with bad dates. Left as is; noted in docs/ipc-api.md.
  • Studies with no deployment dates (hasTimestamps: false) hide the effort column and summary, matching the sparklines.

Test plan

  • npm test — 1543 passing after rebasing on main (18 new: shared effort rule, activity query effortDays in both branches, group sums/skip counts, label and date-range formatting)
  • Formatter tests pass under TZ=Asia/Tokyo, TZ=Pacific/Pago_Pago, and TZ=UTC
  • npm run lint, npm run format:check
  • Driven in the running app over CDP across 8 local studies: rendered effort matched the interval math for every deployment; dateless study hides the column; tooltips verified on rows, group headers, summary strip, and popover
  • Reviewer: open a study with co-located deployments (e.g. FIBRAS Casanare) and hover a group header's count and camera-days cells

@netlify

netlify Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for lucent-yeot-0cb408 canceled.

Name Link
🔨 Latest commit 85e1e6f
🔍 Latest deploy log https://app.netlify.com/projects/lucent-yeot-0cb408/deploys/6ab3c74f3b2571000880c8ab

@Chouffe
Chouffe requested a review from ioRekz September 23, 2026 07:46
Ecologists need to read detections against how long each camera actually ran. The Deployments tab now shows camera-days per row, summed per co-located group and study-wide, and replaces the popover's rounded Duration with the same figure. Effort comes from one shared helper (valid interval = both dates parse, end after start) chosen to match the RAI effort rule in PR #637 so the two agree once it lands; it is computed fractionally in the activity query and only rounded for display.

Both the observation count and camera-days figures get an explanatory tooltip (headline, scope, plain-language definition) so the numbers are not mistaken for sequence-adjusted or population estimates.
PR #637 landed on main, so the shared helper's comment and the IPC docs now name validateDeploymentIntervals instead of a pending PR.
@Chouffe
Chouffe force-pushed the worktree-arthur+deployment-effort branch from f80c1fb to 85e1e6f Compare September 23, 2026 12:34
@Chouffe

Chouffe commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator Author

would love your review @ioRekz

@Chouffe
Chouffe merged commit 65670d1 into main Sep 25, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant