Summary
The Today Summary Dashboard is the home screen of the application. It provides users with an immediate, high-level overview of their digital habits for the current day. It aggregates screen time, phone unlocks, notification counts, and scroll distance into a grid of cards, while also offering “Coach” suggestions to help users set or adjust their usage limits based on past behavior.How It Works
The dashboard acts as a central hub that pulls data from various tracking sources to present a unified view of the day.Initialization & Permission Check
When the screen loads, the system first checks if the necessary Android permissions (Accessibility, Usage Stats, Notification Listener) are granted. If any are missing, a “Permissions Card” is displayed at the top of the list, prompting the user to enable them.
Data Aggregation
The ViewModel requests today’s data from the local database. This includes:
- Total Screen Time: How long the screen has been on.
- Unlocks: How many times the phone was unlocked.
- Notifications: The total count of incoming alerts.
- Scroll Distance: The physical distance the user has scrolled (converted from pixels to meters).
Comparison & Analysis
The system simultaneously fetches data from the previous day. It calculates percentage changes (e.g., “10% less than yesterday”) to display trend indicators on the statistic cards.
Coach Suggestions
The “Coach” logic analyzes recent history. If a user consistently exceeds a limit, the Coach might suggest increasing it to a realistic goal. If a user stays well under a limit, it might suggest tightening it. These appear as swipeable cards at the top of the dashboard.
Data Displayed
The dashboard aggregates data from several underlying tables to create the summary view.| Field | Type | Description |
|---|---|---|
| Total Usage | Time | Total duration the screen was active today |
| Top App | App Info | The single app used most frequently this week |
| Unlocks | Integer | Count of successful device unlocks |
| Notifications | Integer | Count of posted notifications |
| Scroll Distance | String | Estimated distance scrolled (e.g., “150 m”) |
| Limits Count | Integer | Number of active app limits currently set |
| Coach Status | Enum | State of the suggestion engine (Ready, Gathering Data, etc.) |
Key Components
TodaySummaryScreen
The main UI composable. It handles the layout, including the sticky header, pull-to-refresh gestures, and the grid of statistic cards.
TodaySummaryViewModel
The brain of the screen. It coordinates data fetching, handles the logic for “Coach” suggestions, and manages the state of permissions and loading animations.
AppUiModelMapper
A helper component that transforms raw database rows into pretty UI objects, attaching app icons and human-readable names.
CoachSuggestionManager
Analyzes usage patterns over the last 7-30 days to generate intelligent suggestions for adjusting app limits.
User Interactions
- Pull to Refresh: Users can pull down on the list to force a refresh of the data. This triggers a haptic feedback effect and re-queries the database.
- Coach Cards: Users can swipe right to accept a suggestion (updating a limit) or swipe left to dismiss it.
- Navigation: Tapping on specific cards (like “Unlocks” or “Scroll Distance”) navigates the user to a detailed historical view of that specific metric.
- Quick Limits: Users can tap an hourglass icon on an app in the “Hero” card to quickly set a usage limit for that specific app.