Trigger autocomplete options for url using down arrow key.

RESOLVED FIXED in Camino1.5

Status

Camino Graveyard
Location Bar & Autocomplete
--
enhancement
RESOLVED FIXED
13 years ago
11 years ago

People

(Reporter: dirocco, Assigned: froodian (Ian Leue))

Tracking

({fixed1.8.1})

unspecified
Camino1.5
PowerPC
Mac OS X
fixed1.8.1

Details

Attachments

(1 attachment, 5 obsolete attachments)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040517 Camino/0.8b
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040517 Camino/0.8b

Say there are two pages that you like to visit on the same site.  After visiting
the shorter one, like http://www.theweathernetwork.ca, and reading its content,
the user should be able to click the location bar and hit the down arrow key to
see more autocomplete options for the address that's already there, like
http://www.theweathernetwork.com/weather/cities/can/Pages/CAON0728.htm.


Reproducible: Always
Steps to Reproduce:
1.
2.
3.




I also tried this with the build labelled 2004061608 but didn't want to restart
my browser to copy the ID information.

Comment 1

13 years ago
To make sure I understand: the behavior you want is for clicking in the URL bar
to trigger autocomplete, rather than only doing it with typing (in order not to
have to delete a letter to get autocomplete)?

Comment 2

13 years ago
Indeed this would be a very helpful behavior. Don't know how many times a day I drag, click, erase and 
choose an entry... simply clicking the current URL and seeing all relevant URL's would be great.

Comment 3

13 years ago
Confirming as harmless enhancment.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Display autocomplete options for urls that have been just been visited. → Triger autocomplete options for url using down arrow key.
Target Milestone: --- → Camino1.2
(In reply to comment #3)
> Confirming as harmless enhancment.

Harmless this most certainly is not....

This is a very bad idea for reasons of platform consistency.  In Mac OS X single-line text fields, down arrow is the standard for "move the cursor to the end of the field".

This is one of the things I find most annoying about the Fx implementation, as I like to down-arrow and then start typing (i.e., at cb.o, down-arrow so I can add support/docs/proxy to the url).

Breaking platform conventions in some places and not others will confuse users and is really bad UI design/behavior; it's certainly not worth it here to save a few users *1* keystroke (to dirty the field before down-arrow works).

I'm not mortally opposed to adding a *different* keybinding to invoke autocomplete on the current (clean) url if this is really a warranted behavior (or even for a hidden pref, although I'd prefer a keybinding to hidden-pref-land), but our autocomplete behavior is the most sane, easy-to-use, and perfect of any brower I've ever tried, so I am very much opposed to changing the *default* behavior or breaking the standard text editing behaviors in a clean field.

(Note we've filed bug 329673, among others, to fix text behaviors so they behave properly elsewhere.)

Comment 5

12 years ago
I always type one character, just to get some results for the current page. Too bad we can't use the down-arrow, since that is most natural (as it is done in other browsers).

Does anyone have an idea of a near-intuitive key that would show autocompletion in this situation?

Updated

12 years ago
Summary: Triger autocomplete options for url using down arrow key. → Trigger autocomplete options for url using down arrow key.
(Assignee)

Comment 6

11 years ago
Is there a good reason not to use cmd-down?
(Assignee)

Comment 7

11 years ago
Created attachment 230229 [details] [diff] [review]
Uses command-down to trigger autocomplete
Assignee: mikepinkerton → stridey
Status: NEW → ASSIGNED
Attachment #230229 - Flags: review?(stuart.morgan)

Comment 8

11 years ago
So... why is pressing command-down, which isn't at all discoverable and takes two hands to do, better than deleting the last character?

Comment 9

11 years ago
What about using the down arrow only when the cursor is at the end?  Click at the end and press down, or click anywhere and press down twice, to get auto-completions.
(Assignee)

Comment 10

11 years ago
Created attachment 230313 [details] [diff] [review]
Uses the down key to trigger autocomplete (when already at the end of location bar)

This patch contains a very hackish bit of code in BrowserWindow.mm, which unfortunately I'm too tired to explain (it being 5:30 AM), but which luckily is documented pretty well.

Besides that, basically what we want to do is retain current behavior if the cursor isn't at the end of the location bar, or if the autocomplete options are already showing.  This does exactly that.
Attachment #230229 - Attachment is obsolete: true
Attachment #230313 - Flags: review?(stuart.morgan)
Attachment #230229 - Flags: review?(stuart.morgan)

Comment 11

11 years ago
Comment on attachment 230313 [details] [diff] [review]
Uses the down key to trigger autocomplete (when already at the end of location bar)


>+  // This is an ugly hack.  For some unknown reason, |performKeyEquivalent:| is called twice for every down-arrow
>+  // keydown.

Once is keydown, once is keyup. You can just check for the event being a keydown instead of the hack.


Before getting into specifics of the rest: is there a reason this can't be done inside of AutoCompleteTextField?
Attachment #230313 - Flags: review?(stuart.morgan) → review-
(Assignee)

Comment 12

11 years ago
Created attachment 232660 [details] [diff] [review]
Moves logic into AutoCompleteTextField

Thanks for figuring out why performKeyEquivalent was being called twice, it was really bugging me.  Of course, now that this is in AutoCompleteTextField (and can use MoveDown:), it eliminates that problem... ;)
Attachment #230313 - Attachment is obsolete: true
Attachment #232660 - Flags: review?(stuart.morgan)
(Assignee)

Updated

11 years ago
Attachment #232660 - Flags: review?(stuart.morgan) → review?(hwaara)

Comment 13

11 years ago
Comment on attachment 232660 [details] [diff] [review]
Moves logic into AutoCompleteTextField

* Why are you modifying the string in the status bar (removing whitespace)?

* Please rename |startSearchWithDownArrow| to |maybeStartSearchWithDownArrow| to reflect its function better.

* I think your endOfBarIsSelected can be a simplified a bit by doing:
  o Check if the length is 0 (no selection)
  o Check if the location is the length of the string value of the textfield.
Attachment #232660 - Flags: review?(hwaara) → review-

Comment 14

11 years ago
By "modifying the string" I mean: "modifying the string before you use it".
(Assignee)

Comment 15

11 years ago
Created attachment 235791 [details] [diff] [review]
Addresses hwaara's comments

(In reply to comment #13)
> (From update of attachment 232660 [details] [diff] [review] [edit])
> * Why are you modifying the string in the status bar (removing whitespace)?

No good reason.  Removed.

I also made a couple new whitespace changes, replacing tabs with spaces.  Sorry for the clutter it introduces.
Attachment #232660 - Attachment is obsolete: true
Attachment #235791 - Flags: review?(hwaara)

Comment 16

11 years ago
Comment on attachment 235791 [details] [diff] [review]
Addresses hwaara's comments

Sorry, just some minor nits I caught now:

* You can simply return |endOfBarIsSelected|
* Please rename it to |caretIsAtEndOfBar| or something
* Also put a small comment above the method on what criteria it will trigger autocomplete

After that, you can mark the next patch r=me.
Attachment #235791 - Flags: review?(hwaara) → review-
(Assignee)

Comment 17

11 years ago
Created attachment 235800 [details] [diff] [review]
r=hwaara patch
Attachment #235791 - Attachment is obsolete: true
Attachment #235800 - Flags: superreview?(mikepinkerton)
Attachment #235800 - Flags: review+
QA Contact: location.bar
+- (BOOL) maybeStartSearchWithDownArrow;

there has got to be a better name for this method.

+  if(cursorIsAtEndOfBar) {
+    [self startSearch:[self stringValue] complete:YES];

space between |if| and paren.

Comment 19

11 years ago
(In reply to comment #18)
> +- (BOOL) maybeStartSearchWithDownArrow;
> 
> there has got to be a better name for this method.

Another approach would be to make the method simply check if the caret is at the end of the line, and rename it accordingly (caretIsAtEndOfLine?)

Then invoke the autocomplete search in the other method (where you right now just call |maybeStartSearchWithDownArrow|.
(Assignee)

Comment 20

11 years ago
Created attachment 236027 [details] [diff] [review]
Patch

This takes the approach in comment 19 (since I'd already renamed the method once, and if you're having to name a method three times, maybe it's a sign that you could be solving the problem more elegantly)
Attachment #235800 - Attachment is obsolete: true
Attachment #236027 - Flags: superreview?(mikepinkerton)
Attachment #235800 - Flags: superreview?(mikepinkerton)
Comment on attachment 236027 [details] [diff] [review]
Patch

sr=pink
Attachment #236027 - Flags: superreview?(mikepinkerton) → superreview+
(Assignee)

Comment 22

11 years ago
Checked in on trunk and 1.8branch.
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Moving fixed "1.2" bugs to 1.1 where they were really fixed. Filter on CaminoFixed1.1 for bugmail purposes.
Target Milestone: Camino1.2 → Camino1.1
You need to log in before you can comment on or make changes to this bug.