Closed Bug 1679113 Opened 4 years ago Closed 3 years ago

Search from autocomplete input on toolbar opens three gloda tabs

Categories

(Thunderbird :: Search, defect)

defect

Tracking

(thunderbird_esr78 unaffected)

RESOLVED FIXED
85 Branch
Tracking Status
thunderbird_esr78 --- unaffected

People

(Reporter: darktrojan, Assigned: lasana)

References

(Depends on 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

STR: In the toolbar search widget, type something you know will produce results. Click on one of the suggestions in the drop-down. Three tabs are opened instead of one.

I see this with 84.0b1.
Alice, can you get a regression range?

Flags: needinfo?(alice0775)

What is "toolbar search widget"?

never mind, I see Ctrl+k to focus the search field

Flags: needinfo?(alice0775)

Thanks Alice. That puts a pretty fine point on the cause

Assignee: nobody → lasana
Flags: needinfo?(lasana)
Regressed by: 1663904
See Also: → 1679976
Blocks: 1679976
See Also: 1679976
Status: NEW → ASSIGNED
Flags: needinfo?(lasana)
Depends on: 1680587

We have three autocomplete widgets in the messenger.xhtml for global search at the following selectors:
.remote-gloda-search, #IMSearchInput and #searchInput. All three hook into the "autocomplete-did-enter-text" nsIObserver event
to handle clicks on the autocomplete suggestions. The underlying C++ code does not seem to provide the original element as the subject for these events so the current code checks subject.popupElement value to determine which gloda-autocomplete-input to handle the event.

Unfortunately, the 3 autocompletes are all using the same popupElement so the checks will always be true.

Attached patch bug1679113.patch (obsolete) — Splinter Review

This changes the check to use document.activeElement instead of checking the popup element. Also adds some tests to make sure this action opens one tab however it will fail for the chat tab because of the issue in bug 1680587.

Attachment #9191273 - Flags: review?(alessandro)

Requesting review from Alessandro because of the conversion work in bug 1542720. Bug 1542720 comment 24 is related.

Comment on attachment 9191273 [details] [diff] [review]
bug1679113.patch

Review of attachment 9191273 [details] [diff] [review]:
-----------------------------------------------------------------

This fixes the issue in the gloda search.
Good stuff in adding a test to cover this area, but unfortunately the test fails locally on macos.

This is the failure log:
FAIL uncaught exception - TypeError: can't access property "hasAttribute", window.gBrowser.selectedBrowser is null at AutocompleteInput/<@chrome://global/content/elements/autocomplete-input.js:70:1
testClickingGlobalSearchResultItemOpensOneTab@chrome://mochitests/content/browser/comm/mail/test/browser/global-search-bar/browser_clickResultItem.js:106:11
Attachment #9191273 - Flags: review?(alessandro) → feedback+

unfortunately the test fails locally on macos

This patch in bug 1680587 fixes this.

Comment on attachment 9191273 [details] [diff] [review]
bug1679113.patch

Review of attachment 9191273 [details] [diff] [review]:
-----------------------------------------------------------------

You're right, bug 1680587 fixes the test failure.
Updating my review.
Attachment #9191273 - Flags: feedback+ → review+

Cool! thanks! Just need a resolution for bug 1680587 and this should be fixed.

Skipped the chat search test because my patch for bug 1680587 is unlikely to be accepted. Meanwhile this bug has a direct impact on usability.

Attachment #9191273 - Attachment is obsolete: true
Attachment #9191679 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9191679 [details] [diff] [review]
bug1679113v2.patch

Review of attachment 9191679 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM
Attachment #9191679 - Flags: review?(mkmelin+mozilla) → review+
Target Milestone: --- → 85 Branch

Pushed by thunderbird@calypsoblue.org:
https://hg.mozilla.org/comm-central/rev/db6e5c49fa30
Ensure MozGlodaAutocompleteInput is active element before handling "autocomplete-did-enter-text". r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: