fix(grid): continue Oracle manual transaction cursor for infinite scroll
This commit is contained in:
10 files changed
+410
-30
No files matched your search
@@ -197,7 +197,16 @@ import {
|
||||
tableDataVisiblePreviewRowRange,
|
||||
type ResultScopedRowCache,
|
||||
} from "@/lib/dataGrid/dataGridLargeValues";
|
||||
import { dataGridBottomScrollTop, dataGridScrollPosition, isDataGridAtScrollBottom, isDataGridNearScrollBottom, isDataGridPrefixAppend, shouldCheckInfiniteScrollAfterScroll, type DataGridScrollPosition } from "@/lib/dataGrid/dataGridInfiniteScroll";
|
||||
import {
|
||||
dataGridBottomScrollTop,
|
||||
dataGridInfiniteScrollAppendCompletion,
|
||||
dataGridScrollPosition,
|
||||
didDataGridInfiniteScrollContextChange,
|
||||
isDataGridAtScrollBottom,
|
||||
isDataGridNearScrollBottom,
|
||||
shouldCheckInfiniteScrollAfterScroll,
|
||||
type DataGridScrollPosition,
|
||||
} from "@/lib/dataGrid/dataGridInfiniteScroll";
|
||||
import { resolveDataGridWheelScroll } from "@/lib/dataGrid/dataGridWheel";
|
||||
import { CANVAS_DATA_GRID_ROW_HEIGHT, MAX_CANVAS_DATA_GRID_PIXEL_RATIO, canvasDataGridActionOverlayWidth, canvasDataGridActionReservedWidth, dataGridSearchMatchKey, drawCanvasDataGrid, type CanvasDevicePixelSize } from "@/lib/dataGrid/canvasDataGridRenderer";
|
||||
import { DATA_GRID_DARK_STRIPED_ROW_BG, DATA_GRID_LIGHT_STRIPED_ROW_BG, dataGridActiveRowBackground } from "@/lib/dataGrid/dataGridPaintTheme";
|
||||
@@ -3533,7 +3542,8 @@ function currentOrderBy(): string | undefined {
|
||||
|
||||
watch(
|
||||
() => [props.countSql ?? "", props.tableMeta?.schema ?? "", props.tableMeta?.tableName ?? "", currentWhereInput() ?? "", props.database ?? "", props.connectionId ?? ""],
|
||||
() => {
|
||||
(values, previousValues) => {
|
||||
if (!didDataGridInfiniteScrollContextChange(values, previousValues)) return;
|
||||
manualTotalRowCount.value = undefined;
|
||||
// Reset infinite-scroll allLoaded when query context changes
|
||||
infiniteScrollAllLoaded = false;
|
||||
@@ -9757,7 +9767,22 @@ watch(
|
||||
preservedDetailsOnNextResult = null;
|
||||
const shouldPreserveTranspose = preserveTransposeOnNextResult.value;
|
||||
preserveTransposeOnNextResult.value = false;
|
||||
if (isDataGridPrefixAppend(previousResult, result)) return;
|
||||
const appendCompletion = dataGridInfiniteScrollAppendCompletion(previousResult, result, {
|
||||
pageSize: pageSize.value,
|
||||
maxRows: infiniteScrollMaxRows.value,
|
||||
});
|
||||
if (appendCompletion) {
|
||||
if (infiniteScrollEnabled.value) {
|
||||
currentPage.value = appendCompletion.loadedPage;
|
||||
lastInfiniteScrollPage = Math.max(0, appendCompletion.loadedPage - 1);
|
||||
infiniteScrollAllLoaded = appendCompletion.allLoaded;
|
||||
infiniteScrollRequestedOffset = undefined;
|
||||
infiniteScrollRequestedLimit = undefined;
|
||||
infiniteScrollLoading.value = false;
|
||||
isInfiniteScrollPaginating.value = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (getResetScrollAfterResult()) {
|
||||
clearResetScrollAfterResult();
|
||||
resetGridVerticalScroll();
|
||||
|
||||
+2
-1
@@ -33,7 +33,8 @@ describe("DataGridReadonlyTextSelection", () => {
|
||||
it("closes a stale read-only selection when a result is replaced", () => {
|
||||
const resultWatcher = dataGridSource.match(/watch\(\s*\(\) => props\.result,\s*\(result, previousResult\) => \{[\s\S]*?\n\);/)?.[0] ?? "";
|
||||
|
||||
expect(resultWatcher).toContain("if (isDataGridPrefixAppend(previousResult, result)) return;");
|
||||
expect(resultWatcher).toContain("const appendCompletion = dataGridInfiniteScrollAppendCompletion(previousResult, result");
|
||||
expect(resultWatcher).toContain("if (appendCompletion) {");
|
||||
expect(resultWatcher).toContain("closeReadonlyCellTextSelection();");
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user