Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions apps/hash-frontend/src/components/grid/grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";

import { gridRowHeight } from "@local/hash-isomorphic-utils/data-grid";

import { getCellHorizontalPadding } from "./utils";
import { getCellHorizontalPadding, gridHeaderBaseFont } from "./utils";
import { ColumnFilterMenu } from "./utils/column-filter-menu";
import {
ConversionMenu,
Expand Down Expand Up @@ -136,8 +136,6 @@ const gridHeaderHeight = 42;

export const gridHeaderHeightWithBorder = gridHeaderHeight + 1;

export const gridHeaderBaseFont = "600 14px Inter";

export const gridHorizontalScrollbarHeight = 17;

export const Grid = <
Expand Down
3 changes: 3 additions & 0 deletions apps/hash-frontend/src/components/grid/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { getMiddleCenterBias, GridCellKind } from "@glideapps/glide-data-grid";

import type { CustomCell, DrawArgs, Theme } from "@glideapps/glide-data-grid";

/** The font a grid draws its column headers in. */
export const gridHeaderBaseFont = "600 14px Inter";

/**
* @returns vertical center of a grid cell, relative to the visible grid area
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ export const summarizeEntitiesQuery = gql`
}
`;

export const queryEntitiesTableQuery = gql`
query queryEntitiesTable($request: QueryEntitiesTableParams!) {
queryEntitiesTable(request: $request)
}
`;

export const updateEntityMutation = gql`
mutation updateEntity($entityUpdate: EntityUpdateDefinition!) {
# This is a scalar, which has no selection.
Expand Down
9 changes: 8 additions & 1 deletion apps/hash-frontend/src/pages/entities.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ const EntitiesPage: NextPageWithLayout = () => {
return {};
}, [router]);

// A stable identity β€” the column list feeds the table query hook's
// processing effect, which a fresh array on every render would re-run.
const hideColumns = useMemo(
() => (entityTypeId ? ["entityTypes" as const] : []),
[entityTypeId],
);

const { latestEntityTypes } = useLatestEntityTypesOptional({
includeArchived: true,
});
Expand Down Expand Up @@ -345,7 +352,7 @@ const EntitiesPage: NextPageWithLayout = () => {
<EntitiesVisualizer
entityTypeBaseUrl={entityTypeBaseUrl}
entityTypeId={entityTypeId}
hideColumns={entityTypeId ? ["entityTypes"] : []}
hideColumns={hideColumns}
/>
</Container>
</>
Expand Down
Loading
Loading