25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
feat(settings): add Redis scan page size setting
t8y28d73e6e00d71
diff --git a/src/components/editor/EditorSettingsDialog.vue b/src/components/editor/EditorSettingsDialog.vueindex 3f23375b9f..123ac072c6 100644--- a/src/components/editor/EditorSettingsDialog.vue+++ b/src/components/editor/EditorSettingsDialog.vue@@ -11,7 +11,6 @@ import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popoverimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";import { Separator } from "@/components/ui/separator";import { Switch } from "@/components/ui/switch";-import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";import {useSettingsStore,EDITOR_THEMES,@@ -44,6 +43,8 @@ const editTheme = ref(settingsStore.editorSettings.theme);const editExecuteMode = ref(settingsStore.editorSettings.executeMode);const editWordWrap = ref(settingsStore.editorSettings.wordWrap);const editAppLayout = ref(settingsStore.editorSettings.appLayout);+const editRedisScanPageSize = ref(settingsStore.editorSettings.redisScanPageSize);+const redisScanPageSizeOptions = [200, 1000, 5000, 10000];// Sync from store when dialog openswatch(@@ -56,6 +57,7 @@ watch(editExecuteMode.value = settingsStore.editorSettings.executeMode;editWordWrap.value = settingsStore.editorSettings.wordWrap;editAppLayout.value = settingsStore.editorSettings.appLayout;+ editRedisScanPageSize.value = settingsStore.editorSettings.redisScanPageSize;}},);@@ -67,7 +69,8 @@ function hasChanges(): boolean {editTheme.value !== settingsStore.editorSettings.theme ||editExecuteMode.value !== settingsStore.editorSettings.executeMode ||editWordWrap.value !== settingsStore.editorSettings.wordWrap ||- editAppLayout.value !== settingsStore.editorSettings.appLayout+ editAppLayout.value !== settingsStore.editorSettings.appLayout ||+ editRedisScanPageSize.value !== settingsStore.editorSettings.redisScanPageSize);}@@ -79,6 +82,7 @@ function applySettings() {executeMode: editExecuteMode.value,wordWrap: editWordWrap.value,appLayout: editAppLayout.value,+ redisScanPageSize: editRedisScanPageSize.value,});emit("update:open", false);}@@ -90,6 +94,7 @@ function resetDefaults() {editExecuteMode.value = DEFAULT_EDITOR_SETTINGS.executeMode;editWordWrap.value = DEFAULT_EDITOR_SETTINGS.wordWrap;editAppLayout.value = DEFAULT_EDITOR_SETTINGS.appLayout;+ editRedisScanPageSize.value = DEFAULT_EDITOR_SETTINGS.redisScanPageSize;}function onExecuteModeChange(v: any) {@@ -104,6 +109,11 @@ function onThemeChange(v: any) {if (typeof v === "string") editTheme.value = v as typeof DEFAULT_EDITOR_SETTINGS.theme;}+function onRedisScanPageSizeChange(v: any) {+ const value = Number(v);+ if (redisScanPageSizeOptions.includes(value)) editRedisScanPageSize.value = value;+}+function setAppLayout(value: "separated" | "classic") {editAppLayout.value = value;}@@ -111,6 +121,24 @@ function setAppLayout(value: "separated" | "classic") {const activeSettingsTab = ref("editor");const isWeb = !isTauriRuntime();const displayedAppVersion = computed(() => (props.appVersion ? `v${props.appVersion}` : ""));+type SettingsCategory = "editor" | "appearance" | "redis" | "ai" | "security" | "about";+const settingsCategoryNav = computed<{ value: SettingsCategory; label: string }[]>(() => [+ { value: "editor", label: t("settings.editorTab") },+ { value: "appearance", label: t("settings.appearanceTab") },+ { value: "redis", label: t("settings.redisTab") },+ { value: "ai", label: t("settings.aiTab") },+ ...(isWeb ? [{ value: "security" as const, label: t("settings.securityTab") }] : []),+ { value: "about", label: t("settings.aboutTab") },+]);++function settingsCategoryButton(value: SettingsCategory): string {+ return [+ "w-full rounded-md px-3 py-2 text-left text-sm transition-colors",+ value === activeSettingsTab.value+ ? "bg-primary text-primary-foreground shadow-sm"+ : "text-muted-foreground hover:bg-muted hover:text-foreground",+ ].join(" ");+}function openExternalUrl(url: string) {if (isTauriRuntime()) {@@ -363,7 +391,7 @@ watch(<template><Dialog :open="open" @update:open="(v: boolean) => emit('update:open', v)">- <DialogContent class="sm:max-w-[720px] max-h-[calc(100vh-80px)] overflow-y-auto overflow-x-hidden">+ <DialogContent class="sm:max-w-[860px] max-h-[calc(100vh-80px)] overflow-hidden"><DialogHeader><DialogTitle class="flex items-center gap-2"><Settings class="h-4 w-4" />@@ -371,454 +399,492 @@ watch(</DialogTitle></DialogHeader>- <Tabs v-model="activeSettingsTab">- <TabsList class="w-full">- <TabsTrigger value="editor" class="flex-1">{{ t("settings.editorTab") }}</TabsTrigger>- <TabsTrigger value="appearance" class="flex-1">{{ t("settings.appearanceTab") }}</TabsTrigger>- <TabsTrigger value="ai" class="flex-1">{{ t("settings.aiTab") }}</TabsTrigger>- <TabsTrigger v-if="isWeb" value="security" class="flex-1">{{ t("settings.securityTab") }}</TabsTrigger>- <TabsTrigger value="about" class="flex-1">{{ t("settings.aboutTab") }}</TabsTrigger>- </TabsList>-- <TabsContent value="editor" class="space-y-5 py-2">- <div class="grid gap-4 md:grid-cols-[minmax(0,1fr)_220px]">- <!-- Font Family -->- <div class="space-y-2">- <Label>{{ t("settings.fontFamily") }}</Label>- <Select :model-value="editFontFamily" @update:model-value="onFontFamilyChange">- <SelectTrigger>- <SelectValue :placeholder="t('settings.selectFont')" />- </SelectTrigger>- <SelectContent>- <SelectItem- v-for="font in FONT_FAMILIES"- :key="font.value"- :value="font.value"- :style="{ fontFamily: font.value }"- >- {{ font.label }}- </SelectItem>- </SelectContent>- </Select>+ <div class="flex min-h-[520px] flex-col gap-3 overflow-hidden sm:flex-row">+ <nav+ class="settingsCategoryNav flex shrink-0 gap-1 overflow-x-auto border-b pb-3 sm:w-40 sm:flex-col sm:overflow-visible sm:border-b-0 sm:border-r sm:pb-0 sm:pr-3"+ >+ <button+ v-for="category in settingsCategoryNav"+ :key="category.value"+ type="button"+ :class="settingsCategoryButton(category.value)"+ @click="activeSettingsTab = category.value"+ >+ {{ category.label }}+ </button>+ </nav>++ <div class="min-w-0 flex-1 overflow-y-auto overflow-x-hidden pr-1">+ <section v-if="activeSettingsTab === 'editor'" class="flex min-h-full flex-col gap-5 py-2">+ <div class="grid gap-4 md:grid-cols-[minmax(0,1fr)_220px]">+ <!-- Font Family -->+ <div class="space-y-2">+ <Label>{{ t("settings.fontFamily") }}</Label>+ <Select :model-value="editFontFamily" @update:model-value="onFontFamilyChange">+ <SelectTrigger>+ <SelectValue :placeholder="t('settings.selectFont')" />+ </SelectTrigger>+ <SelectContent>+ <SelectItem+ v-for="font in FONT_FAMILIES"+ :key="font.value"+ :value="font.value"+ :style="{ fontFamily: font.value }"+ >+ {{ font.label }}+ </SelectItem>+ </SelectContent>+ </Select>+ </div>++ <!-- Theme -->+ <div class="space-y-2">+ <Label>{{ t("settings.theme") }}</Label>+ <Select :model-value="editTheme" @update:model-value="onThemeChange">+ <SelectTrigger>+ <SelectValue :placeholder="t('settings.selectTheme')" />+ </SelectTrigger>+ <SelectContent>+ <SelectItem v-for="theme in EDITOR_THEMES" :key="theme.value" :value="theme.value">+ <div class="flex items-center gap-2">+ <span+ class="h-3 w-3 rounded-full border"+ :class="+ theme.dark+ ? 'bg-foreground border-foreground/20'+ : 'bg-muted-foreground/30 border-muted-foreground/40'+ "+ />+ {{ theme.label }}+ </div>+ </SelectItem>+ </SelectContent>+ </Select>+ </div></div>- <!-- Theme -->+ <!-- Font Size --><div class="space-y-2">- <Label>{{ t("settings.theme") }}</Label>- <Select :model-value="editTheme" @update:model-value="onThemeChange">- <SelectTrigger>- <SelectValue :placeholder="t('settings.selectTheme')" />- </SelectTrigger>- <SelectContent>- <SelectItem v-for="theme in EDITOR_THEMES" :key="theme.value" :value="theme.value">- <div class="flex items-center gap-2">- <span- class="h-3 w-3 rounded-full border"- :class="- theme.dark- ? 'bg-foreground border-foreground/20'- : 'bg-muted-foreground/30 border-muted-foreground/40'- "- />- {{ theme.label }}- </div>- </SelectItem>- </SelectContent>- </Select>+ <div class="flex items-center justify-between">+ <Label>{{ t("settings.fontSize") }}</Label>+ <span class="text-xs text-muted-foreground tabular-nums">{{ editFontSize }}px</span>+ </div>+ <input+ type="range"+ min="10"+ max="24"+ step="1"+ :value="editFontSize"+ @input="editFontSize = Number(($event.target as HTMLInputElement).value)"+ class="w-full accent-primary"+ />+ <div class="flex items-center gap-2 text-xs text-muted-foreground">+ <span>10px</span>+ <span class="flex-1 border-b border-dashed border-muted-foreground/30" />+ <span>24px</span>+ </div></div>- </div>- <!-- Font Size -->- <div class="space-y-2">- <div class="flex items-center justify-between">- <Label>{{ t("settings.fontSize") }}</Label>- <span class="text-xs text-muted-foreground tabular-nums">{{ editFontSize }}px</span>- </div>- <input- type="range"- min="10"- max="24"- step="1"- :value="editFontSize"- @input="editFontSize = Number(($event.target as HTMLInputElement).value)"- class="w-full accent-primary"- />- <div class="flex items-center gap-2 text-xs text-muted-foreground">- <span>10px</span>- <span class="flex-1 border-b border-dashed border-muted-foreground/30" />- <span>24px</span>+ <Separator />++ <div class="grid gap-4 md:grid-cols-2">+ <div class="space-y-2">+ <Label>{{ t("settings.executeMode") }}</Label>+ <Select :model-value="editExecuteMode" @update:model-value="onExecuteModeChange">+ <SelectTrigger>+ <SelectValue :placeholder="t('settings.executeMode')" />+ </SelectTrigger>+ <SelectContent>+ <SelectItem value="all">{{ t("settings.executeModeAll") }}</SelectItem>+ <SelectItem value="current">{{ t("settings.executeModeCurrent") }}</SelectItem>+ </SelectContent>+ </Select>+ </div>++ <div class="flex items-start justify-between gap-4">+ <div class="space-y-1">+ <Label for="editor-word-wrap">{{ t("settings.wordWrap") }}</Label>+ <p class="text-xs text-muted-foreground">{{ t("settings.wordWrapDescription") }}</p>+ </div>+ <Switch id="editor-word-wrap" v-model:checked="editWordWrap" class="mt-0.5" />+ </div></div>- </div>- <Separator />+ <Separator />- <div class="grid gap-4 md:grid-cols-2">+ <!-- Live Preview --><div class="space-y-2">- <Label>{{ t("settings.executeMode") }}</Label>- <Select :model-value="editExecuteMode" @update:model-value="onExecuteModeChange">- <SelectTrigger>- <SelectValue :placeholder="t('settings.executeMode')" />- </SelectTrigger>- <SelectContent>- <SelectItem value="all">{{ t("settings.executeModeAll") }}</SelectItem>- <SelectItem value="current">{{ t("settings.executeModeCurrent") }}</SelectItem>- </SelectContent>- </Select>+ <Label>{{ t("settings.preview") }}</Label>+ <div+ class="rounded-md border overflow-auto max-w-full"+ :class="+ editTheme === 'vscode-light' || editTheme === 'duotone-light' || editTheme === 'xcode'+ ? 'border-border'+ : 'border-border/50'+ "+ >+ <div ref="previewRef" style="min-width: 100%" />+ </div></div>- <div class="flex items-start justify-between gap-4">- <div class="space-y-1">- <Label for="editor-word-wrap">{{ t("settings.wordWrap") }}</Label>- <p class="text-xs text-muted-foreground">{{ t("settings.wordWrapDescription") }}</p>+ <DialogFooter class="mt-auto border-t-0 bg-transparent gap-3 sm:gap-3">+ <Button variant="outline" @click="resetDefaults">+ {{ t("settings.resetDefaults") }}+ </Button>+ <div class="flex-1" />+ <Button variant="outline" @click="emit('update:open', false)">+ {{ t("common.close") }}+ </Button>+ <Button :disabled="!hasChanges()" @click="applySettings">+ {{ t("settings.apply") }}+ </Button>+ </DialogFooter>+ </section>++ <section v-else-if="activeSettingsTab === 'appearance'" class="flex min-h-full flex-col gap-5 py-2">+ <div class="space-y-2">+ <Label>{{ t("settings.appLayout") }}</Label>+ <div class="grid grid-cols-2 gap-2">+ <Button+ type="button"+ variant="outline"+ class="h-auto justify-start p-3"+ :class="editAppLayout === 'separated' ? 'border-blue-300 border-2 ring-2 ring-blue-300/50' : ''"+ @click="setAppLayout('separated')"+ >+ <div class="text-left">+ <div class="text-sm font-medium">{{ t("settings.appLayoutSeparated") }}</div>+ <div class="text-xs text-muted-foreground">{{ t("settings.appLayoutSeparatedDescription") }}</div>+ </div>+ </Button>+ <Button+ type="button"+ variant="outline"+ class="h-auto justify-start p-3"+ :class="editAppLayout === 'classic' ? 'border-blue-300 border-2 ring-2 ring-blue-300/50' : ''"+ @click="setAppLayout('classic')"+ >+ <div class="text-left">+ <div class="text-sm font-medium">{{ t("settings.appLayoutClassic") }}</div>+ <div class="text-xs text-muted-foreground">{{ t("settings.appLayoutClassicDescription") }}</div>+ </div>+ </Button></div>- <Switch id="editor-word-wrap" v-model:checked="editWordWrap" class="mt-0.5" />- </div>- </div>-- <Separator />-- <!-- Live Preview -->- <div class="space-y-2">- <Label>{{ t("settings.preview") }}</Label>- <div- class="rounded-md border overflow-auto max-w-full"- :class="- editTheme === 'vscode-light' || editTheme === 'duotone-light' || editTheme === 'xcode'- ? 'border-border'- : 'border-border/50'- "- >- <div ref="previewRef" style="min-width: 100%" /></div>- </div>-- <DialogFooter class="border-t-0 bg-transparent gap-3 sm:gap-3">- <Button variant="outline" @click="resetDefaults">- {{ t("settings.resetDefaults") }}- </Button>- <div class="flex-1" />- <Button variant="outline" @click="emit('update:open', false)">- {{ t("common.close") }}- </Button>- <Button :disabled="!hasChanges()" @click="applySettings">- {{ t("settings.apply") }}- </Button>- </DialogFooter>- </TabsContent>-- <TabsContent value="appearance" class="space-y-5 py-2">- <div class="space-y-2">- <Label>{{ t("settings.appLayout") }}</Label>- <div class="grid grid-cols-2 gap-2">- <Button- type="button"- variant="outline"- class="h-auto justify-start p-3"- :class="editAppLayout === 'separated' ? 'border-blue-300 border-2 ring-2 ring-blue-300/50' : ''"- @click="setAppLayout('separated')"- >- <div class="text-left">- <div class="text-sm font-medium">{{ t("settings.appLayoutSeparated") }}</div>- <div class="text-xs text-muted-foreground">{{ t("settings.appLayoutSeparatedDescription") }}</div>- </div>++ <DialogFooter class="mt-auto border-t-0 bg-transparent gap-3 sm:gap-3">+ <Button variant="outline" @click="resetDefaults">+ {{ t("settings.resetDefaults") }}</Button>- <Button- type="button"- variant="outline"- class="h-auto justify-start p-3"- :class="editAppLayout === 'classic' ? 'border-blue-300 border-2 ring-2 ring-blue-300/50' : ''"- @click="setAppLayout('classic')"- >- <div class="text-left">- <div class="text-sm font-medium">{{ t("settings.appLayoutClassic") }}</div>- <div class="text-xs text-muted-foreground">{{ t("settings.appLayoutClassicDescription") }}</div>- </div>+ <div class="flex-1" />+ <Button variant="outline" @click="emit('update:open', false)">+ {{ t("common.close") }}</Button>- </div>- </div>-- <DialogFooter class="border-t-0 bg-transparent gap-3 sm:gap-3">- <Button variant="outline" @click="resetDefaults">- {{ t("settings.resetDefaults") }}- </Button>- <div class="flex-1" />- <Button variant="outline" @click="emit('update:open', false)">- {{ t("common.close") }}- </Button>- <Button :disabled="!hasChanges()" @click="applySettings">- {{ t("settings.apply") }}- </Button>- </DialogFooter>- </TabsContent>-- <!-- AI Settings Tab -->- <TabsContent value="ai" class="space-y-5 py-2">- <p class="text-xs text-muted-foreground">{{ t("ai.settingsHint") }}</p>-- <div class="space-y-3">- <div class="grid grid-cols-3 items-center gap-3">- <Label class="text-right text-xs">{{ t("ai.provider") }}</Label>- <Select :model-value="aiEditProvider" @update:model-value="(v: any) => aiSelectProvider(v)">- <SelectTrigger class="col-span-2 h-8 text-xs"><SelectValue /></SelectTrigger>+ <Button :disabled="!hasChanges()" @click="applySettings">+ {{ t("settings.apply") }}+ </Button>+ </DialogFooter>+ </section>++ <section v-else-if="activeSettingsTab === 'redis'" class="flex min-h-full flex-col gap-5 py-2">+ <div class="space-y-2">+ <Label>{{ t("settings.redisScanPageSize") }}</Label>+ <Select :model-value="String(editRedisScanPageSize)" @update:model-value="onRedisScanPageSizeChange">+ <SelectTrigger>+ <SelectValue :placeholder="t('settings.redisScanPageSize')" />+ </SelectTrigger><SelectContent>- <SelectItem value="claude">Claude</SelectItem>- <SelectItem value="openai">OpenAI</SelectItem>- <SelectItem value="custom">Custom</SelectItem>+ <SelectItem v-for="size in redisScanPageSizeOptions" :key="size" :value="String(size)">+ {{ t("settings.redisScanPageSizeOption", { count: size }) }}+ </SelectItem></SelectContent></Select>+ <p class="text-xs text-muted-foreground">{{ t("settings.redisScanPageSizeDescription") }}</p></div>- <div class="grid grid-cols-3 items-center gap-3">- <Label class="text-right text-xs">API Key</Label>- <Input v-model="aiEditApiKey" type="password" autocomplete="off" class="col-span-2 h-8 text-xs" />- </div>+ <DialogFooter class="mt-auto border-t-0 bg-transparent gap-3 sm:gap-3">+ <Button variant="outline" @click="resetDefaults">+ {{ t("settings.resetDefaults") }}+ </Button>+ <div class="flex-1" />+ <Button variant="outline" @click="emit('update:open', false)">+ {{ t("common.close") }}+ </Button>+ <Button :disabled="!hasChanges()" @click="applySettings">+ {{ t("settings.apply") }}+ </Button>+ </DialogFooter>+ </section>++ <!-- AI Settings Tab -->+ <section v-else-if="activeSettingsTab === 'ai'" class="flex min-h-full flex-col gap-5 py-2">+ <p class="text-xs text-muted-foreground">{{ t("ai.settingsHint") }}</p>++ <div class="space-y-3">+ <div class="grid grid-cols-3 items-center gap-3">+ <Label class="text-right text-xs">{{ t("ai.provider") }}</Label>+ <Select :model-value="aiEditProvider" @update:model-value="(v: any) => aiSelectProvider(v)">+ <SelectTrigger class="col-span-2 h-8 text-xs"><SelectValue /></SelectTrigger>+ <SelectContent>+ <SelectItem value="claude">Claude</SelectItem>+ <SelectItem value="openai">OpenAI</SelectItem>+ <SelectItem value="custom">Custom</SelectItem>+ </SelectContent>+ </Select>+ </div>- <div class="grid grid-cols-3 items-center gap-3">- <Label class="text-right text-xs">Endpoint</Label>- <Input- v-model="aiEditEndpoint"- placeholder="https://api.openai.com/v1"- autocomplete="off"- class="col-span-2 h-8 text-xs"- />- </div>+ <div class="grid grid-cols-3 items-center gap-3">+ <Label class="text-right text-xs">API Key</Label>+ <Input v-model="aiEditApiKey" type="password" autocomplete="off" class="col-span-2 h-8 text-xs" />+ </div>- <div class="grid grid-cols-3 items-center gap-3">- <Label class="text-right text-xs">Model</Label>- <Input v-model="aiEditModel" autocomplete="off" class="col-span-2 h-8 text-xs" />- </div>+ <div class="grid grid-cols-3 items-center gap-3">+ <Label class="text-right text-xs">Endpoint</Label>+ <Input+ v-model="aiEditEndpoint"+ placeholder="https://api.openai.com/v1"+ autocomplete="off"+ class="col-span-2 h-8 text-xs"+ />+ </div>- <div v-if="aiEditProvider !== 'claude'" class="grid grid-cols-3 items-center gap-3">- <Label class="text-right text-xs">API</Label>- <div class="col-span-2 flex gap-2">- <Button- size="sm"- variant="outline"- class="h-8 flex-1 text-xs"- :class="{ 'border-blue-300 border-2 ring-2 ring-blue-300/50': aiEditApiStyle === 'completions' }"- @click="aiEditApiStyle = 'completions'"- >/chat/completions</Button- >- <Button- size="sm"- variant="outline"- class="h-8 flex-1 text-xs"- :class="{ 'border-blue-300 border-2 ring-2 ring-blue-300/50': aiEditApiStyle === 'responses' }"- @click="aiEditApiStyle = 'responses'"- >/responses</Button- >+ <div class="grid grid-cols-3 items-center gap-3">+ <Label class="text-right text-xs">Model</Label>+ <Input v-model="aiEditModel" autocomplete="off" class="col-span-2 h-8 text-xs" /></div>- </div>- <div class="grid grid-cols-3 items-center gap-3">- <Label class="text-right text-xs">{{ t("ai.enableThinking") }}</Label>- <div class="col-span-2 flex items-center gap-2">- <label class="flex items-center gap-2 text-xs text-muted-foreground">- <input- v-model="aiEditEnableThinking"- type="checkbox"- class="h-4 w-4 shrink-0 accent-primary"- :disabled="!aiCompletionsMode"- />- {{ aiEditEnableThinking ? t("ai.enableThinkingOn") : t("ai.enableThinkingOff") }}+ <div v-if="aiEditProvider !== 'claude'" class="grid grid-cols-3 items-center gap-3">+ <Label class="text-right text-xs">API</Label>+ <div class="col-span-2 flex gap-2">+ <Button+ size="sm"+ variant="outline"+ class="h-8 flex-1 text-xs"+ :class="{ 'border-blue-300 border-2 ring-2 ring-blue-300/50': aiEditApiStyle === 'completions' }"+ @click="aiEditApiStyle = 'completions'"+ >/chat/completions</Button+ >+ <Button+ size="sm"+ variant="outline"+ class="h-8 flex-1 text-xs"+ :class="{ 'border-blue-300 border-2 ring-2 ring-blue-300/50': aiEditApiStyle === 'responses' }"+ @click="aiEditApiStyle = 'responses'"+ >/responses</Button+ >+ </div>+ </div>++ <div class="grid grid-cols-3 items-center gap-3">+ <Label class="text-right text-xs">{{ t("ai.enableThinking") }}</Label>+ <div class="col-span-2 flex items-center gap-2">+ <label class="flex items-center gap-2 text-xs text-muted-foreground">+ <input+ v-model="aiEditEnableThinking"+ type="checkbox"+ class="h-4 w-4 shrink-0 accent-primary"+ :disabled="!aiCompletionsMode"+ />+ {{ aiEditEnableThinking ? t("ai.enableThinkingOn") : t("ai.enableThinkingOff") }}+ </label>+ <Popover>+ <PopoverTrigger as-child>+ <CircleHelp class="h-3.5 w-3.5 cursor-help text-muted-foreground hover:text-foreground" />+ </PopoverTrigger>+ <PopoverContent class="max-w-[320px] text-xs leading-relaxed" side="top" align="start">+ {{ t("ai.enableThinkingHint") }}+ </PopoverContent>+ </Popover>+ </div>+ </div>++ <div class="grid grid-cols-3 items-center gap-3">+ <Label class="text-right text-xs">{{ t("ai.proxy") }}</Label>+ <label class="col-span-2 flex items-center gap-2 text-xs text-muted-foreground">+ <input v-model="aiEditProxyEnabled" type="checkbox" class="h-4 w-4 shrink-0 accent-primary" />+ {{ t("ai.proxyEnable") }}</label>- <Popover>- <PopoverTrigger as-child>- <CircleHelp class="h-3.5 w-3.5 cursor-help text-muted-foreground hover:text-foreground" />- </PopoverTrigger>- <PopoverContent class="max-w-[320px] text-xs leading-relaxed" side="top" align="start">- {{ t("ai.enableThinkingHint") }}- </PopoverContent>- </Popover></div>- </div>- <div class="grid grid-cols-3 items-center gap-3">- <Label class="text-right text-xs">{{ t("ai.proxy") }}</Label>- <label class="col-span-2 flex items-center gap-2 text-xs text-muted-foreground">- <input v-model="aiEditProxyEnabled" type="checkbox" class="h-4 w-4 shrink-0 accent-primary" />- {{ t("ai.proxyEnable") }}- </label>+ <div class="grid grid-cols-3 items-center gap-3">+ <Label class="text-right text-xs">{{ t("ai.proxyUrl") }}</Label>+ <Input+ v-model="aiEditProxyUrl"+ autocomplete="off"+ class="col-span-2 h-8 text-xs"+ placeholder="socks5://127.0.0.1:7890"+ :disabled="!aiEditProxyEnabled"+ />+ </div></div>- <div class="grid grid-cols-3 items-center gap-3">- <Label class="text-right text-xs">{{ t("ai.proxyUrl") }}</Label>+ <DialogFooter class="mt-auto flex items-center gap-2">+ <div class="flex-1 flex items-center gap-2">+ <Button+ size="sm"+ variant="outline"+ :disabled="aiTesting || !aiEditApiKey?.trim() || !aiEditEndpoint?.trim() || !aiEditModel?.trim()"+ @click="aiTestConn"+ >+ <Loader2 v-if="aiTesting" class="h-3 w-3 animate-spin mr-1" />+ {{ t("connection.test") }}+ </Button>+ <span v-if="aiTestResult === 'success'" class="text-xs text-green-500">{{+ t("connection.testSuccess")+ }}</span>+ <span+ v-else-if="aiTestResult === 'error'"+ class="text-xs text-destructive truncate max-w-[200px]"+ :title="aiTestError"+ >{{ aiTestError }}</span+ >+ </div>+ <Button variant="outline" @click="emit('update:open', false)">{{ t("common.close") }}</Button>+ <Button :disabled="!aiHasChanges()" @click="aiApplySettings">{{ t("settings.apply") }}</Button>+ </DialogFooter>+ </section>++ <section v-else-if="activeSettingsTab === 'security' && isWeb" class="flex min-h-full flex-col gap-5 py-2">+ <div class="space-y-3">+ <Label class="text-base">{{ t("auth.changePassword") }}</Label>+ <p class="text-sm text-muted-foreground">{{ t("auth.changePasswordDescription") }}</p><Input- v-model="aiEditProxyUrl"+ v-model="oldPassword"+ type="password"+ :placeholder="t('auth.oldPassword')"+ class="h-9"autocomplete="off"- class="col-span-2 h-8 text-xs"- placeholder="socks5://127.0.0.1:7890"- :disabled="!aiEditProxyEnabled"/>+ <Input+ v-model="newPassword"+ type="password"+ :placeholder="t('auth.newPassword')"+ class="h-9"+ autocomplete="off"+ />+ <Input+ v-model="confirmNewPassword"+ type="password"+ :placeholder="t('auth.confirmPassword')"+ class="h-9"+ autocomplete="off"+ />+ <p v-if="passwordMessage" class="text-xs" :class="passwordError ? 'text-destructive' : 'text-green-500'">+ {{ passwordMessage }}+ </p></div>- </div>-- <DialogFooter class="flex items-center gap-2">- <div class="flex-1 flex items-center gap-2">+ <DialogFooter class="mt-auto border-t-0 bg-transparent">+ <Button variant="outline" @click="emit('update:open', false)">+ {{ t("common.close") }}+ </Button><Button- size="sm"- variant="outline"- :disabled="aiTesting || !aiEditApiKey?.trim() || !aiEditEndpoint?.trim() || !aiEditModel?.trim()"- @click="aiTestConn"+ :disabled="changingPassword || !oldPassword || !newPassword || !confirmNewPassword"+ @click="changePassword">- <Loader2 v-if="aiTesting" class="h-3 w-3 animate-spin mr-1" />- {{ t("connection.test") }}+ {{ t("auth.changePassword") }}</Button>- <span v-if="aiTestResult === 'success'" class="text-xs text-green-500">{{- t("connection.testSuccess")- }}</span>- <span- v-else-if="aiTestResult === 'error'"- class="text-xs text-destructive truncate max-w-[200px]"- :title="aiTestError"- >{{ aiTestError }}</span- >- </div>- <Button variant="outline" @click="emit('update:open', false)">{{ t("common.close") }}</Button>- <Button :disabled="!aiHasChanges()" @click="aiApplySettings">{{ t("settings.apply") }}</Button>- </DialogFooter>- </TabsContent>-- <TabsContent v-if="isWeb" value="security" class="space-y-5 py-2">- <div class="space-y-3">- <Label class="text-base">{{ t("auth.changePassword") }}</Label>- <p class="text-sm text-muted-foreground">{{ t("auth.changePasswordDescription") }}</p>- <Input- v-model="oldPassword"- type="password"- :placeholder="t('auth.oldPassword')"- class="h-9"- autocomplete="off"- />- <Input- v-model="newPassword"- type="password"- :placeholder="t('auth.newPassword')"- class="h-9"- autocomplete="off"- />- <Input- v-model="confirmNewPassword"- type="password"- :placeholder="t('auth.confirmPassword')"- class="h-9"- autocomplete="off"- />- <p v-if="passwordMessage" class="text-xs" :class="passwordError ? 'text-destructive' : 'text-green-500'">- {{ passwordMessage }}- </p>- </div>- <DialogFooter class="border-t-0 bg-transparent">- <Button variant="outline" @click="emit('update:open', false)">- {{ t("common.close") }}- </Button>- <Button- :disabled="changingPassword || !oldPassword || !newPassword || !confirmNewPassword"- @click="changePassword"- >- {{ t("auth.changePassword") }}- </Button>- </DialogFooter>- </TabsContent>-- <TabsContent value="about" class="space-y-5 py-2">- <div class="rounded-lg border bg-muted/20 p-4">- <div class="flex items-start justify-between gap-4">- <div class="min-w-0 space-y-1">- <div class="text-lg font-semibold">DBX</div>- <p class="text-sm text-muted-foreground">{{ t("settings.aboutDescription") }}</p>+ </DialogFooter>+ </section>++ <section v-else-if="activeSettingsTab === 'about'" class="flex min-h-full flex-col gap-5 py-2">+ <div class="rounded-lg border bg-muted/20 p-4">+ <div class="flex items-start justify-between gap-4">+ <div class="min-w-0 space-y-1">+ <div class="text-lg font-semibold">DBX</div>+ <p class="text-sm text-muted-foreground">{{ t("settings.aboutDescription") }}</p>+ </div>+ <div+ v-if="displayedAppVersion"+ class="rounded-md border bg-background px-2 py-1 text-xs text-muted-foreground"+ >+ {{ displayedAppVersion }}+ </div></div>- <div- v-if="displayedAppVersion"- class="rounded-md border bg-background px-2 py-1 text-xs text-muted-foreground"+ </div>++ <div class="grid gap-3 sm:grid-cols-2">+ <button+ type="button"+ class="rounded-lg border p-4 text-left transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"+ @click="openExternalUrl('https://qm.qq.com/cgi-bin/qm/qr?k=&group_code=1087880322')">- {{ displayedAppVersion }}- </div>+ <div class="text-xs font-medium uppercase tracking-wider text-muted-foreground">+ {{ t("settings.community") }}+ </div>+ <div class="mt-3 flex items-center gap-2 text-sm font-medium">+ <img+ src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iODYiIHdpZHRoPSI4NiIgdmlld0JveD0iMCAwIDEyMCAxNDUiPjxwYXRoIGZpbGw9IiNmYWFiMDciIGQ9Ik02MC41MDMgMTQyLjIzN2MtMTIuNTMzIDAtMjQuMDM4LTQuMTk1LTMxLjQ0NS0xMC40Ni0zLjc2MiAxLjEyNC04LjU3NCAyLjkzMi0xMS42MSA1LjE3NS0yLjYgMS45MTgtMi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UuNTkxLS4xNzItNDQuODk2LTYuMjU1LTQ0Ljk2Mi02LjI3NUw4Ljk4NyA3Ni41N2MxNi4xOTMgNC44ODIgMzYuMjYxIDguMDI4IDUxLjQzNiA3Ljg0NWguMTUzYzE1LjE3NS4xODMgMzUuMjQyLTIuOTYzIDUxLjQzNy03Ljg0NXptMCAwIi8+PC9zdmc+"+ alt="QQ"+ class="h-7 w-7 rounded-md bg-white p-1"+ />+ {{ t("settings.qqGroup") }}+ <ExternalLink class="ml-auto h-3.5 w-3.5 text-muted-foreground" />+ </div>+ <div class="mt-1 font-mono text-base">1087880322</div>+ </button>+ <button+ type="button"+ class="rounded-lg border p-4 text-left transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"+ @click="openExternalUrl('https://discord.gg/W7NyVDRt6a')"+ >+ <div class="text-xs font-medium uppercase tracking-wider text-muted-foreground">+ {{ t("settings.community") }}+ </div>+ <div class="mt-3 flex items-center gap-2 text-sm font-medium">+ <img+ src="https://cdn.simpleicons.org/discord/5865F2"+ alt="Discord"+ class="h-7 w-7 rounded-md bg-white p-1"+ />+ Discord+ <ExternalLink class="ml-auto h-3.5 w-3.5 text-muted-foreground" />+ </div>+ <div class="mt-1 text-sm text-primary">discord.gg/W7NyVDRt6a</div>+ </button>+ <button+ type="button"+ class="rounded-lg border p-4 text-left transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"+ @click="openExternalUrl('https://github.com/t8y2/dbx')"+ >+ <div class="text-xs font-medium uppercase tracking-wider text-muted-foreground">+ {{ t("settings.project") }}+ </div>+ <div class="mt-3 flex items-center gap-2 text-sm font-medium">+ <img+ src="https://cdn.simpleicons.org/github/181717"+ alt="GitHub"+ class="h-7 w-7 rounded-md bg-white p-1"+ />+ {{ t("settings.openSource") }}+ <ExternalLink class="ml-auto h-3.5 w-3.5 text-muted-foreground" />+ </div>+ <div class="mt-1 text-sm text-primary">github.com/t8y2/dbx</div>+ </button>+ <button+ type="button"+ class="rounded-lg border p-4 text-left transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"+ @click="openExternalUrl('https://dbxio.com')"+ >+ <div class="text-xs font-medium uppercase tracking-wider text-muted-foreground">+ {{ t("settings.project") }}+ </div>+ <div class="mt-3 flex items-center gap-2 text-sm font-medium">+ <img src="/logo.png" alt="DBX" class="h-7 w-7 rounded-md" />+ {{ t("settings.officialDocs") }}+ <ExternalLink class="ml-auto h-3.5 w-3.5 text-muted-foreground" />+ </div>+ <div class="mt-1 text-sm text-primary">dbxio.com</div>+ </button></div>- </div>-- <div class="grid gap-3 sm:grid-cols-2">- <button- type="button"- class="rounded-lg border p-4 text-left transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"- @click="openExternalUrl('https://qm.qq.com/cgi-bin/qm/qr?k=&group_code=1087880322')"- >- <div class="text-xs font-medium uppercase tracking-wider text-muted-foreground">- {{ t("settings.community") }}- </div>- <div class="mt-3 flex items-center gap-2 text-sm font-medium">- <img- src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iODYiIHdpZHRoPSI4NiIgdmlld0JveD0iMCAwIDEyMCAxNDUiPjxwYXRoIGZpbGw9IiNmYWFiMDciIGQ9Ik02MC41MDMgMTQyLjIzN2MtMTIuNTMzIDAtMjQuMDM4LTQuMTk1LTMxLjQ0NS0xMC40Ni0zLjc2MiAxLjEyNC04LjU3NCAyLjkzMi0xMS42MSA1LjE3NS0yLjYgMS45MTgtMi4yNzUgMy44NzQtMS44MDcgNC42NjMgMi4wNTYgMy40NyAzNS4yNzMgMi4yMTYgNDQuODYyIDEuMTM2em0wIDBjMTIuNTM1IDAgMjQuMDM5LTQuMTk1IDMxLjQ0Ny0xMC40NiAzLjc2IDEuMTI0IDguNTczIDIuOTMyIDExLjYxIDUuMTc1IDIuNTk4IDEuOTE4ID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- alt="QQ"- class="h-7 w-7 rounded-md bg-white p-1"- />- {{ t("settings.qqGroup") }}- <ExternalLink class="ml-auto h-3.5 w-3.5 text-muted-foreground" />- </div>- <div class="mt-1 font-mono text-base">1087880322</div>- </button>- <button- type="button"- class="rounded-lg border p-4 text-left transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"- @click="openExternalUrl('https://discord.gg/W7NyVDRt6a')"- >- <div class="text-xs font-medium uppercase tracking-wider text-muted-foreground">- {{ t("settings.community") }}- </div>- <div class="mt-3 flex items-center gap-2 text-sm font-medium">- <img- src="https://cdn.simpleicons.org/discord/5865F2"- alt="Discord"- class="h-7 w-7 rounded-md bg-white p-1"- />- Discord- <ExternalLink class="ml-auto h-3.5 w-3.5 text-muted-foreground" />- </div>- <div class="mt-1 text-sm text-primary">discord.gg/W7NyVDRt6a</div>- </button>- <button- type="button"- class="rounded-lg border p-4 text-left transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"- @click="openExternalUrl('https://github.com/t8y2/dbx')"- >- <div class="text-xs font-medium uppercase tracking-wider text-muted-foreground">- {{ t("settings.project") }}- </div>- <div class="mt-3 flex items-center gap-2 text-sm font-medium">- <img- src="https://cdn.simpleicons.org/github/181717"- alt="GitHub"- class="h-7 w-7 rounded-md bg-white p-1"- />- {{ t("settings.openSource") }}- <ExternalLink class="ml-auto h-3.5 w-3.5 text-muted-foreground" />- </div>- <div class="mt-1 text-sm text-primary">github.com/t8y2/dbx</div>- </button>- <button- type="button"- class="rounded-lg border p-4 text-left transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"- @click="openExternalUrl('https://dbxio.com')"- >- <div class="text-xs font-medium uppercase tracking-wider text-muted-foreground">- {{ t("settings.project") }}- </div>- <div class="mt-3 flex items-center gap-2 text-sm font-medium">- <img src="/logo.png" alt="DBX" class="h-7 w-7 rounded-md" />- {{ t("settings.officialDocs") }}- <ExternalLink class="ml-auto h-3.5 w-3.5 text-muted-foreground" />- </div>- <div class="mt-1 text-sm text-primary">dbxio.com</div>- </button>- </div>-- <DialogFooter class="border-t-0 bg-transparent">- <Button variant="outline" @click="emit('update:open', false)">- {{ t("common.close") }}- </Button>- </DialogFooter>- </TabsContent>- </Tabs>++ <DialogFooter class="mt-auto border-t-0 bg-transparent">+ <Button variant="outline" @click="emit('update:open', false)">+ {{ t("common.close") }}+ </Button>+ </DialogFooter>+ </section>+ </div>+ </div></DialogContent></Dialog></template>diff --git a/src/components/redis/RedisKeyBrowser.vue b/src/components/redis/RedisKeyBrowser.vueindex 3d3a031a6c..9cf5c3a653 100644--- a/src/components/redis/RedisKeyBrowser.vue+++ b/src/components/redis/RedisKeyBrowser.vue@@ -26,6 +26,7 @@ import RedisValueViewer from "./RedisValueViewer.vue";import * as api from "@/lib/api";import type { RedisKeyInfo } from "@/lib/api";import { useConnectionStore } from "@/stores/connectionStore";+import { useSettingsStore } from "@/stores/settingsStore";import {buildRedisKeyTree,collectExpandedGroupIds,@@ -38,6 +39,7 @@ import { isCancelSearchShortcut } from "@/lib/keyboardShortcuts";const { t } = useI18n();const connectionStore = useConnectionStore();+const settingsStore = useSettingsStore();const props = defineProps<{connectionId: string;@@ -67,7 +69,6 @@ const commandResult = ref<any>(null);const commandError = ref("");const commandRunning = ref(false);-const PAGE_SIZE = 200;const keyGridStyle = {gridTemplateColumns: "minmax(12rem, 0.35fr) 80px 1fr 60px 60px",};@@ -129,7 +130,7 @@ async function scanNextPage() {props.db,scanCursor.value,effectivePattern.value,- PAGE_SIZE,+ settingsStore.editorSettings.redisScanPageSize,);const existingKeys = new Set(flatKeys.value.map((key) => key.key_raw));flatKeys.value = [...flatKeys.value, ...result.keys.filter((key) => !existingKeys.has(key.key_raw))];diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.tsindex 6ad2d9175a..c37b5507ab 100644--- a/src/i18n/locales/en.ts+++ b/src/i18n/locales/en.ts@@ -1005,6 +1005,7 @@ export default {title: "Settings",editorTab: "Editor",appearanceTab: "Appearance",+ redisTab: "Redis",aiTab: "AI",jdbcTab: "JDBC Drivers",securityTab: "Security",diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.tsindex a6d77ed559..2b1e59f0fe 100644--- a/src/i18n/locales/es.ts+++ b/src/i18n/locales/es.ts@@ -983,6 +983,8 @@ export default {title: "Configuración",editorTab: "Editor",appearanceTab: "Apariencia",+ redisTab: "Redis",+ aiTab: "IA",jdbcTab: "Drivers JDBC",securityTab: "Seguridad",aboutTab: "Acerca de",diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.tsindex da4dced953..25e92b819c 100644--- a/src/i18n/locales/zh-CN.ts+++ b/src/i18n/locales/zh-CN.ts@@ -987,6 +987,7 @@ export default {title: "设置",editorTab: "编辑器",appearanceTab: "外观",+ redisTab: "Redis",aiTab: "AI",jdbcTab: "JDBC 驱动",securityTab: "安全",diff --git a/src/stores/settingsStore.ts b/src/stores/settingsStore.tsindex c63cf624e1..f583d017ae 100644--- a/src/stores/settingsStore.ts+++ b/src/stores/settingsStore.ts@@ -51,6 +51,7 @@ export interface EditorSettings {wordWrap: boolean;appLayout: "separated" | "classic";pageSize: number;+ redisScanPageSize: number;}export const EDITOR_THEMES: { value: EditorTheme; label: string; dark: boolean }[] = [@@ -83,26 +84,32 @@ export const DEFAULT_EDITOR_SETTINGS: EditorSettings = {wordWrap: false,appLayout: "classic",pageSize: 100,+ redisScanPageSize: 1000,};export const STORAGE_KEY = "dbx-editor-settings";const OLD_FONT_SIZE_KEY = "dbx-query-editor-font-size";+export function normalizeEditorSettings(settings: Partial<EditorSettings>): EditorSettings {+ return {+ fontFamily: settings.fontFamily ?? DEFAULT_EDITOR_SETTINGS.fontFamily,+ fontSize: settings.fontSize ?? DEFAULT_EDITOR_SETTINGS.fontSize,+ theme: settings.theme ?? DEFAULT_EDITOR_SETTINGS.theme,+ executeMode: settings.executeMode ?? DEFAULT_EDITOR_SETTINGS.executeMode,+ wordWrap: settings.wordWrap ?? DEFAULT_EDITOR_SETTINGS.wordWrap,+ appLayout: settings.appLayout ?? DEFAULT_EDITOR_SETTINGS.appLayout,+ pageSize: settings.pageSize ?? DEFAULT_EDITOR_SETTINGS.pageSize,+ redisScanPageSize: settings.redisScanPageSize ?? DEFAULT_EDITOR_SETTINGS.redisScanPageSize,+ };+}+function loadEditorSettings(): EditorSettings {// Try new format firsttry {const raw = localStorage.getItem(STORAGE_KEY);if (raw) {const parsed = JSON.parse(raw) as Partial<EditorSettings>;- return {- fontFamily: parsed.fontFamily ?? DEFAULT_EDITOR_SETTINGS.fontFamily,- fontSize: parsed.fontSize ?? DEFAULT_EDITOR_SETTINGS.fontSize,- theme: parsed.theme ?? DEFAULT_EDITOR_SETTINGS.theme,- executeMode: parsed.executeMode ?? DEFAULT_EDITOR_SETTINGS.executeMode,- wordWrap: parsed.wordWrap ?? DEFAULT_EDITOR_SETTINGS.wordWrap,- appLayout: parsed.appLayout ?? DEFAULT_EDITOR_SETTINGS.appLayout,- pageSize: parsed.pageSize ?? DEFAULT_EDITOR_SETTINGS.pageSize,- };+ return normalizeEditorSettings(parsed);}} catch {/* ignore */diff --git a/tests/settingsDialogLayout.test.ts b/tests/settingsDialogLayout.test.tsnew file mode 100644index 0000000000..26b57149e0--- /dev/null+++ b/tests/settingsDialogLayout.test.ts@@ -0,0 +1,27 @@+import { readFileSync } from "node:fs";+import { strict as assert } from "node:assert";+import test from "node:test";++const source = readFileSync("src/components/editor/EditorSettingsDialog.vue", "utf8");++test("settings dialog uses a side category navigation", () => {+ assert.match(source, /settingsCategoryNav/);+ assert.match(source, /settingsCategoryButton/);+});++test("Redis scan size lives in its own settings category", () => {+ const redisTab = source.indexOf('value: "redis"');+ const redisContent = source.search(/activeSettingsTab === ['"]redis['"]/);+ const redisScanSetting = source.indexOf('t("settings.redisScanPageSize")');+ const editorContent = source.search(/activeSettingsTab === ['"]editor['"]/);++ assert.ok(redisTab > -1);+ assert.ok(redisContent > -1);+ assert.ok(redisScanSetting > redisContent);+ assert.ok(redisScanSetting > editorContent);+});++test("settings action footer stays at the bottom of the content pane", () => {+ assert.match(source, /class="[^"]*min-h-full[^"]*flex-col[^"]*"/);+ assert.match(source, /<DialogFooter class="[^"]*mt-auto[^"]*"/);+});diff --git a/tests/settingsStore.test.ts b/tests/settingsStore.test.tsnew file mode 100644index 0000000000..7ac9be551a--- /dev/null+++ b/tests/settingsStore.test.ts@@ -0,0 +1,12 @@+import test from "node:test";+import assert from "node:assert/strict";+import { DEFAULT_EDITOR_SETTINGS, normalizeEditorSettings } from "../src/stores/settingsStore.ts";++test("defaults Redis scan page size to 1000 keys", () => {+ assert.equal(DEFAULT_EDITOR_SETTINGS.redisScanPageSize, 1000);+ assert.equal(normalizeEditorSettings({}).redisScanPageSize, 1000);+});++test("keeps a saved Redis scan page size", () => {+ assert.equal(normalizeEditorSettings({ redisScanPageSize: 5000 }).redisScanPageSize, 5000);+});