fix(grid): mask loading only on executing result run

This commit is contained in:
jearhe authored and GitHub committed 2026-09-01 14:09:42 +08:00
1 parent 1aa9f06719
commit f19439ad7a
9 files changed
+115 -8

No files matched your search

@@ -8,6 +8,21 @@ export function canCancelQueryExecution(state: QueryExecutionStateLike): boolean
return state.isExecuting && !!state.executionId && !state.isCancelling;
}
export interface QueryResultLoadingStateLike extends QueryExecutionStateLike {
activeResultRunId?: string;
/** The result run being updated; null means the execution will create a new run. */
executingResultRunId?: string | null;
}
export function isActiveResultLoading(state: QueryResultLoadingStateLike): boolean {
if (!state.isExecuting) return false;
if (!state.activeResultRunId) return true;
// Keep unscoped legacy callers conservative while all new executions set an
// explicit run id (or null when they are producing a new result run).
if (state.executingResultRunId === undefined) return true;
return state.executingResultRunId === state.activeResultRunId;
}
export function queryExecutionLabelKey(state: Pick<QueryExecutionStateLike, "isCancelling">): "common.loading" | "common.stopping" {
return state.isCancelling ? "common.stopping" : "common.loading";
}