refine grid row change indicators
This commit is contained in:
1 parent
4efd7c2517
commit
747784ffe0
6 files changed
+127
-66
No files matched your search
@@ -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";
|
||||
}
|
||||
@@ -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),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user