Closed Bug 986838 Opened 12 years ago Closed 12 years ago

Add-on SDK modules should be listed after the add-on's own modules

Categories

(DevTools :: Debugger, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 31

People

(Reporter: mossop, Assigned: mossop)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

The grouping of sources in the add-on debugger is alphabetical right now, so the "Add-on SDK" group always appears before the add-on's own modules. We should make the SDK group appear towards the end. If we can collapse groups in the future we should default it to collapsed too.
Assignee: nobody → dtownsend+bugmail
Attached patch patch rev 1 (obsolete) — Splinter Review
This allows us to define a set of known groups for URI and sort them at the end of the list.
Attachment #8397931 - Flags: review?(nfitzgerald)
Attached patch patchSplinter Review
Realised that getSourceGroup and getSourceLabel don't need splitting the -> urls.
Attachment #8397931 - Attachment is obsolete: true
Attachment #8397931 - Flags: review?(nfitzgerald)
Attachment #8397944 - Flags: review?(nfitzgerald)
Comment on attachment 8397944 [details] [diff] [review] patch Review of attachment 8397944 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/devtools/debugger/debugger-panes.js @@ +11,5 @@ > const INDENT_COUNT_THRESHOLD = 5; // percentage > const CHARACTER_LIMIT = 250; // line character limit > > +// Maps known URLs to friends source group names > +const SOURCE_GROUPS = { Maybe we could name this better? I understand what it does from reading the code, but it seems like it isn't just SOURCE_GROUPS it's SPECIAL_SOURCE_GROUPS (where "special" could be improved upon; KNOWN_SOURCE_GROUPS?). Also, the comment doesn't make sense to me wrt "friends". @@ +1571,5 @@ > + let sourceLabel = null; > + > + for (let name of Object.keys(SOURCE_GROUPS)) { > + if (aUrl.startsWith(SOURCE_GROUPS[name])) > + sourceLabel = aUrl.substring(SOURCE_GROUPS[name].length); Style nit: in devtools code we always wrap an if's consequent in brackets. @@ +1575,5 @@ > + sourceLabel = aUrl.substring(SOURCE_GROUPS[name].length); > + } > + > + if (!sourceLabel) > + sourceLabel = this.trimUrl(aUrl); ditto @@ +1608,5 @@ > let groupLabel = uri.prePath; > + > + for (let name of Object.keys(SOURCE_GROUPS)) { > + if (aUrl.startsWith(SOURCE_GROUPS[name])) > + groupLabel = name; ditto ::: browser/devtools/debugger/test/browser_dbg_addon-sources.js @@ +91,5 @@ > + let groups = gDebugger.document.querySelectorAll(".side-menu-widget-group-title .name"); > + is(groups[0].value, "jar:", "Add-on bootstrap should be the first group"); > + is(groups[1].value, "resource://jid1-ami3akps3baaeg-at-jetpack", "Add-on code should be the second group"); > + is(groups[2].value, "Add-on SDK", "Add-on SDK should be the third group"); > + is(groups.length, 3, "Should be only two groups."); "Should only be *three* groups"
Attachment #8397944 - Flags: review?(nfitzgerald) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 31
QA Whiteboard: [qa-]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: