diff --git a/.changeset/39475-list-view-export-on-by-default.md b/.changeset/39475-list-view-export-on-by-default.md
index 9f684460494..75b340f119e 100644
--- a/.changeset/39475-list-view-export-on-by-default.md
+++ b/.changeset/39475-list-view-export-on-by-default.md
@@ -14,6 +14,6 @@ Who may export is unchanged. The permission set's `allowExport` grant reaches th
To keep a view without export, declare `exportOptions: { formats: [] }` on it. To take export off every view of an object, set the object's `userActions.exportCsv: false`.
-An `object-grid` page component is not changed: it still offers export only when it declares `exportOptions`.
+An `object-grid` page component that names an object reads an absent `exportOptions` the same way: it offers `csv` and `json` by default, and `xlsx` only where it lists it in `formats`. Declare `exportOptions: { formats: [] }` on it to turn its export off.
The upgrade guide carries the change as the semantic entry `list-view-export-on-by-default`.
diff --git a/.changeset/39475-object-grid-export-on-by-default.md b/.changeset/39475-object-grid-export-on-by-default.md
new file mode 100644
index 00000000000..c8f3b2b17f9
--- /dev/null
+++ b/.changeset/39475-object-grid-export-on-by-default.md
@@ -0,0 +1,18 @@
+---
+'@object-ui/plugin-grid': minor
+'@object-ui/plugin-list': patch
+'@object-ui/plugin-detail': patch
+'@object-ui/plugin-designer': patch
+'@object-ui/console': patch
+---
+
+feat(plugin-grid): an object table that declares no `exportOptions` offers export
+
+Clause-②: no
+Metadata-protocol: semantic
+
+An `object-grid` used to draw its Export menu only when it declared `exportOptions`. A grid over an object now reads an absent `exportOptions` the way a list view does: as the empty block, offering the default formats, `csv` and `json`. `xlsx` is offered where the grid lists it in `formats` and the server stream delivers it, as before. A declared block behaves as before, and a grid that names no object still offers export only when it declares the block.
+
+Who may export is unchanged. The permission set's `allowExport` grant reaches the grid through the object's effective `export` operation: a user whose permission sets do not grant it sees no Export entry, and the server refuses the export request. To keep a table without export, declare `exportOptions: { formats: [] }` on it; to take export off every surface of an object, set the object's `userActions.exportCsv: false`.
+
+The platform's own screens that compose a grid declare `exportOptions: { formats: [] }` on the grid they build, so none gains an Export entry: the list page's grid (whose list toolbar keeps the one export door), the enlarged related list tab, the Studio metadata lists, the object manager, the field designer and the console's row-action dev page.
diff --git a/content/docs/ui/components/plugins.mdx b/content/docs/ui/components/plugins.mdx
index 0e0d135f8cd..efefceeeaa7 100644
--- a/content/docs/ui/components/plugins.mdx
+++ b/content/docs/ui/components/plugins.mdx
@@ -247,7 +247,7 @@ Namespace `plugin-grid`.
| `keyboardNavigation` | `boolean` | | Arrow-key cell navigation on the WAI-ARIA grid pattern: the grid's data cells take one place in the Tab order instead of one each (a link or button inside a cell keeps its own), and the arrow keys move focus between them (Home / End to the ends of the row, Ctrl+Home / Ctrl+End to the ends of the page). Enter still opens an editable cell, and an edit ended with Enter or Escape returns focus to its cell. Always on when the grid renders editable, because that grid selects a cell first and moves the selection with these keys; a read-only grid keeps every cell its own Tab stop unless this is `true`. |
| `navigation` | `object` | | What a row click does, `{ mode: "drawer" \| "page" \| "new_window" \| "none", … }`; a block written without `mode` opens the drawer. |
| `operations` | `object` | | Toggles for the built-in affordances, `{ create, update, delete, export }`, e.g. `{ delete: false }`. A declared block replaces the default, so an `update` / `delete` it does not name is withheld. |
-| `exportOptions` | `object` | | Export config, `{ formats, maxRecords, includeHeaders, fileNamePrefix, streaming }`. `streaming` (default true) picks server-side streaming vs browser-side assembly for the export — a behaviour fork, not decoration; set it to `false` to force browser-side assembly. Needs `operations.export` to be reachable from the toolbar. |
+| `exportOptions` | `object` | | Export config, `{ formats, maxRecords, includeHeaders, fileNamePrefix, streaming }`. `streaming` (default true) picks server-side streaming vs browser-side assembly for the export — a behaviour fork, not decoration; set it to `false` to force browser-side assembly. On a grid that names an object, an absent block offers the default formats, `csv` and `json` (`xlsx` only where `formats` lists it); `formats: []` turns the export off, and a grid that names no object offers export only when it declares the block. Who may export is still the object's export verdict (the `allowExport` grant, through the effective `export` operation, and `userActions.exportCsv`). `operations.export: false` withholds every export entry; `operations.export: true` additionally draws the table's own CSV button. |
| `dataSource` | `object` (`object` data binding) | | Per-element data binding: \{ object, view, filter, sort, limit \}. Overrides the page-level object context for this block; `view` names a saved view of `object`, and `filter` is ANDed with the view’s own rather than replacing it. |
## `object-kanban` [#object-kanban]
diff --git a/scripts/sdui-manifest.record.json b/scripts/sdui-manifest.record.json
index 1507e4cfe2f..34dae08414a 100644
--- a/scripts/sdui-manifest.record.json
+++ b/scripts/sdui-manifest.record.json
@@ -14,7 +14,7 @@
"source": "built-tree",
"generator": "scripts/gen-sdui-manifest-node.mjs",
"generatedAt": "2026-12-04",
- "sha256": "2763ba89195a8b4b3ef121df0f853449645595d77ee9c350490c0bbf0ba07e7e",
+ "sha256": "5cdb212da496eef4cfc65bf4751871edbd80519986abfd039c759c77366a80e8",
"components": 106,
"inTree": {
"modulesRoot": "ui/apps/console",
diff --git a/sdui.manifest.json b/sdui.manifest.json
index 44f30ace476..1bed055ac2f 100644
--- a/sdui.manifest.json
+++ b/sdui.manifest.json
@@ -161,7 +161,7 @@
{
"name": "exportOptions",
"type": "object",
- "description": "Export config, `{ formats, maxRecords, includeHeaders, fileNamePrefix, streaming }`. `streaming` (default true) picks server-side streaming vs browser-side assembly for the export — a behaviour fork, not decoration; set it to `false` to force browser-side assembly. Needs `operations.export` to be reachable from the toolbar."
+ "description": "Export config, `{ formats, maxRecords, includeHeaders, fileNamePrefix, streaming }`. `streaming` (default true) picks server-side streaming vs browser-side assembly for the export — a behaviour fork, not decoration; set it to `false` to force browser-side assembly. On a grid that names an object, an absent block offers the default formats, `csv` and `json` (`xlsx` only where `formats` lists it); `formats: []` turns the export off, and a grid that names no object offers export only when it declares the block. Who may export is still the object's export verdict (the `allowExport` grant, through the effective `export` operation, and `userActions.exportCsv`). `operations.export: false` withholds every export entry; `operations.export: true` additionally draws the table's own CSV button."
},
{
"name": "dataSource",
diff --git a/ui/apps/console/src/dev/DevRowActions.exportOff-39475.test.tsx b/ui/apps/console/src/dev/DevRowActions.exportOff-39475.test.tsx
new file mode 100644
index 00000000000..908d629d07e
--- /dev/null
+++ b/ui/apps/console/src/dev/DevRowActions.exportOff-39475.test.tsx
@@ -0,0 +1,21 @@
+/**
+ * objectstack#39475 — a grid over an object offers Export unasked. The dev
+ * row-action page composes three object grids to pin row actions only, so the
+ * node it builds declares `exportOptions: { formats: [] }` and none of them
+ * draws an Export entry. The rows are read first, so the absence is of drawn
+ * grids.
+ */
+import { describe, it, expect } from 'vitest';
+import { render, screen } from '@testing-library/react';
+import '@testing-library/jest-dom';
+
+import { DevRowActions } from './DevRowActions';
+
+describe('DevRowActions.exportOff-39475', () => {
+ it('none of the dev page grids draws an Export entry', () => {
+ render();
+ expect(screen.getByTestId('grid-default')).toHaveTextContent('hotcrm-fix-verify');
+ expect(screen.getByTestId('grid-wide')).toHaveTextContent('hotcrm-fix-verify');
+ expect(screen.queryAllByRole('button', { name: /^export$/i })).toHaveLength(0);
+ });
+});
diff --git a/ui/apps/console/src/dev/DevRowActions.tsx b/ui/apps/console/src/dev/DevRowActions.tsx
index da635877304..d87901139f5 100644
--- a/ui/apps/console/src/dev/DevRowActions.tsx
+++ b/ui/apps/console/src/dev/DevRowActions.tsx
@@ -49,6 +49,9 @@ function EnvGrid({ maxInlineRowActions }: { maxInlineRowActions?: number }) {
columns: COLUMNS,
data: { provider: 'value', items: ENV_ROWS },
rowActionDefs: ROW_ACTION_DEFS,
+ // objectstack#39475 — a grid over an object offers export unasked; this
+ // dev page pins row actions only, so it declares none.
+ exportOptions: { formats: [] },
...(maxInlineRowActions != null ? { maxInlineRowActions } : {}),
};
return (
diff --git a/ui/packages/app-shell/src/views/metadata-admin/metadataListGrid.test.ts b/ui/packages/app-shell/src/views/metadata-admin/metadataListGrid.test.ts
index 971e473bdfd..ca99271096d 100644
--- a/ui/packages/app-shell/src/views/metadata-admin/metadataListGrid.test.ts
+++ b/ui/packages/app-shell/src/views/metadata-admin/metadataListGrid.test.ts
@@ -82,3 +82,17 @@ describe('metadataListGrid (objectstack#36897)', () => {
expect(pageWindow([], 3, 50)).toEqual({ page: 1, rows: [] });
});
});
+
+/**
+ * objectstack#39475 — a grid over an object offers Export unasked; a Studio
+ * metadata list is a platform screen, so the node it builds declares no
+ * export format and the grid draws no Export (`plugin-grid`'s
+ * `ObjectGrid.exportDefaultOn-39475` pins what `formats: []` draws).
+ */
+describe('metadataListGrid.exportOff-39475', () => {
+ it('the metadata list grid node declares exportOptions with no formats', () => {
+ const g = metadataListGridSchema('flow', COLUMNS, sortKeyOf, 50) as any;
+ expect(g.objectName).toBe('metadata_list_flow');
+ expect(g.exportOptions).toEqual({ formats: [] });
+ });
+});
diff --git a/ui/packages/app-shell/src/views/metadata-admin/metadataListGrid.ts b/ui/packages/app-shell/src/views/metadata-admin/metadataListGrid.ts
index d8b92c2ea2b..328ccedfb85 100644
--- a/ui/packages/app-shell/src/views/metadata-admin/metadataListGrid.ts
+++ b/ui/packages/app-shell/src/views/metadata-admin/metadataListGrid.ts
@@ -127,6 +127,9 @@ export function metadataListGridSchema(
resizable: false,
reorderableColumns: false,
pagination: { pageSize },
+ // objectstack#39475 — a grid over an object offers export unasked; a
+ // metadata list is a platform screen, so it declares none.
+ exportOptions: { formats: [] },
};
}
diff --git a/ui/packages/plugin-designer/src/FieldDesigner.tsx b/ui/packages/plugin-designer/src/FieldDesigner.tsx
index 2b8b36c34c7..c21f6c38843 100644
--- a/ui/packages/plugin-designer/src/FieldDesigner.tsx
+++ b/ui/packages/plugin-designer/src/FieldDesigner.tsx
@@ -311,6 +311,9 @@ export function FieldDesigner({
searchableFields: ['name', 'label', 'description'],
showSearch: true,
operations: readOnly ? undefined : { create: true, update: true, delete: true },
+ // objectstack#39475 — a grid over an object offers export unasked; this
+ // designer table is a platform screen, so it declares none.
+ exportOptions: { formats: [] },
}), [gridColumns, readOnly]);
// Handlers
diff --git a/ui/packages/plugin-designer/src/ObjectManager.tsx b/ui/packages/plugin-designer/src/ObjectManager.tsx
index 7d642976689..b97eb19ece7 100644
--- a/ui/packages/plugin-designer/src/ObjectManager.tsx
+++ b/ui/packages/plugin-designer/src/ObjectManager.tsx
@@ -117,6 +117,9 @@ export function ObjectManager({
searchableFields: ['name', 'label', 'description'],
showSearch: true,
operations: readOnly ? undefined : { create: true, update: true, delete: true },
+ // objectstack#39475 — a grid over an object offers export unasked; this
+ // designer table is a platform screen, so it declares none.
+ exportOptions: { formats: [] },
}), [gridColumns, readOnly]);
// Handlers
diff --git a/ui/packages/plugin-designer/src/__tests__/FieldDesigner.systemFieldDelete-8674.test.tsx b/ui/packages/plugin-designer/src/__tests__/FieldDesigner.systemFieldDelete-8674.test.tsx
index 2db3d95330d..4c39931dc25 100644
--- a/ui/packages/plugin-designer/src/__tests__/FieldDesigner.systemFieldDelete-8674.test.tsx
+++ b/ui/packages/plugin-designer/src/__tests__/FieldDesigner.systemFieldDelete-8674.test.tsx
@@ -149,3 +149,18 @@ describe('objectui#8674 · the system field draws no delete action', () => {
expect(await rowKebab(CUSTOM.name)).toEqual({ edit: false, delete: false, trigger: false });
});
});
+
+/**
+ * objectstack#39475 — a grid over an object offers Export unasked; the field
+ * designer is a platform screen, so its grid node declares
+ * `exportOptions: { formats: [] }` and the real grid draws no Export. The rows
+ * are read first, so the absence is of a drawn grid.
+ */
+describe('FieldDesigner.gridExportOff-39475', () => {
+ it('the field designer grid draws no Export entry', async () => {
+ renderDesigner();
+ await settle();
+ expect(screen.getByText(CUSTOM.name)).toBeInTheDocument();
+ expect(screen.queryByRole('button', { name: /^export$/i })).toBeNull();
+ });
+});
diff --git a/ui/packages/plugin-designer/src/__tests__/ObjectManager.systemObjectDelete-9219.test.tsx b/ui/packages/plugin-designer/src/__tests__/ObjectManager.systemObjectDelete-9219.test.tsx
index 0cf3dbf7acc..cf8591e1dcf 100644
--- a/ui/packages/plugin-designer/src/__tests__/ObjectManager.systemObjectDelete-9219.test.tsx
+++ b/ui/packages/plugin-designer/src/__tests__/ObjectManager.systemObjectDelete-9219.test.tsx
@@ -181,3 +181,17 @@ describe('objectui#9219 · the system object draws no delete action', () => {
expect(await rowKebab(CUSTOM.name)).toEqual({ edit: false, delete: false, trigger: false });
});
});
+
+/**
+ * objectstack#39475 — a grid over an object offers Export unasked; the object
+ * manager is a platform screen, so its grid node declares
+ * `exportOptions: { formats: [] }` and the real grid draws no Export. The rows
+ * are read first, so the absence is of a drawn grid.
+ */
+describe('ObjectManager.gridExportOff-39475', () => {
+ it('the object manager grid draws no Export entry', async () => {
+ renderManager();
+ await waitFor(() => expect(screen.getByText(CUSTOM.name)).toBeInTheDocument());
+ expect(screen.queryByRole('button', { name: /^export$/i })).toBeNull();
+ });
+});
diff --git a/ui/packages/plugin-detail/src/RelatedList.tsx b/ui/packages/plugin-detail/src/RelatedList.tsx
index 01f15f47125..6159050c932 100644
--- a/ui/packages/plugin-detail/src/RelatedList.tsx
+++ b/ui/packages/plugin-detail/src/RelatedList.tsx
@@ -3843,6 +3843,10 @@ export const RelatedList: React.FC = ({
),
showSearch: false,
showPagination: false,
+ // objectstack#39475 — a grid over an object offers export unasked;
+ // this list's own toolbar keeps the related list's export door, so
+ // the grid draws none.
+ exportOptions: { formats: [] },
// objectstack#35892 — cell editing as on the list page
// (objectstack#35683): where the reader may edit the child object.
...(tabList ? { editable: tabInlineEdit } : {}),
diff --git a/ui/packages/plugin-detail/src/__tests__/RelatedList.enlargedListGrid-28865.test.tsx b/ui/packages/plugin-detail/src/__tests__/RelatedList.enlargedListGrid-28865.test.tsx
index 98848f5bf0b..423511bd1ff 100644
--- a/ui/packages/plugin-detail/src/__tests__/RelatedList.enlargedListGrid-28865.test.tsx
+++ b/ui/packages/plugin-detail/src/__tests__/RelatedList.enlargedListGrid-28865.test.tsx
@@ -425,3 +425,19 @@ describe('the related table leads with the record name when no columns are decla
expect(h.schema.columns).toEqual(['code', 'amount']);
});
});
+
+/**
+ * objectstack#39475 — a grid over an object offers Export unasked; the
+ * enlarged related tab keeps its export door in its own toolbar, so the grid
+ * node it builds declares no export format and the grid draws no second
+ * Export (`plugin-grid`'s `ObjectGrid.exportDefaultOn-39475` pins what
+ * `formats: []` draws).
+ */
+describe('RelatedList.enlargedGridExportOff-39475', () => {
+ it('the enlarged tab hands object-grid exportOptions with no formats', async () => {
+ renderList();
+ await waitFor(() => expect(h.schema?.type).toBe('object-grid'));
+ expect(h.schema.objectName).toBe('opportunity');
+ expect(h.schema.exportOptions).toEqual({ formats: [] });
+ });
+});
diff --git a/ui/packages/plugin-grid/src/ObjectGrid.tsx b/ui/packages/plugin-grid/src/ObjectGrid.tsx
index 0b1b3d03336..f252519a5b1 100644
--- a/ui/packages/plugin-grid/src/ObjectGrid.tsx
+++ b/ui/packages/plugin-grid/src/ObjectGrid.tsx
@@ -22,7 +22,7 @@
*/
import React, { useEffect, useState, useCallback, useMemo } from 'react';
-import type { ObjectGridSchema, DataSource, ViewData, TableSortItem, DataTableSchema, ListViewExportFormat, RecordNavigateAction } from '@object-ui/types';
+import type { ObjectGridSchema, DataSource, ViewData, TableSortItem, DataTableSchema, ListViewExportFormat, ListViewExportOptions, RecordNavigateAction } from '@object-ui/types';
import { isSystemManagedField, detectStatusField } from '@object-ui/types';
import { SchemaRenderer, isPermissionError, useDataScope, useNavigationOverlay, useAction, useSafeFieldLabel, usePredicateScope, useCapabilityGate, useRelatedRecordActions, notifyDataChanged, useMetadata, claimAnswerWarnings, toastRecordSave, useOwnWrites, createOwnWrites } from '@object-ui/react';
// objectui#8920 — the grid reaches a cell renderer through THIS module and
@@ -942,6 +942,23 @@ function cellEditorWidthClass(type: string): string {
/** objectstack#35689 — no record waits in its group. */
const NO_HELD_RECORDS: ReadonlySet = new Set();
+/**
+ * The export block a grid over an object that declares none is read as
+ * (objectstack#39475, the grid half of the list ruling): every member unset,
+ * so the menu offers the default formats, `csv` and `json`, and every other
+ * member keeps its own default, exactly as `plugin-list`'s list view reads an
+ * absent block. Who may export is not this block: it is the object's export
+ * verdict, `objectExportOffered`, which carries the caller's `allowExport`
+ * grant through the server's effective `export` operation.
+ *
+ * Platform screens that compose a grid for their own purposes write
+ * `exportOptions: { formats: [] }` on the node they build, so only the
+ * author-placed table gains the entry. A grid that names no object keeps the
+ * old reading: export only where the block is declared. Frozen, so no reader
+ * can write into the shared default.
+ */
+const UNDECLARED_EXPORT_OPTIONS: Readonly = Object.freeze({});
+
export const ObjectGrid: React.FC = ({
schema,
dataSource,
@@ -2185,23 +2202,33 @@ export const ObjectGrid: React.FC = ({
// runs. Such a value reaches here and is dropped by the same rule, with no
// `'pdf'`-specific branch to keep alive (objectui#4535).
// (Hoisted above the error/loading early returns to satisfy hooks rules.)
+ //
+ // [objectstack#39475] The block every export read below takes: the declared
+ // one, or — on a grid over an object that declares none — the default block
+ // (`UNDECLARED_EXPORT_OPTIONS`). A grid that names no object stays
+ // explicit-only. Platform hosts that must not offer export write
+ // `exportOptions: { formats: [] }` on the node they build.
+ // Bound WITHOUT a type annotation and read directly (no second alias):
+ // `ObjectGrid.exportOptionsKeys.test.ts` follows `const NAME =
+ // schema.exportOptions` as an alias of the block, one level deep.
+ const exportOptions = schema.exportOptions ?? (objectName ? UNDECLARED_EXPORT_OPTIONS : undefined);
const exportableFormats = useMemo(() => {
- const declared = schema.exportOptions?.formats || ['csv', 'json'];
+ const declared = exportOptions?.formats || ['csv', 'json'];
const serverAvailable = typeof dataSource?.exportDownload === 'function'
&& !!objectName
&& !hasInlineData
- && schema.exportOptions?.streaming !== false;
+ && exportOptions?.streaming !== false;
const supported = serverAvailable ? ['csv', 'xlsx', 'json'] : ['csv', 'json'];
return declared.filter((f: string) => supported.includes(f));
- }, [schema.exportOptions, dataSource, objectName, hasInlineData]);
+ }, [exportOptions, dataSource, objectName, hasInlineData]);
useEffect(() => {
- const declared = schema.exportOptions?.formats;
+ const declared = exportOptions?.formats;
if (!declared) return;
const dropped = declared.filter((f) => !exportableFormats.includes(f));
if (dropped.length > 0) {
console.warn(`[ObjectUI] ObjectGrid export: unsupported format(s) hidden from the menu: ${dropped.join(', ')}`);
}
- }, [schema.exportOptions, exportableFormats]);
+ }, [exportOptions, exportableFormats]);
const handleExport = useCallback((format: ListViewExportFormat) => {
// Object-level export permission gate. Default-allow: an explicit
@@ -2212,15 +2239,14 @@ export const ObjectGrid: React.FC = ({
// object's own verdict alone.
if (schema.operations?.export === false) return;
if (!objectExportOffered) return;
- const exportConfig = schema.exportOptions;
- const maxRecords = exportConfig?.maxRecords || 0;
- const includeHeaders = exportConfig?.includeHeaders !== false;
+ const maxRecords = exportOptions?.maxRecords || 0;
+ const includeHeaders = exportOptions?.includeHeaders !== false;
// Download filename: `<配置前缀|对象中文标签|API名>-<视图名>-<日期时间>.`,
// e.g. `合同-进行中-20260714-153045.xlsx`. The translated object label (when
// the schema has loaded) beats the raw API name; a configured
// exportOptions.fileNamePrefix beats both (and suppresses the view label).
const fileNameFor = (ext: string) => buildExportFileName(ext, {
- prefix: exportConfig?.fileNamePrefix,
+ prefix: exportOptions?.fileNamePrefix,
label: objectSchema?.label,
objectName: objectName || schema.objectName,
// `title` is the deprecated spelling of `label` and takes the same door:
@@ -2239,7 +2265,7 @@ export const ObjectGrid: React.FC = ({
&& !!objectName
&& !hasInlineData
// Honor an opt-out: schema.exportOptions.streaming === false forces client-side.
- && exportConfig?.streaming !== false;
+ && exportOptions?.streaming !== false;
if (serverEligible) {
const cols = generateColumns().filter((c) => c.accessorKey !== '_actions');
@@ -2343,7 +2369,7 @@ export const ObjectGrid: React.FC = ({
downloadFile(new Blob([JSON.stringify(unmasked, null, 2)], { type: 'application/json' }), fileNameFor('json'));
}
setShowExport(false);
- }, [data, schema.exportOptions, schema.operations?.export, objectExportOffered, schema.objectName, objectName, objectSchema, objectFields, objectTypesPending, generateColumns, dataSource, hasInlineData, schemaFilter, schemaSort, t]);
+ }, [data, exportOptions, schema.operations?.export, objectExportOffered, schema.objectName, objectName, objectSchema, objectFields, objectTypesPending, generateColumns, dataSource, hasInlineData, schemaFilter, schemaSort, t]);
// objectui#9050 step 2 — a refused filter: `schema.filter` (a render-time
// `useMemo`, which would otherwise have thrown out of render), or a
@@ -4877,13 +4903,15 @@ export const ObjectGrid: React.FC = ({
// key the save gate refuses. Pinned by
// `__tests__/gridNonAuthorKeys.test.tsx`.
const showRowHeightToggle = schema.rowHeight !== undefined && !(schema as any).hideRowHeightToggle;
- // Export is offered only when configured AND not blocked: by the view's
+ // Export is offered only when configured AND not blocked: configured is the
+ // declared block or, over an object, the default one (objectstack#39475,
+ // `exportOptions` above); blocked is by the view's
// `operations.export`, or by the object's resolved export verdict
// (`objectExportOffered`: `userActions.exportCsv` over the bucket default,
// ANDed with the server's effective API operation set, objectstack#3391 /
// objectstack#35619). Missing set → the object's own verdict alone.
const exportEnabled =
- !!schema.exportOptions &&
+ !!exportOptions &&
exportableFormats.length > 0 &&
schema.operations?.export !== false &&
objectExportOffered;
diff --git a/ui/packages/plugin-grid/src/__tests__/exportGate.test.tsx b/ui/packages/plugin-grid/src/__tests__/exportGate.test.tsx
index 2a6c0b7e9d0..5a1edb4c353 100644
--- a/ui/packages/plugin-grid/src/__tests__/exportGate.test.tsx
+++ b/ui/packages/plugin-grid/src/__tests__/exportGate.test.tsx
@@ -12,6 +12,7 @@ import React from 'react';
import { ObjectGrid } from '../ObjectGrid';
import { registerAllFields } from '@object-ui/fields';
import { ActionProvider } from '@object-ui/react';
+import { MePermissionsProvider, type MePermissionsAuthenticatedResponse } from '@object-ui/permissions';
registerAllFields();
@@ -89,3 +90,87 @@ describe('ObjectGrid export dead formats', () => {
expect(screen.queryAllByRole('button', { name: /export/i }).length).toBe(0);
});
});
+
+/**
+ * objectstack#39475 — the grid half of the list ruling (option A): a grid over
+ * an object that declares no `exportOptions` reads the absent block as the
+ * default one, as `plugin-list`'s list view does — the default formats, `csv`
+ * and `json`. The author-placed object table therefore offers Export unasked.
+ * Who may export does not move: the server folds the caller's `allowExport`
+ * grant into the object's effective `export` operation (`/me/permissions`
+ * `apiOperations`), so a caller served no `export` sees no Export entry. A
+ * platform screen that composes a grid turns it off with
+ * `exportOptions: { formats: [] }` on the node it builds; a grid that names no
+ * object stays explicit-only.
+ */
+describe('ObjectGrid.exportDefaultOn-39475', () => {
+ const OBJECT = 'test_object';
+
+ const session = (apiOperations: string[]): MePermissionsAuthenticatedResponse => ({
+ authenticated: true,
+ userId: 'u1',
+ tenantId: null,
+ hasAnyQueue: false,
+ objectsUsingQueues: [],
+ positions: ['member'],
+ permissionSets: ['member'],
+ objects: { [OBJECT]: { allowRead: true, apiOperations } as never },
+ fields: {},
+ });
+
+ /** An author-placed table: an object, inline rows, no `exportOptions`. */
+ function renderTable(opts: { schema?: Record; apiOperations?: string[] } = {}) {
+ const schema: any = {
+ type: 'object-grid',
+ objectName: OBJECT,
+ columns: [{ field: 'name', label: 'Name' }],
+ data: { provider: 'value', items: data },
+ ...opts.schema,
+ };
+ let tree = (
+
+
+
+ );
+ if (opts.apiOperations) {
+ tree = {tree};
+ }
+ return render(tree);
+ }
+
+ const exportButton = () => screen.queryByRole('button', { name: /^export$/i });
+
+ it('THE CHANGE — an object table that declares no exportOptions draws Export and offers csv and json', async () => {
+ renderTable();
+ fireEvent.click(screen.getByRole('button', { name: /^export$/i }));
+ expect(await screen.findByRole('button', { name: /export as csv/i })).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: /export as json/i })).toBeInTheDocument();
+ expect(screen.queryByRole('button', { name: /export as xlsx/i })).toBeNull();
+ });
+
+ it('THE CHANGE — a caller the server serves `export` (the `allowExport` grant) sees Export on the undeclared table', () => {
+ renderTable({ apiOperations: ['get', 'list', 'aggregate', 'search', 'export'] });
+ expect(exportButton()).toBeInTheDocument();
+ });
+
+ it('a caller the server serves no `export` (no `allowExport` grant) sees no Export on the undeclared table', () => {
+ renderTable({ apiOperations: ['get', 'list', 'aggregate', 'search'] });
+ expect(exportButton()).toBeNull();
+ });
+
+ it('a platform host that writes `exportOptions: { formats: [] }` shows no Export', () => {
+ renderTable({ schema: { exportOptions: { formats: [] } } });
+ expect(exportButton()).toBeNull();
+ });
+
+ it('a grid that names no object stays explicit-only: no block, no Export', () => {
+ renderTable({ schema: { objectName: undefined } });
+ expect(screen.getByText('Alice')).toBeInTheDocument();
+ expect(exportButton()).toBeNull();
+ });
+
+ it('CONTROL — the same object-less grid declaring the block draws Export', () => {
+ renderTable({ schema: { objectName: undefined, exportOptions: { formats: ['csv'] } } });
+ expect(exportButton()).toBeInTheDocument();
+ });
+});
diff --git a/ui/packages/plugin-grid/src/index.tsx b/ui/packages/plugin-grid/src/index.tsx
index 4a815f79055..115ff6249ca 100644
--- a/ui/packages/plugin-grid/src/index.tsx
+++ b/ui/packages/plugin-grid/src/index.tsx
@@ -372,7 +372,7 @@ const GRID_QUERY_INPUTS: ComponentInput[] = [
{ name: 'keyboardNavigation', type: 'boolean', description: 'Arrow-key cell navigation on the WAI-ARIA grid pattern: the grid\'s data cells take one place in the Tab order instead of one each (a link or button inside a cell keeps its own), and the arrow keys move focus between them (Home / End to the ends of the row, Ctrl+Home / Ctrl+End to the ends of the page). Enter still opens an editable cell, and an edit ended with Enter or Escape returns focus to its cell. Always on when the grid renders editable, because that grid selects a cell first and moves the selection with these keys; a read-only grid keeps every cell its own Tab stop unless this is `true`.' },
{ name: 'navigation', type: 'object', description: 'What a row click does, `{ mode: "drawer" | "page" | "new_window" | "none", … }`; a block written without `mode` opens the drawer.' },
{ name: 'operations', type: 'object', description: 'Toggles for the built-in affordances, `{ create, update, delete, export }`, e.g. `{ delete: false }`. A declared block replaces the default, so an `update` / `delete` it does not name is withheld.' },
- { name: 'exportOptions', type: 'object', description: 'Export config, `{ formats, maxRecords, includeHeaders, fileNamePrefix, streaming }`. `streaming` (default true) picks server-side streaming vs browser-side assembly for the export — a behaviour fork, not decoration; set it to `false` to force browser-side assembly. Needs `operations.export` to be reachable from the toolbar.' },
+ { name: 'exportOptions', type: 'object', description: 'Export config, `{ formats, maxRecords, includeHeaders, fileNamePrefix, streaming }`. `streaming` (default true) picks server-side streaming vs browser-side assembly for the export — a behaviour fork, not decoration; set it to `false` to force browser-side assembly. On a grid that names an object, an absent block offers the default formats, `csv` and `json` (`xlsx` only where `formats` lists it); `formats: []` turns the export off, and a grid that names no object offers export only when it declares the block. Who may export is still the object\'s export verdict (the `allowExport` grant, through the effective `export` operation, and `userActions.exportCsv`). `operations.export: false` withholds every export entry; `operations.export: true` additionally draws the table\'s own CSV button.' },
];
ComponentRegistry.register('object-grid', ObjectGridRenderer, {
diff --git a/ui/packages/plugin-list/src/ListView.tsx b/ui/packages/plugin-list/src/ListView.tsx
index 357577f323e..7795d1b3d69 100644
--- a/ui/packages/plugin-list/src/ListView.tsx
+++ b/ui/packages/plugin-list/src/ListView.tsx
@@ -5649,6 +5649,10 @@ export const ListView = React.forwardRef(({
// does not opt out (`inlineEditOffered`); objectstack#35684 retired
// the mode that used to gate this as well.
editable: inlineEditOffered,
+ // objectstack#39475 — a grid over an object offers export unasked;
+ // this list's own toolbar, Display panel and page bar are the one
+ // export door (`resolvedExportOptions`), so the grid draws none.
+ exportOptions: { formats: [] },
// objectstack#35702 — the resident footer row (the record count in
// its first cell, so the list draws no count bar of its own), and,
// for a reader who may change the view, each cell's calculation menu.
diff --git a/ui/packages/plugin-list/src/__tests__/ListView.harness.test.tsx b/ui/packages/plugin-list/src/__tests__/ListView.harness.test.tsx
index e5cc524ce78..8082d1213c4 100644
--- a/ui/packages/plugin-list/src/__tests__/ListView.harness.test.tsx
+++ b/ui/packages/plugin-list/src/__tests__/ListView.harness.test.tsx
@@ -2853,6 +2853,18 @@ describe('ListView.exportDefaultOn-39475', () => {
await renderList({ compactToolbar: true, exportOptions: { formats: ['xlsx'] } });
expect(displayExportEntries()).toEqual(['display-export-xlsx']);
});
+
+ // The grid half (`plugin-grid`, ObjectGrid.exportDefaultOn-39475): a grid
+ // over an object offers Export unasked, so the list page's grid child is
+ // handed `exportOptions: { formats: [] }` — the list's own toolbar, Display
+ // panel and page bar stay the one export door. With the compact toolbar the
+ // list draws no Export button of its own, so a drawn one is the grid's.
+ it('the grid child draws no Export of its own: the list keeps the one export door', async () => {
+ await renderList({ compactToolbar: true });
+ await waitFor(() => expect(screen.getByText('Acme')).toBeInTheDocument());
+ expect(wideExport()).toBeNull();
+ expect(displayExportEntries()).toEqual(['display-export-csv', 'display-export-json']);
+ });
});
// ── ListView.toolbarTrailingExportDoor-36113 ────────────────────────────────────