From 80b57161ca4499e9488a3ab9908d0f661c29705c Mon Sep 17 00:00:00 2001
From: Linus Rath <139418639+rathlinus@users.noreply.github.com>
Date: Fri, 2 Oct 2026 13:04:01 +0200
Subject: [PATCH] fix: say what an empty folder list or a finished task is on
the widgets #52
Folder counts showed only its "Folders" heading when there was no
folder to list, which looks broken; it now says there are no folders to
show. A finished task past its due date still read "Overdue" on the
Tasks widget; it shows its date instead.
---
locales/rn/en.json | 1 +
src/widgets/layouts/mail.tsx | 7 +++++++
src/widgets/parts.tsx | 4 +++-
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/locales/rn/en.json b/locales/rn/en.json
index 7f79fe4d..1a7c8f68 100644
--- a/locales/rn/en.json
+++ b/locales/rn/en.json
@@ -1282,6 +1282,7 @@
"in_outbox_short": "{count} waiting",
"inbox": "Inbox",
"more_unread": "+{count} more unread",
+ "no_folders": "No folders to show",
"no_starred": "No starred mail",
"no_starred_body": "Star a message to keep it here.",
"no_subject": "(no subject)",
diff --git a/src/widgets/layouts/mail.tsx b/src/widgets/layouts/mail.tsx
index 23e28832..ab70929b 100644
--- a/src/widgets/layouts/mail.tsx
+++ b/src/widgets/layouts/mail.tsx
@@ -250,6 +250,13 @@ export const FolderCountsLayout: Layout = ({ s, p, f, height }) => {
const count = role === 'drafts' ? folder.total : folder.unread;
rows.push({ role, name: folder.name, count, strong: role !== 'drafts' && folder.unread > 0 });
}
+ if (rows.length === 0) {
+ return (
+
+
+
+ );
+ }
const fit = Math.max(1, Math.floor((height - 40) / 31));
const colors: Record = {
inbox: p.folder.inbox,
diff --git a/src/widgets/parts.tsx b/src/widgets/parts.tsx
index dfe61696..ed2edc84 100644
--- a/src/widgets/parts.tsx
+++ b/src/widgets/parts.tsx
@@ -206,7 +206,9 @@ export function TaskRow({
now: number;
last?: boolean;
}) {
- const kind = dueKind(task, now);
+ // A finished task is not overdue: it shows its date.
+ const due = dueKind(task, now);
+ const kind = task.done && due === 'overdue' ? 'later' : due;
const dueColor = task.done
? p.muted
: kind === 'overdue'