fix(grid): use table-open page size for documents

Closes #6903
This commit is contained in:
t8y2 committed 2026-08-21 17:32:32 +00:00
1 parent f57cd3960b
commit 3bec5091df
5 files changed
+85 -13

No files matched your search

@@ -84,7 +84,6 @@ import { dataGridCellDisplayText, dataGridCellEditorText } from "@/lib/dataGrid/
import { createColumnDrafts } from "@/lib/table/tableStructureEditorState";
import type { BuildSingleColumnAlterSqlOptions } from "@/lib/table/tableStructureEditorSql";
import { buildTableSelectSql, quoteTableDataIdentifier } from "@/lib/table/tableSelectSql";
import { tableOpenPageLimit } from "@/lib/table/tableOpenPageLimit";
import { uuid } from "@/lib/common/utils";
import { generateCellValues, type CellValueGenerationKind } from "@/lib/dataGrid/cellValueGeneration";
import { compactHeaderColumnType, isNumericColumnType, resolveDataGridTypeVisualKind, resolveHeaderColumnType, resolveResultColumnType } from "@/lib/dataGrid/dataGridColumnType";
@@ -219,6 +218,7 @@ import {
replaceColumnValueFilterCondition,
} from "@/lib/dataGrid/dataGridColumnFilter";
import { normalizeResultPageSize, resultPageSizeMenuOptions } from "@/lib/dataGrid/paginationPageSize";
import { dataGridPageSizeSettingsPatch, preferredDataGridPageSize, resolveDataGridPageSizePreference, type DataGridPageSizePreference } from "@/lib/dataGrid/dataGridPageSizePreference";
import { continuousQueryResultMaxRows, effectiveQueryResultMaxRows } from "@/lib/dataGrid/queryResultRowLimit";
import { allNullColumnIndexes } from "@/lib/dataGrid/dataGridColumnVisibility";
import { buildDataGridColumnLookupItems, dataGridColumnCommentFor, filterDataGridColumnLookupItems } from "@/lib/dataGrid/dataGridColumnLookup";
@@ -385,6 +385,7 @@ interface DataGridProps {
schema?: string;
columnLayoutScopeKey?: string;
context?: "results" | "table-data";
pageSizePreference?: DataGridPageSizePreference;
autoTransposeSingleRow?: boolean;
sourceColumns?: Array<string | undefined>;
readonlyColumnIndexes?: number[];
@@ -3076,7 +3077,8 @@ watch(
);
// --- Pagination ---
const pageSize = ref(normalizeResultPageSize(props.context === "table-data" ? (props.pageLimit ?? tableOpenPageLimit(settingsStore.editorSettings.tableOpenPageSize)) : settingsStore.editorSettings.pageSize));
const pageSizePreference = computed(() => resolveDataGridPageSizePreference(props.context, props.pageSizePreference));
const pageSize = ref(preferredDataGridPageSize(settingsStore.editorSettings, pageSizePreference.value, props.pageLimit));
const currentPage = ref(1);
const pageSizeOptions = computed(() => resultPageSizeMenuOptions(pageSize.value));
const customPageSizeInput = ref(String(pageSize.value));
@@ -3097,8 +3099,8 @@ watch(pageSize, (value) => {
watch(
() => settingsStore.editorSettings.pageSize,
(value) => {
// Table-data segments keep their own pagination state instead of following SQL result settings.
if (props.context === "table-data") return;
// Table-open grids keep their own pagination state instead of following SQL result settings.
if (pageSizePreference.value !== "results") return;
pageSize.value = normalizeResultPageSize(value, pageSize.value);
},
);
@@ -3440,7 +3442,7 @@ function checkInfiniteScroll(scroller: HTMLElement) {
function changePageSize(size: number) {
const normalizedSize = normalizeResultPageSize(size);
pageSize.value = normalizedSize;
settingsStore.updateEditorSettings(props.context === "table-data" ? { tableOpenPageSize: normalizedSize } : { pageSize: normalizedSize });
settingsStore.updateEditorSettings(dataGridPageSizeSettingsPatch(pageSizePreference.value, normalizedSize));
currentPage.value = 1;
lastInfiniteScrollPage = 0;
infiniteScrollAllLoaded = false;