Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

[Source Tree] show first root #1337

Closed
jasonLaster opened this issue Nov 29, 2016 · 2 comments · May be fixed by jrogatis/debugger.html#1
Closed

[Source Tree] show first root #1337

jasonLaster opened this issue Nov 29, 2016 · 2 comments · May be fixed by jrogatis/debugger.html#1

Comments

@jasonLaster
Copy link
Contributor

One nice thing that chrome does is only expand the first source tree root. This is nice because, they do some work to make sure it is often the most helpful and it helps focus the user on where to take an action.

Steps to reproduce

  1. debug google.com

Patch

This patch should be everything we need.

diff --git a/src/components/SourcesTree.js b/src/components/SourcesTree.js
index fe5ce95..03e24cd 100644
--- a/src/components/SourcesTree.js
+++ b/src/components/SourcesTree.js
@@ -135,7 +135,9 @@ let SourcesTree = React.createClass({
       getRoots: () => sourceTree.contents,
       getKey: (item, i) => item.path,
       itemHeight: 30,
+      autoExpand: 0,
       autoExpandDepth: 1,
+      autoExpandAll: false,
       onFocus: this.focusItem,
       renderItem: this.renderItem
     });

Chrome

screen shot 2016-11-28 at 7 20 23 pm

Firefox

screen shot 2016-11-28 at 7 18 42 pm

Dalimil added a commit to Dalimil/debugger.html that referenced this issue Dec 1, 2016
Dalimil added a commit to Dalimil/debugger.html that referenced this issue Dec 1, 2016
@Dalimil
Copy link
Contributor

Dalimil commented Dec 1, 2016

So first, the devtools-sham-modules tree component with autoExpand(roots[0], 0); will throw an undefined error for an empty roots array so that had to be fixed. I wasn't quite sure if this should be filed in Bugzilla for the whole devtools project or if this code is local only to the debugger.html project...
Then I was trying to implement a source tree ordering that would be similar to the one used in Chrome - they keep the root domain on top and then only alphabetically sort the rest. (see the attached screenshot - www.mozilla.org needs to go before www.google-analytics even though g is before m ).
screenshot_2016-12-01_22-26-54
I just pinned the first group of sources to the top - which in most cases happens to be the domain corresponding to the opened tab but I think to implement this properly you'd need to change the way that reducers mergeIn a new source on ADD_SOURCE action or somehow keep track of the tab URL so that it can be compared later...

Dalimil added a commit to Dalimil/debugger.html that referenced this issue Dec 2, 2016
Dalimil added a commit to Dalimil/debugger.html that referenced this issue Dec 6, 2016
jasonLaster pushed a commit that referenced this issue Dec 7, 2016
* Fix devtools-sham-modules tree expansion

* [Source Tree] show first root #1337
@jasonLaster
Copy link
Contributor Author

This was done in #1371

jasonLaster pushed a commit to arthur801031/debugger.html that referenced this issue Dec 16, 2016
Try pushing a commit

Try pushing a commit

Revert some files

Try solving merge conflict

fixed active tab header seperation (firefox-devtools#1368)

Fix styling for watch expression buttons. (firefox-devtools#1386)

[Source Tree] show first root firefox-devtools#1337 (firefox-devtools#1371)

* Fix devtools-sham-modules tree expansion

* [Source Tree] show first root firefox-devtools#1337

Add show source redux backend (firefox-devtools#1370)

Bump internal packages (firefox-devtools#1390)

[typo] "we" recommend not "I" (firefox-devtools#1397)

bump webpack and flow (firefox-devtools#1401)

Add HMR support to SMP (firefox-devtools#1372)

Rebase master

Revert sources-tree.js to have url.group check on line 138 to pass failing test

Remove list of items from redux & Add code to pass and process list of items in ManagedTree.js

Resolve failing test

Revert code

Remove trailing spaces

Add suggested changes by jasonLaster

Handle special cases which cause the program to crash

Add code to handle extensions folder

Move getExpendedPaths to utils/sources-tree

* add a test

add new functions

Handle special cases in findSource and getDirectories and add one unit test for getDirectories

Handle more edge cases and fix bugs

Clean up code & Add 1 more unit test for reveal
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants