From 22f01049b03f3a6bbe0455f96105a73d37abb3ee Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 24 Aug 2026 10:45:32 +0200 Subject: fix(messageview): drop the receive-only ribbon when the pane is blanked MessageView::clear() resets the blocked-content bar, the stale notice and the attachment bar by hand, and forgot the receive-only ribbon. Only setReceiveOnlyAccount() ever hid it, and that is reached from updateComposeActions(), which runs on a SELECTION change. So the ribbon survived every route to a blank pane that is not one: clear_pane, clear_selection, a new query, and a multi-row selection. It sat over a blank pane, or over another account's mail, naming an account that was no longer on screen and contradicting the live Reply button beside it. Worth recording because it cost a test: the first one written for this selected receive-only mail and then mail from a sending account, which is how the report reads. It passed against the unfixed code, because that gesture is precisely the one path that was already covered. The test now drives clear_pane and a new query as well. Its own trap, in the test rather than the code: clear_pane leaves the row CURRENT, so re-selecting it emits no change and the ribbon is never re-raised. The test moves away and back instead. --- src/messageview.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/messageview.cpp b/src/messageview.cpp index 5682858..aa887ae 100644 --- a/src/messageview.cpp +++ b/src/messageview.cpp @@ -540,6 +540,14 @@ void MessageView::clear() // button offers to recover a thread the user has navigated away from. setStaleThread(QString(), QString()); + // The ribbon explains ONE message's account, so it goes with the message + // for the same reason as the two bars above. Only setReceiveOnlyAccount() + // hid it, which every SELECTION change reaches, so the ribbon survived + // every other route to a blank pane: clear_pane, clear_selection, a new + // query and a multi-row selection all blanked the message underneath it + // and left it contradicting the Reply button beside it. + m_receiveOnlyRibbon->hide(); + // clear() does not go through render(), so the bar has to be emptied // here or the previous thread's attachments stay offered. rebuildAttachmentBar(); -- cgit v1.2.3