fix(grid): respect page size row limits

This commit is contained in:
t8y2 committed 2026-05-19 11:31:38 +08:00
1 parent 95d70eede6
commit 261d43c1b7
13 files changed
+302 -102

No files matched your search

@@ -24,7 +24,6 @@ import { loadEditorTheme, editorFontTheme } from "@/lib/editorThemes";
import { isTauriRuntime } from "@/lib/tauriRuntime";
import { aiTestConnection } from "@/lib/api";
import { eventToShortcut } from "@/lib/keyboardShortcuts";
import { MAX_RESULT_PAGE_SIZE, MIN_RESULT_PAGE_SIZE, normalizeResultPageSize } from "@/lib/paginationPageSize";
import {
SHORTCUT_DEFINITIONS,
findShortcutConflict,
@@ -52,7 +51,6 @@ const editFontFamily = ref(settingsStore.editorSettings.fontFamily);
const editFontSize = ref(settingsStore.editorSettings.fontSize);
const editTheme = ref(settingsStore.editorSettings.theme);
const editExecuteMode = ref(settingsStore.editorSettings.executeMode);
const editPageSize = ref(settingsStore.editorSettings.pageSize);
const editWordWrap = ref(settingsStore.editorSettings.wordWrap);
const editAppLayout = ref(settingsStore.editorSettings.appLayout);
const editRedisScanPageSize = ref(settingsStore.editorSettings.redisScanPageSize);
@@ -69,7 +67,6 @@ watch(
editFontSize.value = settingsStore.editorSettings.fontSize;
editTheme.value = settingsStore.editorSettings.theme;
editExecuteMode.value = settingsStore.editorSettings.executeMode;
editPageSize.value = settingsStore.editorSettings.pageSize;
editWordWrap.value = settingsStore.editorSettings.wordWrap;
editAppLayout.value = settingsStore.editorSettings.appLayout;
editRedisScanPageSize.value = settingsStore.editorSettings.redisScanPageSize;
@@ -93,7 +90,6 @@ function hasChanges(): boolean {
editFontSize.value !== settingsStore.editorSettings.fontSize ||
editTheme.value !== settingsStore.editorSettings.theme ||
editExecuteMode.value !== settingsStore.editorSettings.executeMode ||
editPageSize.value !== settingsStore.editorSettings.pageSize ||
editWordWrap.value !== settingsStore.editorSettings.wordWrap ||
editAppLayout.value !== settingsStore.editorSettings.appLayout ||
editRedisScanPageSize.value !== settingsStore.editorSettings.redisScanPageSize ||
@@ -109,7 +105,6 @@ function applySettings() {
fontSize: editFontSize.value,
theme: editTheme.value,
executeMode: editExecuteMode.value,
pageSize: normalizeResultPageSize(editPageSize.value),
wordWrap: editWordWrap.value,
appLayout: editAppLayout.value,
redisScanPageSize: editRedisScanPageSize.value,
@@ -124,7 +119,6 @@ function resetDefaults() {
editFontSize.value = DEFAULT_EDITOR_SETTINGS.fontSize;
editTheme.value = DEFAULT_EDITOR_SETTINGS.theme;
editExecuteMode.value = DEFAULT_EDITOR_SETTINGS.executeMode;
editPageSize.value = DEFAULT_EDITOR_SETTINGS.pageSize;
editWordWrap.value = DEFAULT_EDITOR_SETTINGS.wordWrap;
editAppLayout.value = DEFAULT_EDITOR_SETTINGS.appLayout;
editRedisScanPageSize.value = DEFAULT_EDITOR_SETTINGS.redisScanPageSize;
@@ -136,10 +130,6 @@ function onExecuteModeChange(v: any) {
if (v === "all" || v === "current") editExecuteMode.value = v;
}
function onPageSizeInput(event: Event) {
editPageSize.value = normalizeResultPageSize((event.target as HTMLInputElement).value);
}
function onFontFamilyChange(v: any) {
if (typeof v === "string") editFontFamily.value = v;
}
@@ -574,26 +564,6 @@ watch(
</SelectContent>
</Select>
</div>
<div class="space-y-2">
<div class="flex items-center justify-between gap-3">
<Label for="editor-result-page-size">{{ t("settings.resultPageSize") }}</Label>
<span class="text-xs text-muted-foreground tabular-nums">
{{ t("settings.resultPageSizeOption", { count: editPageSize }) }}
</span>
</div>
<Input
id="editor-result-page-size"
type="number"
inputmode="numeric"
:min="MIN_RESULT_PAGE_SIZE"
:max="MAX_RESULT_PAGE_SIZE"
step="1"
:model-value="editPageSize"
@input="onPageSizeInput"
/>
<p class="text-xs text-muted-foreground">{{ t("settings.resultPageSizeDescription") }}</p>
</div>
</div>
<div class="grid gap-4 md:grid-cols-2">