From de1f7dba196d59cdaa46d2938e5e40e40f97a692 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 14 Aug 2026 18:04:32 +0200 Subject: feat(search): offer Exclude from search in both menus Third entry in the message pane's submenus and in each details row, greyed rather than hidden when the query bar is empty, so the feature stays visible to someone exploring a fresh window. requestSearch refuses an Exclude with no query as well, so the guard does not rest on the menu's enabled state alone. Mutation checked: disabling that condition fails the new test on the blocked emit. Co-Authored-By: Claude Opus 5 --- src/messageview.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/messageview.cpp') diff --git a/src/messageview.cpp b/src/messageview.cpp index 9dc5b36..bdf1b13 100644 --- a/src/messageview.cpp +++ b/src/messageview.cpp @@ -577,6 +577,14 @@ void MessageView::addSearchEntries(QMenu *menu, const QList &offers connect(narrow, &QAction::triggered, this, [this, entry]() { emit searchRequested(entry.query, SearchTerm::SearchMode::Narrow); }); + + auto *exclude = sub->addAction(tr("Exclude from search")); + // Visible but greyed rather than hidden, as in the details dialog: + // there must be a query to exclude FROM. + exclude->setEnabled(m_hasQuery); + connect(exclude, &QAction::triggered, this, [this, entry]() { + emit searchRequested(entry.query, SearchTerm::SearchMode::Exclude); + }); } } -- cgit v1.2.3