diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue index e0408d99e2..4662a75b1c 100644 --- a/apps/desktop/src/components/grid/DataGrid.vue +++ b/apps/desktop/src/components/grid/DataGrid.vue @@ -181,6 +181,7 @@ import { import { temporalCellEditorConfig, type TemporalCellEditorConfig } from "@/lib/dataGrid/dataGridTemporalEditor"; import { BOOLEAN_CELL_EDITOR_VALUES, 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 { isCancelSearchShortcut, isCopyCurrentRowShortcut, isDeleteCurrentRowShortcut, isFocusSearchShortcut, isModRShortcut, isSaveShortcut, isToggleTransposeShortcut } from "@/lib/editor/keyboardShortcuts"; import { dataGridHeaderContentWidth, scrollbarGutterWidth } from "@/lib/dataGrid/dataGridScrollGutter"; import { canFetchNextDataGridSegment, canGoNextDataGridPage, dataGridTotalRowCountLabelKey, dataGridTruncationHintKey, hasCompleteLocalDataGridResult, resolveDataGridPaginationTotal, type DataGridInexactTotalRowCountMode } from "@/lib/dataGrid/dataGridPagination"; @@ -6580,8 +6581,15 @@ function rowNumberText(item: RowItem | undefined): string { return String(item.displayIndex + 1 + rowNumberPageOffset()); } -function draftCellPlaceholder(item: RowItem | undefined, columnIndex: number): string | null { - return item?.isDraft && item.data[columnIndex] === null ? t("grid.quickEntryDraftPlaceholder") : null; +const quickEntryDraftPlaceholder = computed(() => t("grid.quickEntryDraftPlaceholder")); + +function newRowCellPlaceholder(item: RowItem | undefined, columnIndex: number): string | null { + return resolveDataGridNewRowCellPlaceholder({ + row: item, + columnIndex, + column: tableColumnsByResultIndex.value[columnIndex], + draftFallback: quickEntryDraftPlaceholder.value, + }); } function columnTypeCacheSignature(): string { @@ -7349,7 +7357,7 @@ function drawCanvasGrid() { searchMatchKeys: searchMatchSet.value, currentSearchMatch: currentSearchMatch.value, formatCell: (value, columnIndex, row) => formatCellCached(visibleLargeValuePreviewValue(row, columnIndex, value), columnIndex, largeValueOriginalBytes(row, columnIndex)), - draftCellPlaceholder: t("grid.quickEntryDraftPlaceholder"), + newRowCellPlaceholder, isRowActive, rowCellsUseSelectionVisual, cellIsSelected, @@ -12036,8 +12044,8 @@ function currentGridContextMenuItems(): ContextMenuItem[] { />