Skip to main content

Review-changes sheet

Prop showChangesSheet — adapter chrome, default follows mode: 'batch'.

Guide

When to use it

In batch editing, give users a review-before-save panel: every pending edit listed, revertable, with the final Save confirmation.

How it works

showChangesSheet adds an {n} unsaved chip and a Review & save button that opens a side sheet listing each change (row · column · old → new) with per-change and per-row revert. Confirming runs commitAll() → one onSave. It follows enableEditing with mode: 'batch' and replaces the plain save bar while on.

Gotchas

  • Meant for batch mode; in row / cell mode use showSaveBar instead.
  • A failed save keeps the drafts and shows the error in the sheet — users don't lose work.
  • changesRowLabel sets how each row is named in the list (e.g. by a human key, not the row id).

Live example

Batch editing — every edit is a draft; review and save in one call

Example source
import React from 'react'
import { BstTableMui } from '@bloomskill/table-mui'
import type { BstTableColumn } from '@bloomskill/table-engine'
import '@bloomskill/table-engine/styles.css'
type Row = { id: string; name: string; team: string; role: string; score: number }
const seed: Row[] = [
{ id: '1', name: 'Ada Lovelace', team: 'Platform', role: 'Engineer', score: 92 },
{ id: '2', name: 'Alan Turing', team: 'Research', role: 'Scientist', score: 88 },
{ id: '3', name: 'Grace Hopper', team: 'Platform', role: 'Engineer', score: 95 },
{ id: '4', name: 'Katherine J.', team: 'Research', role: 'Analyst', score: 90 },
{ id: '5', name: 'Edsger Dijkstra', team: 'Platform', role: 'Architect', score: 84 },
]
const columns: BstTableColumn<Row>[] = [
{ id: 'name', accessorKey: 'name', header: 'Name' },
{ id: 'team', accessorKey: 'team', header: 'Team' },
{ id: 'role', accessorKey: 'role', header: 'Role' },
{ id: 'score', accessorKey: 'score', header: 'Score', sortFn: 'basic' },
]
const editable: BstTableColumn<Row>[] = columns.map((c) =>
c.id === 'name' || c.id === 'score'
? { ...c, meta: { type: c.id === 'score' ? 'number' : 'text', editable: true } }
: c)
export default function App() {
const [rows, setRows] = React.useState(seed)
return (
<BstTableMui data={rows} columns={editable} getRowId={(r) => r.id}
enableEditing={{ mode: 'batch' }} showChangesSheet onDataChange={setRows}
onSave={({ rows }) => alert(rows.length + ' row(s) saved')} />
)
}
Loading live example…

Overview

Layershow* (chrome, resolved in the adapter)
Typeboolean
Defaultfollows mode: 'batch'
Maps toadapter "{n} unsaved" chip + Review & save → right sheet (MUI Drawer / shadcn slide-over) listing each edit (row · column · old → new) with per-change/per-row revert + the final Save confirmation (runtime.commitAll() → one onSave); failed save keeps drafts + shows the error. Replaces the plain save bar while on. Like showSaveBar, not a settings-sheet entry
Status✅ done
Sincev0.30.0

Enable it

<BstTableMui
data={rows}
columns={columns}
enableEditing // chrome is a no-op without its behaviour flag
showChangesSheet
/>

Swap BstTableMui for BstTableShadcn (and the CSS import) for the shadcn skin — same props.

Options

OptionNotes
changesRowLabelRelated prop for this feature.

Behavior & interactions

  • Requires enableEditing to be on — this flag is a no-op otherwise.
  • Replaces the plain save bar; follows enableEditing.mode: "batch".