From 846c12ed1e7f556dc1a15dc18da93b25fe768753 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 12:42:00 +0000 Subject: [PATCH 1/7] wip(list): per-cell autosave in the select-first grid Claude-Session: https://claude.ai/code/session_01L6bhgUYnzYCcbcpABdW7ps Co-authored-by: Claude --- .../src/context/gridCellSelection.tsx | 3 +- .../src/renderers/complex/data-table.tsx | 353 +++++++++++++++++- ui/packages/i18n/src/locales/ar.ts | 4 + ui/packages/i18n/src/locales/de.ts | 4 + ui/packages/i18n/src/locales/en.ts | 4 + ui/packages/i18n/src/locales/es.ts | 4 + ui/packages/i18n/src/locales/fr.ts | 4 + ui/packages/i18n/src/locales/ja.ts | 4 + ui/packages/i18n/src/locales/ko.ts | 4 + ui/packages/i18n/src/locales/pt-BR.ts | 4 + ui/packages/i18n/src/locales/ru.ts | 4 + ui/packages/i18n/src/locales/zh-Hans.ts | 4 + ui/packages/i18n/src/locales/zh-Hant.ts | 4 + ui/packages/plugin-grid/src/ObjectGrid.tsx | 71 +++- .../plugin-grid/src/objectGridRowPatch.ts | 81 ++++ 15 files changed, 518 insertions(+), 34 deletions(-) create mode 100644 ui/packages/plugin-grid/src/objectGridRowPatch.ts diff --git a/ui/packages/components/src/context/gridCellSelection.tsx b/ui/packages/components/src/context/gridCellSelection.tsx index 8302bd61347..3348d0e9a96 100644 --- a/ui/packages/components/src/context/gridCellSelection.tsx +++ b/ui/packages/components/src/context/gridCellSelection.tsx @@ -12,7 +12,8 @@ * * Inside a provider whose value is not `null`, a data cell is SELECTED by a * single click, never edited by it and never opening the record. An editor - * opens on double-click, Enter, F2 or typing; Space opens the record; Esc + * opens on double-click, Enter, F2 or typing (Space included; a two-state + * cell flips instead); the title link or a touch tap opens the record; Esc * cancels; Enter and Tab commit and move (in a multi-line editor Enter is a * newline and Ctrl/Cmd+Enter commits). A cell that opens no editor says why * in place. Outside a provider (`null`, the default) the table keeps its diff --git a/ui/packages/components/src/renderers/complex/data-table.tsx b/ui/packages/components/src/renderers/complex/data-table.tsx index c3621e2c0ea..8b7f2d4347f 100644 --- a/ui/packages/components/src/renderers/complex/data-table.tsx +++ b/ui/packages/components/src/renderers/complex/data-table.tsx @@ -64,6 +64,8 @@ import { Plus, MoreHorizontal, AlertCircle, + Check, + Loader2, } from 'lucide-react'; import { DropdownMenu, @@ -342,6 +344,11 @@ const TABLE_DEFAULT_TRANSLATIONS: Record = { // objectstack#35684 — a selected cell that opens no editor, when its host // gives no reason of its own. 'table.cellReadOnly': 'This cell can\'t be edited here.', + // objectstack#35685 — a list cell's own save state, and the way out of a + // rule the list cannot complete. + 'table.cellSaving': 'Saving…', + 'table.cellSaved': 'Saved', + 'table.openRecordToFinish': 'Open the record to finish this change', 'common.actions': 'Actions', // objectui#10625 — the inline date editors' notice for a stored value // written on a day that does not exist. The SAME keys `DateField` / @@ -1386,6 +1393,70 @@ function CellNotice({ text, onDismiss }: { text: string; onDismiss: () => void } ); } +/** + * objectstack#35685 — why a list cell's save was refused, said on that cell: + * the server's reasons, one line each, and, when the refusal names a field the + * list cannot edit, the way to the record where it can be finished. + */ +function CellSaveFailure({ + lines, + title, + openRecordLabel, + onOpenRecord, + onDismiss, +}: { + lines: readonly string[]; + title: string; + openRecordLabel: string; + onOpenRecord?: (e: React.MouseEvent) => void; + onDismiss: () => void; +}) { + return ( + { if (!open) onDismiss(); }}> + + + e.preventDefault()} + onCloseAutoFocus={(e) => e.preventDefault()} + className="w-auto max-w-xs space-y-1 px-2.5 py-1.5 text-xs" + > +
+ + {lines.length === 1 ? ( + {title}: {lines[0]} + ) : ( +
+ {title}: +
    + {lines.map((line) =>
  • {line}
  • )} +
+
+ )} +
+ {onOpenRecord && ( + + )} +
+
+ ); +} + const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { const { caption, @@ -1438,7 +1509,8 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { // objectstack#35684 — the select-first cell model, when a host mounted one // (`GridCellSelection`): a click selects a cell, an editor opens on - // double-click, Enter, F2 or typing, Space opens the record. It needs the + // double-click, Enter, F2 or typing (Space too), and each committed cell + // saves at once (objectstack#35685). It needs the // arrow keys, so it turns the roving-cell navigation on. const cellSelection = useGridCellSelection(); const selectFirst = cellSelection !== null; @@ -1946,6 +2018,33 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { // kept under (objectui#12310) — tinted destructive so the author sees exactly // which rows didn't persist (no silent "phantom save"). const [erroredRows, setErroredRows] = useState>(new Set()); + // ── Per-cell autosave (objectstack#35685), the select-first model's save ── + // A committed cell sends its record's update at once; nothing waits for a + // save bar. A refused update keeps its edits pending, so the row's next + // commit sends them again together with the new cell, as one update. + // + // The refusal of a row's last save: its lines, and whether it named a field + // the list cannot edit (the record is where that change can be finished). + const [rowRefusals, setRowRefusals] = useState>(new Map()); + // Each cell's save state while it shows: in flight, or just saved. + const [cellSaveStates, setCellSaveStates] = useState>>(new Map()); + // The refused cell whose reason opens on its own as the refusal lands. + const [failureNotice, setFailureNotice] = useState<{ rowKey: PendingRowKey; columnKey: string } | null>(null); + // The rows a save updated in place since the rows last loaded, each as it + // sorted and filtered before that save: a client-side sort or search keeps + // reading these, so a saved row stays where it is until the next load. + const [sortBasis, setSortBasis] = useState>(new Map()); + // The records whose save is running, those committed again meanwhile, and + // those whose commit is waiting for the render that holds it. + const runningSavesRef = useRef>(new Set()); + const saveAgainRef = useRef>(new Set()); + const autosaveDueRef = useRef>(new Set()); + const [autosaveTick, setAutosaveTick] = useState(0); + const savedTimersRef = useRef>>(new Set()); + useEffect(() => () => { + for (const timer of savedTimersRef.current) clearTimeout(timer); + savedTimersRef.current.clear(); + }, []); // Column header context menu state const [contextMenu, setContextMenu] = useState<{ x: number; y: number; columnKey: string } | null>(null); // objectstack#28434 — the row context menu: which row it is open on, where, @@ -2064,6 +2163,26 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { // filter path, so leaving both active would not even be redundant: the client // pass would narrow the server's answer to whichever of its rows happen to // contain the term as rendered text. + // objectstack#35685 — a row a save updated in place is sorted and searched + // as it was before that save, until the rows load again (`sortBasis`). + const sortRowOf = (row: any): any => (sortBasis.size > 0 ? sortBasis.get(pendingRowKeyOf(row)) ?? row : row); + // A load is any held row that changed without a save of ours updating it: + // the basis then has nothing left to stand for. + const lastHeldRowsRef = useRef | null>(null); + useEffect(() => { + const held = new Map(); + for (const row of data) held.set(pendingRowKeyOf(row), row); + const before = lastHeldRowsRef.current; + lastHeldRowsRef.current = held; + if (sortBasis.size === 0 || before === null) return; + const loaded = held.size !== before.size + || Array.from(held).some(([key, row]) => before.get(key) !== row && !sortBasis.has(key)); + if (loaded) setSortBasis(new Map()); + }, [data]); + useEffect(() => { + setSortBasis((prev) => (prev.size === 0 ? prev : new Map())); + }, [sortColumn, sortDirection, searchQuery]); + const filteredData = useMemo(() => { if (manualSearch) return data; if (!searchQuery) return data; @@ -2074,11 +2193,11 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { const searchedColumns = columns.filter((col) => !isMaskedColumnKey(rawColumns, col.accessorKey)); return data.filter((row) => searchedColumns.some((col) => { - const value = row[col.accessorKey]; + const value = sortRowOf(row)[col.accessorKey]; return value?.toString().toLowerCase().includes(searchQuery.toLowerCase()); }) ); - }, [data, searchQuery, columns, rawColumns, manualSearch]); + }, [data, searchQuery, columns, rawColumns, manualSearch, sortBasis]); // Sorting — client-side, over the rows this table was handed. // @@ -2104,14 +2223,14 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { // the reader how it compares with every other row's. if (isMaskedColumnKey(rawColumns, sortColumn)) return filteredData; - const keyed = filteredData.map((row) => ({ row, key: getSortValue(row[sortColumn]) })); + const keyed = filteredData.map((row) => ({ row, key: getSortValue(sortRowOf(row)[sortColumn]) })); // Array#sort is stable, so rows with equal keys keep their incoming order. keyed.sort((a, b) => { const comparison = compareSortValues(a.key, b.key); return sortDirection === 'asc' ? comparison : -comparison; }); return keyed.map((entry) => entry.row); - }, [filteredData, sortColumn, sortDirection, manualSorting, rawColumns]); + }, [filteredData, sortColumn, sortDirection, manualSorting, rawColumns, sortBasis]); // objectui#12620 — a grouped table keeps every row in its own band. The // sorted rows are partitioned back into their groups, in group order; the @@ -2656,6 +2775,8 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { const inFlight = inFlightRef.current.get(rowKey); setPendingChanges((prev) => stageCellChange(prev, rowKey, row, columnKey, valueToStage, inFlight)); clearCellError(rowKey, columnKey); + // objectstack#35685 — the select-first model saves the commit at once. + requestAutosave(rowKey); // Call the legacy onCellChange callback if provided if (schema.onCellChange) { @@ -2709,7 +2830,11 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { const active = editingCellRef.current; const snap = editRevertRef.current; editRevertRef.current = null; - if (revert && active && snap) { + if (revert && active && selectFirst) { + // objectstack#35685 — Esc goes back to the stored value, a kept + // (refused) edit of this cell included. + discardCellChange(active.rowKey, active.columnKey); + } else if (revert && active && snap) { const { rowKey, columnKey } = active; setPendingChanges((prev) => { const cur = prev.get(rowKey); @@ -2956,6 +3081,148 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { setSaveError(null); }; + // ── Per-cell autosave (objectstack#35685) ──────────────────────────────── + const setCellSaveState = (rowKey: PendingRowKey, columnKeys: readonly string[], state: 'saving' | 'saved' | null) => { + setCellSaveStates((prev) => { + const next = new Map(prev); + const cells = { ...(prev.get(rowKey) ?? {}) }; + for (const key of columnKeys) { + if (state) cells[key] = state; + else delete cells[key]; + } + if (Object.keys(cells).length > 0) next.set(rowKey, cells); + else next.delete(rowKey); + return next; + }); + }; + /** A just-saved cell says so for a moment, then goes quiet. */ + const flashSaved = (rowKey: PendingRowKey, columnKeys: readonly string[]) => { + setCellSaveState(rowKey, columnKeys, 'saved'); + const timer = setTimeout(() => { + savedTimersRef.current.delete(timer); + setCellSaveStates((prev) => { + const cells = prev.get(rowKey); + if (!cells || !columnKeys.some((key) => cells[key] === 'saved')) return prev; + const rest = { ...cells }; + for (const key of columnKeys) if (rest[key] === 'saved') delete rest[key]; + const next = new Map(prev); + if (Object.keys(rest).length > 0) next.set(rowKey, rest); + else next.delete(rowKey); + return next; + }); + }, 1500); + savedTimersRef.current.add(timer); + }; + + /** Ask for a record's autosave; it runs once the render holding the commit lands. */ + const requestAutosave = (rowKey: PendingRowKey) => { + if (!selectFirst) return; + autosaveDueRef.current.add(rowKey); + setAutosaveTick((tick) => tick + 1); + }; + + /** + * Send one record's pending edits as one update. Every edit the record still + * holds goes, so a cell a refusal kept travels with the next commit on its + * row. A commit made while the record's save runs waits for it, and then + * sends what is left. + */ + const autosaveRow = async (rowKey: PendingRowKey, pending: PendingRow | undefined) => { + if (!pending || Object.keys(pending.changes).length === 0 || !schema.onRowSave) return; + if (runningSavesRef.current.has(rowKey)) { + saveAgainRef.current.add(rowKey); + return; + } + runningSavesRef.current.add(rowKey); + const sentChanges = pending.changes; + const sentKeys = Object.keys(sentChanges); + const sent = new Map([[rowKey, sentChanges]]); + const row = heldRowOf(rowKey) ?? pending.row; + // The row sorts as it does now until the next load, whatever the save writes. + setSortBasis((prev) => (prev.has(rowKey) ? prev : new Map(prev).set(rowKey, row))); + setCellSaveState(rowKey, sentKeys, 'saving'); + try { + await whileInFlight(sent, async () => { + await schema.onRowSave?.(rowIndexOf(rowKey), sentChanges, row); + }); + setPendingChanges((prev) => removeSentEdits(prev, sent)); + setRowCellErrors(rowKey, null); + setRowRefusals((prev) => { + if (!prev.has(rowKey)) return prev; + const next = new Map(prev); + next.delete(rowKey); + return next; + }); + setFailureNotice((prev) => (prev?.rowKey === rowKey ? null : prev)); + flashSaved(rowKey, sentKeys); + } catch (error) { + // The edits stay pending and the cells keep what was typed. Each cell the + // refusal names shows its own reason; a cell it does not name shows them + // all. A named field the list cannot edit sends the reader to the record. + console.error('Failed to save row:', error); + setCellSaveState(rowKey, sentKeys, null); + const lines = saveRefusalLines([error]); + const named = refusedCellsOf(error) ?? {}; + const editableHere = (field: string) => { + const col = columns.find((c) => c.accessorKey === field); + return !!col && col.editable !== false && !col.masked; + }; + const cells: Record = {}; + for (const [field, message] of Object.entries(named)) { + if (columns.some((c) => c.accessorKey === field)) cells[field] = message; + } + for (const key of sentKeys) if (!(key in cells)) cells[key] = lines.join(' '); + setRowCellErrors(rowKey, cells); + setRowRefusals((prev) => new Map(prev).set(rowKey, { + lines, + needsRecord: Object.keys(named).some((field) => !editableHere(field)), + })); + setFailureNotice({ rowKey, columnKey: sentKeys[0] }); + } finally { + runningSavesRef.current.delete(rowKey); + if (saveAgainRef.current.delete(rowKey)) requestAutosave(rowKey); + } + }; + + useEffect(() => { + if (!selectFirst || autosaveDueRef.current.size === 0) return; + const due = Array.from(autosaveDueRef.current); + autosaveDueRef.current.clear(); + for (const rowKey of due) void autosaveRow(rowKey, pendingChanges.get(rowKey)); + }, [autosaveTick, pendingChanges]); + + /** + * Esc on a cell whose edit is kept: the edit is dropped and the cell shows + * the stored value again. The rest of the row's kept edits stay. + */ + const discardCellChange = (rowKey: PendingRowKey, columnKey: string) => { + setPendingChanges((prev) => { + const cur = prev.get(rowKey); + if (!cur || !(columnKey in cur.changes)) return prev; + const next = new Map(prev); + const rest = { ...cur.changes }; + delete rest[columnKey]; + if (Object.keys(rest).length > 0) next.set(rowKey, { row: cur.row, changes: rest }); + else next.delete(rowKey); + return next; + }); + const kept = pendingChanges.get(rowKey)?.changes; + if (!kept || Object.keys(kept).every((key) => key === columnKey)) { + // Nothing of the row is kept any more, so nothing of its refusal stands. + setRowCellErrors(rowKey, null); + setRowRefusals((prev) => { + if (!prev.has(rowKey)) return prev; + const next = new Map(prev); + next.delete(rowKey); + return next; + }); + setFailureNotice((prev) => (prev?.rowKey === rowKey ? null : prev)); + } else { + clearCellError(rowKey, columnKey); + setFailureNotice((prev) => (prev?.rowKey === rowKey && prev.columnKey === columnKey ? null : prev)); + } + }; + // ── Keyboard navigation (objectui#11068) ────────────────────────────────── // // Arrow-key cell navigation on the WAI-ARIA grid pattern, behind @@ -3175,6 +3442,9 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { const col = columns[colIndex]; if (row === undefined || col === undefined) return; setCellNotice(null); + // objectstack#35685 — a selected cell whose edit a refusal kept says why. + const rowKey = pendingRowKeyOf(row); + setFailureNotice(cellErrors.get(rowKey)?.[col.accessorKey] !== undefined ? { rowKey, columnKey: col.accessorKey } : null); rove(rowIndex, colIndex); if (selectedPos?.rowIndex === rowIndex && selectedPos.colIndex === colIndex) { // Selected already, so no render follows to move the focus: a click on @@ -3220,6 +3490,7 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { setPendingChanges((prev) => stageCellChange(prev, rowKey, held, columnKey, value, inFlight)); clearCellError(rowKey, columnKey); schema.onCellChange?.(rowIndexOf(rowKey), columnKey, value, held); + requestAutosave(rowKey); }; /** What a cell does with a value it is handed rather than edited: a toggle or a paste. */ @@ -3281,8 +3552,13 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { if (row === undefined || col === undefined) return; const bare = !e.ctrlKey && !e.metaKey && !e.altKey; if (e.key === 'Escape') { + const rowKey = pendingRowKeyOf(row); if (cellNotice) setCellNotice(null); - else if (selectedPos) { + else if (pendingChanges.get(rowKey)?.changes && col.accessorKey in pendingChanges.get(rowKey)!.changes && !runningSavesRef.current.has(rowKey)) { + // objectstack#35685 — a kept (refused) edit: Esc drops it. + e.preventDefault(); + discardCellChange(rowKey, col.accessorKey); + } else if (selectedPos) { e.preventDefault(); focusGridCell(rowIndex, colIndex); setSelectedCell(null); @@ -3316,10 +3592,11 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { if ((e.key === 'Enter' || e.key === 'F2') && bare && !e.shiftKey) { e.preventDefault(); attemptEdit(rowIndex, colIndex); - } else if (e.key === ' ' && bare) { + } else if (e.key === ' ' && bare && togglesCell(row, col)) { + // A two-state cell flips; on any other cell Space is typed like any key + // and opens the editor (the catcher reads it). e.preventDefault(); - if (togglesCell(row, col)) toggleCell(rowIndex, colIndex); - else schema.onRowClick?.(row, e); + toggleCell(rowIndex, colIndex); } else if ((e.key === 'Backspace' || e.key === 'Delete') && bare) { // An empty editor; nothing is written until it commits. e.preventDefault(); @@ -3599,10 +3876,10 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { (Array.isArray(schema.rowActionDefs) && schema.rowActionDefs.length > 0 && schema.onRowActionDef) ); const rowActionsColumnIsEditOnly = editable && !!(schema.onRowSave || schema.onBatchSave) && !rowMenuDeclared; - // objectstack#35684, until objectstack#35685 retires it: in the select-first - // model the edit-only column shows only while a row has pending changes, so a - // list at rest ends on its last data column (objectstack#35554). - const drawRowActionsColumn = rowActions && !(selectFirst && rowActionsColumnIsEditOnly && !hasPendingChanges); + // objectstack#35685 — the select-first model saves each cell as it is + // committed, so it never draws the edit-only column: a list ends on its last + // data column (objectstack#35554). + const drawRowActionsColumn = rowActions && !(selectFirst && rowActionsColumnIsEditOnly); /** * objectstack#28434 — the items ONE row's context menu opens with, or `null` @@ -3727,7 +4004,8 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => {
- {hasPendingChanges && ( + {/* objectstack#35685 — the select-first model saves each cell, so it draws no save bar. */} + {hasPendingChanges && !selectFirst && ( <>
{t('table.modified', { count: pendingChanges.size })} @@ -3775,7 +4053,7 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { {/* The last save's refusal, on a line of its own and said whole — one line per reason (objectstack-ai/objectstack#27520). The cells it names are marked in the table below. */} - {hasPendingChanges && saveError && ( + {hasPendingChanges && !selectFirst && saveError && (
{ "data-[active-record]:bg-primary/10 data-[active-record]:[--os-row-tint:color-mix(in_oklab,var(--color-primary)_10%,transparent)]", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset", !selectFirst && schema.onRowClick && "cursor-pointer", - rowHasChanges && !rowErrored && "bg-amber-50 dark:bg-amber-950/20", - rowErrored && "bg-destructive/10 dark:bg-destructive/15 ring-1 ring-inset ring-destructive/40", + // objectstack#35685 — the select-first model marks the cell, never the row. + !selectFirst && rowHasChanges && !rowErrored && "bg-amber-50 dark:bg-amber-950/20", + !selectFirst && rowErrored && "bg-destructive/10 dark:bg-destructive/15 ring-1 ring-inset ring-destructive/40", rowClassName && rowClassName(row, rowIndex) )} style={rowStyle ? rowStyle(row, rowIndex) : undefined} @@ -4457,7 +4736,7 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { // A ring that moves no layout (outline, not border). isSelectedCell && "outline-2 -outline-offset-2 outline-primary", selectFirst && !isFrozen && "relative", - hasPendingChange && "font-semibold text-amber-700 dark:text-amber-400", + !selectFirst && hasPendingChange && "font-semibold text-amber-700 dark:text-amber-400", cellError !== undefined && "ring-2 ring-inset ring-destructive", isFrozen && ['sticky z-10 bg-background', STICKY_ROW_TINT], isFrozen && colIndex === frozenColumns - 1 && scrolledX && FROZEN_EDGE_SHADOW, @@ -4582,6 +4861,40 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { {cellNotice?.rowIndex === rowIndex && cellNotice.colIndex === colIndex && ( setCellNotice(null)} /> )} + {selectFirst && !isEditing && cellError !== undefined + && failureNotice?.rowKey === rowKey && failureNotice.columnKey === col.accessorKey + && !(cellNotice?.rowIndex === rowIndex && cellNotice.colIndex === colIndex) && (() => { + // objectstack#35685 — the refusal, on the cell it kept. + const refusal = rowRefusals.get(rowKey); + const lines = refusal && cellError === refusal.lines.join(' ') ? refusal.lines : [cellError]; + return ( + schema.onRowClick?.(row, e) : undefined} + onDismiss={() => setFailureNotice(null)} + /> + ); + })()} + {selectFirst && !isEditing && cellSaveStates.get(rowKey)?.[col.accessorKey] && (() => { + // objectstack#35685 — the cell's own save state, drawn over its + // edge so nothing moves. + const state = cellSaveStates.get(rowKey)?.[col.accessorKey]; + return ( + + {state === 'saving' + ? + ); + })()} {isEditing ? ( (() => { // Type-aware inline editor. `col.type` is forwarded @@ -4829,7 +5142,7 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => { {drawRowActionsColumn && (
- {rowHasChanges && (schema.onRowSave || schema.onBatchSave) ? ( + {rowHasChanges && !selectFirst && (schema.onRowSave || schema.onBatchSave) ? ( <>