diff --git a/src/vs/workbench/browser/positronComponents/positronModalPopup/positronModalPopup.tsx b/src/vs/workbench/browser/positronComponents/positronModalPopup/positronModalPopup.tsx index 1063ccf9c1d..544792f9904 100644 --- a/src/vs/workbench/browser/positronComponents/positronModalPopup/positronModalPopup.tsx +++ b/src/vs/workbench/browser/positronComponents/positronModalPopup/positronModalPopup.tsx @@ -158,7 +158,7 @@ export const PositronModalPopup = (props: PropsWithChildren { if (isNumber(props.width)) { - popupLayout.left = (anchorX + anchorWidth) - props.width - LAYOUT_OFFSET; + popupLayout.left = (anchorX + anchorWidth) - props.width; } else { popupLayout.right = documentWidth - (anchorX + anchorWidth); } diff --git a/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/addEditRowFilterModalPopup/components/columnSelectorModalPopup.tsx b/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/addEditRowFilterModalPopup/components/columnSelectorModalPopup.tsx index e8551020243..0476bce59d4 100644 --- a/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/addEditRowFilterModalPopup/components/columnSelectorModalPopup.tsx +++ b/src/vs/workbench/browser/positronDataExplorer/components/dataExplorerPanel/components/addEditRowFilterModalPopup/components/columnSelectorModalPopup.tsx @@ -19,6 +19,9 @@ import { ColumnSchema } from '../../../../../../../services/languageRuntime/comm import { PositronModalPopup } from '../../../../../../positronComponents/positronModalPopup/positronModalPopup.js'; import { PositronModalReactRenderer } from '../../../../../../positronModalReactRenderer/positronModalReactRenderer.js'; +// Constants. +const SEARCH_AREA_HEIGHT = 34; + /** * ColumnSelectorModalPopupProps interface. */ @@ -80,19 +83,15 @@ export const ColumnSelectorModalPopup = (props: ColumnSelectorModalPopupProps) = // Enable search when there are more than 10 rows. const enableSearch = rows > 10; - // Calculate the max height. This is the height of the search UI plus the height of the rows, - // plus the height of the top and bottom rows margin. - const maxHeight = - (enableSearch ? 34 : 0) + - (rows * defaultRowHeight) + - (rowsMargin * 2); - - // Calculate the min height. This is the height of the search UI plus the height of four rows, - // plus the height of the top and bottom rows margin. - const minHeight = - (enableSearch ? 34 : 0) + - (2 * defaultRowHeight) + - (rowsMargin * 2); + // Calculate the base height. This is the height of the search UI plus the height of the top and + // bottom rows margin. + const baseHeight = (enableSearch ? SEARCH_AREA_HEIGHT : 0) + (2 * rowsMargin); + + // Calculate the max height for all rows. + const maxHeight = baseHeight + (rows * defaultRowHeight); + + // Calculate the min height for two rows. + const minHeight = baseHeight + (2 * defaultRowHeight); // Render. return (