- make them both use .theme-twisty to show an arrow icon.
- move some specifics stylings of SourcesTree to the base class.
- make SourcesTree use the arrow React component provided by Tree class.
- use .theme-twisty instead of .arrow (which already implements rotation and colors on expand). But it uses "open" instead of "expanded" classname.
(VirtualizedTree was already using theme-twisty)
This impacts the Source Tree, ObjectInspector (console, debugger), Watch Expressions, memory panel (dominator view).
Differential Revision: https://phabricator.services.mozilla.com/D215637
This introduces a new reducer in order to maintain a Source Tree data structure.
A Source Tree is composed of:
* Thread Items
To designate targets/threads. These are the roots of the Tree if no project directory is selected.
* Group Items
To designates the different domains used in the website.
These are direct children of threads and may contain directory or source items.
* Directory Items
To designate all the folders. Note that each every folder has an items.
The Source Tree React component is doing the magic to coallesce folders made
of only one sub folder.
* Source Items
To designate sources. They are the leaves of the Tree.
(we should not have empty directories.)
See the creation methods in the reducer to see the various attributes available on each Item type.
Project root implementation has been simplified, but there is still subtantial complexity around it.
Also, there is a behavior change. Now the project root is thread specific,
whereas before it could be per domain/URL across threads.
The complexity of it is around preserving the `uniquePath` across reloads.
Because uniquePath starts with the thread actor ID, it can't be preserved across reload.
Instead, we replace the thread actor ID with "top-level" string.
This means that project root isn't preserved across reload for non-top-level targets.
About `uniquePath` attribute available on all items,
this will be the Path in ManagedTree and Key in Tree components.
i.e. a unique identifier for any item in the Tree.
The isWebExtension check is simplified to fetch it from the thread object,
instead of having to involve the "CONNECT" action.
Depends on D151467
Differential Revision: https://phabricator.services.mozilla.com/D150548
In devtools/client/shared/components/tree/TreeView.js I have had to leave defaultProps outside the getter as a temporary workaround for bug 1413167.
MozReview-Commit-ID: 1yaxqFnC92p