Skip to content

feat(reminder): add geofence and time-window domain triggers - #198

Merged
Wintercom merged 2 commits into
1024XEngineer:mainfrom
gac0812:feat/reminder-geofence-time-window-domain
Aug 12, 2026
Merged

Wintercom merged 2 commits into
1024XEngineer:mainfrom
gac0812:feat/reminder-geofence-time-window-domain

Conversation

@gac0812

@gac0812 gac0812 commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • 新增地点围栏领域规则 geofence.ts(距离、arrive/return 中心点、armed→triggered 状态机)
  • 新增时间窗领域规则 timeWindow.ts(at_time/before_start、snooze、有效触发时刻)
  • 更新 domain/index 导出上述能力;不含适配器与组合根接线

Merge Order

Scope

  • frontend/src/features/reminder/domain/geofence.ts
  • frontend/src/features/reminder/domain/timeWindow.ts
  • frontend/src/features/reminder/domain/index.ts

Out of scope

  • LocalReminderApplication 与其它 application 实现
  • 原生定位/闹钟适配器、权限引导、createAppServices 切换
  • strengthDelivery 等后续 domain 切片

Verification

  • npm run check
  • npm ci

Closes #212

Add pure domain helpers for location geofence arming/triggering and
time-window / snooze trigger resolution, without adapters or DI wiring.
@vercel

vercel Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
timeflow Ready Ready Preview Aug 12, 2026 7:10am

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one correctness issue in the time-window resolver. I reviewed the geofence state transition, time/snooze helpers, exports, and their downstream use in PR #199.

Verification note: npm run check could not run in this checkout because the installed eslint shim is not executable and the expected package binary is absent, so this review used source-level analysis of the locked SHA diff.

Comment thread frontend/src/features/reminder/domain/timeWindow.ts Outdated
Use the runtime occurrence cursor for recurring schedules with
before_start offset semantics, and return null until the cursor exists
instead of falling back to the series start_time.
@gac0812

gac0812 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@fennoai /review

@fennoai

fennoai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Complete

  • Initialized the fixed PR workspace at the requested base/head SHAs
  • Reviewed code quality, performance, security, and documentation implications
  • Posted a comment-only PR review: no issues found
  • Ran git diff --check
  • npm run check — blocked by the existing install: eslint exits with Permission denied

The changed geofence and time-window helpers align with the domain types and backend reminder invariants. No actionable findings were identified.

View job run

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found in the locked 23f3e923...2e1a292 diff. The recurring reminder path now uses runtime.next_trigger_at and preserves before_start offset semantics, resolving the prior correctness finding.

Verification: GitHub’s frontend check passed for head 2e1a292. Local npm run check could not run because the checkout’s eslint shim is not executable and the expected TypeScript/Prettier package binaries are absent.

View job run

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found in the reviewed changes. The geofence and time-window helpers are consistent with the declared domain types and backend reminder invariants; no actionable correctness, performance, security, or documentation findings were identified.

@Wintercom Wintercom left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Wintercom
Wintercom merged commit 7a89588 into 1024XEngineer:main Aug 12, 2026
5 checks passed
gac0812 pushed a commit to gac0812/Tfgxs that referenced this pull request Aug 13, 2026
LocalReminderApplication imports these helpers; add them to this PR so
typecheck and bundling no longer depend on 1024XEngineer#198 being merged first.
Wintercom pushed a commit that referenced this pull request Aug 13, 2026
…199)

* feat(reminder): add LocalReminderApplication and memory state store

Introduce the local reminder coordinator and in-memory runtime state
store, and align mock alarm/schedule adapters with the scheduled receipt
and subscribe/notify contracts.

* fix(reminder): align LocalReminderApplication with confirmed sync port

Use ReminderConfirmedDisposition for submitConfirmed and default snooze
minutes for presenter snooze actions.

* fix(reminder): include geofence and time-window domain modules

LocalReminderApplication imports these helpers; add them to this PR so
typecheck and bundling no longer depend on #198 being merged first.

* fix(reminder): isolate location events and tear down failed delivery

Route watcher callbacks to the emitting schedule only, and best-effort
dismiss already-started channels when a later delivery step fails.

* fix(reminder): serialize coordinator lifecycle and drop stale registrations

Tear down existing watchers/alarms when register() becomes unschedulable,
and serialize start/stop/rebuild so a queued rebuild cannot reinstall
resources after shutdown.

* fix(reminder): cancel pre-shutdown work across restart generations

Replace the shared stopRequested flag with a per-start generation token
and wait for in-flight handlers during stop, so a delivery or time/location
handler begun before shutdown cannot resume as live work after start().

---------

Co-authored-by: mac <mac@mac11MacBook-Pro.local>
gac0812 pushed a commit to gac0812/Tfgxs that referenced this pull request Aug 13, 2026
Bring in 1024XEngineer#198/1024XEngineer#199/1024XEngineer#205/1024XEngineer#210/1024XEngineer#213/1024XEngineer#217 while keeping the local native
reminder stack, strength delivery, and alarm event hydration.
@gac0812
gac0812 deleted the feat/reminder-geofence-time-window-domain branch August 13, 2026 05:48

This branch was successfully deployed

1 active deployment
Preview — 2e1a292b Deployed Aug 12, 2026 by vercel[bot]
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.

feat(reminder): 实现地点围栏与时间窗领域触发

2 participants