Reported from an app project (steedos-labs/os-project-titanwind-ehr#1161) on @objectstack/*@17.0.0-rc.6.
The divergence
@objectstack/spec types a list view's exportOptions as a bare array:
// packages/spec/src/ui/view.zod.ts:1438exportOptions: z.array(z.enum(['csv','xlsx','pdf','json'])).optional().describe('Available export format options'),The only renderer of that property reads an object and looks for .formats:
// objectui/packages/plugin-grid/src/ObjectGrid.tsx:1394constdeclared=schema.exportOptions?.formats||['csv','json'];
objectui/packages/types/src/objectql.ts:785 declares the object shape
({ formats?, maxRecords?, includeHeaders?, fileNamePrefix? }) under the comment
"Aligned with @objectstack/spec ListViewSchema.exportOptions" — that comment is
false today; the two shapes have never matched.
Consequence for app projects
A project that follows the published spec type writes exportOptions: ['xlsx'].
At render time ['xlsx'].formats is undefined, so ObjectGrid falls back to
['csv', 'json'] and XLSX never appears in the export menu. Writing the object form
that Console actually reads makes the metadata fail its own @objectstack/spec type
check. There is no declaration that is both type-legal and functional, which is
what the reporting project hit.
Second defect on the same property: the dead 'pdf' member
The spec enum still admits 'pdf', but PDF export was closed NOT_PLANNED as
objectstack-ai/objectstack#1301, and ObjectGrid drops unsupported formats with only a
runtime console.warn (ObjectGrid.tsx:1403-1409). So exportOptions: ['xlsx','pdf']
type-checks, passes validate, passes tsc, and silently renders a menu without PDF —
the app author's only signal is a browser console line they may never see.
Repro
- Declare
exportOptions: ['xlsx', 'pdf'] on any object list view (spec-legal form). - Grant
allowExport. - Open the list's export menu → only CSV and JSON, no XLSX, no PDF, no build/validate diagnostic.
What we're asking for
- Pick one shape and make it the contract. Either spec adopts the object form
Console implements (with array-form normalization for back-compat), or Console is
fixed to read the array the spec publishes. Whichever side moves, the false
"Aligned with @objectstack/spec" comment at objectui/packages/types/src/objectql.ts:785
must be corrected in the same change. - Resolve
'pdf'. Given objectstack#1301 is NOT_PLANNED, the spec enum should
drop 'pdf' (a breaking-but-honest narrowing), or a declared-but-unrenderable format
should surface as a validate-time diagnostic rather than a runtime console.warn.
Business impact at the reporting project
The customer spec (§7.7) promises "download/print supports PDF/Excel export". Both halves
are currently blocked platform-side: XLSX by the contract mismatch above, PDF by
objectstack#1301.
Related
Reported from an app project (
steedos-labs/os-project-titanwind-ehr#1161) on@objectstack/*@17.0.0-rc.6.The divergence
@objectstack/spectypes a list view'sexportOptionsas a bare array:The only renderer of that property reads an object and looks for
.formats:objectui/packages/types/src/objectql.ts:785declares the object shape(
{ formats?, maxRecords?, includeHeaders?, fileNamePrefix? }) under the comment"Aligned with
@objectstack/specListViewSchema.exportOptions" — that comment isfalse today; the two shapes have never matched.
Consequence for app projects
A project that follows the published spec type writes
exportOptions: ['xlsx'].At render time
['xlsx'].formatsisundefined, so ObjectGrid falls back to['csv', 'json']and XLSX never appears in the export menu. Writing the object formthat Console actually reads makes the metadata fail its own
@objectstack/spectypecheck. There is no declaration that is both type-legal and functional, which is
what the reporting project hit.
Second defect on the same property: the dead
'pdf'memberThe spec enum still admits
'pdf', but PDF export was closed NOT_PLANNED asobjectstack-ai/objectstack#1301, and ObjectGrid drops unsupported formats with only aruntime
console.warn(ObjectGrid.tsx:1403-1409). SoexportOptions: ['xlsx','pdf']type-checks, passes
validate, passestsc, and silently renders a menu without PDF —the app author's only signal is a browser console line they may never see.
Repro
exportOptions: ['xlsx', 'pdf']on any object list view (spec-legal form).allowExport.What we're asking for
Console implements (with array-form normalization for back-compat), or Console is
fixed to read the array the spec publishes. Whichever side moves, the false
"Aligned with @objectstack/spec" comment at
objectui/packages/types/src/objectql.ts:785must be corrected in the same change.
'pdf'. Givenobjectstack#1301is NOT_PLANNED, the spec enum shoulddrop
'pdf'(a breaking-but-honest narrowing), or a declared-but-unrenderable formatshould surface as a validate-time diagnostic rather than a runtime
console.warn.Business impact at the reporting project
The customer spec (§7.7) promises "download/print supports PDF/Excel export". Both halves
are currently blocked platform-side: XLSX by the contract mismatch above, PDF by
objectstack#1301.Related
window.print()— no preview, no output, silent no-op in headless/WebView objectui#4462objectstack-ai/objectstack#1301— print / PDF export, closed NOT_PLANNED