Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
Power search polish
Browse files Browse the repository at this point in the history
Summary:
sorry this ended up becoming a number of changes

1. Give power search min height so size doesnt change when empty vs not empty
2. Align search bar and items better by using flex start instead of base line
3. Use consistent style for buttons on the right (antd button ghost)

Reviewed By: lblasa

Differential Revision: D56191805

fbshipit-source-id: 8ba3022dfeb0f4f6be501096c48efba707821378
  • Loading branch information
Luke De Feo authored and facebook-github-bot committed Apr 18, 2024
1 parent 372a25f commit 5cb4c0d
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 22 deletions.
31 changes: 15 additions & 16 deletions desktop/flipper-plugin/src/ui/MasterDetailWithPowerSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
PauseCircleOutlined,
PlayCircleOutlined,
} from '@ant-design/icons';
import {Button} from 'antd';
import {Button, Tooltip} from 'antd';
import {usePluginInstance} from '../plugin/PluginContext';
import {useAssertStableRef} from '../utils/useAssertStableRef';
import {Atom, createState, useValue} from '../state/atom';
Expand Down Expand Up @@ -213,23 +213,22 @@ export function MasterDetailWithPowerSearch<T extends object>({
actionsRight={
<>
{connected && isPaused && (
<Button
size="small"
type="text"
title={`Click to ${pausedState ? 'resume' : 'pause'} the stream`}
danger={pausedState}
onClick={handleTogglePause}>
{pausedState ? <PlayCircleOutlined /> : <PauseCircleOutlined />}
</Button>
<Tooltip
title={`Click to ${pausedState ? 'resume' : 'pause'} the stream`}>
<Button
type="ghost"
danger={pausedState}
onClick={handleTogglePause}>
{pausedState ? <PlayCircleOutlined /> : <PauseCircleOutlined />}
</Button>
</Tooltip>
)}
{connected && enableClear && (
<Button
size="small"
type="text"
title="Clear records"
onClick={handleClear}>
<DeleteOutlined />
</Button>
<Tooltip title="Clear records">
<Button type="ghost" onClick={handleClear}>
<DeleteOutlined />
</Button>
</Tooltip>
)}
</>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const containerStyle = css`
border: 1px solid ${theme.borderColor};
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
padding: ${theme.space.tiny / 2}px;
min-height: 34px;
&:focus-within,
&:hover {
border-color: ${theme.primaryColor};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ export function DataTable<T extends object>(
<Layout.Container>
{props.actionsTop ? <Searchbar gap>{props.actionsTop}</Searchbar> : null}
{props.enableSearchbar && (
<Searchbar grow shrink gap style={{alignItems: 'baseline'}}>
<Searchbar grow shrink gap style={{alignItems: 'flex-start'}}>
<PowerSearch
config={powerSearchConfig}
searchExpression={searchExpression}
Expand All @@ -943,7 +943,7 @@ export function DataTable<T extends object>(
/>
{contexMenu && (
<Dropdown overlay={contexMenu} placement="bottomRight">
<Button type="text" size="small">
<Button type="ghost">
<MenuOutlined />
</Button>
</Dropdown>
Expand Down
3 changes: 2 additions & 1 deletion desktop/plugins/public/logs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,13 @@ export function Component() {
plugin.isConnected ? (
<>
<Button
type="ghost"
title={`Click to ${paused ? 'resume' : 'pause'} the log stream`}
danger={paused}
onClick={plugin.resumePause}>
{paused ? <PlayCircleOutlined /> : <PauseCircleOutlined />}
</Button>
<Button title="Clear logs" onClick={plugin.clearLogs}>
<Button type="ghost" title="Clear logs" onClick={plugin.clearLogs}>
<DeleteOutlined />
</Button>
</>
Expand Down
9 changes: 7 additions & 2 deletions desktop/plugins/public/network/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -611,11 +611,16 @@ export function Component() {
enableAutoScroll
extraActions={
<Layout.Horizontal gap>
<Button title="Clear logs" onClick={instance.clearLogs}>
<Button
type="ghost"
title="Clear logs"
onClick={instance.clearLogs}>
<DeleteOutlined />
</Button>
{isMockResponseSupported && (
<Button onClick={instance.onMockButtonPressed}>Mock</Button>
<Button type="ghost" onClick={instance.onMockButtonPressed}>
Mock
</Button>
)}
</Layout.Horizontal>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export function FrameworkEventsTable({
<>
<Tooltip title="Back to tree">
<Button
type="ghost"
onClick={() => {
instance.uiActions.onFocusNode(undefined);
instance.uiActions.onSetViewMode({mode: 'default'});
Expand All @@ -129,6 +130,7 @@ export function FrameworkEventsTable({
</Tooltip>
<Tooltip title="Delete all events">
<Button
type="ghost"
onClick={() => {
instance.frameworkEvents.clear();
managerRef.current?.clearSelection();
Expand Down

0 comments on commit 5cb4c0d

Please sign in to comment.