No actionable comments were generated in the recent review.
Walkthrough
-
This change adds an optional Screen Time link for Pomodoro focus sessions. A local API route validates requests and communicates with Screen Time. Pomodoro and settings display link status, and lesson details provide focus goals and resource URLs.
Changes: Screen Time focus link
Layer / File(s) Summary Screen Time contracts and focus sync
apps/web/src/lib/screen-time/contract.ts,apps/web/src/lib/screen-time/client.ts,apps/web/src/lib/__tests__/screen-time-link.test.tsDefines request and status schemas, manages the local link setting, maps timer state to focus intents, and synchronizes updates with deduplication and queued-intent handling. Tests cover intent mapping, request dispatch, release, and recovery behavior. Local Screen Time adapter and session route
apps/web/src/lib/server/screen-time.ts,apps/web/src/routes/api/screen-time/session.ts,apps/web/src/routeTree.gen.ts,apps/web/src/lib/__tests__/screen-time-adapter.test.tsAdds local connection-file validation and Screen Time API calls. The session route handles status, validated start, and stop requests. The generated route tree registers the endpoint. Tests cover connection handling, request results, paths, and allowed-site selection. Pomodoro, lesson, and settings integration
apps/web/src/components/learning/Pomodoro.tsx,apps/web/src/components/learning/ScreenTimeSettings.tsx,apps/web/src/views/studio/learn.tsx,apps/web/src/views/studio/personal-settings.tsx,apps/web/src/lib/__tests__/screen-time-pomodoro.test.tsx,docs/syllo-setup.mdThe lesson page supplies a goal and filtered resource URLs. Pomodoro synchronizes focus intent, checks status, and displays link status. Personal settings adds the Screen Time link control. Tests cover timer and status behavior, and the setup guide documents the link. Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Feature
Sequence Diagram(s)
mermaid1 sequenceDiagram 2 participant Pomodoro 3 participant ScreenTimeClient 4 participant SessionRoute 5 participant ScreenTimeAdapter 6 participant ScreenTimeAPI 7 Pomodoro->>ScreenTimeClient: Send focus intent when linked 8 ScreenTimeClient->>SessionRoute: Request status, start, or stop 9 SessionRoute->>ScreenTimeAdapter: Run the requested operation 10 ScreenTimeAdapter->>ScreenTimeAPI: Send authenticated loopback request 11 ScreenTimeAPI-->>ScreenTimeAdapter: Return session response 12 ScreenTimeAdapter-->>SessionRoute: Return mapped status 13 SessionRoute-->>ScreenTimeClient: Return status as JSON 14 ScreenTimeClient-->>Pomodoro: Update link status
Merge Risk: External image Low · up to 06032
-
This adds an optional, off-by-default Screen Time link that starts and stops a focus session with the Pomodoro timer. A few minor edge cases remain: a failed stop after pause may not be shown, a failed start has no retry path, a repeated unlink during an in-flight start may leave blocking on, and overlapping status checks in Settings can show stale information. None of these affect the timer itself, so it is mergeable with these tracked as follow-ups.
Pre-merge checks: Passed 4
-
Check name Status Explanation Title check Passed The title "feat(learn): start a screen time focus session with each focus period" matches the main change. The PR adds an optional Screen Time link that starts a Screen Time session with each Pomodoro… Linked Issues check Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request. Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled. Full details: Title check
-
Explanation
The title "feat(learn): start a screen time focus session with each focus period" matches the main change. The PR adds an optional Screen Time link that starts a Screen Time session with each Pomodoro focus period, and it stops the session on breaks, pauses, resets, and disabling the link. The title is specific and does not describe unrelated work. The changeset also includes supporting pieces (server route, client, allowlist logic, settings UI, and docs) that the title does not name, which is expected for a title.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit starts the focus clock,
And checks the link beside the lock.
Lesson goals and sites take flight,
Status checks return in sight.
When focus ends, the link lets go,
Then off to nibble greens below.
External image Recent review info
-
External image Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: ASSERTIVE
- Plan: Advanced
- Run ID:
be6d4df8-4c69-44cd-8be4-570d8606d616
External image Commits
-
Reviewing files that changed from the base of the PR and between 036b00022e83f1c9ed667e50b8af6fa03c897c26 and 0603231c0260f052d3f6f08bae8b7e4ffed0d1c3.
External image Files selected for processing: 8
-
apps/web/src/components/learning/Pomodoro.tsxapps/web/src/lib/__tests__/screen-time-adapter.test.tsapps/web/src/lib/__tests__/screen-time-link.test.tsapps/web/src/lib/__tests__/screen-time-pomodoro.test.tsxapps/web/src/lib/screen-time/client.tsapps/web/src/lib/screen-time/contract.tsapps/web/src/lib/server/screen-time.tsdocs/syllo-setup.md
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
External image Recent review info
-
External image Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: ASSERTIVE
- Plan: Advanced
- Run ID:
be6d4df8-4c69-44cd-8be4-570d8606d616
External image Commits
-
Reviewing files that changed from the base of the PR and between 036b00022e83f1c9ed667e50b8af6fa03c897c26 and 0603231c0260f052d3f6f08bae8b7e4ffed0d1c3.
External image Files selected for processing: 8
-
apps/web/src/components/learning/Pomodoro.tsxapps/web/src/lib/__tests__/screen-time-adapter.test.tsapps/web/src/lib/__tests__/screen-time-link.test.tsapps/web/src/lib/__tests__/screen-time-pomodoro.test.tsxapps/web/src/lib/screen-time/client.tsapps/web/src/lib/screen-time/contract.tsapps/web/src/lib/server/screen-time.tsdocs/syllo-setup.md
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
-