Closed Bug 611440 Opened 15 years ago Closed 14 years ago

Smart abbreviation for URLs in the Web Console

Categories

(DevTools :: General, defect, P2)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: pcwalton, Assigned: pcwalton)

References

Details

(Keywords: polish, uiwanted)

Attachments

(2 files, 3 obsolete files)

Per a discussion in IRC we'd like to see "smart abbreviation" for URLs. The idea is that, for long URLs, we show the first part of the URL and the last component + first part of the query string. Some examples: http://www.google.com/search?q=kitten+pictures&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a => www.google.com/search?q=kitten+pictures&... http://techcrunch.com/2010/11/11/itunes-ping-actually-goes-social-with-full-twitter-integration-facebook-still-mia/ => www.techcrunch.com/.../itunes-ping-actually-goes-.../ http://www.nytimes.com/external/gigaom/2010/11/10/10gigaom-one-third-of-top-grossing-iphone-apps-are-free-86181.html?ref=technology => www.nytimes.com/.../10gigaom-one-third-of-...?ref=technology Ideally we'd like the user to be able to resize the window and see more and more of the URL appear.
Blocks: devtools4
So this is going to need to be based on top of bug 605621, because this depends significantly on the way that network requests are displayed.
mass change: filter on PRIORITYSETTING
Priority: -- → P2
You want to set the cropping (via the 'crop' attribute). It should do what you need...
(In reply to comment #3) > You want to set the cropping (via the 'crop' attribute). It should do what you > need... That only abbreviates in the middle AIUI. It'd be better to be a little smarter with hostnames. Also, I'm not sure if that works with multi-line descriptions, does it?
(In reply to comment #4) > That only abbreviates in the middle AIUI. It'd be better to be a little smarter > with hostnames. No, it crops wherever you want it to crop (see bug 305206 for a similar attempt with the error console, although it's a long patch...). > Also, I'm not sure if that works with multi-line descriptions, does it? I _think_ it does, not sure...
(In reply to comment #5) > (In reply to comment #4) > > That only abbreviates in the middle AIUI. It'd be better to be a little smarter > > with hostnames. > > No, it crops wherever you want it to crop (see bug 305206 for a similar attempt > with the error console, although it's a long patch...). Well, we want to crop at the end of the hostname, at the beginning of the path, and at the end of the query string. I don't think there's a way to do that with "crop": it only has a few settings.
I would suggest a regex that cuts the string up at the desired places so that http://error.example.com/long_path/to/error_location/error.html becomes http://error.example.com/ | long_path/to/error_location/ | error.html then use 3 descriptions/labels and flex/crop as desired. IOW, put the maximum flex on the middle path, minimum on the beginning hostname and medium on the ending file name. Make sure to crop appropriately for each as well.
This is going to break string freeze, because we have two localization strings called "networkUrlWithStatus" and "networkUrlWithStatusAndDuration" that put the URL together with the status and duration - but we now need to split the URL off into a separate XUL/HTML element from the status and/or duration. Drivers will need to determine whether this feature is worth breaking the string freeze.
Whiteboard: [strings]
Actually, never mind. This patch involves *removing* those two strings, but thankfully the "NetworkPanel.durationMS" saves us from breaking string freeze: we already have the localization for "ms". Yay!
Whiteboard: [strings]
Attached patch Proposed patch. (obsolete) — Splinter Review
Proposed patch attached.
Attachment #494856 - Flags: feedback?(mihai.sucan)
Attached patch Proposed patch, version 2. (obsolete) — Splinter Review
Patch version 2 adds the CSS to winstripe and gnomestripe as well.
Attachment #494856 - Attachment is obsolete: true
Attachment #494858 - Flags: feedback?(mihai.sucan)
Attachment #494856 - Flags: feedback?(mihai.sucan)
Attached image Screenshot.
Screenshot attached.
looking good. What's going to happen on selection+copy? Are we getting the full text of the URL in the copy buffer or will it be truncated?
Comment on attachment 494858 [details] [diff] [review] Proposed patch, version 2. Patch comments: - What's the difference between .webconsole-msg-url and .webconsole-msg-link? - Why do you add .webconsole-msg-body-piece? I am asking these questions because we are growing the number of class names up to confusion. - In browser_webconsole_bug_601177_log_levels.js: you removed the use of the msgs variable, but you did not remove let msgs; and msgs = null. - In head.js: why not put the labels loop outside of the msgs loop? Just search and loop once through all of the labels in outputNode. The patch looks fine otherwise, and I like the visual results. Web Console's output is now much more polished. Feedback+ with the above comments addressed.
Attachment #494858 - Flags: feedback?(mihai.sucan) → feedback+
(In reply to comment #14) > Comment on attachment 494858 [details] [diff] [review] > Proposed patch, version 2. > > Patch comments: > > - What's the difference between .webconsole-msg-url and .webconsole-msg-link? .webconsole-msg-url is the actual URL; .webconsole-msg-link is the URL plus the status (i.e. the part that's clickable). > - Why do you add .webconsole-msg-body-piece? I am asking these questions > because we are growing the number of class names up to confusion. To stop the inheritance of margin and padding.
Patrick: any comment on Rob's note in comment 13 about copying? That's a good point that you'd want to copy the full URL if you're copying it out of the console.
I'd be happy with a follow-up bug if you don't want to worry about it here.
(In reply to comment #13) > looking good. > > What's going to happen on selection+copy? Are we getting the full text of the > URL in the copy buffer or will it be truncated? It should Just Work, but I can verify.
Patch version 3 rebases to the current state of bug 605621. Review requested.
Attachment #494858 - Attachment is obsolete: true
Attachment #497192 - Flags: review?(dolske)
(In reply to comment #18) > (In reply to comment #13) > > looking good. > > > > What's going to happen on selection+copy? Are we getting the full text of the > > URL in the copy buffer or will it be truncated? > > It should Just Work, but I can verify. Copying now works properly.
Comment on attachment 497192 [details] [diff] [review] Proposed patch, part 1, version 3: Code changes. Not a blocker, but generally looks straightforward to me. Get a review from robc or mihai, and I'll rubberstamp this for landing.
Attachment #497192 - Flags: review?(dolske) → feedback+
Attachment #497192 - Flags: feedback?(mihai.sucan)
This patch depends on the patches from bug 605621.
Depends on: 605621
Comment on attachment 497192 [details] [diff] [review] Proposed patch, part 1, version 3: Code changes. The patch seems fine, except the following: +XPCOMUtils.defineLazyServiceGetter(this, "ioService", + "@mozilla.org/network/io-service;1", + "nsIIOService"); This is not needed. The new code does not use ioService. In test files: + findLogEntry("test-network.html"); findLogEntry is undefined. Tests fail. I believe these are remnants of older patch iterations. Once these are fixed, f+. Additional nitpick: from the toolbar, I cannot filter output by status. For example, if I write down 404 or 304, I cannot see the requests that have 404 response status. I think this happens because the filter code uses textContent, and the status uses a label with no text content. Not sure if you can do something about this now, but maybe it's worth a follow up bug report?
Attachment #497192 - Flags: feedback?(mihai.sucan) → feedback-
(In reply to comment #24) > Additional nitpick: from the toolbar, I cannot filter output by status. For > example, if I write down 404 or 304, I cannot see the requests that have 404 > response status. I think this happens because the filter code uses textContent, > and the status uses a label with no text content. Not sure if you can do > something about this now, but maybe it's worth a follow up bug report? Yeah, this will be tricky to fix now. Will file a followup once this lands.
Patch version 4 rebases and addresses feedback comments.
Attachment #497192 - Attachment is obsolete: true
Attachment #505277 - Flags: feedback?(mihai.sucan)
Comment on attachment 505277 [details] [diff] [review] [checked-in] Proposed patch, version 4: Code changes. Patch is fine, feedback+ it is.
Attachment #505277 - Flags: feedback?(mihai.sucan) → feedback+
Comment on attachment 505277 [details] [diff] [review] [checked-in] Proposed patch, version 4: Code changes. per comment 22, dolske will approve this after in-group review (which this has now had). Requesting approval to land this in firefox 4. It makes the console output much more readable and without horizontal scrolling even for long URLs in network requests.
Attachment #505277 - Flags: review?(dolske)
Attachment #505277 - Flags: approval2.0?
ditto. Running with this now and it's a big usability win. Would like to land it when we get an a+.
Comment on attachment 505277 [details] [diff] [review] [checked-in] Proposed patch, version 4: Code changes. rs=me per comment 22, a+.
Attachment #505277 - Flags: review?(dolske)
Attachment #505277 - Flags: review+
Attachment #505277 - Flags: approval2.0?
Attachment #505277 - Flags: approval2.0+
Comment on attachment 505277 [details] [diff] [review] [checked-in] Proposed patch, version 4: Code changes. http://hg.mozilla.org/mozilla-central/rev/812710794ca1
Attachment #505277 - Attachment description: Proposed patch, version 4: Code changes. → [checked-in] Proposed patch, version 4: Code changes.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Verified fixed on Mozilla/5.0 (Windows NT 6.1; rv:2.0b12pre) Gecko/20110206 Firefox/4.0b12pre
Status: RESOLVED → VERIFIED
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: