RESOLVED FIXED Bug 19931
Input should be printed before the output in the console
https://bugs.webkit.org/show_bug.cgi?id=19931
Summary Input should be printed before the output in the console
Anthony Ricaud
Reported 2008-07-07 12:38:51 PDT
Like in Firebug and other "shells", the input should be printed before the output. Actual behaviour : foo enter_bug.cgi > console.log('foo') Desired behaviour : > console.log('foo') foo enter_bug.cgi
Attachments
initial prototype (3.87 KB, patch)
2008-07-07 18:51 PDT, Keishi Hattori
aroben: review-
screenshot (16.24 KB, patch)
2008-07-07 18:56 PDT, Keishi Hattori
no flags
better screenshot (20.93 KB, image/png)
2008-07-07 18:59 PDT, Keishi Hattori
no flags
Original Design (2.09 KB, image/png)
2008-07-08 09:27 PDT, Timothy Hatcher
no flags
Fixed change log (4.20 KB, patch)
2008-07-09 18:29 PDT, Keishi Hattori
no flags
Proposed Patch (9.51 KB, patch)
2009-02-28 15:28 PST, Timothy Hatcher
oliver: review+
Screenshot of new design (8.48 KB, image/png)
2009-02-28 15:28 PST, Timothy Hatcher
no flags
Keishi Hattori
Comment 1 2008-07-07 18:51:27 PDT
Created attachment 22148 [details] initial prototype Here is a quick patch to see what it might look. We could add "if (typeof result === "undefined") return;" to match Firebug completely and not print assigned undefineds.
Keishi Hattori
Comment 2 2008-07-07 18:56:29 PDT
Created attachment 22149 [details] screenshot screenshot of patch in action
Keishi Hattori
Comment 3 2008-07-07 18:59:53 PDT
Created attachment 22150 [details] better screenshot
Anthony Ricaud
Comment 4 2008-07-07 23:09:43 PDT
Thanks, it looks really better. For undefined, let's talk in bug 19932.
Adam Roben (:aroben)
Comment 5 2008-07-08 07:16:37 PDT
Comment on attachment 22148 [details] initial prototype + Fix for https://bugs.webkit.org/show_bug.cgi?id=19931 We usually include the title of the bug, then the URL, like this: Fix Bug 19931: Input should be printed before the output in the console <https://bugs.webkit.org/show_bug.cgi?id=19931> + * page/inspector/Console.js: Console command line input gets printed immediately. We normally try to describe the actual changes made here, not what the problem was that inspired the changes. We also try to break up the changes by function, like this: (WebInspector.Console.prototype._enterKeyPressed): Split the input/output into two pieces. The input is added to the console before it is evaluated. After evaluation the output is added. +WebInspector.ConsoleCommandResult = function(command, result, formattedResultElement, level) +{ + this.command = command; I don't think we need to pass in and store the command here. I think ConsoleCommandInput and ConsoleCommandOutput would be better names fro these types than ConsoleCommand and ConsoleCommandResult. What do you think? I guess there's a chance that some styling will change as a result of this, but it looks like the common cases stay the same. r- so that the ChangeLog can be fixed up and the new names can be considered. Looking good!
Timothy Hatcher
Comment 6 2008-07-08 09:26:42 PDT
(In reply to comment #5) > I guess there's a chance that some styling will change as a result of this, but > it looks like the common cases stay the same. The styling did change. There is now a divider line between the input and output, which I think makes the output look confusing and was avoided in the original design. See the attached screenshot.
Timothy Hatcher
Comment 7 2008-07-08 09:27:08 PDT
Created attachment 22158 [details] Original Design
Timothy Hatcher
Comment 8 2008-07-08 11:41:27 PDT
It is not clear where the line that logs the function result came from. Sometimes it is after any console.logs() that the function did, or it is the line right after the input. Look at the screenshot in bug 19931, and you see: > console.log("hi") --------- "hi" --------- undefined That undefined could be a console.log(undefined). The result is not clearly marked. I think we need to mark function result lines some how. Or keep the input and function result grouped, but insert the input into the console before the function executes then update the input with the result. So: > console.log("hi") undefined -------- "hi"
Keishi Hattori
Comment 9 2008-07-09 18:29:24 PDT
Created attachment 22196 [details] Fixed change log I fixed the change log.
Anthony Ricaud
Comment 10 2008-08-05 17:00:25 PDT
What about something like that : > console.log("hi") "hi" ->undefined with -> an arrow like the one in Mail.app when you answer a mail (but reversed). You get the same visual order as the order that things happen and you have a visual distinction between console.log output and result.
Timothy Hatcher
Comment 11 2008-08-06 09:34:50 PDT
(In reply to comment #10) > What about something like that : > > > console.log("hi") > "hi" > ->undefined > > with -> an arrow like the one in Mail.app when you answer a mail (but > reversed). > > You get the same visual order as the order that things happen and you have a > visual distinction between console.log output and result. > That might be enough! Maybe clicking the "curled arrow" would scroll to and highlight the original function call for a couple of seconds. THat way, if there is lots of console.logging in the function, you can find the original call quickly.
Timothy Hatcher
Comment 12 2009-02-28 15:28:25 PST
Created attachment 28127 [details] Proposed Patch
Timothy Hatcher
Comment 13 2009-02-28 15:28:55 PST
Created attachment 28128 [details] Screenshot of new design
Timothy Hatcher
Comment 14 2009-03-02 00:23:30 PST
Fixed in r41352.
Note You need to log in before you can comment on or make changes to this bug.