From a880134140f7ab8195c6651c2f64f614855c8dce Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sun, 18 Oct 2026 11:00:53 +0200 Subject: mail: open accounts and messages in qtmaildir from the drawer and notifications qtmaildir now takes --account, --thread and --message, and hands them to a running window over its socket, so the drawer and the notifications can open the exact thing they show instead of just launching the client. mail-open.sh is the one place that turns an account and a thread into selectors, shared by both callers. It looks up the thread's newest unread message at click time rather than when the row or notification was built: by then it may have been read, and an empty lookup falls back to the whole thread instead of a miss in qtmaildir's status bar. The notification never had a working click: dunstify is not installed, so mail-notify.sh always took its notify-send fallback, which carried no action. It now uses notify-send -A NAME=Text, one action per listed thread (keyed by thread id, which is hex and so never holds the "=" separator) plus the account as default. The round trip through notifyd was checked: notifyctl action makes notify-send print the picked name. On the page, the account header opens the account and a thread row its newest unread message. Rows use TapHandler and HoverHandler because a MouseArea cannot fill a Column. Launches are detached: a first launch is the client itself, and the old reused Process would have killed it on the next click. Opening anything now closes the drawer rather than going back. Co-Authored-By: Claude Opus 5.5 --- desktop/modules/mail/MailPage.qml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'desktop/modules/mail/MailPage.qml') diff --git a/desktop/modules/mail/MailPage.qml b/desktop/modules/mail/MailPage.qml index 85b0876..1b41412 100644 --- a/desktop/modules/mail/MailPage.qml +++ b/desktop/modules/mail/MailPage.qml @@ -97,6 +97,7 @@ Column { model: Accounts.accounts Column { + id: account required property var modelData width: page.width spacing: 4 @@ -105,6 +106,12 @@ Column { width: parent.width implicitHeight: 26 + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { Accounts.open(modelData.key); page.close(); } + } + Rectangle { id: dot anchors.verticalCenter: parent.verticalCenter @@ -132,12 +139,13 @@ Column { } } - // The newest three unread threads. Read-only: qtmaildir takes no - // arguments, so there is no way to ask it for a particular thread. + // The newest three unread threads. A click opens the thread's + // newest unread message, in this account. Repeater { model: modelData.threads Column { + id: row required property var modelData width: page.width - 18 x: 18 @@ -177,6 +185,11 @@ Column { font.family: Theme.fontFamily font.pixelSize: Theme.fontSize - 2 } + + // Handlers, not a MouseArea: a Column would lay one out + // as a row of its own rather than let it fill. + HoverHandler { cursorShape: Qt.PointingHandCursor } + TapHandler { onTapped: { Accounts.open(account.modelData.key, row.modelData.thread); page.close(); } } } } } -- cgit v1.2.3