From 1dbb3c764630e77ed21236e3050684c64b6908a7 Mon Sep 17 00:00:00 2001 From: Bogdan Abaev Date: Wed, 26 Aug 2026 15:49:06 -0700 Subject: [PATCH] fix opening an attachment triggering search rerun --- chrome/content/zotero/collectionViewItemTree.jsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/collectionViewItemTree.jsx b/chrome/content/zotero/collectionViewItemTree.jsx index 56aaf429f4..bda8678971 100644 --- a/chrome/content/zotero/collectionViewItemTree.jsx +++ b/chrome/content/zotero/collectionViewItemTree.jsx @@ -1086,7 +1086,19 @@ class CollectionViewItemTreeRowProvider extends ItemTreeRowProvider { await this.itemTree._refreshPromise; const cachedSelection = this.itemTree._cachedSelection; - const collectionTreeRows = this.collectionTreeRows; + const collectionTreeRows = this.collectionTreeRows; + + // Opening an attachment writes its lastRead, which arrives here as an + // ordinary modify and triggers best match rerun if it is active. + // For now, do nothing since best match searches are costly. + if (type == 'item' && action == 'modify' && ids.length + && collectionTreeRows.some(rowIsBestMatchSearch) + && ids.every((id) => { + let item = Zotero.Items.get(id); + return item && item.isAttachment(); + })) { + return; + } // A changed item's derived match previews are stale: back to // placeholders, re-derived on their next render. The re-score the