The Detail module is the analytical heart of the application. It serves two primary purposes:
Scroll Dashboard: A high-level overview of scrolling behavior across all apps, featuring a and ranked lists.
App Deep-Dive: A granular view of a specific application’s performance, including “Focus Quality” (active vs. passive time), “Physical Effort” (meters scrolled), and “Launch Triggers” (notifications vs. intentional opens).
This module transforms raw system events into human-readable “physical” metrics, helping users understand the literal distance their thumbs travel.
Extraction: ViewModels request data from ScrollDataRepository and AppMetadataRepository based on a selected LocalDate or ScrollDetailPeriod (Daily, Weekly, Monthly).
Transformation: The AppUiModelMapper performs heavy lifting by combining usage records, scroll data, and -injected limit configurations into AppScrollUiItem objects.
Presentation: The UI observes a single UiState (for the dashboard) or multiple specialized flows (for app details) to render charts and Bento-style insight grids.
The ViewModels use flatMapLatest and combine operators to ensure the UI stays in sync with user interactions. For example, when a user changes the date on the heatmap, the ScrollDetailViewModel automatically triggers a new data fetch for that specific window, re-mapping all app items to reflect that day’s usage.
A unique feature of this module is its handling of uninstalled applications. If the ScrollDataRepository returns data for a package that is no longer found in AppMetadataRepository, the system aggregates these into a RemovedAppsData object. This ensures that historical “physical effort” is never lost, even if the app is deleted.
The module uses a TutorialScaffold and TutorialRepository to manage the “Spotlight” onboarding. It tracks whether a user has seen the scroll distance explanation and uses TutorialTargetId to highlight specific UI elements like the “Limit Icon” or “Heatmap.”
The module relies on a ConversionUtil to translate raw or pixels into meters and kilometers.
Legacy Data: Older versions stored scroll data in pixels. The AppDetailViewModel includes logic to normalize legacy pixels to micrometers (using a 160 DPI baseline) to maintain historical continuity.
Aggregation: For Weekly/Monthly views, the system calculates a “Daily Average” by dividing the period total by the number of days, providing a normalized view of behavior trends.