How TabStyr counts your active time
"Active time" sounds like a simple thing to measure. It isn't, once you account for how people actually use a browser.
The basic idea
TabStyr watches which tab has focus and books time to it while your browser window is focused, your OS isn't idle, and (if the tab isn't producing audio) you've interacted recently enough to count as "here." Switch tabs, and the clock moves with you. Nothing is measured server-side — there's no server. It's a background script counting seconds and writing them to your browser's own IndexedDB.
Where it gets interesting
Idle detection. If you stop moving the mouse or typing for longer than your configured threshold (default: 3 minutes), the active tab stops accruing time. Reading a long article without touching the keyboard for 10 minutes will eventually pause — unless that tab is also playing audio, which brings us to:
Audio is tracked separately. A YouTube video playing in a background tab while you work in another one is real usage, but it isn't active usage of the tab playing it. TabStyr counts it, but as its own bucket, so your active-time total never gets inflated by "a video was open somewhere."
Sleep and lock are capped, not exact. Close your laptop lid for three hours and TabStyr doesn't book three hours of active time. Non-media sessions open when the OS sleeps or locks get closed and capped at 30 minutes — long enough to not lose a real short break, short enough that a multi-hour sleep never shows up as multi-hour "activity."
Crashes lose at most a minute. Time is checkpointed to storage every 60 seconds. If Chrome crashes or gets force-quit, you lose at most the seconds since the last checkpoint for whichever tab was in focus — everything before that is already saved.
There's a 24-hour ceiling. No single session — even an uncapped media session — can accumulate more than 24 hours. If your system clock jumps (an NTP correction, a VM resuming from a snapshot), TabStyr can't be tricked into showing days of bogus activity.
Why this level of detail matters
Most of the value of a time tracker is trust. If the number on the dashboard doesn't match what you feel like you did today, you stop looking at it. Getting idle detection, audio handling, and crash recovery right isn't glamorous, but it's the difference between a number you check because it's honest and a number you ignore because it's noise.
If you want the exhaustive list of edge cases and deliberate limitations (there are a few — calendar-day-only buckets, no cross-app tracking, local-dev hosts grouped together), the README's Scope & limitations section has all of them.