Bug 45166 - Web Inspector: implement go-to-line feature
Summary: Web Inspector: implement go-to-line feature
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Yury Semikhatsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-03 00:41 PDT by Graham Ballantyne
Modified: 2010-09-27 09:58 PDT (History)
9 users (show)

See Also:


Attachments
Patch (8.76 KB, patch)
2010-09-17 08:48 PDT, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Safari screenshot for the patch (198.43 KB, image/png)
2010-09-17 08:49 PDT, Yury Semikhatsky
no flags Details
Chromium screenshot (127.10 KB, image/png)
2010-09-17 09:18 PDT, Yury Semikhatsky
no flags Details
Safari screenshot(narrower text field) (485.11 KB, image/png)
2010-09-27 01:51 PDT, Yury Semikhatsky
no flags Details
Chromium screenshot - 2 (362.10 KB, image/png)
2010-09-27 03:12 PDT, Yury Semikhatsky
no flags Details
Patch (10.58 KB, patch)
2010-09-27 03:18 PDT, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (12.71 KB, patch)
2010-09-27 07:36 PDT, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Safari screenshot(with go button) (484.75 KB, image/png)
2010-09-27 07:38 PDT, Yury Semikhatsky
no flags Details
Chromium screenshot - 3(with go button) (399.44 KB, image/png)
2010-09-27 07:43 PDT, Yury Semikhatsky
no flags Details
Patch (12.77 KB, patch)
2010-09-27 08:47 PDT, Yury Semikhatsky
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Ballantyne 2010-09-03 00:41:20 PDT
Problem: the web inspector lacks a go-to-line feature in the Scripts & Resources panes.

Steps to reproduce:

1. Open the web inspector.
2. View a script in the Scripts pane.

Desired outcome: invoke the nifty go-to-line feature, enter a line number and be magically whisked off to your specified line. Dance a little happy dance of joy.

Actual outcome: look around for the nifty go-to-line feature and find none. Resort to doing it how our father's fathers did it: scrolling your 15 kiloline script by hand, in the snow, uphill both ways. No dancing.

Having a keyboard shortcut would be good, but there isn't an obvious one (CMD-L/CTRL-L is taken, as is CMD-OPT-L/insert-windows-equivalent). CMD-SHIFT-L?
Comment 1 Joseph Pecoraro 2010-09-03 11:44:36 PDT
Thanks for filing the bug, with a little bit of humor too. It'll be a challenge
coming up with a discoverable UI solution to this.
Comment 2 Yury Semikhatsky 2010-09-17 08:48:29 PDT
Created attachment 67910 [details]
Patch
Comment 3 Yury Semikhatsky 2010-09-17 08:49:25 PDT
Created attachment 67911 [details]
Safari screenshot for the patch
Comment 4 Ilya Tikhonovsky 2010-09-17 09:12:14 PDT
It'd be better to have shortcuts for this.
Visual Studio uses Ctrl-g
Eclipse uses Ctrl-L
XCode uses Cmd-L
InteliJ Idea ?

Also some button is required for mouse men.
Comment 5 Yury Semikhatsky 2010-09-17 09:18:10 PDT
Created attachment 67914 [details]
Chromium screenshot
Comment 6 Yury Semikhatsky 2010-09-17 09:29:57 PDT
(In reply to comment #4)
> It'd be better to have shortcuts for this.
> Visual Studio uses Ctrl-g
> Eclipse uses Ctrl-L
> XCode uses Cmd-L

This is already used for jump to location bar I'm not sure we can easily override this in Web Inspector.


> InteliJ Idea ?

It's  Ctrl+g there.


> Also some button is required for mouse men.
Well, I'd rather keep it as simple as it's now but given that there are already two of you who wants to see a pair of Ok/Cancel buttons I'm ready to add them.

Timothy, any criticism/thoughts on how this dialog should look like?
Comment 7 Joseph Pecoraro 2010-09-17 10:12:34 PDT
Comment on attachment 67910 [details]
Patch

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

Neat solution Yury! A few observations from the screenshots.

> WebCore/inspector/front-end/GoToLineDialog.js:45
> +    labelText = WebInspector.UIString("Go to line%s:", labelText);

I'd like to see a few more space spaces here:

  "Go to line (1-300): [            ]"
             ^        ^

> WebCore/inspector/front-end/GoToLineDialog.js:97
> +    },

I don't know if we typically include the extra comma here. Its fine
by me, it just caught my eye.
Comment 8 Joseph Pecoraro 2010-09-17 10:14:13 PDT
Whoops, I got so carried away with the new review features I forgot my main point.
I think the <input> could be narrower. No need to have it be so wide, if the usual
input is going to nearly always be a number less than 5 characters wide.
Comment 9 Yury Semikhatsky 2010-09-27 01:51:20 PDT
Created attachment 68888 [details]
Safari screenshot(narrower text field)

Centered the window, added spaces, reduced input width. Perdonally I think that overall look of a wider text field is better, even though user may never need such a long text input.
Comment 10 Yury Semikhatsky 2010-09-27 03:12:01 PDT
Created attachment 68893 [details]
Chromium screenshot - 2
Comment 11 Yury Semikhatsky 2010-09-27 03:18:50 PDT
Created attachment 68894 [details]
Patch
Comment 12 Pavel Feldman 2010-09-27 06:04:23 PDT
Comment on attachment 68894 [details]
Patch

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

Please add this to VC project as well.

> WebCore/inspector/front-end/GoToLineDialog.js:31
> +WebInspector.GoToLineDialog = function(view)

It'd nice to factor it out into generic dialog.

> WebCore/inspector/front-end/GoToLineDialog.js:44
> +    var labelText = linesCount ? " (1 - " + linesCount + ")" : "";

Should be localizable.
Comment 13 Yury Semikhatsky 2010-09-27 07:36:50 PDT
Created attachment 68908 [details]
Patch
Comment 14 Yury Semikhatsky 2010-09-27 07:38:03 PDT
Created attachment 68909 [details]
Safari screenshot(with go button)
Comment 15 Yury Semikhatsky 2010-09-27 07:40:41 PDT
(In reply to comment #7)
> (From update of attachment 67910 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=67910&action=prettypatch
> 
> Neat solution Yury! A few observations from the screenshots.
> 
> > WebCore/inspector/front-end/GoToLineDialog.js:45
> > +    labelText = WebInspector.UIString("Go to line%s:", labelText);
> 
> I'd like to see a few more space spaces here:
> 
>   "Go to line (1-300): [            ]"
>              ^        ^
> 
Done.


> > WebCore/inspector/front-end/GoToLineDialog.js:97
> > +    },
> 
> I don't know if we typically include the extra comma here. Its fine
> by me, it just caught my eye.
Fixed.

(In reply to comment #8)
> Whoops, I got so carried away with the new review features I forgot my main point.
> I think the <input> could be narrower. No need to have it be so wide, if the usual
> input is going to nearly always be a number less than 5 characters wide.
Done. The input width is 6 characters.


(In reply to comment #12)
> (From update of attachment 68894 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=68894&action=review
> 
> Please add this to VC project as well.
> 
Done.

> > WebCore/inspector/front-end/GoToLineDialog.js:31
> > +WebInspector.GoToLineDialog = function(view)
> 
> It'd nice to factor it out into generic dialog.
> 
I'd rather wait until its code is stable enough and we know what we want to see as the generic dialog.

> > WebCore/inspector/front-end/GoToLineDialog.js:44
> > +    var labelText = linesCount ? " (1 - " + linesCount + ")" : "";
> 
> Should be localizable.
Done.
Comment 16 Yury Semikhatsky 2010-09-27 07:43:51 PDT
Created attachment 68910 [details]
Chromium screenshot - 3(with go button)
Comment 17 Timothy Hatcher 2010-09-27 08:11:53 PDT
The overall look is nice for the new screenshots. But the (1-2344) part is not the best design. I think a seperate, smaller and grey, label under the text field (or just as a tooltip) would be best. You can clamp the entered line to the max line, so typing 999999 would get you the last line without needing to read or think. So the info isn't that useful if you clamp.
Comment 18 Yury Semikhatsky 2010-09-27 08:47:03 PDT
Created attachment 68914 [details]
Patch
Comment 19 Yury Semikhatsky 2010-09-27 08:48:11 PDT
(In reply to comment #17)
> The overall look is nice for the new screenshots. But the (1-2344) part is not the best design. I think a seperate, smaller and grey, label under the text field (or just as a tooltip) would be best. You can clamp the entered line to the max line, so typing 999999 would get you the last line without needing to read or think. So the info isn't that useful if you clamp.

Added clamping and moved "1 - n" into a tooltip as we agreed on the IRC channel.
Comment 20 Yury Semikhatsky 2010-09-27 09:58:30 PDT
Committed r68398