From 3f7b3d07c5129b032fcad5ea9b8885999476d87f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 7 Aug 2026 10:49:26 -0400 Subject: [PATCH] Only defer the quick search while a quotation mark is unclosed Searching was deferred whenever the query contained a double quotation mark, with an items-pane message to press Enter. Quoted phrases are no longer expensive now that Everything mode uses full-text search, so defer only while an unclosed quote means the phrase is still being typed, and search as soon as it's closed. Enter still forces a search mid-quote. --- chrome/content/zotero/zoteroPane.js | 14 +++----------- chrome/content/zotero/zoteroPane.xhtml | 1 - chrome/locale/en-US/zotero/zotero.properties | 1 - 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index be39e1475d..aec7627fa6 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -3185,13 +3185,6 @@ var ZoteroPane = new function () { } - this.handleSearchInput = function (textbox, event) { - if (textbox.searchTextbox.value.indexOf('"') != -1) { - this.setItemsPaneMessage(Zotero.getString('advancedSearchMode')); - } - } - - /** * @return {Promise} */ @@ -3201,7 +3194,9 @@ var ZoteroPane = new function () { } var search = document.getElementById('zotero-tb-search'); var searchVal = search.searchTextbox.value; - if (!runAdvanced && searchVal.indexOf('"') != -1) { + // An unclosed quotation mark means a phrase is still being typed, so + // wait for the closing quote, or an explicit Enter, to search + if (!runAdvanced && (searchVal.match(/"/g) || []).length % 2) { return; } var spinner = document.getElementById('zotero-tb-search-spinner'); @@ -3210,9 +3205,6 @@ var ZoteroPane = new function () { await this.itemsView.setFilter('search', searchVal); spinner.style.removeProperty("visibility"); spinner.removeAttribute("status"); - if (runAdvanced) { - this.clearItemsPaneMessage(); - } }; diff --git a/chrome/content/zotero/zoteroPane.xhtml b/chrome/content/zotero/zoteroPane.xhtml index 99b8cf26d1..a1eab8bae9 100644 --- a/chrome/content/zotero/zoteroPane.xhtml +++ b/chrome/content/zotero/zoteroPane.xhtml @@ -1342,7 +1342,6 @@ diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index 9f50561fb6..de5370f78b 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -773,7 +773,6 @@ quickSearch.mode.titleCreatorYear = Title, Creator, Year quickSearch.mode.fieldsAndTags = All Fields & Tags quickSearch.mode.everything = Everything -advancedSearchMode = Advanced search mode — press Enter to search. searchInProgress = Search in progress — please wait. searchOperator.is = is