Closed Bug 405893 Opened 17 years ago Closed 17 years ago

Search should match TLDs as well as download file names

Categories

(Toolkit :: Downloads API, enhancement, P1)

enhancement

Tracking

()

VERIFIED FIXED
mozilla1.9beta3

People

(Reporter: madhava, Assigned: Mardak)

References

Details

Attachments

(3 files, 3 obsolete files)

[actually nominating for wanted]

Now that we're showing the (very useful!) TLD for each download, it would be great if the DM's search would match against them.  That way if a user needs to find something, and she remembers is where she got it, the search is of use to her.
Flags: blocking-firefox3?
Should we only search the referrer or also the download source?

And should this only match the eTLD+1 part (probably very tricky) or the whole URI?

Or an estimate if the search matches anything in the URI skipping the first 6 characters and looking at the next 20 characters.

6 for addressing ftp:// which is probably the second most likely usecase after http:// and 20 because uhh sounds like a good number.
Referrer vs source.. potentially not too difficult to search source only if referrer is empty.

If we search both referrer and source, we might match "mirror" for source "mozilla" but the UI would only show "mozilla" for the TLD because it's the referrer.
Attached patch v1 (obsolete) — Splinter Review
Oh, simpler than I thought. The referrer /is/ null and not just empty ;)

SUBSTR(IFNULL(referrer, source), 7, 20)
Assignee: nobody → edilee
Status: NEW → ASSIGNED
Attachment #291528 - Flags: review?(comrade693+bmo)
Attached image screenshot of v1 (obsolete) —
Match file names and referrer... and source if we don't have a referrer.
Attachment #291529 - Flags: ui-review?(madhava)
Builds on top of the bug 392097 heart transplant.
Depends on: 392097
Comment on attachment 291529 [details]
screenshot of v1

Great!
Attachment #291529 - Flags: ui-review?(madhava) → ui-review+
Flags: blocking-firefox3? → blocking-firefox3+
Priority: -- → P3
Target Milestone: --- → Firefox 3 M11
Comment on attachment 291528 [details] [diff] [review]
v1

What's the significance of the 7 and 20 here?  A comment in the file would be awesome, as well as an explanation in the bug.
Attachment #291528 - Flags: review?(comrade693+bmo) → review-
(In reply to comment #7)
> What's the significance of the 7 and 20 here?

(In reply to comment #1)
> 6 for addressing ftp:// which is probably the second most likely usecase after
> http:// and 20 because uhh sounds like a good number.

;)

.. Too bad there isn't a strpos function to find the first slash. But even then, computing the eTLD+1 will be tricky in SQL...
what about edge cases or other new protocols?  Someone could do something like a://...
the other question of course is what does places do in the location bar?
Priority: P3 → P1
Attached image screenshot of v2 (reso)
Attachment #291529 - Attachment is obsolete: true
Depends on: 408500
Attached patch v2 (obsolete) — Splinter Review
Create a function for use in sql that does the same thing as getDisplayHost in js.

The display column could potentially be grabbed and put in a download richlistitem if we wanted.. Would need to make sure that stays in sync with referrer though.
Attachment #291528 - Attachment is obsolete: true
Attachment #293327 - Flags: review?(comrade693+bmo)
Comment on attachment 293327 [details] [diff] [review]
v2

>+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Please remove this line from DownloadProgressListener.js now since it's included in this file which is loaded before that one in the XUL.

r=sdwilsh
Attachment #293327 - Flags: review?(comrade693+bmo) → review+
Comment on attachment 293327 [details] [diff] [review]
v2

Urgh. We can't reuse the existing createFunction because apparently the script gets cleared so XPConnect doesn't have its callback anymore.
Attachment #293327 - Flags: review+ → review-
Attached patch v2.1Splinter Review
Correctly remove the function instead of reusing the old one.
Attachment #293327 - Attachment is obsolete: true
Attachment #293339 - Flags: review?(comrade693+bmo)
If someone wants to check the performance of this patch..
https://build.mozilla.org/tryserver-builds/2007-12-15_23:14-edward.lee@engineering.uiuc.edu-dlmgr.awbar/

Things seem pretty fast for me. The common case of just loading the list is really fast because it's just doing a LIKE %% match. On my windows box, searching starts showing results immediately and on my iBook, it's definitely under a second when matching something like "org".

It's got some other patches as well.

Bug 405893 - Search should match TLDs as well as download file names
Bug 408351 - Double click download should do default action (first item in menu)
Bug 408350 - Enter/return on downloads should do the same as double click
Bug 405888 - Remove the "Information" button at the right of every download row
Bug 405886 - Remove the "Open File" button at the right of every download row
Bug 394516 - Figure out a remaining-time rounding scheme for minutes -> hours/days
Bug 406857 - Don't clear referrer when restarting downloads
Bug 395735 - Instrument the location bar auto-complete to report accuracy
Bug 406359 - Unify the logic for url bar searches and drop down items
Bug 406358 - Location bar drop down ignores frequency of visits
Bug 395739 - adaptive learning (match entered text to selected item) in url bar autocomplete
Bug 393678 - location bar autocomplete should take word boundaries in account
Bug 406422 - Globally decay adaptive input history to allow for new entries
Bug 406425 - Limit how many adaptive input history entries to track
Bug 406427 - Penalize skipped results to allow adaptive learning of shifting preferences
Bug 401316 - Open-with downloads are readonly
Comment on attachment 293339 [details] [diff] [review]
v2.1

r=sdwilsh
Attachment #293339 - Flags: review?(comrade693+bmo) → review+
Checking in toolkit/mozapps/downloads/content/DownloadProgressListener.js;
/cvsroot/mozilla/toolkit/mozapps/downloads/content/DownloadProgressListener.js,v  <--  DownloadProgressListener.js
new revision: 1.34; previous revision: 1.33
done
Checking in toolkit/mozapps/downloads/content/downloads.js;
/cvsroot/mozilla/toolkit/mozapps/downloads/content/downloads.js,v  <--  downloads.js
new revision: 1.117; previous revision: 1.116
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Verified FIXED using:

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b3pre) Gecko/2007122004 Minefield/3.0b3pre

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b3pre) Gecko/2007122004 Minefield/3.0b3pre

and

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b3pre) Gecko/2007122005 Minefield/3.0b3pre
Status: RESOLVED → VERIFIED
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: