feat(result-tabs): support pinned tabs and batch closing

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-08-23 02:53:07 +08:00
1 parent 9815e5ac81
commit 93dc455c72
17 files changed
+883 -57

No files matched your search

@@ -9,6 +9,7 @@ export interface SavedQueryResultRun {
sequence: number;
sql: string;
createdAt: number;
pinned?: boolean;
activeResultIndex?: number;
resultCacheKey?: string;
resultEvicted?: boolean;
@@ -138,6 +139,7 @@ export function serializeOpenTabs(tabs: QueryTab[]): SavedOpenTab[] {
sequence: run.sequence,
sql: run.sql,
createdAt: run.createdAt,
...(run.pinned ? { pinned: true } : {}),
activeResultIndex: run.activeResultIndex,
...(run.resultCacheKey !== undefined ? { resultCacheKey: run.resultCacheKey } : {}),
...(run.resultEvicted ? { resultEvicted: true } : {}),
+2 -1
View File
@@ -344,12 +344,13 @@ export function activeResultRun(tab: Pick<QueryTab, "resultRuns" | "activeResult
return tab.resultRuns?.find((run) => run.id === tab.activeResultRunId);
}
export function resultRunItems(tab: Pick<QueryTab, "resultRuns" | "activeResultRunId">): { id: string; title: string; sequence: number; active: boolean }[] {
export function resultRunItems(tab: Pick<QueryTab, "resultRuns" | "activeResultRunId">): { id: string; title: string; sequence: number; active: boolean; pinned: boolean }[] {
return (tab.resultRuns ?? []).map((run) => ({
id: run.id,
title: run.title,
sequence: run.sequence,
active: run.id === tab.activeResultRunId,
pinned: run.pinned === true,
}));
}