Bug 72798 - Web Inspector: Design of the autocomplete suggest
Summary: Web Inspector: Design of the autocomplete suggest
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-19 05:39 PST by Nikita Vasilyev
Modified: 2011-11-22 01:19 PST (History)
10 users (show)

See Also:


Attachments
Proposed changes (8.79 KB, image/png)
2011-11-19 05:39 PST, Nikita Vasilyev
no flags Details
Proposed changes 2 (9.35 KB, image/png)
2011-11-20 09:52 PST, Nikita Vasilyev
no flags Details
Patch (3.70 KB, patch)
2011-11-21 07:30 PST, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff
Patch (7.71 KB, patch)
2011-11-22 00:16 PST, Alexander Pavlov (apavlov)
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2011-11-19 05:39:37 PST
Created attachment 115948 [details]
Proposed changes

Recently there were changes in autocomplete suggest https://bugs.webkit.org/show_bug.cgi?id=65511
The gray text right next to a text caret has been replaced with a pop-over. Can we keep both pop-over and "gray text on the same line" the same way Google SERP does?

* It looks better when only one autocomplete item suggested
* Accepting first suggestion by pressing right arrow key feels more intuitive
Comment 1 Timothy Hatcher 2011-11-19 07:06:22 PST
I agree. Just for comparison, Xcode still shows the popup when there is only one match.
Comment 2 Nikita Vasilyev 2011-11-19 07:37:18 PST
Xcode 4 suggest allows you to look up a reference by pressing the "?" icon. http://elv1s.ru/i/xcode-autocomplete-single-item.png
I believe that's why it shows the popup when there is only one match. Web Inspector's suggest doesn't have anything like that, so do see the reason show it.
Comment 3 Timothy Hatcher 2011-11-19 08:34:55 PST
Funny, I don't see the "?" button on Xcode 4.2.
Comment 4 Timothy Hatcher 2011-11-19 08:35:46 PST
I agree showing it for one item isn't useful.
Comment 5 Pavel Feldman 2011-11-19 23:48:48 PST
(In reply to comment #4)
> I agree showing it for one item isn't useful.

I also find single suggestion looking weird, I agree we should fix it. Summary:
1) Show inline completion at all times
2) Do not show suggest box with single entry
Comment 6 Nikita Vasilyev 2011-11-20 09:52:58 PST
Created attachment 115985 [details]
Proposed changes 2

I haven't considered the following case:

Type 'con'
Press arrow down (it should select the second item, 'console')
Press arrow up (it should select the first (previous) item, 'confirm')
Comment 7 Pavel Feldman 2011-11-20 10:08:56 PST
> 
> Type 'con'
> Press arrow down (it should select the second item, 'console')
> Press arrow up (it should select the first (previous) item, 'confirm')

I am not sure I understand what you are trying to say. But I like the mock.
Comment 8 Nikita Vasilyev 2011-11-20 10:16:11 PST
Here https://bug-72798-attachments.webkit.org/attachment.cgi?id=115948, on the right side, there is no 'confirm' item in the pop-over. It was a mistake. It was impossible to select 'confirm' using arrow keys once you selected item above.

Hope it makes sense.
Comment 9 Pavel Feldman 2011-11-20 10:23:21 PST
(In reply to comment #8)
> Here https://bug-72798-attachments.webkit.org/attachment.cgi?id=115948, on the right side, there is no 'confirm' item in the pop-over. It was a mistake. It was impossible to select 'confirm' using arrow keys once you selected item above.
> 
> Hope it makes sense.

Yeah, you should always list all options in the suggest box. (Except for there is only one option :) )
Comment 10 Pavel Feldman 2011-11-20 10:24:32 PST
Read as "(Except for the case when there is the only option)."
Comment 11 Alexander Pavlov (apavlov) 2011-11-21 07:30:06 PST
Created attachment 116082 [details]
Patch
Comment 12 Nikita Vasilyev 2011-11-21 08:21:00 PST
It still shows a pop-over box when there is the only option available (e.g. "doc|ument").
Comment 13 Nikita Vasilyev 2011-11-21 08:31:17 PST
A text caret position bug has been introduced: http://www.screenr.com/Stqs
Comment 14 Alexander Pavlov (apavlov) 2011-11-22 00:16:51 PST
Created attachment 116186 [details]
Patch
Comment 15 Alexander Pavlov (apavlov) 2011-11-22 00:18:21 PST
(In reply to comment #13)
> A text caret position bug has been introduced: http://www.screenr.com/Stqs

Thanks for the heads up! It was actually introduced with the suggest box from the outset but is annoying. I've uploaded an updated patch now.
Comment 16 Pavel Feldman 2011-11-22 01:03:14 PST
Comment on attachment 116186 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=116186&action=review

> Source/WebCore/inspector/front-end/TextPrompt.js:69
> +    setProxyElementDisplay: function(x)

renderAsBlock() ?
Comment 17 Alexander Pavlov (apavlov) 2011-11-22 01:19:06 PST
Committed r100981: <http://trac.webkit.org/changeset/100981>