← ALL LABS

LAB 004 / RESEARCH

Idle-aware Focus Tracking

Modeling trustworthy focus and away boundaries from minimal Windows activity signals.

STATUSCOMPLETEDATE2026-08-03MODETECHNICAL NOTE

01 / LAB NOTES

01 / SECTION

Question

How can a break-reminder application measure meaningful computer activity without monitoring what a person types, clicks, reads, or views?

02 / SECTION

Constraints

The tracker should use only elapsed idle duration and operating-system lifecycle signals. It must not collect keystrokes, pointer coordinates, screenshots, open documents, or application content. Its history should also survive lock, sleep, suspend, timer stalls, and application restarts without inventing focus time.

03 / SECTION

Approach

Represent the day as wall-clock segments rather than a single accumulated timer. Verified active ticks extend a focus segment. Crossing the configured idle threshold closes that segment at the last recorded input and removes the threshold’s idle tail. Returning closes the away segment and begins a new focus session.

Lock and suspend signals close activity immediately. An unusually large gap between timer ticks is treated conservatively as away time, and an open segment found after restart is closed rather than stretched across the shutdown.

04 / SECTION

Experiment

Pure activity functions were separated from Electron window and tray code, then exercised with deterministic tests for idle-tail correction, away-to-focus transitions, session resets, and stale restart state.

05 / SECTION

Result

The resulting timeline preserves real clock position and excludes idle grace periods from focused work. That makes reminder thresholds and daily rhythm views more credible while retaining a narrow privacy boundary.

06 / SECTION

What I changed

Moved session-boundary logic into a pure module, made the Electron main process the single runtime authority, and treated uncertainty—sleep, restart, or missed ticks—as away time instead of assuming continued focus.

TOOLS & TECHNOLOGIES

01TypeScript02Electron03Windows APIs04Vitest