@@ -79,9 +79,9 @@ import { resolveRowCrudAffordances, resolveRowRecordCrudAffordance } from './row
7979import { useRecordCrudVerdicts } from './hooks/useRecordCrudVerdicts' ;
8080import { resolveLegacyRowActions } from './resolveLegacyRowActions' ;
8181import { applyRelationalMeta } from './relationalMetaKeys' ;
82- import { resolveBulkActions , describeUnusableBulkActionDefs , resolvePromotedBulkParams } from './resolveBulkActions' ;
82+ import { resolveBulkActions , resolvePromotedBulkParams } from './resolveBulkActions' ;
8383import { partitionBulkRows } from './bulkEligibility' ;
84- import { resolvesToDataColumn , describeUnresolvedColumns } from './columnSpellingDiagnostics' ;
84+ import { resolvesToDataColumn } from './columnSpellingDiagnostics' ;
8585import { RowActionMenu , formatActionLabel , planRowActionMenu } from './components/RowActionMenu' ;
8686import { BulkActionBar } from './components/BulkActionBar' ;
8787import { BulkActionDialog } from './components/BulkActionDialog' ;
@@ -91,10 +91,11 @@ import { findParamsSignature, useResolvedGridFilters } from './objectGridQuery';
9191import { type ObjectGridColumn , type ObjectGridColumnDraft , isChipFieldType , normalizeColumns , resolveColumnLabel } from './objectGridColumns' ;
9292import { LinkCell , recordPointerFace , rowRecordId } from './objectGridLinkCell' ;
9393import { useGridTranslation } from './objectGridTranslations' ;
94- import { DEFAULT_DISPLAY_PAGE_SIZE , DEFAULT_FETCH_BATCH_SIZE , DEFAULT_SELECTION_TYPE , NO_GROUPING_REFUSAL , type RowHeightMode , describeNonPositivePageSize , resolvePageSize , resolveRowHeightMode } from './objectGridDefaults' ;
94+ import { DEFAULT_DISPLAY_PAGE_SIZE , DEFAULT_FETCH_BATCH_SIZE , DEFAULT_SELECTION_TYPE , NO_GROUPING_REFUSAL , type RowHeightMode , resolvePageSize , resolveRowHeightMode } from './objectGridDefaults' ;
9595import { type BatchSaveOutcome , OCC_TOKEN_FIELD , type RowConflictChoice , type WrittenRowVersion , rowVersionOf , rowVersionToSend } from './objectGridRowVersion' ;
9696import { type ObjectGridColumnState , type ObjectGridExternalPaginationProps , type ObjectGridFooterSummary } from './objectGridProps' ;
9797import { FooterSummaryReport } from './objectGridFooterSummaryReport' ;
98+ import { useObjectGridDiagnostics } from './objectGridDiagnostics' ;
9899export type { RetiredListColumnKey , ObjectGridColumnHolds , ObjectGridColumnDraft , ObjectGridColumn } from './objectGridColumns' ;
99100export type { ObjectGridColumnState , ObjectGridFooterSummary , ObjectGridExternalPaginationProps } from './objectGridProps' ;
100101
@@ -2622,84 +2623,9 @@ export const ObjectGrid: React.FC<ObjectGridComponentProps> = ({
26222623 wholeSetSummary . row ,
26232624 ) ;
26242625
2625- // An authored column the renderer cannot read now says so, instead of just
2626- // not being there (objectui#5349 — the Q2 objectui#5068 deferred).
2627- //
2628- // #5068 made `ListColumnSchema`'s `field` / `label` the only spelling read
2629- // here, which is right; what it left behind was the receipt. A column
2630- // authored `{ accessorKey, header }` (or with no `field` at all) is dropped
2631- // by `resolvesToDataColumn` above, and until this effect landed the author
2632- // saw no error, no warning and no empty header — just a grid with its
2633- // row-number column and no data columns. Same defect shape #5068 exists to
2634- // fix, one level down: renderer and author disagree, author gets a success
2635- // receipt.
2636- //
2637- // Scope, deliberately narrow: this reads the `columns` INPUT and nothing
2638- // else. It never asks whether the grid found ROWS, because a grid legitimately
2639- // draws them from five different places (inline `data` array, `data.provider:
2640- // 'value'`, legacy `staticData`, `bind`, or a host that owns the fetch and
2641- // passes the window down as a `data` React prop). A predicate that consulted
2642- // those would eventually paint a configuration error over a working grid.
2643- // `hidden: true` is authored intent and is never reported.
2644- //
2645- // Channel: the same one `ObjectGrid` already uses for "you declared it, the
2646- // renderer dropped it" — a `useEffect` keyed on the schema slice and one
2647- // `console.warn` prefixed `[ObjectUI] ObjectGrid <topic>:` (see the export
2648- // format warning below) — rather than a second, differently-shaped one.
2649- const columnDiagnosticBlockType = ( schema as { type ?: unknown } ) . type ;
2650- const columnDiagnosticLabel = schema . label ?? ( schema as { title ?: unknown } ) . title ;
2651- useEffect ( ( ) => {
2652- const message = describeUnresolvedColumns ( schema . columns , {
2653- blockType : columnDiagnosticBlockType ,
2654- objectName : schema . objectName ,
2655- label : columnDiagnosticLabel ,
2656- } ) ;
2657- if ( message ) console . warn ( message ) ;
2658- } , [ schema . columns , columnDiagnosticBlockType , schema . objectName , columnDiagnosticLabel ] ) ;
2659-
2660- // [objectui#8730] The same channel, for the sibling failure on
2661- // `bulkActionDefs`. A member that is not a usable def (a bare action name —
2662- // the OTHER key's vocabulary — or `null`, a number, `{}`, `{ name: '' }`) is
2663- // skipped by `resolveBulkActions`; before that guard it reached the bar and
2664- // `formatActionLabel(undefined)` threw during render, so the author's first
2665- // multi-row selection lost the whole selection bar.
2666- //
2667- // The skip alone would only relocate the failure into silence — which is what
2668- // the mirror direction already does (`bulkActions: [{ name: 'approve' }]`,
2669- // stepped over by the `typeof name !== 'string'` guard). Saying which member
2670- // was dropped, and that a bare name belongs in `bulkActions`, is what makes
2671- // this a diagnosis rather than a quieter version of the same defect. One
2672- // `console.warn` per authored array, keyed on it — NOT a second guard: the
2673- // predicate lives once, in `resolveBulkActions`, and this reads it.
2674- const bulkDefsDiagnosticSlice = ( schema as { bulkActionDefs ?: unknown } ) . bulkActionDefs ;
2675- useEffect ( ( ) => {
2676- const message = describeUnusableBulkActionDefs ( bulkDefsDiagnosticSlice , {
2677- blockType : columnDiagnosticBlockType ,
2678- objectName : schema . objectName ,
2679- label : columnDiagnosticLabel ,
2680- } ) ;
2681- if ( message ) console . warn ( message ) ;
2682- } , [ bulkDefsDiagnosticSlice , columnDiagnosticBlockType , schema . objectName , columnDiagnosticLabel ] ) ;
2683-
2684- // [objectui#9853] The same channel again, for a `pagination.pageSize` (or the
2685- // deprecated flat shorthand) that is not a positive integer. `resolvePageSize`
2686- // drops such a value at all three read points and uses the site's default; on
2687- // its own that is a quieter version of the defect, because substituting a
2688- // number the author never wrote is exactly what the flat site already did in
2689- // silence. This is the half that makes it a diagnosis.
2690- //
2691- // Keyed on the authored slice, so it is one warning per declaration and not
2692- // one per render. NOT a second guard — the predicate lives once, in
2693- // `isUsablePageSize`, and this reads it.
2694- const pageSizeDiagnosticObject = schema . pagination ;
2695- const pageSizeDiagnosticFlat = schema . pageSize ;
2696- useEffect ( ( ) => {
2697- const message = describeNonPositivePageSize (
2698- { pagination : pageSizeDiagnosticObject , pageSize : pageSizeDiagnosticFlat } ,
2699- { blockType : columnDiagnosticBlockType , objectName : schema . objectName } ,
2700- ) ;
2701- if ( message ) console . warn ( message ) ;
2702- } , [ pageSizeDiagnosticObject , pageSizeDiagnosticFlat , columnDiagnosticBlockType , schema . objectName ] ) ;
2626+ // The authored-input diagnostics (`columns`, `bulkActionDefs`, page size),
2627+ // three `console.warn` effects, run here in hook order (`./objectGridDiagnostics`).
2628+ useObjectGridDiagnostics ( schema ) ;
27032629
27042630 const generateColumns = useCallback ( ( ) : ObjectGridColumnDraft [ ] => {
27052631 // objectui#11815 — the host's verdict on a declared deadline's
0 commit comments