Make plugin status screen more useful

Summary: If no device/client was selected, no plugins would show up in the plugin status list either, which is very confusing. Changed this to always show all loaded plugins, regardless of selected device / app.

Reviewed By: nikoant

Differential Revision: D29661006

fbshipit-source-id: 720a1697df7ed17b00d5db5a72a8e2b6bb344b1e
This commit is contained in:
Michel Weststrate
2021-07-13 03:33:20 -07:00
committed by Facebook GitHub Bot
parent 1fdc261111
commit 25fa0b7c61

View File

@@ -210,73 +210,19 @@ class PluginDebugger extends Component<Props> {
}
render() {
let content = null;
if (!this.props.selectedDevice) {
content = (
<InfoText>
We can't find any device connected to your computer. Is an
emulator/simulator currently running on your system, or is there a
development device connected via USB? There are some devices/emulators
known to have problems connecting to Flipper. Check out the{' '}
<Link href="https://fbflipper.com/docs/troubleshooting#known-incompatibilities">
known incompatibilities
</Link>
.
</InfoText>
);
} else if (
!this.props.clients.some(
(client: Client) =>
client.query.device_id === this.props.selectedDevice,
)
) {
// no clients for selected device
content = (
<Fragment>
<InfoText>
While Flipper was able to connect to your device, it wasn't able to
connect to the app you are running on your device. For this reason,
app-specific plugins will not show up.
</InfoText>
{this.props.clients.length > 0 && (
// we have clients, but not for this device
<InfoText>
Make sure you selected the correct device from the dropdown button
in the upper left corner. Only plugins for the selected device are
shown in the sidebar.
</InfoText>
)}
<InfoText>
To debug why Flipper couldn't establish a connection to the app,
check out our documentation about{' '}
<Link href="https://fbflipper.com/docs/troubleshooting#connection-issues">
connection issues
</Link>
.
</InfoText>
</Fragment>
);
} else {
content = (
<Fragment>
<InfoText>
The table lists all plugins known to Flipper. Some of them might be
blocked by GKs, others may not show up, because none of the
connected apps are supporting it.
</InfoText>
<TableContainer>
<ManagedTable
columns={COLUMNS}
rows={this.getRows()}
highlightableRows={false}
columnSizes={COLUMNS_SIZES}
/>
</TableContainer>
</Fragment>
);
}
return content;
return (
<Fragment>
<InfoText>The table lists all plugins known to Flipper.</InfoText>
<TableContainer>
<ManagedTable
columns={COLUMNS}
rows={this.getRows()}
highlightableRows={false}
columnSizes={COLUMNS_SIZES}
/>
</TableContainer>
</Fragment>
);
}
}