Loading devtools/client/debugger/packages/devtools-components/src/tree.js +26 −7 Original line number Diff line number Diff line Loading @@ -488,7 +488,7 @@ class Tree extends Component { super(props); this.state = { seen: new Set(), autoExpanded: new Set(), }; this.treeRef = React.createRef(); Loading Loading @@ -536,29 +536,40 @@ class Tree extends Component { } _autoExpand() { const { autoExpandDepth, autoExpandNodeChildrenLimit } = this.props; if (!autoExpandDepth) { const { autoExpandDepth, autoExpandNodeChildrenLimit, initiallyExpanded, } = this.props; if (!autoExpandDepth && !initiallyExpanded) { return; } // Automatically expand the first autoExpandDepth levels for new items. Do // not use the usual DFS infrastructure because we don't want to ignore // collapsed nodes. // collapsed nodes. Any initially expanded items will be expanded regardless // of how deep they are. const autoExpand = (item, currentDepth) => { if (currentDepth >= autoExpandDepth || this.state.seen.has(item)) { const initial = initiallyExpanded && initiallyExpanded(item); if (!initial && currentDepth >= autoExpandDepth) { return; } const children = this.props.getChildren(item); if ( !initial && autoExpandNodeChildrenLimit && children.length > autoExpandNodeChildrenLimit ) { return; } if (!this.state.autoExpanded.has(item)) { this.props.onExpand(item); this.state.seen.add(item); this.state.autoExpanded.add(item); } const length = children.length; for (let i = 0; i < length; i++) { Loading @@ -574,6 +585,14 @@ class Tree extends Component { } } else if (length != 0) { autoExpand(roots[0], 0); if (initiallyExpanded) { for (let i = 1; i < length; i++) { if (initiallyExpanded(roots[i])) { autoExpand(roots[i], 0); } } } } } Loading devtools/client/debugger/packages/devtools-reps/src/object-inspector/components/ObjectInspector.js +7 −0 Original line number Diff line number Diff line Loading @@ -198,6 +198,7 @@ class ObjectInspector extends Component<Props> { nodeExpand, nodeCollapse, recordTelemetryEvent, setExpanded, roots, } = this.props; Loading @@ -210,6 +211,10 @@ class ObjectInspector extends Component<Props> { } else { nodeCollapse(item); } if (setExpanded) { setExpanded(item, expand); } } focusItem(item: Node) { Loading Loading @@ -249,6 +254,7 @@ class ObjectInspector extends Component<Props> { const { autoExpandAll = true, autoExpandDepth = 1, initiallyExpanded, focusable = true, disableWrap = false, expandedPaths, Loading @@ -264,6 +270,7 @@ class ObjectInspector extends Component<Props> { autoExpandAll, autoExpandDepth, initiallyExpanded, isExpanded: item => expandedPaths && expandedPaths.has(item.path), isExpandable: this.isNodeExpandable, Loading devtools/client/debugger/src/actions/pause/expandScopes.js 0 → 100644 +25 −0 Original line number Diff line number Diff line /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ // @flow import { getScopeItemPath } from "../../utils/pause/scopes/utils"; import type { ThunkArgs } from "../types"; import type { ThreadContext } from "../../types"; export function setExpandedScope( cx: ThreadContext, item: Object, expanded: boolean ) { return function({ dispatch, getState }: ThunkArgs) { return dispatch({ type: "SET_EXPANDED_SCOPE", cx, thread: cx.thread, path: getScopeItemPath(item), expanded, }); }; } devtools/client/debugger/src/actions/pause/index.js +1 −0 Original line number Diff line number Diff line Loading @@ -28,3 +28,4 @@ export { pauseOnExceptions } from "./pauseOnExceptions"; export { selectFrame } from "./selectFrame"; export { toggleSkipPausing } from "./skipPausing"; export { toggleMapScopes } from "./mapScopes"; export { setExpandedScope } from "./expandScopes"; devtools/client/debugger/src/actions/pause/moz.build +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ CompiledModules( 'breakOnNext.js', 'commands.js', 'continueToHere.js', 'expandScopes.js', 'fetchScopes.js', 'index.js', 'mapFrames.js', Loading Loading
devtools/client/debugger/packages/devtools-components/src/tree.js +26 −7 Original line number Diff line number Diff line Loading @@ -488,7 +488,7 @@ class Tree extends Component { super(props); this.state = { seen: new Set(), autoExpanded: new Set(), }; this.treeRef = React.createRef(); Loading Loading @@ -536,29 +536,40 @@ class Tree extends Component { } _autoExpand() { const { autoExpandDepth, autoExpandNodeChildrenLimit } = this.props; if (!autoExpandDepth) { const { autoExpandDepth, autoExpandNodeChildrenLimit, initiallyExpanded, } = this.props; if (!autoExpandDepth && !initiallyExpanded) { return; } // Automatically expand the first autoExpandDepth levels for new items. Do // not use the usual DFS infrastructure because we don't want to ignore // collapsed nodes. // collapsed nodes. Any initially expanded items will be expanded regardless // of how deep they are. const autoExpand = (item, currentDepth) => { if (currentDepth >= autoExpandDepth || this.state.seen.has(item)) { const initial = initiallyExpanded && initiallyExpanded(item); if (!initial && currentDepth >= autoExpandDepth) { return; } const children = this.props.getChildren(item); if ( !initial && autoExpandNodeChildrenLimit && children.length > autoExpandNodeChildrenLimit ) { return; } if (!this.state.autoExpanded.has(item)) { this.props.onExpand(item); this.state.seen.add(item); this.state.autoExpanded.add(item); } const length = children.length; for (let i = 0; i < length; i++) { Loading @@ -574,6 +585,14 @@ class Tree extends Component { } } else if (length != 0) { autoExpand(roots[0], 0); if (initiallyExpanded) { for (let i = 1; i < length; i++) { if (initiallyExpanded(roots[i])) { autoExpand(roots[i], 0); } } } } } Loading
devtools/client/debugger/packages/devtools-reps/src/object-inspector/components/ObjectInspector.js +7 −0 Original line number Diff line number Diff line Loading @@ -198,6 +198,7 @@ class ObjectInspector extends Component<Props> { nodeExpand, nodeCollapse, recordTelemetryEvent, setExpanded, roots, } = this.props; Loading @@ -210,6 +211,10 @@ class ObjectInspector extends Component<Props> { } else { nodeCollapse(item); } if (setExpanded) { setExpanded(item, expand); } } focusItem(item: Node) { Loading Loading @@ -249,6 +254,7 @@ class ObjectInspector extends Component<Props> { const { autoExpandAll = true, autoExpandDepth = 1, initiallyExpanded, focusable = true, disableWrap = false, expandedPaths, Loading @@ -264,6 +270,7 @@ class ObjectInspector extends Component<Props> { autoExpandAll, autoExpandDepth, initiallyExpanded, isExpanded: item => expandedPaths && expandedPaths.has(item.path), isExpandable: this.isNodeExpandable, Loading
devtools/client/debugger/src/actions/pause/expandScopes.js 0 → 100644 +25 −0 Original line number Diff line number Diff line /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ // @flow import { getScopeItemPath } from "../../utils/pause/scopes/utils"; import type { ThunkArgs } from "../types"; import type { ThreadContext } from "../../types"; export function setExpandedScope( cx: ThreadContext, item: Object, expanded: boolean ) { return function({ dispatch, getState }: ThunkArgs) { return dispatch({ type: "SET_EXPANDED_SCOPE", cx, thread: cx.thread, path: getScopeItemPath(item), expanded, }); }; }
devtools/client/debugger/src/actions/pause/index.js +1 −0 Original line number Diff line number Diff line Loading @@ -28,3 +28,4 @@ export { pauseOnExceptions } from "./pauseOnExceptions"; export { selectFrame } from "./selectFrame"; export { toggleSkipPausing } from "./skipPausing"; export { toggleMapScopes } from "./mapScopes"; export { setExpandedScope } from "./expandScopes";
devtools/client/debugger/src/actions/pause/moz.build +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ CompiledModules( 'breakOnNext.js', 'commands.js', 'continueToHere.js', 'expandScopes.js', 'fetchScopes.js', 'index.js', 'mapFrames.js', Loading