Skip to main content

Active CommitTs List

The Commits Tab (commits.tsx) is the primary landing screen of the application. It renders a real-time list of every active commitment the user has created, each displayed as a rich card with condition indicators, recurrence metadata, and a context menu for management actions.

List Architecture

To maintain 60fps scrolling performance on low-end Android devices, the list employs a strict Container/Presentational hybrid architecture built on a heterogeneous virtualized list. Rather than rendering a ScrollView with nested .map() loops (which destroys memory on long lists), all UI elements — the permission warning, the verification card, the section header, and each task card — are flattened into a single one-dimensional array of ListItem objects.
Each card is wrapped in Animated.View with Reanimated LinearTransition springs for smooth insertion and deletion animations.

CommitCard Anatomy

Each commitment renders as a CommitCard component displaying:

Context Menu Actions

Long-pressing a card opens a floating ActionMenu anchored to the press position. Available actions include:
  • Delete — Removes the commitment after a confirmation modal
  • Lock (Strict Mode) — Navigates to the Strict Mode setup screen, making the task immutable
  • Duplicate — Creates a copy of the commitment configuration
  • Copy to… — Copies the commitment to another account or device

Permission Warning Card

If any of the eight required system permissions are revoked while commitments are active, a red-bordered warning card animates into view at the top of the list. Tapping it navigates directly to the permissions audit screen. The warning uses a 3-second warmup delay to prevent UI flashing during the initial boot sequence when permissions are still being audited.

Default Templates

When the user has no commitments yet, the list automatically populates with pre-configured example templates (e.g., “Study Session”, “Gym Workout”). Tapping a template pre-fills the commitment wizard with its configuration, allowing rapid first-time setup.