Closed Bug 715891 Opened 13 years ago Closed 5 years ago

In the Style Editor, in the URLs, the "file name" should highlighted

Categories

(DevTools :: Style Editor, enhancement, P3)

x86
All
enhancement

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: paul, Unassigned)

References

Details

Attachments

(3 files, 1 obsolete file)

For example, in bugzilla.mozilla.org, we see:

js/yui/assets/skins/sam/autocomplete.css?42424242

We should use different colors to highlight the file name:

<grey>js/yui/assets/skins/sam/</grey> <white>autocomplete.css</white> <grey>?42424242</grey>
Blocks: 708257
Here's a first attempt at this.

Originally, the whole name was stored in the "value" attribute of xul:label element. This doesn't allow highlighting just one part of the value, so I created an HTML fragment that I place as content inside the label.

For the moment, I highlighted the filename with an "<em>" styled as bold, I could also alter the colors in a future version of the patch.

The problem is that in the original version, long paths that didn't fit in the available width were cropped at the start, so that the actual filename is visible instead of the long path leading to it, and this was done using the "crop" attribute on the label. But this attribute doesn't have any effect when the label value comes from inner content instead of the "value" attribute, so the start-crop is lost. I managed to write some CSS rules to at least add an ellipsis at the end, but I'd like to find a solution so that the old behavior of cropping at the start is preserved. I'm out of ideas, so any help is appreciated.


As an additional change, I changed the way the name of stylesheets from the filesystem (saved or imported) is displayed: instead of just the filename, I display the whole path, highlighting the actual filename.
Attached image UI before patch
Attached image UI after patch
Sergiu, thank you for your work. Please let us know when the patch is ready for review.
Assignee: nobody → sergiu
Status: NEW → ASSIGNED
Attachment #697809 - Attachment is obsolete: true
Attachment #697921 - Flags: review?(paul)
Comment on attachment 697921 [details] [diff] [review]
Patch (first version, with issues)

(In reply to Sergiu Dumitriu from comment #2)
> The problem is that in the original version, long paths that didn't fit in
> the available width were cropped at the start, so that the actual filename
> is visible instead of the long path leading to it, and this was done using
> the "crop" attribute on the label. But this attribute doesn't have any
> effect when the label value comes from inner content instead of the "value"
> attribute, so the start-crop is lost. I managed to write some CSS rules to
> at least add an ellipsis at the end, but I'd like to find a solution so that
> the old behavior of cropping at the start is preserved. I'm out of ideas, so
> any help is appreciated.

That's a very annoying problem. I ran into the same thing with the inspector infobar and the inspector breadcrumbs. The solutions were to: no crop at all (just hide, like in the breadcrumbs) or use HTML instead of XUL.

Just hiding is a valid option here I think.

Also, I don't think we should spend too much time on this. We are planning to refactor this code in the coming weeks (get rid of splitview).
Attachment #697921 - Flags: review?(paul)
Inspector bug triage (filter on CLIMBING SHOES).
Severity: normal → enhancement
Inspector bug triage (filter on CLIMBING SHOES).
Priority: -- → P3
Product: Firefox → DevTools
Assignee: sergiu → nobody
Status: ASSIGNED → NEW
The style editor is not showing the paths anymore (moved to a popup)

Obsolete bug report, closing.

Honza

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: