feat(result-tabs): support pinned tabs and batch closing
This commit is contained in:
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 } : {}),
|
||||
|
||||
@@ -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,
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user