NodeInfo tree working (besides litho nodes)
Summary: The second tree has access to all AX NodeInfo properties (they are not in the sidebar yet). Infrastructure set up to customize displayed information bassed on what is most useful. Descriptors for views updated to include AX functionality and non-view descriptors AX functions defaulted to null/empty. Non-view nodes (like Fragments, Window, Appication) no longer included in AX tree. Corresponding nodes will be highlighted (although not expanded) on click in either tree. Differential Revision: D8795800 fbshipit-source-id: cf2333f69bfecca3ff84aae62681c684dfa14bf3
This commit is contained in:
committed by
Facebook Github Bot
parent
9e673a07a8
commit
1c5ecce667
@@ -166,11 +166,6 @@ export default class Layout extends SonarPlugin<InspectorState> {
|
||||
SelectElement(state: InspectorState, {key}: SelectElementArgs) {
|
||||
return {
|
||||
selected: key,
|
||||
};
|
||||
},
|
||||
|
||||
SelectAXElement(state: InspectorState, {key}: SelectElementArgs) {
|
||||
return {
|
||||
AXselected: key,
|
||||
};
|
||||
},
|
||||
@@ -402,7 +397,7 @@ export default class Layout extends SonarPlugin<InspectorState> {
|
||||
});
|
||||
|
||||
if (AXToggleButtonEnabled) {
|
||||
this.client.call('getRoot').then((element: Element) => {
|
||||
this.client.call('getAXRoot').then((element: Element) => {
|
||||
this.dispatchAction({elements: [element], type: 'UpdateAXElements'});
|
||||
this.dispatchAction({root: element.id, type: 'SetAXRoot'});
|
||||
this.performInitialExpand(element, true).then(() => {
|
||||
@@ -511,7 +506,7 @@ export default class Layout extends SonarPlugin<InspectorState> {
|
||||
if (ids.length > 0) {
|
||||
performance.mark('LayoutInspectorGetNodes');
|
||||
return this.client
|
||||
.call('getNodes', {ids})
|
||||
.call(ax ? 'getAXNodes' : 'getNodes', {ids})
|
||||
.then(({elements}: GetNodesResult) => {
|
||||
this.props.logger.trackTimeSince('LayoutInspectorGetNodes');
|
||||
return Promise.resolve(elements);
|
||||
@@ -629,7 +624,7 @@ export default class Layout extends SonarPlugin<InspectorState> {
|
||||
});
|
||||
|
||||
onAXElementSelected = debounce((key: ElementID) => {
|
||||
this.dispatchAction({key, type: 'SelectAXElement'});
|
||||
this.dispatchAction({key, type: 'SelectElement'});
|
||||
this.client.send('setHighlighted', {id: key});
|
||||
this.getNodes([key], true, true).then((elements: Array<Element>) => {
|
||||
this.dispatchAction({elements, type: 'UpdateAXElements'});
|
||||
|
||||
Reference in New Issue
Block a user