Harden iOS app with audit fixes, UI consistency, and sheet race condition fixes

Applies verified fixes from deep audit (concurrency, performance, security,
accessibility), standardizes CRUD form buttons to Add/Save pattern, removes
.drawingGroup() that broke search bar TextFields, and converts vulnerable
.sheet(isPresented:) + if-let patterns to safe presentation to prevent
blank white modals.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-03-06 09:59:56 -06:00
parent 61ab95d108
commit 9c574c4343
76 changed files with 824 additions and 971 deletions

View File

@@ -40,13 +40,7 @@ struct CompleteTaskIntent: AppIntent {
func perform() async throws -> some IntentResult {
print("CompleteTaskIntent: Starting completion for task \(taskId)")
// Mark task as pending completion immediately (optimistic UI)
WidgetActionManager.shared.markTaskPendingCompletion(taskId: taskId)
// Reload widget immediately to update task list and stats
WidgetCenter.shared.reloadTimelines(ofKind: "Casera")
// Get auth token and API URL from shared container
// Check auth BEFORE marking pending if auth fails the task should remain visible
guard let token = WidgetActionManager.shared.getAuthToken() else {
print("CompleteTaskIntent: No auth token available")
WidgetCenter.shared.reloadTimelines(ofKind: "Casera")
@@ -59,6 +53,12 @@ struct CompleteTaskIntent: AppIntent {
return .result()
}
// Mark task as pending completion (optimistic UI) only after auth is confirmed
WidgetActionManager.shared.markTaskPendingCompletion(taskId: taskId)
// Reload widget immediately to update task list and stats
WidgetCenter.shared.reloadTimelines(ofKind: "Casera")
// Make API call to complete the task
let success = await WidgetAPIClient.quickCompleteTask(
taskId: taskId,