fix(grid): preserve column filters across tab eviction

This commit is contained in:
t8y2 committed 2026-07-26 12:12:20 +08:00
1 parent 3836142f72
commit 66e2dad11e
7 files changed
+87 -1

No files matched your search

+11
View File
@@ -2089,6 +2089,16 @@ export const useQueryStore = defineStore("query", () => {
}
}
function updateDataGridLocalColumnFilters(id: string, filters: Record<string, string[]>) {
const tab = tabs.value.find((item) => item.id === id);
if (!tab?.result) return;
if (Object.keys(filters).length === 0) {
delete tab.result.local_column_filters;
} else {
tab.result.local_column_filters = Object.fromEntries(Object.entries(filters).map(([columnIndex, values]) => [columnIndex, [...values]]));
}
}
function setAutoCommit(id: string, autoCommit: boolean) {
const tab = tabs.value.find((t) => t.id === id);
if (tab) {
@@ -4584,6 +4594,7 @@ export const useQueryStore = defineStore("query", () => {
rollbackConnectionTransactions,
rollbackDatabaseTransactions,
updateSql,
updateDataGridLocalColumnFilters,
updateEditorViewport,
updateEditorSelection,
updateObjectBrowserViewport,