Skip to content

Overdue tasks: visible on Home, Plan, nav and app badge - #27

Merged
antonsxh merged 1 commit into
mainfrom
overdue-tasks
Nov 22, 2026
Merged

antonsxh merged 1 commit into
mainfrom
overdue-tasks

Conversation

@antonsxh

@antonsxh antonsxh commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

What

A task planned for a day that passed without being done used to stay on that past day — Home only lists today and Plan only the current week, so it was only findable through search. Missed tasks are now visible everywhere until you decide what to do with them.

Overdue = planned before today (server TZ, so right after midnight), not done, and of kind other or of an open quest (closed quests' tasks stay hidden, like their backlog). It is computed, never stored — no migration, no nightly job, no automatic rollover. The planned day changes only through an explicit action: Today · Tomorrow · Backlog · Done (checkbox, the day stays) · Delete.

  • Home: an Overdue · N card above the lists (desktop/iPad) — newest day first, 5 rows + "Show all N", per-row Today and ⋯ (Tomorrow, Backlog, Delete), age ("yesterday" / "since Wed, Nov 18"), secondary All to today in the header. On phones it is one quiet row "N tasks overdue · View ›" (Next up stays the primary action) that opens a bottom sheet with every row and a full-width All to today.
  • Nav: a small dot on Home (top nav and phone capsule) while anything is overdue; screen readers hear "Home, N overdue".
  • Plan: an Overdue group at the top of the backlog rail (3 rows + "Show all"), rows drag onto any day (existing drag & drop) or use Today / ⋯; open cards on past days get a small overdue dot; on phones the day strip's dot turns the overdue colour and the backlog sheet shows the same group.
  • App icon badge: now today's open tasks plus overdue ones (closed quests excluded, which also aligns today's count with that rule).
  • Command palette: "Move overdue tasks to today" while there are any.
  • Midnight: an app left open over midnight (or woken up the next morning) reloads its data when the server's day ends, so Home shows the new day and yesterday's open tasks turn overdue without a manual reload.

Screenshots

Demo seed data on Sunday, Nov 22 — Monday–Saturday's seed tasks were never done.

Desktop (1600px) — Home

Before After
before after

Desktop (1600px) — Plan (board scrolled to the backlog rail)

Before After
before after

Phone (iPhone 13) — Home, the overdue sheet, Plan's day strip

Before After Sheet Plan
before after sheet plan

Technical notes

  • Pure rules in #lib/overdue.ts (isOverdue, compareOverdue, age labels via Intl, parseOverdueSelection, appendOrders); SQL twin overdueCondition + listOverdue, taskCounts (badge + overdue in one query on tasks_day_idx) and rescheduleOverdue(ids | 'all', day, today) in server/tasks.ts — one transaction, rows locked, only tasks that are still overdue move, appended to the end of the target day's lists in display order.
  • Shared form action overdueTo (task-actions.ts, fields to + all=1 or taskId…) on Home and Plan; POST /api/overdue for the palette (400 on invalid input). Backlog / Done / Delete reuse toBacklog / toggle / deleteTask.
  • Shared rows: components/tasks/OverdueList.svelte (Home's OverdueCard, Plan's rail group). Plan rows carry no data-task (the task may also have a card in the shown week).
  • Root layout data: badge + overdueCount (was openToday), today, dayEndsAt (nextDayStart in #lib/dates.ts, DST-safe). Push payloads use badgeCount() (was openTodayCount()).
  • New token --overdue (a muted --danger mix) for dots, markers and the age text only.
  • Streaks, Review and stats are session-based and unchanged. No migration.
  • plan.spec.ts' drop onto the rail now scrolls its quest group into view first (the new group plus other runs' leftovers could push it below the rail).

Test plan

  • bun run check (0 errors / 0 warnings), bun run test (471 pass), bun run lint, bun run build
  • bun run test:e2e (desktop: 98 passed) and bun run test:e2e:mobile (iPhone + iPad: 49 passed)
  • overdue.spec.ts and plan.spec.ts with --repeat-each=2
  • Guards checked against reintroduced bugs: without the closed-quest filter the closed quest's task shows (fails); ascending day order in rescheduleOverdue breaks the "All to today" order test (fails) — both pass again after reverting
  • Manual run of the production build against a fresh seeded DB on the dev Postgres (desktop + iPhone emulation), no server errors
  • Not covered automatically: the midnight refresh in a real browser (nextDayStart is unit-tested incl. both DST switches), the badge on a real iPhone home screen

🤖 Generated with Claude Code

A task planned for a past day that isn't done (kind other or an open quest)
is overdue — computed, never stored, no auto-rollover. It stays visible until
the user moves it (Today / Tomorrow / Backlog), finishes it or deletes it.

- #lib/overdue.ts: pure rules (isOverdue, display order, ages, selection
  parsing, appendOrders); server/tasks.ts: listOverdue, taskCounts,
  rescheduleOverdue (one transaction, only still-overdue tasks, order kept)
- Home: Overdue card (desktop/iPad) / one row + bottom sheet (phones) with
  per-row Today + ⋯ and "All to today" (shared overdueTo form action)
- Plan: Overdue group atop the backlog rail (drag onto a day, Today + ⋯),
  marker on past-day cards, overdue dot in the phone day strip
- Nav dot on Home; palette action "Move overdue tasks to today"
  (POST /api/overdue)
- App badge = today's open + overdue tasks (closed quests excluded); root
  layout data badge / overdueCount (was openToday)
- Root layout refreshes all data when the server's day ends (nextDayStart)
- --overdue token; en/de strings; unit + e2e tests (overdue.spec.ts)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@antonsxh
antonsxh merged commit 20d4901 into main Nov 22, 2026
6 checks passed
@antonsxh
antonsxh deleted the overdue-tasks branch November 22, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant