From b8cb95ab0cd5aadd4a81ed6f5fc6cf0b1c4044d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=BCchele?= Date: Tue, 26 Feb 2019 02:33:41 -0800 Subject: [PATCH] toolbar Summary: When there wasn't enough space for the text toolbar, the text was wrapped into multiple lines. Now it's truncated. Reviewed By: jknoxville Differential Revision: D14209813 fbshipit-source-id: 1971cd791daf345639993ed0632d718374a5f91b --- src/plugins/layout/layout2/InspectorSidebar.js | 8 ++++---- src/plugins/layout/layout2/index.js | 15 +++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/plugins/layout/layout2/InspectorSidebar.js b/src/plugins/layout/layout2/InspectorSidebar.js index 247351cf3..f3deebc1e 100644 --- a/src/plugins/layout/layout2/InspectorSidebar.js +++ b/src/plugins/layout/layout2/InspectorSidebar.js @@ -18,6 +18,7 @@ import { FlexCenter, styled, colors, + SidebarExtensions, } from 'flipper'; import {Component} from 'react'; @@ -92,7 +93,6 @@ type Props = {| client: PluginClient, realClient: Client, logger: Logger, - extensions?: Array, |}; type State = {| @@ -124,14 +124,14 @@ export default class Sidebar extends Component { } render() { - const {element, extensions} = this.props; + const {element} = this.props; if (!element || !element.data) { return No data; } const sections: Array = - (extensions && - extensions.map(ext => + (SidebarExtensions && + SidebarExtensions.map(ext => ext( this.props.client, this.props.realClient, diff --git a/src/plugins/layout/layout2/index.js b/src/plugins/layout/layout2/index.js index 180b4a508..2a301e6be 100644 --- a/src/plugins/layout/layout2/index.js +++ b/src/plugins/layout/layout2/index.js @@ -16,7 +16,7 @@ import { Link, Glyph, DetailSidebar, - SidebarExtensions, + styled, } from 'flipper'; import Inspector from './Inspector'; import ToolbarIcon from './ToolbarIcon'; @@ -42,6 +42,14 @@ export type PersistedState = {| AXelements: ElementMap, |}; +const BetaBar = styled(Toolbar)({ + display: 'block', + overflow: 'hidden', + lineHeight: '15px', + whiteSpace: 'nowrap', + textOverflow: 'ellipsis', +}); + export default class Layout extends FlipperPlugin { static defaultPersistedState = { rootElement: null, @@ -205,20 +213,19 @@ export default class Layout extends FlipperPlugin { element={element} onValueChanged={this.onDataValueChanged} logger={this.props.logger} - extensions={SidebarExtensions} /> )} {/* TODO: Remove this when rolling out publicly */} - +   Version 2.0:  Provide feedback about this plugin in our  feedback group . - + ); }