tududi/frontend/utils
Chris 402d5b05e1
Fix Today page task completion issues (#970)
* Fix Today page task completion issues

- Fix completed task border color staying as priority color
  - Add isInCompletedSection prop to TaskItem for explicit completed state
  - Tasks in completed section now always show green border regardless of priority
  - Fixes race condition where status wasn't updated during optimistic UI update

- Fix completed task reappearing after unmarking and page refresh
  - Add defensive check in backend to force clear completed_at when status is not DONE
  - Add development logging in tasksService for debugging completion toggle
  - Ensures database state is consistent even if handleCompletionStatus doesn't clear it

- Update TaskList and TasksToday components to pass isInCompletedSection prop
  - Explicitly marks tasks rendered in the completed section
  - Prevents border color flickering during state transitions

* Add comprehensive logging to debug completion issues

* Fix duplicate API requests causing completion state issues

- Separate state update logic from API call in handleTaskUpdate
- Create new updateTaskInState function for state-only updates
- Pass onTaskCompletionToggle to completed section to avoid duplicate calls
- This fixes the persistence issue where unmarked tasks came back after refresh
- Completion toggles now only make ONE API call instead of two

* Add debug logging to updateTaskInState
2026-03-24 16:45:31 +02:00
..
apiKeysService.ts Fix static base path (#549) 2025-11-16 22:43:06 +02:00
areasService.ts Fix static base path (#549) 2025-11-16 22:43:06 +02:00
attachmentsService.ts Cleanup recurring tasks 2025-12-07 14:12:38 +02:00
authUtils.ts Fix tag validation error messages not shown to user (#861) 2026-02-24 14:49:49 +02:00
backupService.ts Reorder elements (#687) 2025-12-09 10:51:51 +02:00
bannersService.ts Fix today pagination (#596) 2025-11-26 23:00:50 +02:00
dateUtils.test.ts Fix date format inconsistency in Task detail screen (#956) 2026-03-21 18:47:33 +02:00
dateUtils.ts Fix date format inconsistency in Task detail screen (#956) 2026-03-21 18:47:33 +02:00
featureFlags.ts feat: Add MCP Integration with client-agnostic instructions (#953) 2026-03-20 16:55:49 +02:00
fetcher.ts Lint frontend (#131) 2025-07-09 12:23:55 +03:00
habitsService.ts Feat: habits (#707) 2025-12-13 08:47:52 +02:00
inboxService.ts Feat add inbox flow (#676) 2025-12-08 09:21:35 +02:00
keyboardShortcutsService.ts Add custom keyboard shortcuts (#749) 2025-12-28 21:58:21 +02:00
localeUtils.ts Fix date format to respect timezone preference, not just language (#898) (#916) 2026-03-06 15:44:15 +02:00
noteDeleteUtils.ts Fix notes.js & areas.js UID usage and remove IDs. (#355) 2025-09-29 16:03:46 +03:00
notesService.ts Fix note creation with project assignment (#927) 2026-03-09 23:14:44 +02:00
profileService.ts Clear local storage on selection (#795) 2026-01-23 23:54:04 +02:00
projectsService.ts Fix static base path (#549) 2025-11-16 22:43:06 +02:00
searchService.ts Reorder elements (#687) 2025-12-09 10:51:51 +02:00
sharesService.ts Fix bug 661 (#682) 2025-12-08 16:14:10 +02:00
slugUtils.ts Setup slugify and fix nanoid issues 2025-08-08 23:14:40 +03:00
tagsService.ts Fix static base path (#549) 2025-11-16 22:43:06 +02:00
taskEventService.ts Fix bump issues (#651) 2025-12-04 18:19:40 +02:00
taskIntelligenceService.ts Lint frontend (#131) 2025-07-09 12:23:55 +03:00
taskSortUtils.ts Fix in progress today priority 2025-12-14 09:07:39 +02:00
tasksService.ts Fix Today page task completion issues (#970) 2026-03-24 16:45:31 +02:00
timezoneUtils.ts fixup! Scaffold timezone package 2025-10-20 16:01:49 +03:00
urlService.ts Fix an issue with breaking inbox input on long strings (#823) 2026-02-07 09:03:13 +02:00
userUtils.ts Tweak UI for feature 2025-10-13 11:09:19 +03:00