A few mini-fixes for the accessibility layout inspector

Summary:
- fix mutual selection of elements in ax and non-ax tree (simplifies linkedNode logic as well)
- remove unneeded extraInfo attributes (focused, nonAXwithAXchild, & hasAXNode were not/no longer being used)
- use 50/50 fixed width view for trees when both are visible

Reviewed By: jknoxville

Differential Revision: D16390355

fbshipit-source-id: bbf9ea887f8f1035df8b4b0562ddcc4de291f004
This commit is contained in:
Sara Valderrama
2019-08-01 21:58:40 -07:00
committed by Facebook Github Bot
parent 3ed71680a1
commit f591475f85
11 changed files with 81 additions and 82 deletions

View File

@@ -20,6 +20,7 @@ import {
Toolbar,
Sidebar,
DetailSidebar,
VerticalRule,
} from 'flipper';
import Inspector from './Inspector';
import ToolbarIcon from './ToolbarIcon';
@@ -168,6 +169,17 @@ export default class Layout extends FlipperPlugin<State, void, PersistedState> {
/>
);
const axInspector = this.state.inAXMode && (
<Inspector
{...inspectorProps}
onSelect={selectedAXElement => this.setState({selectedAXElement})}
showsSidebar={true}
ax
/>
);
const divider = this.state.inAXMode && <VerticalRule />;
return (
<FlexColumn grow={true}>
{this.state.init && (
@@ -211,23 +223,9 @@ export default class Layout extends FlipperPlugin<State, void, PersistedState> {
</Toolbar>
<FlexRow grow={true}>
{this.state.inAXMode ? (
<>
<Sidebar position="left" maxWidth={Infinity}>
{inspector}
</Sidebar>
<Inspector
{...inspectorProps}
onSelect={selectedAXElement =>
this.setState({selectedAXElement})
}
showsSidebar={true}
ax
/>
</>
) : (
inspector
)}
{inspector}
{divider}
{axInspector}
</FlexRow>
<DetailSidebar>
<InspectorSidebar