Details styling

Summary: STDOUT and STDERR can overflow the panel. This change creates a container for these two panels which should keep content within their boundaries.

Reviewed By: antonk52

Differential Revision: D47952711

fbshipit-source-id: 394390ae6b6a12329fe0eea1fc9948a7261b11bf
This commit is contained in:
Lorenzo Blasa
2023-08-01 06:59:08 -07:00
committed by Facebook GitHub Bot
parent 2b56289490
commit fb469faa1d

View File

@@ -26,6 +26,8 @@ import {
} from 'flipper-common'; } from 'flipper-common';
import {Button} from 'antd'; import {Button} from 'antd';
const SIDEBAR_WIDTH = 400;
const rows = createDataSource<ConnectionRecordEntry>([], { const rows = createDataSource<ConnectionRecordEntry>([], {
limit: 200000, limit: 200000,
persist: 'connectivity-logs', persist: 'connectivity-logs',
@@ -135,6 +137,12 @@ const Placeholder = styled(Layout.Container)({
fontSize: 18, fontSize: 18,
}); });
const PanelContainer = styled.div({
width: SIDEBAR_WIDTH - 2 * 32,
whiteSpace: 'pre-wrap',
overflow: 'scroll',
});
function isShellCommand( function isShellCommand(
entry: ConnectionRecordEntry, entry: ConnectionRecordEntry,
): entry is CommandRecordEntry { ): entry is CommandRecordEntry {
@@ -154,10 +162,10 @@ function Sidebar({selection}: {selection: undefined | ConnectionRecordEntry}) {
{selection.description} {selection.description}
</Panel>, </Panel>,
<Panel key="stdout" heading="STDOUT"> <Panel key="stdout" heading="STDOUT">
{selection.stdout} <PanelContainer>{selection.stdout}</PanelContainer>
</Panel>, </Panel>,
<Panel key="stderr" heading="STDERR"> <Panel key="stderr" heading="STDERR">
{selection.stderr} <PanelContainer>{selection.stderr}</PanelContainer>
</Panel>, </Panel>,
<Panel key="troubleshoot" heading="Troubleshooting Tips"> <Panel key="troubleshoot" heading="Troubleshooting Tips">
{selection.troubleshoot} {selection.troubleshoot}
@@ -212,7 +220,7 @@ export const ConnectivityLogs = () => {
); );
return ( return (
<Layout.Right resizable width={selection ? 400 : 0}> <Layout.Right resizable width={selection ? SIDEBAR_WIDTH : 0}>
<DataTable<ConnectionRecordEntry> <DataTable<ConnectionRecordEntry>
dataSource={rows} dataSource={rows}
columns={columns} columns={columns}