Skip to content

fix(alerts): gate face alerts on minimum person count#6

Merged
bolin8017 merged 1 commit into
mainfrom
fix/face-alert-min-person-count
May 26, 2026
Merged

fix(alerts): gate face alerts on minimum person count#6
bolin8017 merged 1 commit into
mainfrom
fix/face-alert-min-person-count

Conversation

@bolin8017

Copy link
Copy Markdown
Owner

Summary

  • Apply the shared 至少人數 (minPersonCount) threshold to face alerts, not only to the 有人 person state machine.
  • Skip face sample recording and person-alert suppression while the person count is below the configured minimum.
  • Persist 至少人數 on input as well as change so the value saves without requiring blur.

Problem

After the graded presence alert work, face detection could fire at the 偵測到臉 level even when only one person was on screen and 至少人數 was set to 2+. That made the person-count control appear broken and collapsed the distinction between 有人 and 偵測到臉 in normal use.

Test plan

  • npm test (27 tests pass)
  • Set 至少人數 to 2, start session with one person (with face visible) → no alert, lamp stays 無人
  • Set 至少人數 to 1, one person back to camera → 有人 sound/lamp; turn to face camera → upgrades to 偵測到臉 with double tone
  • Use 測試音 dropdown to confirm 有人 vs 偵測到臉 sounds differ

Made with Cursor

Face presence skipped the shared person-count threshold, so a single
visible face could trigger the highest alert level and made 有人 vs 偵測到臉
indistinguishable in practice.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying argus with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1d62bdb
Status: ✅  Deploy successful!
Preview URL: https://149d82e1.argus-bnl.pages.dev
Branch Preview URL: https://fix-face-alert-min-person-co.argus-bnl.pages.dev

View logs

@bolin8017 bolin8017 merged commit c3d9a94 into main May 26, 2026
3 checks passed
@bolin8017 bolin8017 deleted the fix/face-alert-min-person-count branch May 26, 2026 05:42
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