The Journeys module is the diagnostic heart of the application. Instead of showing abstract totals (e.g., “3 hours of screen time”), it visualizes the user’s day as a vertical timeline. It maps exactly when the phone was unlocked, which apps were used in succession, how much scrolling occurred, and—crucially—what triggered the session (e.g., a notification).To the user, this looks like a “travel log” of their digital life, highlighting both active usage and the “gaps” where they successfully stayed off their device.
The module follows a strict pattern. It relies on a heavy data aggregation layer that synthesizes multiple raw data sources into a single “Journey” table.
Dotted Lines: Represent “Gaps” (time spent off the phone).
Anchor Dots: Placed at the start of every unlock event.
Intrinsic Measurements: The module uses IntrinsicSize.Min to ensure the vertical timeline line perfectly matches the height of the content cards, regardless of how many apps were used in that session.
The consolidateEvents function performs several critical transformations:
Debouncing: If a user switches between apps in less than 2 seconds (e.g., checking a 2FA code), the segments are merged or treated as a single flow to reduce noise.
Noise Filtering: System apps (launchers, settings, system UI) are stripped out to focus on “intentional” app usage.
Trigger Attribution: The algorithm looks back 15 seconds from an unlock. If a notification arrived in that window, it marks the session as “Notification Triggered.”
Duration Calculation: It calculates the delta between app switches to determine exactly how long each app was used.