feat(mongodb): improve document quick filters

This commit is contained in:
co1dsand authored and GitHub committed 2026-07-17 18:51:33 +08:00
1 parent c417e54698
commit 681da22c33
32 files changed
+1639 -116

No files matched your search

@@ -103,7 +103,7 @@ describe("connectionStore MQ sidebar tree", () => {
{ id: "mq-1:mq-tenant:tenant-a", label: "tenant-a", type: "mq-tenant", tenant: "tenant-a" },
]);
expect(node.isExpanded).toBe(true);
});
}, 10_000);
it("adds a Kafka topics child with a topics initial tab", async () => {
vi.doMock("@/lib/backend/tauriRuntime", () => ({ isTauriRuntime: () => false }));
@@ -38,7 +38,7 @@ describe("queryStore database open state", () => {
store.closeTab(tabId);
expect(store.isDatabaseOpen("pg-1", "analytics")).toBe(false);
});
}, 10_000);
it("keeps object browser viewport per tab and clears it on schema change", async () => {
const { useQueryStore } = await import("@/stores/queryStore");
+6 -1
View File
@@ -1,6 +1,6 @@
import { defineStore } from "pinia";
import { uuid } from "@/lib/common/utils";
import { markRaw, ref, watch, computed } from "vue";
import { computed, markRaw, onScopeDispose, ref, watch } from "vue";
import { useI18n } from "vue-i18n";
import type { ConnectionConfig, DatabaseType, ObjectBrowserViewport, QueryResult, QueryTab, TableInfoTab, TableStructureEditorTarget } from "@/types/database";
import { orderPinnedFirst } from "@/lib/app/pinnedItems";
@@ -999,6 +999,11 @@ export const useQueryStore = defineStore("query", () => {
{ flush: "post" },
);
onScopeDispose(() => {
if (persistTimer) clearTimeout(persistTimer);
persistTimer = null;
});
// Immediately flush any pending debounced persist so the on-disk content
// reflects the latest in-memory tabs without waiting for the 300ms debounce.
// Lets callers (e.g. tests that reload the store) read back persisted state