Add custom interval days support for task frequency

- Add customIntervalDays field to Kotlin models (TaskResponse, TaskCreateRequest, TaskUpdateRequest)
- Update Android AddTaskDialog to show interval field only for "Custom" frequency
- Update Android EditTaskScreen for custom frequency support
- Update iOS TaskFormView for custom frequency support
- Fix preview data in TaskCard and TasksSection to include new field
- Add customIntervalDays to OnboardingFirstTaskView

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-13 19:05:59 -06:00
parent 3140c75815
commit 33ee445aea
20 changed files with 524 additions and 238 deletions

View File

@@ -219,6 +219,14 @@ class MainActivity : ComponentActivity(), SingletonImageLoader.Factory {
lifecycleScope.launch {
Log.d("MainActivity", "🔄 App resumed, checking for lookup updates...")
APILayer.refreshLookupsIfChanged()
// Check if widget completed a task - refresh data if dirty
if (TaskCacheStorage.areTasksDirty()) {
Log.d("MainActivity", "🔄 Tasks marked dirty by widget, refreshing...")
TaskCacheStorage.clearDirtyFlag()
// Force refresh tasks from API
APILayer.getTasks(forceRefresh = true)
}
}
}

View File

@@ -24,9 +24,32 @@ actual class TaskCacheManager(private val context: Context) {
prefs.edit().remove(KEY_TASKS).apply()
}
/**
* Check if tasks need refresh due to widget interactions.
*/
actual fun areTasksDirty(): Boolean {
return prefs.getBoolean(KEY_DIRTY_FLAG, false)
}
/**
* Mark tasks as dirty (needs refresh).
* Called when widget modifies task data.
*/
actual fun markTasksDirty() {
prefs.edit().putBoolean(KEY_DIRTY_FLAG, true).apply()
}
/**
* Clear the dirty flag after tasks have been refreshed.
*/
actual fun clearDirtyFlag() {
prefs.edit().putBoolean(KEY_DIRTY_FLAG, false).apply()
}
companion object {
private const val PREFS_NAME = "mycrib_cache"
private const val KEY_TASKS = "cached_tasks"
private const val KEY_DIRTY_FLAG = "tasks_dirty"
@Volatile
private var instance: TaskCacheManager? = null