diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue index 567742a5e8..96316fa651 100644 --- a/apps/desktop/src/components/grid/DataGrid.vue +++ b/apps/desktop/src/components/grid/DataGrid.vue @@ -310,8 +310,10 @@ interface DataGridProps { } const props = withDefaults(defineProps(), { - // Vue casts absent Boolean props to false unless the default is explicitly - // undefined; omitted row-action limits must keep normal table-data editing. + // Vue casts absent Boolean props to false unless a default is explicit. + // Regular grids have exact totals; document stores opt into lower-bound totals. + totalRowCountIsExact: true, + // Omitted row-action limits must keep normal table-data editing. allowInsertRows: undefined, allowDeleteRows: undefined, }); diff --git a/apps/desktop/src/components/grid/__tests__/DataGridTotalRowCount.spec.ts b/apps/desktop/src/components/grid/__tests__/DataGridTotalRowCount.spec.ts new file mode 100644 index 0000000000..a0cdb42b3f --- /dev/null +++ b/apps/desktop/src/components/grid/__tests__/DataGridTotalRowCount.spec.ts @@ -0,0 +1,12 @@ +import { describe, expect, it } from "vitest"; +import DataGrid from "../DataGrid.vue"; + +type VuePropDefinition = { default?: unknown }; +type VueComponentWithProps = { props?: Record }; + +describe("DataGrid total row count exactness", () => { + it("treats totals as exact unless a caller explicitly marks them as a lower bound", () => { + const component = DataGrid as unknown as VueComponentWithProps; + expect(component.props?.totalRowCountIsExact?.default).toBe(true); + }); +});