Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(grid): follow boolean text setting in editor and detail views

zipgb9dc55586bd9
diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue
index 2f8a905f0a..e47cfef94d 100644
--- a/apps/desktop/src/components/grid/DataGrid.vue
+++ b/apps/desktop/src/components/grid/DataGrid.vue
@@ -206,7 +206,18 @@ import {
import { adjacentDataGridDetailIndex, type DataGridDetailNavigationDelta } from "@/lib/dataGrid/dataGridDetailNavigation";
import { applyColumnFormatter, DataGridDateTimePatterns, displayTimeZoneOption, formatIoTDBTimestampEditorValue, iotdbTimestampFractionDigits, iotdbTimestampPrecision, parseIoTDBTimestampEditorValue, type ColumnFormatterConfig } from "@/lib/dataGrid/columnFormatter";
import { temporalCellEditorConfig, type TemporalCellEditorConfig } from "@/lib/dataGrid/dataGridTemporalEditor";
-import { BOOLEAN_CELL_EDITOR_VALUES, booleanCellDisplayText, booleanCellEditorValue, isBooleanCellValue, isBooleanColumnType, isPointInBooleanCheckbox, nextBooleanCellValue, normalizeBooleanCellValue, parseBooleanCellEditorValue } from "@/lib/dataGrid/dataGridBooleanColumn";
+import {
+ BOOLEAN_CELL_EDITOR_VALUES,
+ booleanCellDisplayText,
+ booleanCellEditorDisplayValues,
+ booleanCellEditorValue,
+ isBooleanCellValue,
+ isBooleanColumnType,
+ isPointInBooleanCheckbox,
+ nextBooleanCellValue,
+ normalizeBooleanCellValue,
+ parseBooleanCellEditorValue,
+} from "@/lib/dataGrid/dataGridBooleanColumn";
import { resolveDataGridColumnNullability, resolveDataGridColumnsByResultIndex } from "@/lib/dataGrid/dataGridColumnMetadata";
import { resolveDataGridNewRowCellPlaceholder } from "@/lib/dataGrid/dataGridDefaultPlaceholder";
import {
@@ -474,6 +485,7 @@ const hideNullColumns = computed(() => settingsStore.editorSettings.dataGridHide
const hideEmptyColumns = computed(() => settingsStore.editorSettings.dataGridHideEmptyColumns);
const booleanCellsUseCheckbox = computed(() => settingsStore.editorSettings.dataGridBooleanDisplayMode === "checkbox");
const booleanCellValueStyle = computed(() => settingsStore.editorSettings.dataGridBooleanValueStyle);
+const booleanEditorDisplayValues = computed(() => booleanCellEditorDisplayValues(booleanCellValueStyle.value));
const booleanDisplayMode = computed(() => settingsStore.editorSettings.dataGridBooleanDisplayMode);
const colorizeDataGridCellTypes = computed(() => settingsStore.editorSettings.colorizeDataGridCellTypes);
const { isDark, themePalette } = useTheme();
@@ -14910,6 +14922,7 @@ useUpdateBlocker(() => (hasPendingChanges.value || hasPendingDataEditorDraft.val
v-else-if="isBooleanGridCell(displayItems[cell.recordIndex], cell.valueIndex)"
v-model="booleanEditorModelValue"
:values="BOOLEAN_CELL_EDITOR_VALUES"
+ :display-values="booleanEditorDisplayValues"
:nullable="isBooleanGridColumnNullable(cell.valueIndex)"
:initial-null="isGridCellInitialNull(displayItems[cell.recordIndex]?.id, cell.valueIndex)"
cell-layout="transpose"
@@ -15616,6 +15629,7 @@ useUpdateBlocker(() => (hasPendingChanges.value || hasPendingDataEditorDraft.val
v-else-if="isBooleanGridCell(getRowItem(canvasEditingCell.rowId), canvasEditingCell.actualColIdx)"
v-model="booleanEditorModelValue"
:values="BOOLEAN_CELL_EDITOR_VALUES"
+ :display-values="booleanEditorDisplayValues"
:nullable="isBooleanGridColumnNullable(canvasEditingCell.actualColIdx)"
:initial-null="isGridCellInitialNull(canvasEditingCell.rowId, canvasEditingCell.actualColIdx)"
@cancel="cancelEdit"
@@ -15844,6 +15858,7 @@ useUpdateBlocker(() => (hasPendingChanges.value || hasPendingDataEditorDraft.val
v-else-if="isBooleanGridCell(item, col.actualColIdx)"
v-model="booleanEditorModelValue"
:values="BOOLEAN_CELL_EDITOR_VALUES"
+ :display-values="booleanEditorDisplayValues"
:nullable="isBooleanGridColumnNullable(col.actualColIdx)"
:initial-null="isGridCellInitialNull(item.id, col.actualColIdx)"
@cancel="cancelEdit"
@@ -16472,6 +16487,7 @@ useUpdateBlocker(() => (hasPendingChanges.value || hasPendingDataEditorDraft.val
v-model:column-open="columnDetailDialogOpen"
:row-detail="rowDetail"
:column-detail="columnDetail"
+ :database-type="resolvedDatabaseType"
:type-color-class="typeColorClass"
@navigate-row="navigateRowDetail"
@navigate-column="navigateColumnDetail"
diff --git a/apps/desktop/src/components/grid/DataGridCellDetailDialog.vue b/apps/desktop/src/components/grid/DataGridCellDetailDialog.vue
index 76239f4f88..fb3645572a 100644
--- a/apps/desktop/src/components/grid/DataGridCellDetailDialog.vue
+++ b/apps/desktop/src/components/grid/DataGridCellDetailDialog.vue
@@ -12,7 +12,7 @@ import { useCellDetailEditor, type UseCellDetailEditorReturn } from "@/composabl
import { useTheme } from "@/composables/useTheme";
import { useSettingsStore } from "@/stores/settingsStore";
import { BINARY_CELL_DOWNLOAD_MODES, isBinaryCellColumnType, binaryCellUtf8Text, isBlobCellColumnType, type BinaryCellDownloadMode } from "@/lib/dataGrid/binaryCellDownload";
-import { isGeometryColumnType } from "@/lib/dataGrid/cellDetailPresentation";
+import { cellDetailPreviewText, isGeometryColumnType } from "@/lib/dataGrid/cellDetailPresentation";
import { isHexGeometry, renderWktOnCanvas } from "@/lib/dataGrid/geometryPreview";
import type { DataGridCellDetail } from "@/lib/dataGrid/dataGridDetail";
import type { DatabaseType } from "@/types/database";
@@ -49,7 +49,7 @@ const jsonFormatted = computed(() => settingsStore.editorSettings.cellDetailJson
const jsonView = computed(() => jsonFormatted.value && !!props.detail?.formattedJson);
const wordWrapEnabled = computed(() => settingsStore.editorSettings.wordWrap);
const binaryTextPreview = computed(() => (props.detail && isBlobCellColumnType(props.detail.type) ? binaryCellUtf8Text(props.detail.value, props.detail.type, props.databaseType) : null));
-const presentedValuePreview = computed(() => (binaryTextPreview.value === null ? props.detail?.rawValuePreview : props.detail?.displayValuePreview) ?? "");
+const presentedValuePreview = computed(() => (binaryTextPreview.value === null && props.detail ? cellDetailPreviewText(props.detail, props.databaseType) : props.detail?.displayValuePreview) ?? "");
function toggleWordWrap() {
settingsStore.updateEditorSettings({ wordWrap: !wordWrapEnabled.value });
diff --git a/apps/desktop/src/components/grid/DataGridCellDetailPanel.vue b/apps/desktop/src/components/grid/DataGridCellDetailPanel.vue
index 28be9008cc..c8de5521ed 100644
--- a/apps/desktop/src/components/grid/DataGridCellDetailPanel.vue
+++ b/apps/desktop/src/components/grid/DataGridCellDetailPanel.vue
@@ -11,7 +11,7 @@ import { TabsContent } from "@/components/ui/tabs";
import TemporalCellEditor from "@/components/grid/TemporalCellEditor.vue";
import { useDataGridCellDetail } from "@/composables/useDataGridCellDetail";
import { BINARY_CELL_DOWNLOAD_MODES, isBinaryCellColumnType, binaryCellUtf8Text, isBlobCellColumnType, type BinaryCellDownloadMode } from "@/lib/dataGrid/binaryCellDownload";
-import { isGeometryColumnType } from "@/lib/dataGrid/cellDetailPresentation";
+import { cellDetailPreviewText, isGeometryColumnType } from "@/lib/dataGrid/cellDetailPresentation";
import { isHexGeometry } from "@/lib/dataGrid/geometryPreview";
import type { DataGridCellDetail } from "@/lib/dataGrid/dataGridDetail";
import type { TemporalCellEditorConfig } from "@/lib/dataGrid/dataGridTemporalEditor";
@@ -78,7 +78,7 @@ void detailsEditorContainer;
void sideJsonPreviewContainer;
const binaryTextPreview = computed(() => (isBlobCellColumnType(props.detail.type) ? binaryCellUtf8Text(props.detail.value, props.detail.type, props.databaseType) : null));
-const presentedValuePreview = computed(() => (binaryTextPreview.value === null ? props.detail.rawValuePreview : props.detail.displayValuePreview));
+const presentedValuePreview = computed(() => (binaryTextPreview.value === null ? cellDetailPreviewText(props.detail, props.databaseType) : props.detail.displayValuePreview));
const transformOpen = ref(false);
// 底部面板横向空间充足:有图片预览时与值文本左右并排,侧栏窄面板保持上下堆叠。
const valueBesideImage = computed(() => props.panelIsBottom && !props.editing && !!props.detail.imagePreviewUrl);
diff --git a/apps/desktop/src/components/grid/DataGridDetailDialogs.vue b/apps/desktop/src/components/grid/DataGridDetailDialogs.vue
index 8388a82db5..53834934ad 100644
--- a/apps/desktop/src/components/grid/DataGridDetailDialogs.vue
+++ b/apps/desktop/src/components/grid/DataGridDetailDialogs.vue
@@ -5,13 +5,16 @@ import { useI18n } from "vue-i18n";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog";
+import { cellDetailPreviewText } from "@/lib/dataGrid/cellDetailPresentation";
import { filterDataGridDetailFields, type DataGridCellDetail, type DataGridColumnDetail, type DataGridRowDetail } from "@/lib/dataGrid/dataGridDetail";
+import type { DatabaseType } from "@/types/database";
import { detailNavigationDelta, shouldIgnoreDataGridDetailNavigation, type DataGridDetailNavigationDelta } from "@/lib/dataGrid/dataGridDetailNavigation";
const { t } = useI18n();
const props = defineProps<{
rowDetail: DataGridRowDetail | null;
columnDetail: DataGridColumnDetail | null;
+ databaseType?: DatabaseType;
typeColorClass: (type: string) => string;
openImagePreview: (src: string, title: string) => void;
copyRowDetailFieldValue: (field: DataGridCellDetail) => void;
@@ -99,7 +102,7 @@ function onColumnDetailKeydown(event: KeyboardEvent) {
<a v-if="field.imagePreviewUrl" :href="field.imagePreviewUrl" role="button" class="mb-2 block max-h-48 overflow-hidden rounded border bg-muted/20" @click.prevent="openImagePreview(field.imagePreviewUrl, field.column)"
><img :src="field.imagePreviewUrl" :alt="field.column" loading="lazy" decoding="async" referrerpolicy="no-referrer" class="max-h-48 w-full object-contain"
/></a>
- <pre class="dbx-data-grid-value-font max-h-44 overflow-auto rounded border bg-muted/20 p-2 text-xs whitespace-pre-wrap break-words" :class="{ 'italic text-muted-foreground': field.isNull ?? field.value === null }">{{ field.rawValuePreview }}</pre>
+ <pre class="dbx-data-grid-value-font max-h-44 overflow-auto rounded border bg-muted/20 p-2 text-xs whitespace-pre-wrap break-words" :class="{ 'italic text-muted-foreground': field.isNull ?? field.value === null }">{{ cellDetailPreviewText(field, databaseType) }}</pre>
<div v-if="field.isValuePreviewTruncated" class="mt-1 text-[11px] text-muted-foreground">{{ t("grid.largeValuePreviewHint", { count: field.rawValuePreview.length }) }}</div>
<div v-if="field.formattedJson" class="mt-2 space-y-1">
<div class="text-muted-foreground">{{ t("grid.formattedJson") }}</div>
@@ -169,7 +172,7 @@ function onColumnDetailKeydown(event: KeyboardEvent) {
<a v-if="field.imagePreviewUrl" :href="field.imagePreviewUrl" role="button" class="mb-2 block max-h-40 overflow-hidden rounded border bg-muted/20" @click.prevent="openImagePreview(field.imagePreviewUrl, field.column)"
><img :src="field.imagePreviewUrl" :alt="field.column" loading="lazy" decoding="async" referrerpolicy="no-referrer" class="max-h-40 w-full object-contain"
/></a>
- <pre class="dbx-data-grid-value-font max-h-36 overflow-auto rounded border bg-muted/20 p-2 text-xs whitespace-pre-wrap break-words" :class="{ 'italic text-muted-foreground': field.isNull ?? field.value === null }">{{ field.rawValuePreview }}</pre>
+ <pre class="dbx-data-grid-value-font max-h-36 overflow-auto rounded border bg-muted/20 p-2 text-xs whitespace-pre-wrap break-words" :class="{ 'italic text-muted-foreground': field.isNull ?? field.value === null }">{{ cellDetailPreviewText(field, databaseType) }}</pre>
<div v-if="field.isValuePreviewTruncated" class="mt-1 text-[11px] text-muted-foreground">{{ t("grid.largeValuePreviewHint", { count: field.rawValuePreview.length }) }}</div>
<div v-if="field.formattedJson" class="mt-2 space-y-1">
<div class="text-muted-foreground">{{ t("grid.formattedJson") }}</div>
diff --git a/apps/desktop/src/components/grid/EnumCellEditor.vue b/apps/desktop/src/components/grid/EnumCellEditor.vue
index 065500bf7f..266491c707 100644
--- a/apps/desktop/src/components/grid/EnumCellEditor.vue
+++ b/apps/desktop/src/components/grid/EnumCellEditor.vue
@@ -8,6 +8,8 @@ const props = withDefaults(
defineProps<{
modelValue: string;
values: string[];
+ /** Optional labels aligned with `values`; the committed value is still `values[i]`. */
+ displayValues?: string[];
nullable?: boolean;
initialNull?: boolean;
cellLayout?: "grid" | "transpose";
@@ -33,9 +35,15 @@ const closeHandled = ref(false);
const triggerClass = computed(() => ["cell-edit-input absolute inset-0 z-10 flex items-center gap-1 border-2 border-primary bg-background py-0 text-left text-xs outline-none", props.cellLayout === "transpose" ? "px-1.5" : "px-2.5"].join(" "));
+function optionLabel(value: string, index: number): string {
+ return props.displayValues?.[index] ?? value;
+}
+
const displayValue = computed(() => {
if (props.initialNull && props.modelValue === "") return t("grid.nullValue");
- return props.modelValue === "" ? "''" : props.modelValue;
+ if (props.modelValue === "") return "''";
+ const index = props.values.indexOf(props.modelValue);
+ return index >= 0 ? optionLabel(props.modelValue, index) : props.modelValue;
});
onMounted(() => {
@@ -99,7 +107,7 @@ function onPopoverInteractOutside(event: PointerDownOutsideEvent | FocusOutsideE
{{ t("grid.nullValue") }}
</button>
<button
- v-for="val in values"
+ v-for="(val, index) in values"
:key="val"
type="button"
class="flex min-h-7 w-full items-center rounded-sm px-2 py-1 text-left text-xs hover:bg-accent hover:text-accent-foreground"
@@ -110,7 +118,7 @@ function onPopoverInteractOutside(event: PointerDownOutsideEvent | FocusOutsideE
<code>''</code>
<span class="ml-2 text-muted-foreground">{{ t("grid.emptyStringValue") }}</span>
</template>
- <template v-else>{{ val }}</template>
+ <template v-else>{{ optionLabel(val, index) }}</template>
</button>
</div>
</PopoverContent>
diff --git a/apps/desktop/src/components/grid/__tests__/DataGridSurfaces.spec.ts b/apps/desktop/src/components/grid/__tests__/DataGridSurfaces.spec.ts
index 5c0e0d8819..0daccb4d99 100644
--- a/apps/desktop/src/components/grid/__tests__/DataGridSurfaces.spec.ts
+++ b/apps/desktop/src/components/grid/__tests__/DataGridSurfaces.spec.ts
@@ -112,6 +112,7 @@ import DataGridSearchBar from "@/components/grid/DataGridSearchBar.vue";
import DataGridSortBuilder from "@/components/grid/DataGridSortBuilder.vue";
import DataGridSortWorkbench from "@/components/grid/DataGridSortWorkbench.vue";
import DataGridTextSortWorkbench from "@/components/grid/DataGridTextSortWorkbench.vue";
+import EnumCellEditor from "@/components/grid/EnumCellEditor.vue";
function detail(patch: Partial<DataGridCellDetail> = {}): DataGridCellDetail {
return {
@@ -2252,6 +2253,55 @@ describe("cell detail surfaces", () => {
expect(findOne(panel.root, (node) => node.type === "textarea").value).toBe("中文");
});
+ it("shows the grid boolean label in the panel and dialog without changing the raw value", () => {
+ const booleanDetail = detail({
+ type: "bit",
+ value: true,
+ rawValue: "true",
+ rawValuePreview: "true",
+ displayValue: "TRUE",
+ displayValuePreview: "TRUE",
+ formattedJson: "",
+ });
+ const panel = mountComponent(DataGridCellDetailPanel, {
+ detail: booleanDetail,
+ panelIsBottom: true,
+ metadataCollapsed: false,
+ valueFillsHeight: false,
+ editing: false,
+ sideJsonView: false,
+ showCompactJson: false,
+ canCompactJson: false,
+ typeColorClass: () => "",
+ canDownloadBinaryValue: () => false,
+ downloadBinaryValue: vi.fn(),
+ canImportBinaryValue: () => false,
+ importBinaryValue: vi.fn(),
+ openImagePreview: vi.fn(),
+ canCopySqlCondition: () => true,
+ databaseType: "sqlserver",
+ });
+ const dialog = mountComponent(DataGridCellDetailDialog, {
+ open: true,
+ detail: booleanDetail,
+ typeColorClass: () => "",
+ openImagePreview: vi.fn(),
+ copyText: vi.fn(),
+ canDownloadBinaryValue: () => false,
+ downloadBinaryValue: vi.fn(),
+ canImportBinaryValue: () => false,
+ importBinaryValue: vi.fn(),
+ databaseType: "sqlserver",
+ });
+
+ for (const mounted of [panel, dialog]) {
+ expect(hostText(mounted.root)).toContain("TRUE");
+ expect(hostText(mounted.root)).not.toContain(">true<");
+ }
+ // rawValue remains the edit/copy payload; only the preview is labeled.
+ expect(booleanDetail.rawValue).toBe("true");
+ });
+
it("keeps the value transform entry for non-binary detail cells", () => {
const panel = mountComponent(DataGridCellDetailPanel, {
detail: detail({ type: "VARCHAR(32)", value: "hello", rawValue: "hello", rawValuePreview: "hello", displayValue: "hello", displayValuePreview: "hello", formattedJson: "" }),
@@ -2583,3 +2633,41 @@ describe("DataGrid column header tooltips", () => {
grid.destroy();
});
});
+
+describe("EnumCellEditor boolean labels", () => {
+ it("shows TRUE/FALSE but commits the raw boolean value", () => {
+ const commit = vi.fn();
+ const editor = mountComponent(EnumCellEditor, {
+ modelValue: "true",
+ values: ["true", "false"],
+ displayValues: ["TRUE", "FALSE"],
+ nullable: true,
+ onCommit: commit,
+ });
+
+ expect(hostText(editor.root)).toContain("TRUE");
+ dispatch(
+ findOne(editor.root, (node) => node.type === "button" && hostText(node).trim() === "FALSE"),
+ "click",
+ );
+ expect(commit).toHaveBeenCalledWith("false");
+ });
+
+ it("shows 1/0 for the zero-one style while keeping the raw values", () => {
+ const commit = vi.fn();
+ const editor = mountComponent(EnumCellEditor, {
+ modelValue: "false",
+ values: ["true", "false"],
+ displayValues: ["1", "0"],
+ nullable: true,
+ onCommit: commit,
+ });
+
+ expect(hostText(editor.root)).toContain("0");
+ dispatch(
+ findOne(editor.root, (node) => node.type === "button" && hostText(node).trim() === "1"),
+ "click",
+ );
+ expect(commit).toHaveBeenCalledWith("true");
+ });
+});
diff --git a/apps/desktop/src/lib/dataGrid/__tests__/dataGridBooleanColumn.spec.ts b/apps/desktop/src/lib/dataGrid/__tests__/dataGridBooleanColumn.spec.ts
index 9bab63236e..4d7c75f883 100644
--- a/apps/desktop/src/lib/dataGrid/__tests__/dataGridBooleanColumn.spec.ts
+++ b/apps/desktop/src/lib/dataGrid/__tests__/dataGridBooleanColumn.spec.ts
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
-import { booleanCellDisplayText, normalizeBooleanCellValueStyle } from "@/lib/dataGrid/dataGridBooleanColumn";
+import { booleanCellDisplayText, booleanCellEditorDisplayValues, normalizeBooleanCellValueStyle } from "@/lib/dataGrid/dataGridBooleanColumn";
describe("booleanCellDisplayText", () => {
it("renders the uppercase TRUE/FALSE text by default", () => {
@@ -20,6 +20,13 @@ describe("booleanCellDisplayText", () => {
});
});
+describe("booleanCellEditorDisplayValues", () => {
+ it("uses the same TRUE/FALSE and 1/0 labels as the grid", () => {
+ expect(booleanCellEditorDisplayValues("true-false")).toEqual(["TRUE", "FALSE"]);
+ expect(booleanCellEditorDisplayValues("zero-one")).toEqual(["1", "0"]);
+ });
+});
+
describe("normalizeBooleanCellValueStyle", () => {
it("keeps known styles", () => {
expect(normalizeBooleanCellValueStyle("zero-one")).toBe("zero-one");
diff --git a/apps/desktop/src/lib/dataGrid/cellDetailPresentation.ts b/apps/desktop/src/lib/dataGrid/cellDetailPresentation.ts
index 4f54d5d190..95af0d3b73 100644
--- a/apps/desktop/src/lib/dataGrid/cellDetailPresentation.ts
+++ b/apps/desktop/src/lib/dataGrid/cellDetailPresentation.ts
@@ -1,4 +1,6 @@
import { safeJsonFormat } from "@/lib/common/safeJsonFormat";
+import { isBooleanColumnType } from "@/lib/dataGrid/dataGridBooleanColumn";
+import type { DatabaseType } from "@/types/database";
export type CellDetailTab = "details" | "hexViewer" | "valueEditor";
export type ValueEditorAction = "formatJson" | "compactJson" | "setNull" | "restoreOriginal";
@@ -37,6 +39,11 @@ export function visibleCellDetailTabs(options: CellDetailPresentationOptions): C
return tabs;
}
+/** Preview text for the detail surfaces. Boolean columns use the same label as the grid (TRUE/FALSE or 1/0), while rawValue stays untouched for length/copy/edit semantics. */
+export function cellDetailPreviewText(detail: Pick<{ type: string; rawValuePreview: string; displayValuePreview: string }, "type" | "rawValuePreview" | "displayValuePreview">, databaseType?: DatabaseType): string {
+ return isBooleanColumnType(detail.type, databaseType) ? detail.displayValuePreview : detail.rawValuePreview;
+}
+
export function cellDetailEditorText(value: unknown, _columnType?: string): string {
if (value === null) return "";
return cellDetailRawEditorText(value);
diff --git a/apps/desktop/src/lib/dataGrid/dataGridBooleanColumn.ts b/apps/desktop/src/lib/dataGrid/dataGridBooleanColumn.ts
index 39c36e3e57..4b42fa98da 100644
--- a/apps/desktop/src/lib/dataGrid/dataGridBooleanColumn.ts
+++ b/apps/desktop/src/lib/dataGrid/dataGridBooleanColumn.ts
@@ -67,6 +67,11 @@ export function booleanCellDisplayText(value: unknown, style: BooleanCellValueSt
return value ? "TRUE" : "FALSE";
}
+/** Labels for the boolean dropdown editor; stored values stay `true`/`false`. */
+export function booleanCellEditorDisplayValues(style: BooleanCellValueStyle): string[] {
+ return style === "zero-one" ? ["1", "0"] : ["TRUE", "FALSE"];
+}
+
export function parseBooleanCellEditorValue(value: string | null): boolean | null | undefined {
if (value === null) return null;
if (value === "true") return true;