Skip to content

Commit

Permalink
Details styling
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lblasa authored and facebook-github-bot committed Aug 1, 2023
1 parent 2b56289 commit fb469fa
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions desktop/flipper-ui-core/src/chrome/ConnectivityLogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import {
} from 'flipper-common';
import {Button} from 'antd';

const SIDEBAR_WIDTH = 400;

const rows = createDataSource<ConnectionRecordEntry>([], {
limit: 200000,
persist: 'connectivity-logs',
Expand Down Expand Up @@ -135,6 +137,12 @@ const Placeholder = styled(Layout.Container)({
fontSize: 18,
});

const PanelContainer = styled.div({
width: SIDEBAR_WIDTH - 2 * 32,
whiteSpace: 'pre-wrap',
overflow: 'scroll',
});

function isShellCommand(
entry: ConnectionRecordEntry,
): entry is CommandRecordEntry {
Expand All @@ -154,10 +162,10 @@ function Sidebar({selection}: {selection: undefined | ConnectionRecordEntry}) {
{selection.description}
</Panel>,
<Panel key="stdout" heading="STDOUT">
{selection.stdout}
<PanelContainer>{selection.stdout}</PanelContainer>
</Panel>,
<Panel key="stderr" heading="STDERR">
{selection.stderr}
<PanelContainer>{selection.stderr}</PanelContainer>
</Panel>,
<Panel key="troubleshoot" heading="Troubleshooting Tips">
{selection.troubleshoot}
Expand Down Expand Up @@ -212,7 +220,7 @@ export const ConnectivityLogs = () => {
);

return (
<Layout.Right resizable width={selection ? 400 : 0}>
<Layout.Right resizable width={selection ? SIDEBAR_WIDTH : 0}>
<DataTable<ConnectionRecordEntry>
dataSource={rows}
columns={columns}
Expand Down

0 comments on commit fb469fa

Please sign in to comment.