Bug 175409

Summary: Web Inspector: Clicking on suggestion hint should apply it, not dismiss
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, inspector-bugzilla-changes, mattbaker, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[Animated GIF] Bug
none
Patch
nvasilyev: review-, nvasilyev: commit-queue-
Patch
none
[Animated GIF] With patch applied
none
Patch none

Description Nikita Vasilyev 2017-08-09 16:44:47 PDT
Created attachment 317757 [details]
[Animated GIF] Bug

In Console prompt and Styles sidebar, clicking on the suggestion hint (the gray text), discards the suggestion hint.

It should instead apply the suggestion hint.
Comment 1 Nikita Vasilyev 2017-08-09 16:49:21 PDT
Created attachment 317758 [details]
Patch
Comment 2 Nikita Vasilyev 2017-08-09 16:53:42 PDT
Comment on attachment 317758 [details]
Patch

This doesn't in Styles.
Comment 3 Nikita Vasilyev 2017-08-09 16:57:02 PDT
Created attachment 317760 [details]
Patch
Comment 4 Nikita Vasilyev 2017-08-09 16:59:11 PDT
Created attachment 317762 [details]
[Animated GIF] With patch applied

(In reply to Nikita Vasilyev from comment #2)
> Comment on attachment 317758 [details]
> Patch
> 
> This doesn't in Styles.

This doesn't WORK in Styles.
Comment 5 Nikita Vasilyev 2017-08-09 17:15:58 PDT
To clarify, the last patch works in both console and styles.
Comment 6 Matt Baker 2017-08-11 13:47:46 PDT
Comment on attachment 317760 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js:259
> +            setTimeout(() => { this._codeMirror.focus() }, 1);

Is there a reason the delay isn't zero?
Comment 7 Nikita Vasilyev 2017-08-11 14:22:12 PDT
(In reply to Matt Baker from comment #6)
> Comment on attachment 317760 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=317760&action=review
> 
> > Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js:259
> > +            setTimeout(() => { this._codeMirror.focus() }, 1);
> 
> Is there a reason the delay isn't zero?

No reason. I see we usually use 0, I'll change it for consistency.
Comment 8 Nikita Vasilyev 2017-08-11 14:44:23 PDT
Created attachment 317966 [details]
Patch
Comment 9 Matt Baker 2017-08-11 14:51:24 PDT
Comment on attachment 317966 [details]
Patch

r=me
Comment 10 WebKit Commit Bot 2017-08-11 15:33:31 PDT
Comment on attachment 317966 [details]
Patch

Clearing flags on attachment: 317966

Committed r220614: <http://trac.webkit.org/changeset/220614>
Comment 11 WebKit Commit Bot 2017-08-11 15:33:33 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Radar WebKit Bug Importer 2017-08-11 15:34:12 PDT
<rdar://problem/33857544>