Skip to content

feat(electron): classify focus activity during sessions#20

Open
lukitasxue wants to merge 2 commits into
lucas/native-messaging-hostfrom
lucas/activity-classification
Open

feat(electron): classify focus activity during sessions#20
lukitasxue wants to merge 2 commits into
lucas/native-messaging-hostfrom
lucas/activity-classification

Conversation

@lukitasxue

@lukitasxue lukitasxue commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds renderer-side focus activity classification during active Deep Sesh sessions.

Taskmaster now combines desktop app activity and browser tab activity into one focus monitoring session model, then classifies the current activity as allowed, blocked, ignored, or unknown.

What changed

  • Adds useFocusMonitoringSession as the renderer hook for focus monitoring state.
  • Combines desktop app snapshots and browser tab snapshots into one activity model.
  • Classifies activity against saved focus environment rules.
  • Shows the classified activity in FocusMonitorPanel.
  • Tracks blocked/distraction events with a warning delay.
  • Tracks unknown activity in session memory for later review.
  • Wires DeepSeshPage to receive desktop activity updates from Electron main.
  • Cleans up browser monitoring state when the page/session is no longer active.

Behavior notes

  • “Blocked” means Taskmaster warns the user; it does not close apps or block websites.
  • Unknown apps/pages are collected for later review, but this PR does not add the final review screen.
  • Browser pages are preferred over the browser executable when tab metadata is available.
  • Monitoring only runs during active/paused Deep Sesh sessions.

Test plan

  • Start a Pomodoro/Deep Sesh session.
  • Switch between allowed apps, blocked apps, and unknown apps.
  • Open browser tabs such as GitHub, YouTube, ChatGPT, or unknown domains.
  • Confirm FocusMonitorPanel shows the current activity and classification.
  • Stay on a blocked activity long enough to trigger the warning state.
  • Return to an allowed activity and confirm the warning clears.
  • Stop the session and confirm monitoring stops.
  • Run:
    • cd electron
    • npm run lint
    • npm run build

@lukitasxue lukitasxue force-pushed the lucas/activity-classification branch from ab9e81d to 943ac79 Compare June 17, 2026 07:02
@lukitasxue lukitasxue force-pushed the lucas/activity-classification branch from 943ac79 to a6715be Compare June 17, 2026 07:11
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