Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { GridCellKind } from "@glideapps/glide-data-grid";
import { Box, Stack, useTheme } from "@mui/material";
import * as Sentry from "@sentry/nextjs";
import { useRouter } from "next/router";
import { useCallback, useEffect, useMemo, useState } from "react";
import { useCallback, useMemo, useState } from "react";

import {
extractBaseUrl,
Expand Down Expand Up @@ -788,30 +788,6 @@ export const EntitiesTable: FunctionComponent<
webNameByWebId,
]);

const [
{ horizontalScrollbarHeight, verticalScrollbarWidth },
setScrollbarSizes,
] = useState({
horizontalScrollbarHeight: 0,
verticalScrollbarWidth: 0,
});

useEffect(() => {
const gridEl = document.querySelector<HTMLElement>(".dvn-scroller");

if (!gridEl) {
return;
}

const scrollbarHeight = gridEl.offsetHeight - gridEl.clientHeight;
const scrollbarWidth = gridEl.offsetWidth - gridEl.clientWidth;

setScrollbarSizes({
horizontalScrollbarHeight: scrollbarHeight,
verticalScrollbarWidth: scrollbarWidth,
});
}, [rows.length]);

const loadMoreRowHeight = 60;

return (
Expand All @@ -824,7 +800,7 @@ export const EntitiesTable: FunctionComponent<
sort={sort}
setSort={setSortWithConversion}
/>
<Stack sx={{ gap: 1, position: "relative" }}>
<Stack>
<Grid
activeConversions={activeConversions}
columns={columns}
Expand All @@ -834,12 +810,19 @@ export const EntitiesTable: FunctionComponent<
customRenderers={customRenderers}
dataLoading={false}
enableCheckboxSelection
experimental={{
paddingBottom: hasMoreRowsAvailable ? loadMoreRowHeight : 0,
}}
firstColumnLeftPadding={firstColumnLeftPadding}
freezeColumns={1}
height={`min(${maxHeight}, 600px)`}
height={
/**
* When the 'Show more entities' bar is visible it takes up part of the
* available height, so the grid shrinks to leave room for it in the flow.
* The bar must not be overlaid on top of the grid, because it would cover
* the grid's horizontal scrollbar.
*/
hasMoreRowsAvailable
? `min(calc(${maxHeight} - ${loadMoreRowHeight}px), 600px)`
: `min(${maxHeight}, 600px)`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Six hundred cap ignores bar

Low Severity

When hasMoreRowsAvailable is true, the grid height uses min(calc(${maxHeight} - 60px), 600px) while the load-more bar adds another 60px in normal flow. If maxHeight is above 600px, the inner min still fixes the grid at 600px, so the stack grows by 60px versus the previous overlaid bar layout.

Fix in CursorΒ Fix in Web

Reviewed by Cursor Bugbot for commit bb754ce. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accurate observation, leaving it for reviewers to judge: the stack never exceeds the available height (maxHeight already accounts for the viewport), so this only makes the widget up to 660px instead of 600px on tall viewports, showing more rows. If the old 600px total cap is preferred, the change is min(calc(${maxHeight} - 60px), 600px) β†’ calc(min(${maxHeight}, 600px) - 60px).

}
onConversionTargetSelected={onConversionTargetSelected}
onSearchClose={() => setShowSearch(false)}
onSelectedRowsChange={(updatedSelectedRows) =>
Expand All @@ -861,10 +844,8 @@ export const EntitiesTable: FunctionComponent<
background: palette.common.white,
borderTop: `1px solid ${palette.gray[20]}`,
height: loadMoreRowHeight,
position: "absolute",
bottom: horizontalScrollbarHeight,
p: 1,
width: `calc(100% - ${verticalScrollbarWidth}px)`,
width: "100%",
})}
>
<Button
Expand Down
Loading