Skip to content

Add a floating focus Mini Timer#289

Open
caezium wants to merge 1 commit into
JerryZLiu:mainfrom
caezium:feature/focus-mini-timer
Open

Add a floating focus Mini Timer#289
caezium wants to merge 1 commit into
JerryZLiu:mainfrom
caezium:feature/focus-mini-timer

Conversation

@caezium

@caezium caezium commented Jun 23, 2026

Copy link
Copy Markdown

What

Adds an optional, always-on-top focus Mini Timer — a small floating pill that shows today's focused time and counts up live.

How it works

  • Focused time is aggregated from analyzed timeline cards (everything that isn't Idle or Distraction), using the epoch start_ts/end_ts columns rather than the display text.
  • Because analysis runs in ~15-min batches, the timer is live-optimistic: it takes the processed total and extends the most recent focused segment forward to now, but only while you're actively recording — not paused, and not idle (a non-latching CGEventSource system-idle check). When the next batch lands, the processed total absorbs the gap, so the number stays smooth. The forward extension is capped so a stalled pipeline can't run it away.

UX

  • Non-activating NSPanel at floating level, joins all Spaces (incl. fullscreen), draggable, remembers its position. Off by default.
  • Toggle from the menu bar (Show/Hide Focus Timer) or Settings → Other.

Files

  • New: ProductivityStats, ProductivityPreferences, MiniTimerWindowController, MiniTimerView, and a small epoch-based fetchTimelineActivity query on StorageManager.
  • Touched: AppDelegate (startup), StatusMenuView (menu toggle), SettingsOtherTabView (settings toggle).

Builds against main. The shared ProductivityStats/fetchTimelineActivity helper is intentionally small so a companion distraction-nudges change can reuse it.

Adds an optional always-on-top pill that shows today's focused time and
counts up live. Focused time is aggregated from analyzed timeline cards
(everything that isn't idle or a distraction) using epoch timestamps, and
the most recent focused segment is optimistically extended to now while the
user is actively recording (not paused, not idle — a non-latching
CGEventSource system-idle check).

- Non-activating NSPanel, floats across Spaces incl. fullscreen, draggable,
  position remembered. Off by default.
- Toggle from the menu bar (Show/Hide Focus Timer) and Settings > Other.

New: ProductivityStats, ProductivityPreferences, MiniTimerWindowController,
MiniTimerView, and a small epoch-based fetchTimelineActivity query.
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