Shared Helpers
The @life-manager/shared/helper package contains feature-grouped business logic used by both platforms. Import via @life-manager/shared/helper or @life-manager/shared/helper/<domain>/<file>.
Work Helpers
Section titled “Work Helpers”treeHelperFunctions (397 LOC)
Section titled “treeHelperFunctions (397 LOC)”Full CRUD operations for the hierarchical project/folder tree structure.
addFolder,renameFolder,deleteFolder— folder management with parent validationmoveProject,moveFolder— drag-and-drop reordering supportbuildTree— convert flat lists to nested tree structuregetFolderPath,getDescendants— tree traversal utilities
workHelperFunctions (286 LOC)
Section titled “workHelperFunctions (286 LOC)”Work-related calculations and formatting utilities.
secondsToTimerFormat— convert seconds toHH:MM:SSdisplaygetRoundedSeconds— apply rounding rules (up/down/nearest) to time valuescalculateEarnings— compute earnings from duration and hourly salaryformatDuration— human-readable duration strings
timeEntryHelperFunctions (200 LOC)
Section titled “timeEntryHelperFunctions (200 LOC)”Time entry grouping, aggregation, and formatting.
- Group time entries by day, week, or project
- Calculate total durations and earnings per group
- Sort and filter entries by date ranges
timeTrackerFunctions (72 LOC)
Section titled “timeTrackerFunctions (72 LOC)”Timer session calculations used by the timer engine.
calculateSessionTimeValues— compute elapsed time, remaining time, and progress for active timer sessions
resolveTimeEntryOverlaps (97 LOC)
Section titled “resolveTimeEntryOverlaps (97 LOC)”Detects and resolves overlapping time entries.
- Identify entries that overlap in time ranges
- Split or trim entries to resolve conflicts
- Used when submitting new timer results or editing entries manually
getTimeFragmentSession (54 LOC)
Section titled “getTimeFragmentSession (54 LOC)”Computes time fragment sessions for partial-day calculations and calendar views.
Finance Helpers
Section titled “Finance Helpers”financeHelperFunction (131 LOC)
Section titled “financeHelperFunction (131 LOC)”Finance calculation and formatting utilities.
- Anchor-day logic for recurring cashflows (handles month-end edge cases like Feb 28/29)
- Currency formatting helpers
- Cashflow categorization (income vs. expense)
processRecurringCashflows (116 LOC)
Section titled “processRecurringCashflows (116 LOC)”Processes recurring cashflow definitions into concrete single cashflow instances.
- Evaluate which recurring cashflows are due based on current date
- Generate pending single cashflow records from recurring definitions
- Handle interval types (daily, weekly, monthly, yearly)
- Called automatically at app startup via
useProcessRecurringCashflows
calculateFinanceProjectValues (62 LOC)
Section titled “calculateFinanceProjectValues (62 LOC)”Computes aggregated values for finance projects.
- Sum up all associated cashflows (single + recurring)
- Apply project adjustments
- Calculate current balance, total income, total expenses
Pomodoro Helpers
Section titled “Pomodoro Helpers”pomodoroFunctions (174 LOC)
Section titled “pomodoroFunctions (174 LOC)”Pomodoro technique phase management and state reconstruction.
getPhaseDuration— return duration for current phase (work/short break/long break)shouldPauseForTransition— determine if timer should auto-pause between phasesshouldStopForLongBreak— determine if cycle is completereconstructPomodoroState— rebuild phase state from persisted timer data (for app restart recovery)- Phase cycle counting and progression logic
pomodoroStyles (90 LOC)
Section titled “pomodoroStyles (90 LOC)”Visual styling constants for pomodoro phases — colors, icons, and border styles per phase type.
Appointment Helpers
Section titled “Appointment Helpers”appointmentTimerHelpers (136 LOC)
Section titled “appointmentTimerHelpers (136 LOC)”Utilities for appointment-timer integration.
getProjectRoundingSettings— extract rounding config from a project for timer use- Validate appointment time ranges
- Convert between appointment and timer data formats
appointmentFormHelper (39 LOC)
Section titled “appointmentFormHelper (39 LOC)”Default values and validation helpers for the appointment creation/edit form.