Skip to content

Highlight due and overdue tasks, fix Date.days_between - #183

Open
mbrettschneider wants to merge 2 commits into
JMoerman:masterfrom
mbrettschneider:due-date-highlighting
Open

mbrettschneider wants to merge 2 commits into
JMoerman:masterfrom
mbrettschneider:due-date-highlighting

Conversation

@mbrettschneider

@mbrettschneider mbrettschneider commented Oct 21, 2026 •

Copy link
Copy Markdown

Tasks with a due: date currently show the date only as plain text, so overdue tasks look the same as everything else. This PR adds a small visual cue and fixes a bug I found along the way.

Changes

  1. TaskRow: highlight due and overdue tasks

    • A task due today shows its due: date in bold.
    • An overdue task shows its due: date in bold red (#c01c28).
    • Completed tasks and tasks due later are unchanged.
    • The tooltip gets a "Due: " line, marked "(today)" or "(overdue)" where that applies.
    • The row now also updates when the due date changes (notify["due-date"]).
  2. Date: fix days_between ignoring its argument
    days_between read the year, month and day of both dates from this.dt, so it always returned 0. Its only caller, the rescheduling of recurring tasks in TaskManager, therefore never moved the threshold date along with the due date: a weekly task with due:2021-11-16 t:2021-11-14, completed on 2021-11-15, got due:2021-11-23 but kept t:2021-11-14. There is a new test, "Repeat weekly task upon completing (due and threshold date)", for this case. It fails without the fix and passes with it.

Testing

  • Built on Ubuntu 24.04 (Vala 0.56.16, GTK 3.24.41) with -DBUILD_TESTS=ON: all 33 tests pass.

  • Checked by hand with a todo.txt that has an overdue task, a task due today (2026-10-21), a task due later and a task without a due date:

screenshot-due-dates

Not included

  • The highlighting is computed when the row is drawn. If the app stays open past midnight, it updates the next time the row is redrawn, not exactly at midnight.
  • The red is a fixed colour, not taken from the theme. I chose GNOME's error red because it stays readable on light and dark themes, but on a selected row with an orange selection colour (Yaru, first row in the screenshot) the contrast is poor. Happy to switch to a style class, or to drop the colour on selected rows, if you prefer that.
  • New translatable strings: "Due", "%s (overdue)", "%s (today)".

🤖 Generated with Claude Code

mbrettschneider and others added 2 commits October 21, 2026 11:18
days_between read the year, month and day of both dates from this.dt,
so it always returned 0. As a result, the threshold date of a recurring
task with both a due and a threshold date was not moved along with the
due date when the task was rescheduled. Add a test for that case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Show the due date in bold if a task is due today and in bold red if it
is overdue, and add the due date to the tooltip. Update the row when the
due date changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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