Skip to content

Lucas/onboarding browser activity#12

Merged
rxv801 merged 13 commits into
lucas/onboardingfrom
lucas/onboarding-browser-activity
Jun 11, 2026
Merged

Lucas/onboarding browser activity#12
rxv801 merged 13 commits into
lucas/onboardingfrom
lucas/onboarding-browser-activity

Conversation

@lukitasxue

Copy link
Copy Markdown
Collaborator

Summary

This PR is stacked on top of lucas/onboarding.

Please review the base onboarding PR first, then review this PR.

This PR adds a new Browser Activity onboarding step, moves browser page rules into shared defaults, connects them to the focus environment settings hook, and cleans up camera lifecycle/comments.

Review order

Base PR first:

lucas/onboarding -> main

This PR second:

lucas/onboarding-browser-activity -> lucas/onboarding

This PR should only show the follow-up browser activity and cleanup work. If GitHub shows the whole onboarding implementation, the PR base is probably wrong.

What changed

New browser activity onboarding screen

electron/src/renderer/components/onboarding/BrowserActivitySelectionStep.tsx

Adds a new onboarding step for common websites/pages.

This screen lets the user mark browser activity as allowed or blocked.

Examples:

  • YouTube
  • YouTube Music
  • Spotify Web
  • WhatsApp Web
  • Email
  • Streaming services
  • AI tools
  • Social media
  • Shopping

Important: this does not detect websites yet. It only lets the user configure rules that can later be matched against the active browser window title.

For example:

"YouTube - Google Chrome"

can later match:

["youtube"]

Shared browser activity rules

electron/src/shared/browserActivity/commonBrowserActivityRules.ts

Adds the default browser activity rule catalogue.

This is separate from commonApps.ts because browser activity rules are not installed desktop programs.

It includes:

  • Rule id
  • Label
  • Description
  • Match text
  • Category
  • Default status

Example distinction:

commonApps.ts
= installed desktop apps, like VS Code, Discord, Steam

commonBrowserActivityRules.ts
= websites/pages, like YouTube, Gmail, Netflix, ChatGPT

Focus environment settings integration

electron/src/renderer/hooks/useFocusEnvironmentSettings.ts

Updates the settings hook so it now owns both:

  • Desktop app rules
  • Browser activity rules

It now exposes:

  • Blocked browser activity rules
  • Flexible browser activity rules
  • Browser activity rule status updater

The browser activity rules are saved in the same localStorage object:

taskmaster:focusEnvironmentSettings

This keeps the focus environment settings in one place.

Onboarding flow update

electron/src/renderer/pages/OnboardingPage.tsx

Adds the Browser Activity screen into the onboarding flow.

Updated flow:

Welcome -> Camera setup -> Desktop app whitelist -> Browser activity -> Distraction options -> Menu

Browser activity UI styling

electron/src/renderer/index.css

Adds styling for the new browser activity screen.

The layout was changed to a single-column list because website descriptions need more horizontal space than desktop app names.

Camera lifecycle cleanup

electron/src/renderer/hooks/useCameraDevices.ts

Improves the camera lifecycle so the preview stream is stopped when the camera setup step unmounts.

Expected behaviour:

Welcome:
camera off

Camera setup:
camera on

Continue to desktop app whitelist:
camera turns off after the transition

Back to camera setup:
camera turns on again

Because onboarding uses an exit animation, the camera may stay on briefly during the transition before the previous screen fully unmounts.

Camera setup comments and cleanup

electron/src/renderer/components/onboarding/OnboardingCameraSetup.tsx

Adds clearer comments and makes the video preview cleanup more explicit.

General comments and structure cleanup

Adds file headers and higher-level comments to make the onboarding code easier for new contributors to understand.

Suggested review focus

Please focus on:

  1. BrowserActivitySelectionStep.tsx

    • UI structure
    • Whether browser activity rules are presented clearly
    • Whether toggles update the hook correctly
  2. commonBrowserActivityRules.ts

    • Whether the default website groups make sense
    • Whether grouped rules like Email, Streaming, and AI tools are reasonable
  3. useFocusEnvironmentSettings.ts

    • Whether app rules and browser activity rules are stored cleanly together
    • Whether the hook is still understandable with the added sections
  4. OnboardingPage.tsx

    • Whether the new onboarding step is wired correctly
  5. useCameraDevices.ts

    • Whether camera cleanup on unmount is safe and clear

Notes

This PR does not implement real browser tab detection yet.

For the MVP, browser activity will later be estimated from the active browser window title. A future browser extension can replace that with accurate tab URL detection.

rxv801 and others added 13 commits June 6, 2026 14:21
* "Claude PR Assistant workflow"

* "Claude Code Review workflow"
* feat(cv): add phone detector placeholder + detection loop

- phone_detector.py: detect_phone(frame) placeholder, returns protocol-shaped
  event ({type,status,confidence,timestamp}); real detector slots in behind it
- detection_loop.py: camera -> detect_phone -> print loop at 10fps, clean shutdown
- requirements.txt: pin CV/server deps (Python 3.11; MediaPipe lacks 3.13/3.14 wheels)
- setup.sh: one-shot install for Python venv + Electron npm
- docs: python/README.md (incl. camera vs loop separation rationale), root README setup

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(cv): implement phone detection with YOLOX via onnxruntime

Replace the placeholder detect_phone() with a real detector:
- find_phones(frame): YOLOX-S inference -> decoded, thresholded, NMS'd boxes
- detect_phone(frame): per-frame protocol event (status/confidence/timestamp)
- phone_detect_test.py: visual webcam test that reuses find_phones()
- lazy-loaded onnxruntime session (load model once, reuse every frame)
- setup.sh fetches yolox_s.onnx; onnxruntime added to requirements
- gitignore *.task for the upcoming gaze model

Detector is perception only ("phone in this frame?"); distracted-state
policy (smoothing / N-second timer) stays in the loop layer.

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…tor tabs detection UI and detection logic (possibly)
* ci: add Electron workflow

* ci: add Electron and Python workflows
* Onboarding flow updates: added new onboarding steps, updated styles, and removed old assets and components. The new onboarding steps include Camera Setup, Distraction Options, Focus Environment, and Welcome. The styles for the onboarding flow have been updated to enhance the visual appeal and user experience. Old assets such as hero.png, react.svg, and vite.svg have been removed to streamline the design. Additionally, the Onboarding component has been deleted in favor of a more modular approach with individual components for each onboarding step.

* changes on onboarding file names and added camera status and camera selection in camera setup step

@rxv801 rxv801 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should fix soon:

  • ipc-handlers.ts — duplicate import { ipcMain } from 'electron' (build/lint risk)
  • Remove leftover debug console.logs — detectCommonWindowsApps.ts (one marked "remove later"), ipc-handlers.ts, preload/index.js

Confirm / clarify:

  • preload/index.ts deleted, raw index.js committed (skips type-check, uses CJS in an ESM app) — intentional?
    -- shared/protocol.ts looks deleted — intended?
  • detectCommonWindowsApps is Windows-only + detects installed (not running) apps — flag as cross-platform / runtime-detection

overall seems fine to me

@rxv801 rxv801 merged commit 0d7ee4b into lucas/onboarding Jun 11, 2026
6 checks passed
rxv801 added a commit that referenced this pull request Jun 12, 2026
* Onboarding flow updates: added new onboarding steps, updated styles, and removed old assets and components. The new onboarding steps include Camera Setup, Distraction Options, Focus Environment, and Welcome. The styles for the onboarding flow have been updated to enhance the visual appeal and user experience. Old assets such as hero.png, react.svg, and vite.svg have been removed to streamline the design. Additionally, the Onboarding component has been deleted in favor of a more modular approach with individual components for each onboarding step.

* changes on onboarding file names and added camera status and camera selection in camera setup step

* Lucas/onboarding browser activity (#12)

* Add claude GitHub actions 1778132378878 (#4)

* "Claude PR Assistant workflow"

* "Claude Code Review workflow"

* feat(cv): phone detection (YOLOX-S via onnxruntime) (#5)

* feat(cv): add phone detector placeholder + detection loop

- phone_detector.py: detect_phone(frame) placeholder, returns protocol-shaped
  event ({type,status,confidence,timestamp}); real detector slots in behind it
- detection_loop.py: camera -> detect_phone -> print loop at 10fps, clean shutdown
- requirements.txt: pin CV/server deps (Python 3.11; MediaPipe lacks 3.13/3.14 wheels)
- setup.sh: one-shot install for Python venv + Electron npm
- docs: python/README.md (incl. camera vs loop separation rationale), root README setup

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(cv): implement phone detection with YOLOX via onnxruntime

Replace the placeholder detect_phone() with a real detector:
- find_phones(frame): YOLOX-S inference -> decoded, thresholded, NMS'd boxes
- detect_phone(frame): per-frame protocol event (status/confidence/timestamp)
- phone_detect_test.py: visual webcam test that reuses find_phones()
- lazy-loaded onnxruntime session (load model once, reuse every frame)
- setup.sh fetches yolox_s.onnx; onnxruntime added to requirements
- gitignore *.task for the upcoming gaze model

Detector is perception only ("phone in this frame?"); distracted-state
policy (smoothing / N-second timer) stays in the loop layer.

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* whitelist common windows apps detection, and UI, preparing for navigator tabs detection UI and detection logic (possibly)

* minor fixes on build, unused import

* ci: add Electron workflow (#7)

* ci: add Electron workflow

* ci: add Electron and Python workflows

* Lucas/onboarding (#6)

* Onboarding flow updates: added new onboarding steps, updated styles, and removed old assets and components. The new onboarding steps include Camera Setup, Distraction Options, Focus Environment, and Welcome. The styles for the onboarding flow have been updated to enhance the visual appeal and user experience. Old assets such as hero.png, react.svg, and vite.svg have been removed to streamline the design. Additionally, the Onboarding component has been deleted in favor of a more modular approach with individual components for each onboarding step.

* changes on onboarding file names and added camera status and camera selection in camera setup step

* no changes

* merge conflicts solved

* Add browser activity onboarding rules UI and logic

* Clean up camera setup lifecycle and comments

* fixed environment focus settings directory

---------

Co-authored-by: Saatvik Sharma <200460255+rxv801@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Saatvik Sharma <200460255+rxv801@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.

2 participants