Skip to content

Commit f98f18c

Browse files
feat(ui,spec): userActions.exportCsv false hides the console Export entry (#36096)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoM2Z7gQnCvEUfEceUuUKyBZ)_ Fixes #35619 Clause-②: yes Metadata-protocol: semantic Skills-docs: none — skills/** never teaches the object-level `userActions` block (its only `userActions` hits are the VIEW-level block in objectstack-ui's list-views and navigation rules); the author-facing docs are updated here (content/docs/data-modeling/objects.mdx, content/docs/frontend/plugins/plugin-list.mdx) ## 维护者速读 - 搭建者在对象表单里关掉「导出」开关后,该对象的表格、列表页和报表都不再显示下载数据的「导出」按钮;以前关了也照样显示,没设置的对象不变;甘特图把图表导出成图片或文档的按钮不受这个开关影响。 - 替在设计器里关掉导出开关的搭建者兑现这个设置:开关一直能设,却从没生效(维护者已裁定「生效」而不是「删除」)。 - 出错最多是某个对象的导出按钮该显示却不显示,或反之;它只隐藏入口、不拦服务端导出,整改动可直接撤回。 - 无。 ## What changes Ruling: **Enforce** (comment 7035537883 on the card). An object's `userActions.exportCsv: false` now hides the console's data Export entry for that object: the CSV, XLSX or JSON download on the grid (toolbar menu, table CSV button), the list view (wide toolbar, Display panel) and the dataset report. A view's export of the picture it draws is not covered: the Gantt view's PNG and PDF buttons stay (Acceptance notes). Every surface reads one verdict, `isObjectExportOffered(objectSchema, effectiveApiOperations)`, new in `@object-ui/core`. That verdict is the authored bit over the object's `managedBy` default, ANDed with the caller's effective `export` operation. Before this change the grid's toolbar menu, the list view and the report read the effective operation but not the object's bit, and the grid's table CSV button read neither half (only `operations.export`), so `exportCsv: false` changed nothing. - **The verdict** (`@object-ui/core`): `isObjectExportOffered` in `managedBy.ts`, beside `isObjectInlineEditable`, returns the resolved `exportCsv` bit from `resolveEffectiveCrudAffordances`. No surface calls `resolveEffectiveCrudAffordances` itself, because the affordance-to-grant census (`affordanceGrantMap-12082.test.tsx`) refuses that call outside its home modules. Why a helper and not an `AFFORDANCE_GRANTS` row is under Acceptance notes. - **ObjectGrid** (`@object-ui/plugin-grid`): one name, `objectExportOffered`, gates three things: the toolbar Export menu (`exportEnabled`), `handleExport`, and the table's own CSV button that `operations.export: true` turns on (`exportable`). - **ListView** (`@object-ui/plugin-list`): `exportPermitted` folds in the verdict. Both toolbar forms already read that name: the wide toolbar's Export button and the Display panel's export footer. `handleExport` reads it too. - **Dataset report** (`@object-ui/plugin-report`): `ReportExportControl` reads the base object's definition (the query answer's `object`) through the report's data source with `useSettledSchema`, then applies the same verdict. `DatasetReportRenderer` passes its `dataSource` down. - **RelatedList**: no change. It draws no export entry at all, so there is nothing to gate. Evidence is in Acceptance notes. - **Spec** (`@objectstack/spec`): - the `exportCsv` describe and the Studio object form's help text now say what the key does, narrowed in round 2 to the data Export entry it gates; - round 2 also fixes three older sentences: `CrudAffordances.exportCsv`'s docblock no longer says "CSV / clipboard export"; the `userActions` docblock's example no longer has an append-only table "expose CSV Export", which it does by default; and the `read` / `view` guidance no longer says `userActions` toggles write affordances only. The form row's label stays "Export CSV", since changing it would ripple into ten locale bundles; - the liveness ledger row `object.userActions.exportCsv` moves `dead` → `live`, citing the readers by `file#symbol`; - the generated reference row and the state-count shard are regenerated. - **Docs**: the `userActions` row in content/docs/data-modeling/objects.mdx; a new "The object's Export switch" section in content/docs/frontend/plugins/plugin-list.mdx; an Export section in each of the three plugin READMEs. - **Translations** (`@objectstack/platform-objects`): the English metadata-forms bundle is regenerated for the new help text. The ten translated locales keep their wording (merge mode). - Changeset: `.changeset/35619-user-actions-export-csv-enforced.md`. It grades spec, `@object-ui/core` and the three ui plugins `minor` and platform-objects `patch`, and carries the `Clause-②: yes` and `Metadata-protocol:` lines. - **Docs**, round 1: the core README gains a section on `isObjectExportOffered`; the three plugin READMEs, plugin-list.mdx and the ledger evidence now name the helper. Unchanged, per the rulings: the ADR-0103 bucket defaults (`exportCsv: true` in every bucket) and ADR-0153. No server gate is added; the REST export route is out of scope. The setting hides an entry and is not a permission: who may export is still the permission set's `allowExport`. ### Read first (by risk) 1. `ui/packages/core/src/utils/managedBy.ts`: `isObjectExportOffered`, the one export verdict and the new public name (Clause-② yes). Its docblock says why it asks no `can(object, verb)`. 2. `ui/packages/plugin-report/src/ReportExport.tsx`: the new definition read through the data source. A source that cannot serve `getObjectSchema` keeps the control, and so does a definition still in flight (fail-open). 3. `ui/packages/plugin-grid/src/ObjectGrid.tsx`: the `exportable: operations?.export && objectExportOffered` hunk. The table's own CSV button now also follows the effective `export` operation, which it did not read before. ### Two-minute check `pnpm --dir ui exec vitest run packages/plugin-grid/src/__tests__/exportCsvGate-35619.test.tsx`. Expect `Tests 4 passed (4)`: `exportCsv: false` finds neither the toolbar Export menu nor the table's CSV button, and the three controls find both. ## Tests New render-level pins. Each `false` case has CONTROLS that find the entry, so an absence is a reading and not a blind probe. - `ui/packages/plugin-grid/src/__tests__/exportCsvGate-35619.test.tsx` (4): - `exportCsv: false` hides both the toolbar Export menu and the table CSV button; - CONTROL: unset keeps both; - CONTROL: `true` keeps both; - closing `edit`/`delete` leaves export open. - `ui/packages/plugin-list/src/__tests__/ListView.harness.test.tsx`, new top-level `describe('ListView.exportCsvGate-35619')` (5): - wide toolbar: `false` hides Export; CONTROLS for unset and `true`; - Display panel footer: `false` hides every format entry; CONTROL. - `ui/packages/plugin-report/src/__tests__/ReportExport.exportCsvGate-35619.test.tsx` (3): `false` hides the report's Export control; CONTROLS for unset and `true`. - `ui/packages/core/src/utils/managedBy.test.ts`, new top-level `describe('isObjectExportOffered — the one export verdict (objectstack#35619)')` (5). It covers: - unset, in every bucket; - `false` and `true`, in every bucket; - other verbs closed; - the effective set; - agreement with `resolveEffectiveCrudAffordances(...).exportCsv` over every bucket, authored value and effective set. Readings, fix round 2, at eabd783. The change is prose only. The L2 record (7064709267) raised S1: the sentences claimed every Export entry and every format, but the Gantt view's PNG / PDF buttons are outside the gate. Round 2 narrows the describe, the help text, the `isObjectExportOffered` docblock, the liveness note, the core and plugin-list READMEs, objects.mdx, plugin-list.mdx and the changeset to the data Export entry, and says the Gantt picture export is not covered. N2 and N3 ride the same commit. Behaviour is unchanged. <details><summary>Round 2 readings: regenerated artifacts, check:i18n, check:liveness, spec suite, census and pins</summary> - `pnpm --filter @objectstack/spec check:generated --fix` found 1 stale artifact (`gen:docs`, the reference row in content/docs/references/data/object.mdx) and regenerated it. VERDICT command-exit 0. - `pnpm check:i18n` gave exit 1 (`platform-objects DRIFTED (1)`) before regeneration. After `node scripts/check-i18n-bundles.mjs --write`, only `en.metadata-forms.generated.ts` moved, and `pnpm check:i18n` gave exit 0 (`platform-objects in sync (32 bundle(s))`). - `pnpm --filter @objectstack/spec run check:liveness` gave exit 0. - `pnpm --filter @objectstack/spec test` gave `Test Files 868 passed (868)`, `Tests 27852 passed | 1 todo (27853)`, VERDICT command-exit 0. - The census, `managedBy.test.ts` and the three 35619 pin files gave `Test Files 5 passed (5)`, `Tests 217 passed (217)`, VERDICT command-exit 0. - `pnpm check:nul-bytes` gave exit 0, and a control-byte scan of the changed files found nothing. </details> Readings, fix round 1, at 88f1d55. CI `Test UI (15/16)` was red at 4443783 (job 136860952696) on the census `no console source outside the map reads a CRUD grant on its own`, naming ObjectGrid.tsx, ListView.tsx and ReportExport.tsx. 88f1d55 routes all three through `isObjectExportOffered`. <details><summary>Census, core and the three 35619 pin files at 88f1d55: 5 files, 217 tests passed</summary> `pnpm --dir ui exec vitest run --maxWorkers=2` over `affordanceGrantMap-12082.test.tsx`, `managedBy.test.ts` and the three pin files, under the verify lock: ```text Test Files 5 passed (5) Tests 217 passed (217) os-verify-lock: VERDICT command-exit 0 ``` - `pnpm --dir ui exec vitest run --maxWorkers=2 packages/core/ packages/plugin-form/src/affordanceGrantMap-12082.test.tsx` gave `Test Files 245 passed (245)`, `Tests 4798 passed | 27 skipped (4825)`, VERDICT command-exit 0. - `pnpm --workspace-concurrency=1 --filter @object-ui/core --filter @object-ui/plugin-grid --filter @object-ui/plugin-list --filter @object-ui/plugin-report run type-check` ran all four packages (each `tsc --noEmit && tsc -p tsconfig.test.json`), VERDICT command-exit 0. - eslint over the five changed ui source and test files: 0 errors. - `check:liveness` exited 0 with the evidence anchor `managedBy.ts#isObjectExportOffered`. </details> <details><summary>Ablation of the helper: every surface pin and the helper's pins go red, every CONTROL stays green</summary> `node scripts/ablation-replace.mjs` turned the helper's `return resolveEffectiveCrudAffordances(obj, effectiveApiOperations).exportCsv;` into `return true || …`. The anchor moved 1 to 0. A trap restores with `git checkout HEAD --` on an absolute path. `@object-ui/core` resolves to `src` through the ui vitest alias, so there is no `dist/` leg. ```text Test Files 4 failed (4) Tests 7 failed | 10 passed | 145 skipped (162) ``` - Red: grid "exportCsv false"; ListView wide-toolbar false and Display-panel false; report "exportCsv false"; three of the helper's five cases. - Green: every CONTROL in the three pin files, plus the helper's unset and other-verb cases. - Restore: blob == HEAD 80024db and `git diff HEAD` empty. So all three surfaces read the helper. </details> <details><summary>Clause-② measured on the built declarations</summary> - `ui/packages/core/dist/index.d.ts` line 18 is `export * from './utils/managedBy.js';`. - `dist/utils/managedBy.d.ts` declares `export declare function isObjectExportOffered(obj: SchemaLike | null | undefined, effectiveApiOperations?: readonly string[] | null): boolean;`. Its neighbour `isObjectInlineEditable` is declared the same way (positive control), and `origin/main`'s `managedBy.ts` has 0 hits for the name. - So it is a new name on `@object-ui/core`'s published entry, and `Clause-②` is `yes`. - The earlier `dataSource?` prop on `ReportExportControlProps` is not reachable from plugin-report's entry. Built `dist/index.d.ts` re-exports nothing from `./ReportExport.js`, and no entry declaration imports it. </details> Readings from round 0, before the fix. Their code head is 3e175d0, and 4443783 added only the regenerated English bundle and the changeset. <details><summary>New pins at 3e175d0: 3 files, 127 tests passed</summary> `pnpm --dir ui exec vitest run --maxWorkers=2` over the three pin files (the ListView harness file carries its other 115 cases too), under the verify lock: ```text Test Files 3 passed (3) Tests 127 passed (127) os-verify-lock: VERDICT command-exit 0 ``` </details> <details><summary>Package suites and type-check: plugin-grid, plugin-list, plugin-report, spec, platform-objects</summary> - ui suites, run on the tree that 3e175d0 commits (13af371 plus the test-typing edit, committed unchanged): `pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-grid/ packages/plugin-list/ packages/plugin-report/` gave `Test Files 515 passed (515)`, `Tests 4928 passed | 7 skipped (4935)`, VERDICT command-exit 0. - ui type-check: `pnpm --filter @object-ui/plugin-grid --filter @object-ui/plugin-list --filter @object-ui/plugin-report run type-check` (each runs `tsc --noEmit` and `tsc -p tsconfig.test.json`) gave VERDICT command-exit 0. - spec at 3e175d0: `pnpm --filter @objectstack/spec typecheck && pnpm --filter @objectstack/spec test` gave `Test Files 868 passed (868)`, `Tests 27852 passed | 1 todo (27853)`, VERDICT command-exit 0. - platform-objects at 4443783: `pnpm --filter @objectstack/platform-objects test` gave `Test Files 125 passed (125)`, `Tests 2117 passed (2117)`, VERDICT command-exit 0. - eslint over the changed ui files: 0 errors. </details> <details><summary>Ablation: each pre-fix gate restored, each false case goes red, every CONTROL stays green</summary> `node scripts/ablation-replace.mjs` mutates the gate line, proves the anchor moved (1 to 0), runs the pin file under the lock, and restores. A trap restores with `git checkout HEAD --` on absolute paths. The subjects resolve to `src` through relative imports and the ui vitest aliases, so there is no `dist/` leg. - ObjectGrid (`objectExportOffered = true || …`, which opens the verdict that all three entries read): "exportCsv false" fails, `Tests 1 failed | 3 passed (4)`. - ListView (`exportPermitted` back to its `origin/main` effective-operation test): the wide-toolbar false case and the Display-panel false case fail; the 3 CONTROLS pass (`Tests 2 failed | 3 passed | 115 skipped`, filtered to the block). - ReportExport (back to its `origin/main` line, `if (ops && !ops.includes('export')) return null;`): "exportCsv false" fails; both CONTROLS pass (`Tests 1 failed | 2 passed (3)`). - Restores proven blob == HEAD (ObjectGrid 7c78f1b, ListView edf466e, ReportExport ac11257), with `git diff HEAD` empty after each leg. </details> ## Acceptance notes - **RelatedList has no export entry.** The ruling names RelatedList as an export surface. At `origin/main`, `ui/packages/plugin-detail/src/RelatedList.tsx` draws no Export button, menu or handler, and sets `exportable: false` on its table, so there is nothing to gate. The diff does not touch it, and the ledger note records this. - **Fail-open while the definition loads.** All three surfaces resolve with the bucket default until the object definition lands. Sibling affordances behave the same way. Every bucket defaults `exportCsv` to `true`, so the entry can show for a moment on an object that authors `false`. The pins wait for the definition before they look. - **Table CSV button now follows the effective `export` operation.** Before, the data-table's own CSV button (`operations.export: true`) read nothing but that flag. It now reads `objectExportOffered`, which includes the server's effective operation set. This matches the toolbar menu it sits beside. - **Legacy `ReportViewer` untouched.** It gates on the report's own `allowExport` and is not bound to an object. - **Interim changeset text.** The unreleased `.changeset/35401-user-actions-transfer.md` paragraph says `exportCsv` is dead and warns. If both changesets ship in one release, that paragraph describes an interim state, and the seat may amend it as a DELIBERATE CORRECTION. This PR does not edit another PR's changeset. - **Translated help text kept.** The ten translated `userActions.exportCsv` help texts still say "the CSV export entry, shown when unset". That is still true, but they do not yet mention every format or that the setting is not a permission. Merge mode keeps them, and they are legacy-trusted, so no gate reads them as stale. Refreshing them is translation work and is not done here. - **Why a helper, not an `AFFORDANCE_GRANTS` row.** Both were measured, and the census-prescribed row does not fit export: - the map's rows name a caller grant asked through `can(object, grant)`, typed `create | update | delete`; - `@object-ui/permissions` answers `can(object, 'export')` with `allowRead` (`MePermissionsProvider`'s verb map), not `allowExport`, so a row's grant half would ask the wrong bit; - the caller's `allowExport` already reaches the client through the effective `export` operation. The server derives it from `list` and that grant (`annotateEffectiveApiOperations` in `@objectstack/core`), and its export door answers `403 EXPORT_NOT_PERMITTED` without it (`enforceExportPermission` in `@objectstack/rest`); - the pin holds every row with a CRUD bit closed under an `append-only` bucket, while ADR-0103 keeps `exportCsv` on in every bucket. So the verdict stays exactly as it was, the authored bit ∧ the effective `export` operation, and it lives in the HOME module as a named helper. `OUT_OF_FAMILY` is unchanged. - **Not covered: a view's picture export (S1).** The Gantt view (`ui/packages/plugin-gantt/src/GanttView.tsx`, drawn by ListView for `viewType: gantt`) has two buttons, "Export as PNG" and "Export PDF". They export the chart it draws and read no export verdict. The switch does not hide them, and every sentence this PR writes now says so. Gating them is outside this claim's file surface; it is a separate card if the maintainer wants the chart picture covered. - **N1, follow-up candidate: the report control paints before its definition read settles.** `ReportExportControl` starts the base object's definition read once the table snapshot exists and reads only `def`. So on a report over an `exportCsv: false` object the control is drawn at least once per open, and for the length of the request when the definition is not cached. Holding it until `useSettledSchema`'s `ready` would remove the flash and keep it open where the source cannot serve a definition. Accepted on this head, since the setting is not a permission. - **N4, follow-up candidate: the Studio switch reads off for an unset key whose default is on.** The form row renders `checked` from the stored value, so an object that never authored `exportCsv` shows the switch off while export is offered. Writing `false` takes switching on and then off. This predates this PR: the row's comment and the composite's help text already describe it. It is now the row's only useful write, so the form face deserves its own card. - **Pin placement.** The claim asked for new pin files named for 35619 beside each surface. The ListView pin sits in the shared `ListView.harness.test.tsx` as a top-level describe instead, per the AGENTS.md shared-harness ruling (6583487846). - **Overlap.** `overlap-check` at eabd783 reports textual conflicts with two PRs. With #35923 they are only on two generated artifacts, `content/docs/references/data/object.mdx` and `packages/spec/liveness/state-counts/object.md`; both PRs regenerate them, so whichever lands second merges main and regenerates them. With #36129 (a draft, the related-tab list) the conflict is in `ui/packages/plugin-list/src/ListView.tsx`. That queues the second of the two to land. `origin/main` (dc10b3b) merges cleanly. ## Verification Round 2, at eabd783: `dispatch-gates --commands` derives the same 122 families. The local re-run was stopped at the coordinator's finish-now order once CI was green on this head, so the local union is partial, and says so. <details><summary>Reconciliation at eabd783: 122 derived, 98 run, 1 NOT MEASURED, 23 unrun; CI 70 check-runs, 0 failures</summary> ```text Run reconciliation — 122 derived, 98 run, 1 NOT-MEASURED, 23 UNRUN. ``` - All 98 that ran exited 0. They include every family the round-2 files feed: `check:generated`, `check:docs`, `check:liveness`, `check:i18n`, `check:i18n-stale-fill`, the changeset checks and `check:nul-bytes`. - `check:dual-build-cjs-loads` is NOT MEASURED locally (exit 3, needs every package built), as in earlier rounds. - 23 families were not run locally on this head: `check:query-options-erasure` through `check:wildcard-fallthrough`, the tail of the list. Each passed locally at 88f1d55, and this round changes prose only. CI ran them all. - CI check-runs on eabd783, read once: 70 runs, 61 success and 9 skipped, none failed. </details> Round 1, at 88f1d55: `dispatch-gates --commands --repo objectstack-ai/objectstack` derives the same 122 families as at 4443783. All of them were re-run on this head, with exit codes captured before any pipe. <details><summary>Reconciliation at 88f1d55: 122 derived, 121 run, 1 NOT MEASURED, 0 unrun; CI 70 check-runs, 0 failures</summary> ```text Run reconciliation — 122 derived, 121 run, 1 NOT-MEASURED, 0 UNRUN. - pnpm check:dual-build-cjs-loads [recorded exit 3 on line 78 — PREREQUISITE NOT MET] ✓ dispatch-gates --ran: 122 derived famil(ies) accounted for — 121 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3). ``` - 121 families exited 0. Their prerequisites were built first: the CLI closure for `check:i18n` (`platform-objects in sync (32 bundle(s))`) and client-react for `check:skill-examples`. - `check:dual-build-cjs-loads` is NOT MEASURED locally, as in round 0: it needs every package built. CI covers it. - `overlap-check` gave exit 1, only on #35923's two generated artifacts (see Acceptance notes). `origin/main` (493ad09) merges cleanly. - CI check-runs on 88f1d55, read once: 70 runs, 61 success and 9 skipped, none failed. `Test UI (15/16)`, `Test UI`, `Test Core`, `Lint & Repo Gates`, `Type Check UI`, `Check Changeset`, `Spec property liveness` and `Lint · PM dispatch-gates` are all success. </details> Round 0, at 4443783: the same 122 families, derived by `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`. Exit codes were captured before any pipe. <details><summary>Reconciliation: 122 derived, 121 run, 1 NOT MEASURED, 0 unrun</summary> ```text Run reconciliation — 122 derived, 121 run, 1 NOT-MEASURED, 0 UNRUN. NOT-MEASURED · DERIVED (1) - pnpm check:dual-build-cjs-loads [recorded exit 3 — PREREQUISITE NOT MET] ✓ dispatch-gates --ran: 122 derived famil(ies) accounted for — 121 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3). ``` - 117 families ran at 3e175d0 and exited 0. - Three refused their prerequisite there (exit 3). Each passed after its prerequisite was met: - `check-plugin-teardown-shape --self-test`, once its pinned fixture commit was fetched; - `check:skill-examples`, once client-react was built; - `check:i18n`, once the CLI closure was built. - `check:i18n` then went red (exit 1, `platform-objects DRIFTED (1)`). That red came from this diff: the object form's `exportCsv` help text is extracted into `en.metadata-forms.generated.ts`. 4443783 regenerates it with `node scripts/check-i18n-bundles.mjs --write` (only `en` moved), and `pnpm check:i18n` now exits 0 with every bundle in sync. - At 4443783 these exited 0: `check:i18n-stale-fill` (new to the derivation), the two changeset checks, `check:nul-bytes` and `check:published-files`. - `check:dual-build-cjs-loads` needs every package built (36 have no `dist/`), so it is NOT MEASURED locally: declared narrowing, and CI runs it. - `check:dev-prereqs` is local-only: exit 1, "the workspace is not built", 23 of 108 packages have no `dist/`. That describes this container, not the diff. - `check:liveness` exited 0 and `check:generated --fix` regenerated the two artifacts this PR commits. </details> CI families: the seat reads the check-runs on 88f1d55. Round 0's red `Test UI (15/16)` is the census this round fixes. --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibxUmEWpcN3eh4vH1WY)_ <!-- signed: repo:objectstack#7 · os-tesla · session_01L9qibxUmEWpcN3eh4vH1WY --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5827212 commit f98f18c

22 files changed

Lines changed: 591 additions & 48 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@object-ui/core': minor
4+
'@object-ui/plugin-grid': minor
5+
'@object-ui/plugin-list': minor
6+
'@object-ui/plugin-report': minor
7+
'@objectstack/platform-objects': patch
8+
---
9+
10+
feat: an object's `userActions.exportCsv: false` hides the console's Export entry
11+
12+
Clause-②: yes
13+
Metadata-protocol: semantic
14+
15+
`userActions.exportCsv` on an object now does what the Studio object form says it does. Set to `false`, the console offers no Export entry for downloading that object's data, in any of its formats (CSV, XLSX, JSON):
16+
17+
- the object grid hides its toolbar Export menu, and the table's own CSV button that `operations.export: true` turns on;
18+
- the list view hides Export in both toolbar forms, the wide toolbar's button and the Display panel's export footer;
19+
- a dataset report hides its Export control when the dataset's base object sets it.
20+
21+
A view's export of the picture it draws is not covered: a Gantt view's PNG and PDF buttons stay.
22+
23+
Every surface reads one verdict, the new `isObjectExportOffered(objectSchema, effectiveApiOperations)` from `@object-ui/core`: the authored `exportCsv` over the object's `managedBy` default, ANDed with the caller's effective `export` API operation. Before this change the grid's toolbar menu, the list view and the report read the effective operation but not the object's bit, and the grid's table CSV button read neither half (only `operations.export`), so `exportCsv: false` changed nothing. Export is a read, so the verdict is not a row of `AFFORDANCE_GRANTS` and asks no `can(object, verb)`: the caller's export grant reaches the console through the effective `export` operation, which the server derives from `list` and `allowExport`.
24+
25+
An object that does not author the key keeps its Export entries, since every `managedBy` bucket still defaults `exportCsv` to `true` (ADR-0103), with one change: the grid's table CSV button (`operations.export: true`) now also follows the effective `export` operation, as the toolbar menu beside it already did. So a viewer whose effective operations exclude `export` no longer sees that button, even on an object that authors nothing. The setting hides the entry and is not a permission: no export request is refused because of it, and who may export is still the permission set's `allowExport`. The report reads the base object's definition through the report's data source, and a report whose source cannot serve one keeps its Export control.
26+
27+
The spec's `exportCsv` description and the Studio form's help text now say this; the form's English help text bundle in `@objectstack/platform-objects` is regenerated to match, and the translated locales keep their wording. The liveness ledger grades `userActions.exportCsv` `live`, so an authored `exportCsv: true` no longer raises the `liveness-dead-property` warning at `os lint` / `os validate`. Nothing needs migrating.

‎content/docs/data-modeling/objects.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ indexes: [
333333
| :--- | :--- | :--- |
334334
| `isSystem` | `boolean` | System object, protected from deletion (default: `false`) |
335335
| `managedBy` | `enum` | Lifecycle bucket that sets the default CRUD affordances and write policy — `'platform'` (default), `'config'`, `'system-data'`, `'engine-owned'`, `'append-only'`, `'synced'`, `'better-auth'`. See [Lifecycle bucket](#lifecycle-bucket-managedby) below. |
336-
| `userActions` | `object` | Per-object override of the CRUD affordances the `managedBy` default implies — `{ create?, edit?, delete?, import?, exportCsv? }`. This is what NARROWS a `system-data` object, opens CSV `import` on one, or opens a verb on an `engine-owned`/`append-only` one. See [Lifecycle bucket](#lifecycle-bucket-managedby). |
336+
| `userActions` | `object` | Per-object override of the CRUD affordances the `managedBy` default implies — `{ create?, edit?, delete?, import?, exportCsv? }`. This is what NARROWS a `system-data` object, opens CSV `import` on one, or opens a verb on an `engine-owned`/`append-only` one. `exportCsv: false` hides the Export entry that downloads the object's data (CSV, XLSX or JSON) on its grids, list views and dataset reports; a Gantt view's PNG / PDF export of its chart is not covered. It refuses no export request, since who may export is the permission set's `allowExport`. See [Lifecycle bucket](#lifecycle-bucket-managedby). |
337337
| `sharingModel` | `enum` | Org-Wide Default record visibility (ADR-0055/0056/0090). Canonical four only: `'private'`, `'public_read'`, `'public_read_write'`, `'controlled_by_parent'` (detail visibility derived from its master). The legacy aliases (`'read'`, `'read_write'`, `'full'`) were removed from the enum (ADR-0090 D4) — authoring rejects them. Unset on a custom object resolves to `'private'` (ADR-0090 D1) |
338338
| `ownership` | `enum` | Record-ownership model: `'user'` (default — injects the reassignable `owner_id` lookup, engaging owner-scoped RLS, "My" views and owner reports, plus `owning_business_unit_id`), `'business_unit'` (owned by an org unit rather than a person — injects `owning_business_unit_id` and deliberately **no** `owner_id`; ADR-0117 D1), `'org'`, or `'none'` (no per-record owner of either kind — Dataverse-style catalog / junction tables). Distinct from the package `own`/`extend` contribution kind. |
339339
| `validations` | `ValidationRule[]` | Object-level validation rules (see [Validation](/docs/data-modeling/validation)) |

‎content/docs/frontend/plugins/plugin-list.mdx‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@ console passes `false` for a view authored `navigation: { mode: 'none' }` or
7272
data API serves no single-record read (objectstack#33317, objectstack#33548,
7373
objectstack#33549).
7474

75+
## The object's Export switch
76+
77+
The list's Export entry (the wide toolbar's button and the Display panel's
78+
footer) follows the object as well as the view. An object that sets
79+
`userActions.exportCsv: false` gets no Export entry for downloading its data,
80+
in any of the list's formats (CSV, XLSX, JSON); the object grid and a dataset
81+
report on that object hide theirs too. All three read one
82+
verdict, `isObjectExportOffered(objectDef, effectiveApiOperations)` from
83+
`@object-ui/core`: the authored switch over the object's `managedBy`
84+
default, ANDed with the caller's effective `export` API operation. Unset, the
85+
switch is on in every bucket. It hides the entry and is not a permission: who
86+
may export is the permission set's `allowExport`. A Gantt view's PNG and PDF
87+
export of the chart it draws is not covered by the switch.
88+
7589
## Status
7690

7791
This plugin is part of the v3.3.0 release. For full API reference and usage

‎content/docs/references/data/object.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ const result = ApiMethod.parse(data);
205205
| **import** | `boolean \| { enabled?: boolean; visibleWhen?: string \| object; disabledWhen?: string \| object }` | optional | Show CSV import wizard entry. Boolean, or an object adding visibleWhen/disabledWhen CEL predicates evaluated once per toolbar against the record in scope (the host record on a related list). |
206206
| **edit** | `boolean \| { enabled?: boolean; visibleWhen?: string \| object; disabledWhen?: string \| object }` | optional | Allow inline / form edit of existing rows. Boolean, or an object adding per-record visibleWhen/disabledWhen CEL predicates. |
207207
| **delete** | `boolean \| { enabled?: boolean; visibleWhen?: string \| object; disabledWhen?: string \| object }` | optional | Show row-level delete + bulk delete. Boolean, or an object adding per-record visibleWhen/disabledWhen CEL predicates. |
208-
| **exportCsv** | `boolean` | optional | Show CSV export entry. |
208+
| **exportCsv** | `boolean` | optional | Show the Export entry that downloads this object's data as CSV, XLSX or JSON: the grid's Export menu and its table CSV button, the list view's Export, and a dataset report's Export over this object; false hides it. A view's export of the picture it draws (the Gantt chart's PNG / PDF) is not covered. Omitted: shown, in every managedBy bucket. It hides the entry and refuses no export request: who may export is the permission set's allowExport. |
209209
| **transfer** | `boolean \| { enabled?: boolean; visibleWhen?: string \| object; disabledWhen?: string \| object }` | optional | Offer the Change Owner action (single and bulk) on records of this object. Boolean, or an object adding per-record visibleWhen/disabledWhen CEL predicates. Omitted: on, except off on a controlled_by_parent detail. Offered only where the platform injects a reassignable owner_id that is provable and not declared readonly (ownership user or omitted, no managedBy, not a sys_ object; an external object declares owner_id or maps a remote column onto it); enabled: true elsewhere is refused. Gates the action, not a plain owner_id write. Resolved by resolveUserActionTransfer. |
210210

211211
### Nested Shape: `Object.systemFields`

‎packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ export const enMetadataForms: NonNullable<TranslationData['metadataForms']> = {
455455
},
456456
"userActions.exportCsv": {
457457
label: "Export CSV",
458-
helpText: "The CSV export entry. Unset: shown, since every managedBy bucket offers export."
458+
helpText: "The Export entry that downloads this object's data (CSV, XLSX or JSON) on its grids, list views and dataset reports: on shows it, off hides it. A Gantt chart's PNG / PDF export is not covered. Unset: shown, since every managedBy bucket offers export. It is not a permission: who may export is the permission set's allowExport."
459459
},
460460
"userActions.transfer": {
461461
label: "Change Owner",

‎packages/spec/liveness/object.json‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245
"status": "live",
246246
"verifiedAt": "2026-11-19",
247247
"evidence": "packages/spec/src/data/object.zod.ts#resolveCrudAffordances (collapses `obj.userActions` onto the managedBy bucket's default row, the one resolution of the five CRUD entries); ui/packages/core/src/utils/managedBy.ts#resolveEffectiveCrudAffordances (hands the object's `userActions` to it and intersects the answer with the server's effective API operations)",
248-
"note": "Drilled 2026-11-19 when `transfer` (the Change Owner switch, ruling 7000907189 point 1, card #35401) landed beside the five CRUD entries with a different verdict: the container used to carry one blanket `live` (\"objectui ObjectGrid per-object CRUD.\") and was recorded in undrilled-containers.baseline.json, so its children had no verdict of their own. Each child below is graded by its own reader, measured at this tree: create/import/edit/delete read through resolveCrudAffordances by the server write guard, the apiMethods reconciliation, the /me/permissions clamp and the console's affordance rows; exportCsv by nothing past the resolver (see its row); transfer by nothing yet (planned).",
248+
"note": "Drilled 2026-11-19 when `transfer` (the Change Owner switch, ruling 7000907189 point 1, card #35401) landed beside the five CRUD entries with a different verdict: the container used to carry one blanket `live` (\"objectui ObjectGrid per-object CRUD.\") and was recorded in undrilled-containers.baseline.json, so its children had no verdict of their own. Each child below is graded by its own reader, measured at this tree: create/import/edit/delete read through resolveCrudAffordances by the server write guard, the apiMethods reconciliation, the /me/permissions clamp and the console's affordance rows; exportCsv by the console's export entries through isObjectExportOffered (see its row; it was graded dead on 2026-11-19 and flipped live on 2026-11-21 when those entries were wired, #35619); transfer by nothing yet (planned).",
249249
"children": {
250250
"create": {
251251
"status": "live",
@@ -268,10 +268,11 @@
268268
"evidence": "packages/plugins/plugin-security/src/system-write-guard.ts#assertEngineOwnedWriteAllowed (a user-context `delete`, `purge` or `restore` on an engine-owned bucket needs the resolved `delete`); packages/spec/src/data/managed-api-affordance.ts#checkManagedApiMethodAffordances (apiMethods `delete` against the resolved `delete`); packages/core/src/security/effective-object-permissions.ts#clampManagedObjectWrites (reads `userActions.delete`); ui/packages/core/src/utils/affordanceGrants.ts#resolveAffordance (the `rowDelete`, `recordDelete`, `listBulkDelete` and related-list rows read the resolved `delete` and `deletePredicates`); ui/packages/plugin-grid/src/ObjectGrid.tsx#ObjectGrid (per-row delete verdict and `objectDeletePredicates`)"
269269
},
270270
"exportCsv": {
271-
"status": "dead",
272-
"verifiedAt": "2026-11-19",
273-
"authorHint": "Remove it: no export menu reads it, so it neither shows nor hides CSV export. The export entry follows the view's exportOptions and the object's effective API operations.",
274-
"note": "Measured 2026-11-19 while drilling this container, by closing the call graph by hand: the key's only reader is packages/spec/src/data/object.zod.ts#resolveCrudAffordances, which copies it onto `CrudAffordances.exportCsv`, and nothing reads that bit. Server side: plugin-security's WRITE_OP_AFFORDANCE and the spec's MANAGED_WRITE_VERB_AFFORDANCE map only create/edit/delete, and core's clampManagedObjectWrites reads only create/edit/delete. Console side: ui/packages/core/src/utils/managedBy.ts#resolveEffectiveCrudAffordances only ANDs the bit with the effective `export` operation, AFFORDANCE_GRANTS has no export row (its `crud` column is create/import/edit/delete), and the export menus (ui/packages/plugin-grid/src/ObjectGrid.tsx `exportEnabled`, ui/packages/plugin-list/src/ListView.tsx `exportPermitted`, ui/packages/plugin-detail/src/RelatedList.tsx, ui/packages/plugin-report/src/ReportExport.tsx) gate on `exportOptions`, `operations.export`, `allowExport` and the effective `export` operation, never on it. `git grep exportCsv` over packages/ and ui/ at this tree returns the declaration, the resolver, the form row, the FLS table (`keep`) and tests only. So `exportCsv: false` does not hide the export entry. Its blanket `live` came from the container's undrilled verdict; drilling may not fan that out (README, Granularity). Enforce-or-remove (ADR-0049) is owed: wire the console export menus to the resolved bit, or retire the key."
271+
"status": "live",
272+
"verifiedAt": "2026-11-21",
273+
"evidenceScope": "in-repo",
274+
"evidence": "ui/packages/core/src/utils/managedBy.ts#isObjectExportOffered (the resolved `exportCsv` bit, through resolveEffectiveCrudAffordances, which hands the object's `userActions` to resolveCrudAffordances and ANDs the bit with the effective `export` API operation: the one export verdict every entry below reads); ui/packages/plugin-grid/src/ObjectGrid.tsx#ObjectGrid (`objectExportOffered`: the toolbar Export menu, its handler and the table's own CSV button); ui/packages/plugin-list/src/ListView.tsx#ListView (`exportPermitted`: the wide toolbar's Export, the Display panel's export footer and the export handler); ui/packages/plugin-report/src/ReportExport.tsx#ReportExportControl (the dataset report's Export, on the query answer's base object, whose definition it reads through the report's data source)",
275+
"note": "Flipped dead → live 2026-11-21 (#35619, ruling 7035537883: enforce). `exportCsv: false` hides the data Export entry (the CSV / XLSX / JSON download: the grid's Export menu and table CSV button, the list view's Export, the dataset report's Export), matching the `exportCsv → export` operation mapping in resolveEffectiveCrudAffordances; a view's export of the picture it draws is not covered (the Gantt view's PNG / PDF buttons in ui/packages/plugin-gantt/src/GanttView.tsx read no export verdict); the bucket defaults (ADR-0103, `exportCsv: true` in every bucket) are unchanged, so an object that does not author the key keeps its entry. It is a console affordance, not a permission: no server door reads it (plugin-security's WRITE_OP_AFFORDANCE, the spec's MANAGED_WRITE_VERB_AFFORDANCE and core's clampManagedObjectWrites map only create/edit/delete), and who may export stays the permission set's allowExport through the effective `export` operation. RelatedList (ui/packages/plugin-detail/src/RelatedList.tsx) offers no export entry at this tree: its table is drawn with `exportable: false`, its enlarged grid carries no `exportOptions`, and its toolbar has no export control, so there is nothing there to gate. Pinned per surface by the `*-35619` render tests beside each reader, each with a CONTROL that the default still shows the entry."
275276
},
276277
"transfer": {
277278
"status": "planned",

‎packages/spec/liveness/state-counts/object.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ committed anywhere: `check:liveness` sums the shards when it reads them.
1212

1313
| Type | live | exp | elsewhere | dead | planned | classified |
1414
|---|---|---|---|---|---|---|
15-
| `object` | 85 | 0 | 0 | 2 | 2 | 89 |
15+
| `object` | 86 | 0 | 0 | 1 | 2 | 89 |

‎packages/spec/src/data/object.form.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ export const objectForm = defineForm({
745745
{ field: 'import', label: 'Import', widget: 'json', helpText: 'The CSV import entry: on shows it, off hides it. A stored {enabled, visibleWhen, disabledWhen} object is edited key by key; write one in source to gate the entry on the record in scope, evaluated once per toolbar.' },
746746
{ field: 'edit', label: 'Edit', widget: 'json', helpText: 'Editing existing records, inline and in the form: on offers it, off hides it. A stored {enabled, visibleWhen, disabledWhen} object is edited key by key; write one in source to gate each row on its own record.' },
747747
{ field: 'delete', label: 'Delete', widget: 'json', helpText: 'Row and bulk delete: on offers it, off hides it. A stored {enabled, visibleWhen, disabledWhen} object is edited key by key; write one in source to gate each row on its own record.' },
748-
{ field: 'exportCsv', label: 'Export CSV', type: 'boolean', helpText: 'The CSV export entry. Unset: shown, since every managedBy bucket offers export.' },
748+
{ field: 'exportCsv', label: 'Export CSV', type: 'boolean', helpText: 'The Export entry that downloads this object\'s data (CSV, XLSX or JSON) on its grids, list views and dataset reports: on shows it, off hides it. A Gantt chart\'s PNG / PDF export is not covered. Unset: shown, since every managedBy bucket offers export. It is not a permission: who may export is the permission set\'s allowExport.' },
749749
{ field: 'transfer', label: 'Change Owner', widget: 'json', helpText: 'The Change Owner action, single and bulk: on offers it, off hides it. Unset: on, except off on a controlled_by_parent detail. Offered only on an object whose records have a reassignable owner (ownership user or unset, no managedBy, not a sys_ object, owner_id not readonly and, on an external object, declared or mapped); turning it on anywhere else is refused. It gates the action only, not a plain edit of owner_id. A stored {enabled, visibleWhen, disabledWhen} object is edited key by key; write one in source to gate the action on each record.' },
750750
],
751751
},

0 commit comments

Comments
 (0)