Skip to content

Build your personal knowledge base with Trilium Notes

fix(table): inconsistent boolean column sorting

Elian Doranafe99b240f06
diff --git a/apps/client/src/widgets/collections/table/columns.tsx b/apps/client/src/widgets/collections/table/columns.tsx
index 9a500f0111..3dc92e8958 100644
--- a/apps/client/src/widgets/collections/table/columns.tsx
+++ b/apps/client/src/widgets/collections/table/columns.tsx
@@ -29,7 +29,11 @@ const labelTypeMappings: Record<ColumnType, Partial<ColumnDefinition>> = {
},
boolean: {
formatter: "tickCross",
- editor: "tickCross"
+ editor: "tickCross",
+ // Values arrive as strings ("true"/"false") from stored labels but as real booleans
+ // once toggled via the editor; the boolean sorter normalizes both, whereas the default
+ // string sorter treats boolean `false` as empty and orders it inconsistently.
+ sorter: "boolean"
},
date: {
editor: "date",