Last Comment Bug 537378 - "search messages" (Ctrl+Shift+F) should always be enabled in the 3pane - doesn't open if no folder or account selected/focused in folder pane
: "search messages" (Ctrl+Shift+F) should always be enabled in the 3pane - does...
Status: VERIFIED FIXED
:
Product: Thunderbird
Classification: Client Software
Component: Mail Window Front End (show other bugs)
: 3.0
: All All
: -- minor (vote)
: Thunderbird 14.0
Assigned To: Magnus Melin
:
:
Mentors:
Depends on:
Blocks: 395596 tb-keyboard-tracker
  Show dependency treegraph
 
Reported: 2009-12-31 06:46 PST by Wayne Mery (:wsmwk, NI for questions)
Modified: 2012-04-16 09:32 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
proposed fix (2.01 KB, patch)
2012-04-01 11:50 PDT, Magnus Melin
no flags Details | Diff | Splinter Review
proposed fix v2 (5.28 KB, patch)
2012-04-02 12:24 PDT, Magnus Melin
bugmail: review+
Details | Diff | Splinter Review

Description Wayne Mery (:wsmwk, NI for questions) 2009-12-31 06:46:18 PST
This may be more than one issue. 

1. folder pane in any folder mode (All, Smart, etc)
2. click a folder 
3. change mode
4. ctrl+shift+F or Edit | Find | Search Messages

Actual results:
* no Search Messages dialog, even though a folder is shown in thread pane, and is enabled in Edit Find UI
* nothing in error console

Expected results:
Search Messages dialog

mostly reproducible. seems to be worse with multiple tabs open.
If you don't see it, cycle to yet another folder mode.

If you still don't see it, open on folder an a second tab ... Edit | Find | Search Messages becomes enabled but dialog still doesn't appear
Comment 1 Wayne Mery (:wsmwk, NI for questions) 2010-02-04 10:53:46 PST
Joe, can you reproduce?
Comment 2 Joe Sabash [:JoeS1] 2010-02-04 14:40:43 PST
Reproducible every time here after a mode change.
Noticed the the folder selection disappears after any mode change, although
the threadpane display does not.
The same thing happens if you de-select a folder without a mode change.
(CTRL-click)
So I think the key here is to retain selection in the folderpane on mode change.
Comment 3 Thomas D. (needinfo?me) 2010-02-16 07:30:22 PST
See also (similar, but for "search all messages"): https://bugzilla.mozilla.org/show_bug.cgi?id=525206
Comment 4 Thomas D. (needinfo?me) 2011-12-28 17:25:16 PST
We could subsume Bug 395596 as a duplicate of this one, and actually do here what the current summary says: Ctrl+Shift+F should *always* work, regardless of focus or selection. Wayne?
Comment 5 Magnus Melin 2012-04-01 11:50:06 PDT
Created attachment 611300 [details] [diff] [review]
proposed fix

Where we end up is selectFolder and that's very much set up to handle a null folder. http://mxr.mozilla.org/comm-central/source/mail/base/content/SearchDialog.js#338
Comment 6 Magnus Melin 2012-04-01 11:58:30 PDT
Comment on attachment 611300 [details] [diff] [review]
proposed fix

Actually, i realized there's the no-account setup yet case to consider.
Comment 7 Thomas D. (needinfo?me) 2012-04-01 14:50:19 PDT
(In reply to Magnus Melin from comment #6)
> Comment on attachment 611300 [details] [diff] [review]
> proposed fix
> 
> Actually, i realized there's the no-account setup yet case to consider.

Will this fix Bug 395596, too?
Comment 8 Magnus Melin 2012-04-01 23:53:11 PDT
(In reply to Thomas D. from comment #7)
> Will this fix Bug 395596, too?

No, that's a separate issue.
Comment 9 Magnus Melin 2012-04-02 12:24:44 PDT
Created attachment 611549 [details] [diff] [review]
proposed fix v2

Checking against gDBView didn't work out since e.g. for no-favourite-folders view on startup that still null. 

To add confusion cmd_search was in the wrong commandset - so the meny item was only sometimes showing correct state. Grr.
Comment 10 Andrew Sutherland [:asuth] 2012-04-02 13:25:06 PDT
Comment on attachment 611549 [details] [diff] [review]
proposed fix v2

I think it's better to do "return !!gDBView;" if you don't want to do "return gDBView != null;" so the type is consistent.

As I read it, this change will make us err more on the side of bringing up the dialog even when it might not have anything to search.  But far better that then to not bring it up when it should work!
Comment 11 Thomas D. (needinfo?me) 2012-04-02 13:45:09 PDT
(In reply to Andrew Sutherland (:asuth) from comment #10)

> As I read it, this change will make us err more on the side of bringing up
> the dialog even when it might not have anything to search.  But far better
> that then to not bring it up when it should work!

Andrew, can you illustrate a case where "Search messages" "might not have anything to search"? Imo, advanced "Search messages" is a general search (albeit not global) which can be useful from any starting point within the application because on the "Search messages" dialogue, user can pick freely which account/folder + subfolders should be searched. Notwithstanding the bug that we can't search cross-account with this search type (and gloda-global search is *not* a sufficient alternative for doing that).
Comment 12 Andrew Sutherland [:asuth] 2012-04-02 13:51:25 PDT
(In reply to Thomas D. from comment #11)
> (In reply to Andrew Sutherland (:asuth) from comment #10)
> 
> > As I read it, this change will make us err more on the side of bringing up
> > the dialog even when it might not have anything to search.  But far better
> > that then to not bring it up when it should work!
> 
> Andrew, can you illustrate a case where "Search messages" "might not have
> anything to search"?

Was just trying to acknowledge that I saw that we are changing from explicit checking of being able to find a folder (with limited/broken heuristics) whose server indicates that it "canSearchMessages" to assuming the presence of any account indicates that we can search messages.  And that I'm cool with that, as I think there's nothing to be gained by being more paranoid about it.
Comment 13 Wayne Mery (:wsmwk, NI for questions) 2012-04-02 20:00:53 PDT
*** Bug 395596 has been marked as a duplicate of this bug. ***
Comment 14 Magnus Melin 2012-04-02 22:41:40 PDT
Yep, there might be very little to actually search if you e.g. set up a chat account an nothing more. (Then you still have Local Folders, but of course no mail unless you drag-n-dropped mails there.)
Comment 15 Magnus Melin 2012-04-03 12:05:33 PDT
http://hg.mozilla.org/comm-central/rev/6e3a62f70261 ->FIXED
Comment 16 Wayne Mery (:wsmwk, NI for questions) 2012-04-16 09:32:39 PDT
thanks! works great. after ctrl+click too

Note You need to log in before you can comment on or make changes to this bug.