feat: show overdue weekly tasks on Dashboard Tasks & Chores card #240
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nidde/parenting-tool!240
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "copilot/update-dashboard-chore-task-cards"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Weekly-scheduled tasks whose assigned weekday has passed without completion are now surfaced in a dedicated Overdue section at the top of the Dashboard Tasks & Chores card, with colour-coded warning indicators.
Backend
DashboardService::getOverdueTasks(): findsschedule_type=weeklytasks (excluding today's day) wherelast_completed_atis null or predates the most recent occurrence of the scheduled weekday; attachesoverdue_days(1–7) as a dynamic attribute; sorted ascending (most recently missed first)getTasksData()return shape gainsoverduekey alongsidetodayandupcomingconfig('app.display_timezone')consistent withTaskServiceFrontend
DashboardTaskinterface gainsoverdue_days?: number;DashboardTasksDatagainsoverdue: DashboardTask[]TaskChip.vue: checksoverdue_daysbeforedue_date— rendersmdi-alertwithwarningcolour (1–2 days) orerrorcolour (3–7 days)TasksSummaryCard.vue: conditional Overdue section above Today, hidden when emptydashboardStore:clearCache,toggleTaskCompletion, and persistence defaults updated for the new listType of Change
Testing
6 new feature tests in
DashboardControllerTest: incomplete past-weekday task appears with correctoverdue_days, 3-day value, today's task excluded, completed-this-cycle excluded, stale prior-week completion included, sort order.Code Quality
CI/CD Checks
Additional Notes
overdue_daysis set as a dynamic Eloquent attribute before serialisation — no migration required.Comment
@coderabbitai helpto get the list of available commands and usage tips.Pull request overview
Adds an “Overdue” section to the Dashboard Tasks & Chores card to surface weekly tasks whose scheduled day has passed without completion, including an
overdue_daysindicator used for warning/error styling.Changes:
DashboardService::getTasksData()now returns anoverduelist computed by a newgetOverdueTasks()helper using the display timezone.TaskChipshows an alert icon and color based onoverdue_days.Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
overdue_days, and sort order.overdueand updates cache/persistence + completion toggling.tasksData.overdueintoTasksSummaryCard.overdue_days.overdue_daysand returns it in tasks payload.@ -44,0 +114,4 @@if ($isIncomplete) {$task->overdue_days = $daysAgo;$overdueTasks[] = $task;orderBy('priority', 'desc')is effectively discarded because the result is later reordered withusort()byoverdue_days. Either remove this DB ordering to avoid unnecessary work, or incorporatepriorityas a secondary key in the final sort (e.g., sort byoverdue_daysasc, thenprioritydesc) so the query ordering remains meaningful.The
usortcomparator only comparesoverdue_days, so ties are not deterministically ordered (and can vary between runs). If stable ordering matters (e.g., keep priority ordering for equaloverdue_days), add a secondary/tertiary comparison (such asprioritydesc, thenidasc) to ensure deterministic output.This template block is hard to read/maintain due to inline tags and split closing tags across lines (e.g.,
</v-card-textfollowed by>), which also makes future diffs noisier. Reformat the markup so tags/attributes are on consistent lines and closing tags aren’t broken across lines; this reduces the risk of accidental template syntax issues and improves reviewability.Toggling completion updates items in-place in the
overduelist, which can leave completed tasks still displayed under the “Overdue” section until a refresh, and can retain a staleoverdue_daysattribute on the client object. To keep the UI consistent with the section semantics, consider either (a) removing the task fromtasksData.overduewhen it becomes completed (and optionally clearingoverdue_days), or (b) refetching/reconcilingtasksDataafter the toggle succeeds so list membership is recalculated by the backend.@ -120,0 +163,4 @@'last_completed_at' => null,]);$response = $this->getJson(route('api.dashboard.tasks'));These tests freeze time without pinning the timezone used by the production code (
DashboardServiceusesconfig('app.display_timezone')). Ifapp.display_timezonediffers from the default timezone used byCarbon::setTestNow()in the test environment, the perceived weekday can shift and make the suite flaky. Consider explicitly setting the display timezone in the test (via config override) and/or settingtestNowwith an explicit timezone-aware Carbon instance.