@@ -43,6 +43,7 @@ import GlobalEnvironmentSettings from 'components/Environments/GlobalEnvironment
4343import OpenAPISyncTab from 'components/OpenAPISyncTab' ;
4444import OpenAPISpecTab from 'components/OpenAPISpecTab' ;
4545import CollapsedPanelIndicator from './CollapsedPanelIndicator' ;
46+ import { clampRequestHeightForResponse } from './paneSize' ;
4647import { IconLoader2 } from '@tabler/icons' ;
4748
4849const MIN_LEFT_PANE_WIDTH = 300 ;
@@ -51,6 +52,8 @@ const MIN_TOP_PANE_HEIGHT = 150;
5152const MIN_BOTTOM_PANE_HEIGHT = 150 ;
5253const COLLAPSE_EDGE_THRESHOLD = 80 ;
5354const EXPAND_EDGE_THRESHOLD = 100 ;
55+ // Minimum response pane height to show placeholder content on click-expand
56+ const RESPONSE_EXPAND_MIN_HEIGHT = 300 ;
5457
5558const RequestTabPanel = ( ) => {
5659 const dispatch = useDispatch ( ) ;
@@ -262,6 +265,21 @@ const RequestTabPanel = () => {
262265 startDragging ( e ) ;
263266 } , [ expandResponse , applyPointerResize , startDragging ] ) ;
264267
268+ const handleResponseIndicatorClickExpand = useCallback ( ( ) => {
269+ expandResponse ( ) ;
270+ if ( ! isVerticalLayoutRef . current || ! mainSectionRef . current ) return ;
271+ const { height : containerHeight } = mainSectionRef . current . getBoundingClientRect ( ) ;
272+ const clampedHeight = clampRequestHeightForResponse (
273+ topPaneHeight ,
274+ containerHeight ,
275+ RESPONSE_EXPAND_MIN_HEIGHT ,
276+ MIN_TOP_PANE_HEIGHT
277+ ) ;
278+ if ( clampedHeight != null ) {
279+ setTopPaneHeight ( clampedHeight ) ;
280+ }
281+ } , [ expandResponse , topPaneHeight , setTopPaneHeight ] ) ;
282+
265283 useEffect ( ( ) => {
266284 document . addEventListener ( 'mouseup' , handleMouseUp ) ;
267285 document . addEventListener ( 'mousemove' , handleMouseMove ) ;
@@ -563,7 +581,7 @@ const RequestTabPanel = () => {
563581 < CollapsedPanelIndicator
564582 panelType = "response"
565583 isVertical = { isVerticalLayout }
566- onExpand = { expandResponse }
584+ onExpand = { handleResponseIndicatorClickExpand }
567585 onDragStart = { handleResponseIndicatorDragStart }
568586 dragThresholdPx = { isVerticalLayout ? MIN_BOTTOM_PANE_HEIGHT / 2 : MIN_RIGHT_PANE_WIDTH / 2 }
569587 />
0 commit comments