Skip to content

Commit

Permalink
Fixes for PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
softwarenerd committed Feb 21, 2025
1 parent 660470b commit bfa5f84
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const PositronModalPopup = (props: PropsWithChildren<PositronModalPopupPr
*/
const positionRight = () => {
if (isNumber(props.width)) {
popupLayout.left = (anchorX + anchorWidth) - props.width - LAYOUT_OFFSET;
popupLayout.left = (anchorX + anchorWidth) - props.width;
} else {
popupLayout.right = documentWidth - (anchorX + anchorWidth);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit bfa5f84

Please sign in to comment.