Closed Bug 93099 Opened 23 years ago Closed 23 years ago

Autocomplete will sort URLs with the longest ones first

Categories

(SeaMonkey :: Autocomplete, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 78270
mozilla1.0

People

(Reporter: brendanb, Assigned: hewitt)

Details

Yes, everything is in alpha sorted order, but I think that length sorting should
be put in first, and maybe use alpha as a second sort.  For example, if I type in:

http://www.f

Then "http://www.foobar.com/" comes up, as it should.  However, if I want to go
to "http://www.foobar.com/foo/bar.html", I'd type:

http://www.fo *TAB* obar.com/
http://www.foobar.com/f *TAB*

And then this comes up:

http://www.foobar.com/fish/bad/smelly/long_ass_url_that_shouldnt_be_first.html

Instead, I think the original URL of "http://www.foobar.com/foo/bar.html" should
come up.  Dare I say that only ".../foo/" come up, and THEN ".../foo/bar.html".
 In the case of the above URL, it would be:

http://www.fo *TAB obar.com/
http://www.foobar.com/fi *TAB* sh/
http://www.foobar.com/fish/ *TAB* bad/
http://www.foobar.com/fish/bad/ *TAB* smelly/
http://www.foobar.com/fish/bad/smelly/ *TAB*
http://www.foobar.com/fish/bad/smelly/long_ass_url_that_shouldnt_be_first.html

One of the main problems I get is the fact that I don't get the first directory,
but instead, the longest URL.  Maybe I wanted to go to:

http://www.foobar.com/fish/bad/smelly/anchov.html

But, I'm forced to do this:

http://www.fo *TAB* obar.com/
http://www.foobar.com/fish/bad/smelly/a *TAB*
http://www.foobar.com/fish/bad/smelly/anchov.html

Instead of tabbing until the first difference in URLs pops up (like bash shell).
 Maybe it shouldn't be on a per-letter basis, but I definately think it should
be within directories.
Here's a good example: 

1) Clear your location history.
2) Type in http://www.newsforge.net and visit it.
3) Click on a few articles there (Read More)
4) Type in http://www.newsfo   or something similar and the autocomplete jumps
to an article since www.newsforge.com/article.pl?sid=15814251 sorts before
www.newsforge.net

MSIE would display newsforge.com (by itself) and newsforge.net and then the
longer articles via Alpha order.

Marking as NEW
Status: UNCONFIRMED → NEW
Ever confirmed: true
I think the primary sort key shouldn't be the URL length (in characters) but the
URL length in components counted as:

http://1/2/3/4/5

Where 1 is a hostname (www.blah.com), 2-4 are directories, and 5 is the last
part including any "?" junk at the end.
So as long as I am typing the host name, there should be only host names at the
beginning of the completion box.  When I have typed hostname + (part of) the
first directory name, there should be host names + one directory name at the top
of the completion box.

Maybe this is exactly what Brendan meant in his bug report, but it wasn't
obvious to me so that's why I'm posting this "clarification" (although I'm not
entirely convinced it got any clearer).
Well, I was more like pointing out a couple of scenaros to carry out, the last
one (which you clarified) being the most ideal.  Though, we should go further
and say:

http://1/2/3/4/5?6

IOW, let the query part of the string be yet another section.  I think it should
be the job of the tab completion engine to split all of the sections of the URL
and store ALL of those elements in the previously viewed database, such as
http://www.foobar.com/food/fish/cod.html into:

http://www.foobar.com/
http://www.foobar.com/food/
http://www.foobar.com/food/fish/
http://www.foobar.com/food/fish/cod.html

Either that, or you could save space and do it on the fly when you reload the
PVDB.  But, you'd have to re-optimise them when you put them back into the
database, if you want to save space.  With the above example, only the fourth
(longest) entry would be stored in the DB, but when it's loaded, it would
automatically split them up back to the four URLs.

I think splitting them while the entry is being typed would be infeasible
because of the sheer amount of entries it would have to sort through every
single time, but if it could be pulled off without being a major speed hit every
time, so be it.

Setting milestone (if I have the authority) to 1.0, which should be reasonable
for such a fairly easy-to-code feature.
Target Milestone: --- → mozilla1.0
I still don't use autocompletion.
The key sorting proposed by Johan Walles would make it much more usable.

I think to really be useful, another feature should be implemented.
We need a keystroke to select some components in the autocompletion drop-list
without loading the URL.

I hope the following sequence will help ;o)

Let's say my global history contains
http://www.a1/a2/a3?a4=a5
http://www.a1/a2/a3?a4=a6
http://www.b1/ba2/ba3
http://www.b1/bb2

and that the web site a1 and b1 begins with the same letter, let's say 'c'

Action: typing www.c in the location bar 
Expected in the autocompletion drop-list:
http://www.a1/
http://www.b1/
http://www.a1/a2/
http://www.b1/ba2/
http://www.a1/a2/a3?
http://www.b1/ba2/ba3
http://www.a1/a2/a3?a4=
http://www.a1/a2/a3?a4=a5
http://www.a1/a2/a3?a4=a6

(Note: at this stage, autocompletion drop-list could also only display:
http://www.a1/
http://www.b1/)

Action: TAB, ARROW-RIGHT
Expected in the location bar: http://www.a1/
Expected in the autocompletion drop-list:
http://www.a1/a2/
http://www.a1/a2/a3?
http://www.a1/a2/a3?a4=
http://www.a1/a2/a3?a4=a5
http://www.a1/a2/a3?a4=a6

At this moment, I want to view b1 website instead of a1 one. So I have to go
back. So I use Back Space to delete 'a1/'.
Location bar: http://www.c
Drop-list: see the longest list above

Action: TAB, TAB, ARROW-RIGHT
Expected in the location bar: http://www.b1/
Expected in the autocompletion drop-list: http://www.b1/ba2/
http://www.b1/bb2/
http://www.b1/ba2/ba3

Action: TAB, ARROW-RIGHT
Expected in the location bar: http://www.b1/ba2/
Expected in the autocompletion drop-list:
http://www.b1/ba2/ba3

What do you think about that?
of course, SPACE could be used in the place of ARROW-RIGHT(if at some point it
is known that we are not doing a search)

PS: at this point, I would rather prefer the following key binding:
ARROW-DOWN instead of TAB         (select an item in the autocompletion db)
TAB        and        ARROW-RIGHT (for completion)
marking dup, since 78270 is the main bug for deciding how to sort autocomplete
results.  The ideas in this bug are very good and of course will be considered.

*** This bug has been marked as a duplicate of 78270 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
This was never fixed. If i have pasted some bugzilla bug-URLs into urlbar, and
also visited http://bugzilla.mozilla.org explicitly:
Every time i start typing http://bug into urlbar, it will autocomplete to the
longest url possible.
Product: Core → Mozilla Application Suite
You need to log in before you can comment on or make changes to this bug.