refine grid row change indicators

This commit is contained in:
SuLe committed 2026-05-02 17:03:54 +08:00
1 parent 4efd7c2517
commit 747784ffe0
6 files changed
+127 -66

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
export type RowStatus = "clean" | "edited" | "new" | "deleted";
export type RowStatusFilter = "all" | "changed" | "edited" | "new" | "deleted";
export function matchesRowStatusFilter(status: RowStatus, filter: RowStatusFilter): boolean {
if (filter === "all") return true;
if (filter === "changed") return status !== "clean";
return status === filter;
}
export function rowStatusFilterAfterAddingRow(filter: RowStatusFilter): RowStatusFilter {
return matchesRowStatusFilter("new", filter) ? filter : "all";
}
+1 -1
View File
@@ -146,7 +146,7 @@ function buildTableItems(prefix: string, tables: SqlCompletionTable[]): SqlCompl
label: table.name,
type: "table" as const,
detail: table.schema ? `${table.schema}.${table.name}` : table.type,
boost: computeBoost(table.name, prefix) + 1000,
boost: computeBoost(table.name, prefix),
}));
}