Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .changeset/39475-list-view-export-on-by-default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
'@objectstack/spec': minor
'@object-ui/plugin-list': minor
---

feat(plugin-list): a list view that declares no `exportOptions` offers export

Clause-②: no
Metadata-protocol: semantic

A list view used to offer its Export entry only when the view declared `exportOptions`, so most lists offered Import and no Export. A list view now reads an absent `exportOptions` as the empty block: the toolbar's Export button, the Display panel's export entries and the page bar's Import / Export menu offer the default formats, `csv` and `json`. `xlsx` is offered where a view lists it in `formats` and the server stream delivers it, as before. A declared block behaves as before.

Who may export is unchanged. The permission set's `allowExport` grant reaches the list through the object's effective `export` operation (`/me/permissions` `apiOperations`): a user whose permission sets do not grant it sees no Export entry on any list, and the server refuses the export request.

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`.

The upgrade guide carries the change as the semantic entry `list-view-export-on-by-default`.
2 changes: 1 addition & 1 deletion content/docs/ui/components/plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ Namespace `plugin-list`.
| `addRecord` | `object` | | The Add button, the spec's `AddRecordConfig`. The spec row declares `enabled` default `true` and `position` default `"bottom"`; the renderer does not apply those defaults: it draws the button only for an explicit `enabled: true`, and places an absent `position` at the top (objectui#13099 owns that gap). `position` places it: `"top"` (the toolbar), `"bottom"` (under the list) or `"both"`. A click opens the create form for the listed object, the one the object list's New opens: the record-form overlay, or the full-page create for an object whose `editMode` is `page`. The button is withheld for a viewer who may not create, or whose create the object greys, and on a host that serves no create. `mode` and `formView` are not read. `userActions.addRecordForm: false` also takes the button off. |
| `compactToolbar` | `boolean` | | Gather the grouping, row colour, density and hide-fields controls into one Display form. On by default; `false` draws one toolbar button per control. |
| `appearance` | `object` | | The spec's appearance config, `{ showDescription, allowedVisualizations }`. `showDescription: false` hides the description. `allowedVisualizations` narrows the kinds a view switcher offers, and a page node draws no switcher, so on a page it changes nothing: the node's `type` is the kind drawn. |
| `exportOptions` | `object` | | The export menu, `{ formats, maxRecords, includeHeaders, fileNamePrefix, streaming }`. Declaring it offers the export on the toolbar, in the listed formats; `fileNamePrefix` names the file. |
| `exportOptions` | `object` | | The export menu, `{ formats, maxRecords, includeHeaders, fileNamePrefix, streaming }`. The toolbar offers export whether or not the view declares it: absent, the menu offers `csv` and `json`; declared, it offers the listed formats, and `fileNamePrefix` names the file. `formats: []` turns the export off for the view, and the object's `userActions.exportCsv: false` for every view of the object. Who may export is the permission set's `allowExport`: a user without it sees no export. |
| `allowPrinting` | `boolean` | | Draw a Print button that opens the browser's print dialog for the list. |
| `showRecordCount` | `boolean` | | The record count in the list's footer. On by default; `false` takes it off. On an ungrouped grid that declares no `pagination` (it loads as it scrolls), `false` also stops the list asking the server for the total, so no count query runs. Everywhere else the list still asks: a grid that keeps a numbered pager (the pager needs the total), a grouped grid, and a list in a page region's compact or capped form. |
| `emptyState` | `object` | | What the list draws when no record comes back, the spec's `EmptyState`: `{ title, message, icon, link }`. `title`, `message` and the link's `label` each take a plain string or an inline per-locale map. |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.

import type { SemanticMigration } from '../../types.js';

// The upgrade-guide entry of a changed default: a list view that declares no
// `exportOptions` now offers export (the maintainer's ruling on #39409, option
// A). Notice only: no key is added or removed and no D2 conversion exists, so
// nothing in the metadata changes and no gate tells an upgrader the meaning moved.
export const entry: SemanticMigration = {
id: 'list-view-export-on-by-default',
surface:
'view.exportOptions on a list view, wherever the view is declared (ABSENT — a view that never declared '
+ 'the block)',
replacement:
'No action is owed to keep export: it is offered with the default formats, `csv` and `json`. 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`. Who may export is unchanged: the permission '
+ 'set\'s `allowExport` grant',
reason:
'Before this release a list view offered its Export entry only when it declared `exportOptions`, so a '
+ 'view that never thought about export offered import and no export. A list now reads an absent block as '
+ 'the empty block and offers its default formats, the way a report offers its own export unasked. The '
+ 'metadata is unchanged and still parses, which is why this is registered: what an absent block means has '
+ 'changed. The permission wall is not moved. A user whose permission sets do not grant `allowExport` on '
+ 'the object is served no `export` operation and sees no Export entry, on any view; the server refuses '
+ 'the export request too. An `object-grid` page component is not changed by this entry: it still offers '
+ 'export only when it declares the block.',
acceptanceCriteria:
'Every list view that must not offer export declares `exportOptions: { formats: [] }`, or its object sets '
+ '`userActions.exportCsv: false`. Signed in as a holder of each permission set, Export is offered on a list '
+ 'exactly where that set grants `allowExport` on the object.',
relevantWhen: { kind: 'stack-declares', keys: ['views', 'viewItems', 'objects', 'pages'] },
};
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ const LIST_VIEW = [
'publish-refuses-list-view-grouping-the-engine-does-not-group-by',
'publish-refuses-views-and-dashboards-that-save-and-do-not-work',
'view-bulk-actions-declared-on-the-action',
'list-view-export-on-by-default',
];
const FORM_VIEW = ['internal-record-forms-not-loaded', 'ui-form-view-modal-size-retired', 'ui-form-view-subforms-retired'];
const FIELD = [
Expand Down Expand Up @@ -362,12 +363,12 @@ const SITES: ReadonlyArray<{ site: string; stack: Record<string, unknown>; entri
},
{ site: 'actions[] (a standalone action)', stack: { actions: [{ name: 'run', type: 'script' }] }, entries: [...ACTION_BODY, ...ACTION_TYPE, 'publish-refuses-metadata-the-runtime-ignores'] },
{ site: 'views[] (a list view, a form view)', stack: { views: [{ name: 'v' }] }, entries: [...LIST_VIEW, ...FORM_VIEW] },
{ site: 'viewItems[]', stack: { viewItems: [{ name: 'v' }] }, entries: [...LIST_VIEW.slice(0, 4), ...FORM_VIEW] },
{ site: 'viewItems[]', stack: { viewItems: [{ name: 'v' }] }, entries: [...LIST_VIEW.slice(0, 4), 'list-view-export-on-by-default', ...FORM_VIEW] },
{ site: 'forms[]', stack: { forms: [{ name: 'site_thing.form' }] }, entries: FORM_VIEW },
{
site: 'pages[] components',
stack: { pages: [{ name: 'p' }] },
entries: ['action-locations-page-parts-retired', 'object-grid-single-click-edit-retired', 'ui-action-type-ask-ai-retired', 'view-bulk-actions-declared-on-the-action', 'cel-list-equality-refused'],
entries: ['action-locations-page-parts-retired', 'object-grid-single-click-edit-retired', 'ui-action-type-ask-ai-retired', 'view-bulk-actions-declared-on-the-action', 'list-view-export-on-by-default', 'cel-list-equality-refused'],
},
{ site: 'dashboards[] (a header action)', stack: { dashboards: [{ name: 'd' }] }, entries: ['ui-action-type-ask-ai-retired', 'publish-refuses-views-and-dashboards-that-save-and-do-not-work'] },
{ site: 'apps[]', stack: { apps: [{ name: 'a' }] }, entries: ['nav-keywords-empty-list-refused', 'publish-refuses-views-and-dashboards-that-save-and-do-not-work'] },
Expand Down
1 change: 1 addition & 0 deletions packages/spec/src/migrations/semantic-relevance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const EXPECTED_RELEVANCE: Readonly<Record<string, readonly string[]>> = {
'19:internal-record-forms-not-loaded': ['views', 'viewItems', 'forms'],
'19:knowledge-service-held-without-embedder-or-store': ['knowledgeSources', 'requires'],
'19:knowledge-source-publish-refuses-missing-references-and-gated-objects': ['knowledgeSources'],
'19:list-view-export-on-by-default': ['views', 'viewItems', 'objects', 'pages'],
'19:lookup-depends-on-param-computed-field-refused': ['objects', 'objectExtensions'],
'19:lookup-depends-on-param-computed-field-refused-on-tree': ['objects', 'objectExtensions'],
'19:lookup-filter-record-path-structured-refused': ['objects', 'objectExtensions'],
Expand Down
11 changes: 11 additions & 0 deletions packages/spec/src/ui/list-view-export-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@
* {@link LIST_VIEW_EXPORT_OPTIONS_ARRAY_FORM}). The list view's published JSON
* Schema did not move with it.
*
* [#39475] What an ABSENT block means differs by carrier. A list view that
* declares none offers its export anyway, read as the empty block — the
* default formats, every other member at its default — as a report offers
* its own unasked (maintainer ruling on #39409, option A of analysis
* 7397854343). Who may export is the permission set's `allowExport`, which
* the server folds into the object's effective `export` operation;
* `formats: []` turns a view's export off and the object's
* `userActions.exportCsv: false` every view's.
* An `object-grid` page component still offers export only when it declares
* the block.
*
* [#26548] A report's export block lives here too, at the end of the module:
* {@link ReportExportOptionsSchema}, three of these five members under the
* same key name, so a report and a list share one export vocabulary rather
Expand Down
6 changes: 3 additions & 3 deletions scripts/sdui-manifest.record.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
],
"source": "built-tree",
"generator": "scripts/gen-sdui-manifest-node.mjs",
"generatedAt": "2026-12-03",
"sha256": "fb32f711dcba2bd07a493557e6328407ea052a53cec63315161dced73552bb2a",
"generatedAt": "2026-12-04",
"sha256": "2763ba89195a8b4b3ef121df0f853449645595d77ee9c350490c0bbf0ba07e7e",
"components": 106,
"inTree": {
"modulesRoot": "ui/apps/console",
"objectuiWorkspaceVersion": "19.0.0-next.3"
"objectuiWorkspaceVersion": "19.0.0-next.4"
}
}
2 changes: 1 addition & 1 deletion sdui.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
{
"name": "exportOptions",
"type": "object",
"description": "The export menu, `{ formats, maxRecords, includeHeaders, fileNamePrefix, streaming }`. Declaring it offers the export on the toolbar, in the listed formats; `fileNamePrefix` names the file."
"description": "The export menu, `{ formats, maxRecords, includeHeaders, fileNamePrefix, streaming }`. The toolbar offers export whether or not the view declares it: absent, the menu offers `csv` and `json`; declared, it offers the listed formats, and `fileNamePrefix` names the file. `formats: []` turns the export off for the view, and the object's `userActions.exportCsv: false` for every view of the object. Who may export is the permission set's `allowExport`: a user without it sees no export."
},
{
"name": "allowPrinting",
Expand Down
20 changes: 17 additions & 3 deletions ui/packages/plugin-list/src/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import { useListEffectiveFilterReport, type ListEffectiveFilter } from './listEf
import { SchemaRenderer, useNavigationOverlay, classifyLoadError, answeredLoadFailure, isPermissionError, usePredicateScope, useDataInvalidation, useFilterScope, useResolvedFilter, NonGridRowCeilingNote, OwnWritesContext, createOwnWrites } from '@object-ui/react';
import type { LoadErrorKind, AnsweredLoadFailure } from '@object-ui/react';
import { useDensityMode, resolveInlineAriaProps } from '@object-ui/react';
import type { DataTableSchema, DependsOnInput, ListViewSchema, ObjectMapConfig } from '@object-ui/types';
import type { DataTableSchema, DependsOnInput, ListViewExportOptions, ListViewSchema, ObjectMapConfig } from '@object-ui/types';
import { AUDIT_FIELD_NAMES, detectStatusField, isSystemManagedField } from '@object-ui/types';
import { usePullToRefresh } from '@object-ui/mobile';
import { type ListViewVisualization, resolveConditionalFormatting, buildExpandFields, buildExportFileName, resolveAffordance, isObjectExportOffered, type SchemaLike, partitionRowsByPredicate, normalizeListViewSchema, isListViewVisualization, rowHeightToDensityMode, mergeFilterNodes, toFilterNodeSafely, FilterOperatorError, columnIdentity, collectPredicateFieldRefs, collectGroupingFieldRefs, listViewPredicates, PLATFORM_RECORD_COLUMNS, EXPANDABLE_FIELD_TYPES, UNMATERIALIZED_FIELD_TYPES, readObjectSortability, isPlatformSortableField, leadWithNameField, filterPlatformSortableSort, applyNonGridRowCeiling, type NonGridCeilingResult, resolveNameField, declaredNameField, resolveDependsOnFields, GANTT_CONFIG_SPELLING, kanbanDeclaredLanes, csvBlob, readWithheldFieldNames, refersToWithheldField, withHeaderSortPick, shownQuantityUnitReads, fieldLockPredicates, type FieldHandLockDef } from '@object-ui/core';
Expand Down Expand Up @@ -2352,6 +2352,15 @@ const OUTSIDE_OPTIONS = 'outside';
*/
const ROW_OPENS_RECORD_VIEW_TYPES: ReadonlySet<string> = new Set(['object-grid', 'object-gallery', 'object-kanban']);

/**
* The export block a list view that declares none is read as (objectstack#39475):
* every member unset, so the menu offers the default formats and every other
* member keeps its own default. A list offers export unasked, as a report does;
* who may use it is the caller's export grant, read through `exportPermitted`.
* Frozen, so no reader can write into the shared default.
*/
const UNDECLARED_EXPORT_OPTIONS: Readonly<ListViewExportOptions> = Object.freeze({});

/**
* objectui#11865 — the toolbar's "Color by field" and the record-count bar's
* rows-per-page selector, drawn with the shared `Select`, the control the rest
Expand Down Expand Up @@ -3663,9 +3672,14 @@ export const ListView = React.forwardRef<ListViewHandle, ListViewProps>(({
*/
const rowsCarryConcurrencyToken = inlineEditOffered;

// Normalize exportOptions: support both ObjectUI object format and spec string[] format
// Normalize exportOptions: support both ObjectUI object format and spec string[] format.
// An undeclared block is the default block, never "no export"
// (objectstack#39475): who may export is `exportPermitted` (the caller's
// export grant, through the server's effective `export` operation), and the
// off switches are `exportOptions: { formats: [] }` on the view and
// `userActions.exportCsv: false` on the object.
const resolvedExportOptions = React.useMemo(() => {
if (!schema.exportOptions) return undefined;
if (!schema.exportOptions) return UNDECLARED_EXPORT_OPTIONS;
// Spec format: simple string[] like ['csv', 'xlsx']
if (Array.isArray(schema.exportOptions)) {
return { formats: schema.exportOptions };
Expand Down
Loading
Loading