Skip to content

Conversation

@earth9890
Copy link

Implement comprehensive idle time tracking functionality that allows users to monitor periods of inactivity alongside their active app and website usage.

New Features

Configurable Idle Timeout

  • Add idle timeout setting in Settings → General
  • Support timeout options: 1, 2, 5, 10, 15, 30 minutes
  • Default timeout: 5 minutes (maintains existing behavior)
  • Settings stored in UserDefaults with environment separation

Idle Time Tracking

  • Detect system idle time using CGEventSource
  • Create idle sessions when user becomes inactive
  • Seamlessly transition between active and idle states
  • Store idle periods as UsageSession objects with type "idle"

Enhanced Visualization

  • Include idle time in pie charts (gray color)
  • Display up to 6 categories instead of 5 to accommodate idle time
  • Show idle time alongside top apps in usage breakdown
  • Support both daily and weekly idle time aggregation

Data Model Updates

  • Add idle case to UsageType enum
  • Update UsageAggregator to handle idle sessions
  • Enhance data fetching to include idle time in analytics
  • Maintain backward compatibility with existing data

Technical Implementation

Core Changes

  • UsageType.swift: Added idle usage type
  • TrackingService.swift: Idle detection logic and session management
  • SettingsStore.swift: Configurable idle timeout setting
  • ContentView.swift: Enhanced data aggregation including idle sessions
  • UsagePieChart.swift: Visual support for idle time display
  • GeneralSettingsView.swift: UI for idle timeout configuration
  • UsageAggregator.swift: Idle time support in AI summaries

Benefits

  • Better productivity insights with complete time accounting
  • Configurable tracking based on user work patterns
  • Visual distinction between active usage and idle periods
  • Enhanced time awareness and usage analytics

Implement comprehensive idle time tracking functionality that allows users to
monitor periods of inactivity alongside their active app and website usage.

## New Features

### Configurable Idle Timeout
- Add idle timeout setting in Settings → General
- Support timeout options: 1, 2, 5, 10, 15, 30 minutes
- Default timeout: 5 minutes (maintains existing behavior)
- Settings stored in UserDefaults with environment separation

### Idle Time Tracking
- Detect system idle time using CGEventSource
- Create idle sessions when user becomes inactive
- Seamlessly transition between active and idle states
- Store idle periods as UsageSession objects with type "idle"

### Enhanced Visualization
- Include idle time in pie charts (gray color)
- Display up to 6 categories instead of 5 to accommodate idle time
- Show idle time alongside top apps in usage breakdown
- Support both daily and weekly idle time aggregation

### Data Model Updates
- Add `idle` case to UsageType enum
- Update UsageAggregator to handle idle sessions
- Enhance data fetching to include idle time in analytics
- Maintain backward compatibility with existing data

## Technical Implementation

### Core Changes
- **UsageType.swift**: Added idle usage type
- **TrackingService.swift**: Idle detection logic and session management
- **SettingsStore.swift**: Configurable idle timeout setting
- **ContentView.swift**: Enhanced data aggregation including idle sessions
- **UsagePieChart.swift**: Visual support for idle time display
- **GeneralSettingsView.swift**: UI for idle timeout configuration
- **UsageAggregator.swift**: Idle time support in AI summaries

### Benefits
- Better productivity insights with complete time accounting
- Configurable tracking based on user work patterns
- Visual distinction between active usage and idle periods
- Enhanced time awareness and usage analytics
@renjfk
Copy link
Owner

renjfk commented Nov 10, 2025

Hello,

Thank you for your interest in the project. Could you please elaborate on the reasoning behind introducing the "idle" type? For example, I keep my laptop open 24/7 and with these changes, my timeline will be fully painted. I'm okay with introducing a setting for idle timeout but the idle type needs more explanation.

@earth9890
Copy link
Author

Hello,

Thank you for your interest in the project. Could you please elaborate on the reasoning behind introducing the "idle" type? For example, I keep my laptop open 24/7 and with these changes, my timeline will be fully painted. I'm okay with introducing a setting for idle timeout but the idle type needs more explanation.

Thank you for reviewing my PR!

I initially added the idle type while implementing the idle timeout setting - the idea was that it could be useful later for tracking system activity patterns (for example, identifying when the system is idle between 1 to 5 and active again from 5 to 9). It felt like a good way to differentiate between active and idle states for potential analytics or optimizations down the line.

I waited for the PR to be reviewed, but since it took a bit longer, I went ahead and made additional updates myself - including UI improvements, new features, and onboarding flow with permission prompts, Google Auth, and Supabase integration (though sync isn’t working yet).

Thanks for the amazing app. @renjfk

https://d.pr/v/O3Jrsq

@renjfk
Copy link
Owner

renjfk commented Nov 11, 2025

I see, so the way I understand there's no concrete use case yet. In that case I cannot accept the idle type for the reason I stated. But like I said I'm totally okay with adding idle timeout configuration.

The demo looks great; I'm genuinely impressed, though it's also something I didn't envision while creating this app. While there are many apps in the market doing similar or more advanced things, SimplyTrack is intentionally designed to be minimalist, as mentioned in the README: "a clean, privacy-focused, local-only productivity tracker that gives you insights without the bloat."

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