diff --git a/Composer/packages/client/src/components/Page.tsx b/Composer/packages/client/src/components/Page.tsx index 9e0d6ed04b..3bc24a1c6e 100644 --- a/Composer/packages/client/src/components/Page.tsx +++ b/Composer/packages/client/src/components/Page.tsx @@ -62,9 +62,10 @@ export const headerContent = css` label: PageHeaderContent; `; +// TODO: https://github.com/microsoft/BotFramework-Composer/issues/6873. Investigate static numbers export const main = (hasRenderHeaderContent) => css` margin-left: 2px; - height: ${hasRenderHeaderContent ? 'calc(100vh - 181px)' : 'calc(100vh - 165px)'}; + max-height: ${hasRenderHeaderContent ? 'calc(100vh - 181px)' : 'calc(100vh - 165px)'}; display: flex; flex-grow: 1; border-top: 1px solid #dddddd; @@ -220,10 +221,10 @@ const Page: React.FC = (props) => { role="region" >
{children}
- {useDebugPane ? : null} + {useDebugPane ? : null} ); diff --git a/Composer/packages/client/src/pages/design/DebugPanel/DebugPanel.tsx b/Composer/packages/client/src/pages/design/DebugPanel/DebugPanel.tsx index cb280efbb2..5f257ca99e 100644 --- a/Composer/packages/client/src/pages/design/DebugPanel/DebugPanel.tsx +++ b/Composer/packages/client/src/pages/design/DebugPanel/DebugPanel.tsx @@ -23,6 +23,11 @@ import { debugPaneHeaderStyle, debugPaneContentStyle, debugPaneFooterStyle, + expandedPanelHeaderHeight, + collapsedPaneHeaderHeight, + debugPanelDefaultHeight, + debugPanelMaxExpandedHeight, + debugPanelMinHeight, } from './styles'; import debugExtensions from './TabExtensions'; import { DebugDrawerKeys, DebugPanelTabHeaderProps } from './TabExtensions/types'; @@ -67,7 +72,7 @@ export const DebugPanel: React.FC = () => { return { key: tabKey, element }; }; - const computedPivotHeight = isPanelExpanded ? 36 : 24; + const computedPivotHeight = isPanelExpanded ? expandedPanelHeaderHeight : collapsedPaneHeaderHeight; const headerPivot = useMemo(() => { const tabTitles = debugExtensions @@ -124,67 +129,69 @@ export const DebugPanel: React.FC = () => { }, [isPanelExpanded, activeTab]); return ( - -
+ -
- {headerPivot} -
-
- { - if (isPanelExpanded) { - onCollapsePanel(); - } else { - onExpandPanel('Diagnostics'); - } - }} + css={css` + ${debugPaneBarStyle} + ${isPanelExpanded ? debugPaneHeaderStyle : debugPaneFooterStyle} + `} + data-testid={isPanelExpanded ? 'debug-panel__header' : 'debug-panel__footer'} + > +
+ {headerPivot} +
+
+
+ { + if (isPanelExpanded) { + onCollapsePanel(); + } else { + onExpandPanel('Diagnostics'); + } + }} + /> +
+
+
+ {debugExtensions.map((debugTabs) => { + const { ContentWidget } = debugTabs; + return ; + })}
-
-
- {debugExtensions.map((debugTabs) => { - const { ContentWidget } = debugTabs; - return ; - })} -
-
+ +
); }; diff --git a/Composer/packages/client/src/pages/design/DebugPanel/styles.ts b/Composer/packages/client/src/pages/design/DebugPanel/styles.ts index db41a0fca7..ac2b86445a 100644 --- a/Composer/packages/client/src/pages/design/DebugPanel/styles.ts +++ b/Composer/packages/client/src/pages/design/DebugPanel/styles.ts @@ -3,9 +3,11 @@ import { css } from '@emotion/core'; -export const DebugPaneHeaderHeight = 36; - -export const DebugPaneFooterHeight = 24; +export const expandedPanelHeaderHeight = 36; +export const collapsedPaneHeaderHeight = 32; +export const debugPanelMaxExpandedHeight = 500; +export const debugPanelDefaultHeight = 300; +export const debugPanelMinHeight = 200; export const debugPaneContainerStyle = css` display: flex; @@ -14,18 +16,17 @@ export const debugPaneContainerStyle = css` `; export const debugPaneHeaderStyle = css` - height: ${DebugPaneHeaderHeight}px; border-top: 1px solid #dfdfdf; `; export const debugPaneContentStyle = css` - height: calc(100% - ${DebugPaneHeaderHeight}px); + height: calc(100% - ${expandedPanelHeaderHeight}px); overflow-y: hidden; overflow-x: auto; `; export const debugPaneFooterStyle = css` - height: ${DebugPaneFooterHeight}px; + height: ${collapsedPaneHeaderHeight}px; border-top: 1px solid #dfdfdf; `; @@ -35,7 +36,9 @@ export const debugPaneBarStyle = css` background: #faf9f8; `; -export const leftBarStyle = css``; +export const leftBarStyle = css` + padding: 0 16px; +`; export const rightBarStyle = css` display: flex; diff --git a/Composer/packages/client/src/pages/design/DesignPage.tsx b/Composer/packages/client/src/pages/design/DesignPage.tsx index dac1a406c0..56c8412188 100644 --- a/Composer/packages/client/src/pages/design/DesignPage.tsx +++ b/Composer/packages/client/src/pages/design/DesignPage.tsx @@ -2,7 +2,7 @@ // Licensed under the MIT License. /** @jsx jsx */ -import { jsx } from '@emotion/core'; +import { css, jsx } from '@emotion/core'; import { RouteComponentProps } from '@reach/router'; import { useRecoilValue } from 'recoil'; import { Split, SplitMeasuredSizes } from '@geoffcox/react-splitter'; @@ -16,10 +16,26 @@ import CommandBar from './CommandBar'; import VisualPanel from './VisualPanel'; import PropertyPanel from './PropertyPanel'; import useEmptyPropsHandler from './useEmptyPropsHandler'; -import { contentWrapper, editorContainer, editorWrapper, pageRoot } from './styles'; +import { contentWrapper, editorContainer, editorWrapper } from './styles'; import Modals from './Modals'; import { DebugPanel } from './DebugPanel/DebugPanel'; +export const root = css` + height: calc(100vh - 50px); + display: flex; + flex-direction: row; + + label: Page; +`; + +export const pageWrapper = css` + display: flex; + flex-direction: column; + flex-grow: 1; + + label: PageWrapper; +`; + const DesignPage: React.FC> = ( props ) => { @@ -35,37 +51,39 @@ const DesignPage: React.FC - - -
- - -
- - - - -
-
- -
-
- +
+
+ + +
+ + +
+ + + + +
+
+
+
+ + +
); };