Skip to content

Activity tracking: monotonic lastActivityAt, modern event set, passive capture listeners #5

Description

@dmythro

Why

Activity is stamped, not timed: a timer reset per event does not scale to holds, refresh scheduling or cross-tab sync, and the current event list is dated.

Proposal

  • Track a monotonic lastActivityAt (performance.now() / injectable clock) instead of resetting a timeout on every event.
  • Default events: pointerdown (covers mouse, touch, pen), keydown (keypress is deprecated; keyboard-wedge scanners type), wheel, and a visibilitychange to visible. Configurable list.
  • Listeners registered passive: true, capture: true on window; removed on dispose().
  • No navigator.userActivation sampling — listeners are cheaper and cover every browser.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions