Repository navigation
Expand file tree
/
Copy pathObjectView.tsx
More file actions
3407 lines (3283 loc) · 177 KB
/
Copy pathObjectView.tsx
File metadata and controls
3407 lines (3283 loc) · 177 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* ObjectUI
* Copyright (c) 2024-present ObjectStack Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* ObjectView Component
*
* A complete object management interface that combines multi-view data display
* (grid, kanban, calendar, gallery, timeline, gantt, map) with ObjectForm
* for create/edit operations.
*
* Features:
* - Multi-view type rendering via SchemaRenderer
* - Named listViews support (e.g., "All", "My Records", "Active")
* - Navigation config for row click behavior (page/drawer/modal/none/new_window)
* - Direct data fetching for all view types
* - Integrated search, filter, and sort controls
* - ViewSwitcher for toggling between view types
*/
import React, { useEffect, useState, useCallback, useMemo, useRef } from 'react';
import type {
ObjectViewSchema,
ObjectGridSchema,
ObjectFormSchema,
DataSource,
ViewSwitcherSchema,
ViewType,
NamedListView,
ViewNavigationConfig,
ObjectMapConfig,
TreeViewConfig,
} from '@object-ui/types';
import { ObjectGrid } from '@object-ui/plugin-grid';
import { ObjectForm } from '@object-ui/plugin-form';
import {
cn,
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
DialogDescription,
Drawer,
DrawerContent,
DrawerHeader,
DrawerTitle,
DrawerDescription,
Sheet,
SheetContent,
SheetHeader,
SheetTitle,
SheetDescription,
Button,
Tabs,
TabsList,
TabsTrigger,
useIsMobile,
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
buttonVariants,
toast,
} from '@object-ui/components';
import { Plus } from 'lucide-react';
import { useObjectTranslation, createSafeTranslation, useDisplayLocale, pickLocalized } from '@object-ui/i18n';
// objectui#7928 — a named view's `label` is the protocol's `I18nLabel` (a plain
// string or an inline locale map) since `ObjectViewSchema.listViews` became its
// record by reference. Resolved the way `ListView` resolves its own `label`.
import { resolveI18nLabel as resolveInlineI18nLabel } from '@objectstack/spec/ui';
import type { ListView as SpecListView } from '@objectstack/spec/ui';
import {
buildExpandFields,
normalizeListViewSchema,
mergeFilterNodes,
columnIdentity,
convertSortToQueryParams,
recordDelete,
resolveAffordance,
resolveFilterPlaceholders,
toFilterNodeSafely,
GANTT_CONFIG_SPELLING,
type FilterTokenScope,
type SchemaLike,
} from '@object-ui/core';
import { SchemaRenderer as ImportedSchemaRenderer, useSettledSchema, notifyDataChanged, useDataInvalidation, useFilterScope } from '@object-ui/react';
import type { HandleClickModifiers } from '@object-ui/react';
import { usePermissions } from '@object-ui/permissions';
import { ViewSwitcher } from './ViewSwitcher';
import { useStableIdentity, isStructurallyEqual } from './stableIdentity';
/**
* SchemaRenderer from @object-ui/react, used to render sub-view schemas.
*/
const SchemaRendererComponent: React.FC<any> = ImportedSchemaRenderer;
/**
* The `case 'map'` branch below builds an `object-map` schema by flattening
* `viewOptions.map`'s CONTENTS to the top level — one entry per key
* `ObjectMapConfigSchema` declares, written under the name the FLAT form uses
* for that key. Whitelisted rather than a whole-bag spread: `style` is ALSO
* `BaseSchema.style` (inline CSS, legal on every node), and spreading the raw
* `map` block collapsed the two namespaces onto one key (objectui#5177). That
* reason is unchanged, and so is its consequence: a key the declaration does
* NOT carry never reaches the product.
*
* `style` IS delivered (objectui#9950) — under its flat spelling `mapStyle`,
* NOT by widening the whitelist to let `style` through unrenamed.
* `getMapConfig` in `ObjectMap.tsx` reads `schema.mapStyle || schema.map?.style`
* and deliberately does NOT read a top-level `style`, because that key is the
* base face's inline CSS (objectui#5017). `mapStyle` is itself a declared
* member of `ObjectMapSchema`, so the flat product stays inside the declaration
* at both ends. Before this, a view authoring `map: { style: '<url>' }` parsed
* green, was dropped here, and the map painted the PUBLIC DEMO TILES.
*
* HAND-LISTED, not derived at runtime — deliberately, and only here (`plugin-
* map`'s own `FLAT_MAP_CONFIG_KEYS` in `ObjectMap.tsx` DOES derive from
* `ObjectMapConfigSchema.shape`, and should stay that way): this file is
* reachable from `examples/console-starter`'s own `src/`, so it is part of the
* import graph `vite-alias-closure.test.ts` walks. That walker resolves a bare
* `@object-ui/*` specifier with plain `index.<ext>` conventions and cannot find
* `@object-ui/types/zod`'s actual barrel file (`zod/index.zod.ts` — a
* non-standard name) — a REAL runtime import of it here reproducibly fails
* that gate (measured on objectui#5177's first PR, PR #5231, CI run
* 32160288416), even though Vite's own alias table already resolves the
* specifier correctly (`examples/console-starter/vite.config.ts` has carried
* an explicit `@object-ui/types/zod` entry since PR #5156). `ObjectMap.tsx`
* gets away with the runtime import only because nothing in
* console-starter's graph reaches `@object-ui/plugin-map` today.
*
* Anti-drift is TWO mechanisms, neither of them this comment:
* - the type below is TOTAL — a `Record` over EVERY `keyof ObjectMapConfig`,
* not a list of some of them — so a key added to the declaration fails
* `tsc` here until it is given a flat spelling. A key can no longer be
* left out by simply not being written down, which is how `style` was.
* - `ObjectView.mapFlatten.test.tsx` pins this object's key set against
* `ObjectMapConfigSchema.shape` — imported only from that TEST file, which
* the alias-closure walker explicitly excludes from traversal — and asserts
* the RELATION (every declared key is delivered under its flat spelling).
* The pre-#9950 pin could not see the omission because it compared the hand
* list against `shape` MINUS `style`: the set it measured against was
* narrowed by the same subtraction the defect was made of, so it stayed
* green while an authored style was being discarded.
*/
export const FLAT_MAP_CONFIG_SPELLING = {
latitudeField: 'latitudeField',
longitudeField: 'longitudeField',
locationField: 'locationField',
titleField: 'titleField',
descriptionField: 'descriptionField',
zoom: 'zoom',
center: 'center',
// The one key whose flat spelling differs from its declared name — see the
// objectui#9950 paragraph above for why it is `mapStyle` and not `style`.
style: 'mapStyle',
} as const satisfies Record<keyof ObjectMapConfig, string>;
/**
* The flat product of `generateViewSchema`'s `timeline` branch, by the same
* mechanism as {@link FLAT_MAP_CONFIG_SPELLING}: one entry per key the
* `@objectstack/spec` list view's `timeline` block declares, under the name the
* renderer reads it by on the node (the same name for every key).
* objectui#6152 round 14 put it in place of the raw spread of the block, which
* forwarded every key a stored block carried, after the node's own keys: an
* undeclared key reached the node, a block key named like a node key
* (`objectName`) overrode the node's own value, and the block's pre-#2231
* `dateField` alias landed on `ObjectTimeline`'s FLAT `dateField` prop, where
* it bound the axis. The `gantt` branch's table is `GANTT_CONFIG_SPELLING`
* from `@object-ui/core`, shared with `ListView` (objectui#13458).
*
* TOTAL over the spec's own type: a key the spec adds to the block fails `tsc`
* here until it is listed. Type-only import, so the alias-closure walker the
* map table's docblock describes is not involved.
*/
const TIMELINE_CONFIG_SPELLING = {
startDateField: 'startDateField',
endDateField: 'endDateField',
titleField: 'titleField',
groupByField: 'groupByField',
colorField: 'colorField',
scale: 'scale',
} as const satisfies Record<keyof NonNullable<SpecListView['timeline']>, string>;
/**
* The gallery block's declared keys; see {@link TIMELINE_CONFIG_SPELLING}. One
* difference from that table and the gantt's: the picked keys go out NESTED, as the
* node's own `gallery` block, because that is where `ObjectGallery` reads all
* five (`schema.gallery.KEY`, objectui#12053). The spec's block and the
* renderer's reads are the same five keys, so this table is both.
*/
const GALLERY_CONFIG_SPELLING = {
coverField: 'coverField',
coverFit: 'coverFit',
cardSize: 'cardSize',
titleField: 'titleField',
visibleFields: 'visibleFields',
} as const satisfies Record<keyof NonNullable<SpecListView['gallery']>, string>;
/**
* Copy the declared keys an author actually wrote onto the flat product,
* each under its flat spelling — the map's keys by default, another block's
* when a branch passes its table.
*
* Values travel AS WRITTEN: this is transport, not a second validation of the
* declared block — that reading belongs to `getMapConfig` in `ObjectMap.tsx`
* and stays there (objectui#5018). Discarding an ill-typed value here would
* reintroduce exactly the silent drop objectui#9950 closed.
*/
function pickFlatMapConfig(
mapConfig: unknown,
spelling: Readonly<Record<string, string>> = FLAT_MAP_CONFIG_SPELLING,
): Record<string, unknown> {
if (!mapConfig || typeof mapConfig !== 'object') return {};
const source = mapConfig as Record<string, unknown>;
return Object.fromEntries(
Object.entries(spelling)
.filter(([declared]) => declared in source)
.map(([declared, flat]) => [flat, source[declared]]),
);
}
/**
* `table.columns` as a FIELD-NAME list — the shape the non-grid field slot
* declares (objectui#5269).
*
* `ObjectGridSchema.columns` is `string[] | ListColumn[]`, but the slot the
* non-grid branch forwards into is a names slot, and its consumers treat every
* entry as a field name — `ObjectKanban` indexes
* the record by it (`resolveKanbanCardFields` casts straight to `string[]`).
* Handing a `ListColumn[]` down raw would therefore arrive as a non-empty card
* field list naming nothing, which renders WORSE than the empty one this card
* fixes: `ObjectKanban` skips its `highlightFields` fallback whenever the list
* is non-empty. That is the objectui#5270 failure again — a value forwarded
* into a slot whose declared shape it does not have — and it is answered the
* same way, at the boundary.
*
* `columnIdentity` is the repo's single converged reader for "which field does
* this column entry name" (objectui#3104), and it is what `ObjectGrid` already
* applies to the SAME `table.columns` value on the grid path (its `$select`
* derivation) and what `ObjectTree` applies downstream. So this narrows a
* declared union to the branch this slot can hold; it does not widen the set
* of accepted spellings, and it keeps the two paths resolving one value the
* same way.
*
* `undefined` — never `[]` — when nothing resolves, so the `||` chain falls
* through to the deprecated `table.fields` instead of stopping on a truthy
* empty array.
*/
function tableColumnFieldNames(columns: unknown): string[] | undefined {
if (!Array.isArray(columns) || columns.length === 0) return undefined;
const names = columns.map(columnIdentity).filter((n): n is string => !!n);
return names.length > 0 ? names : undefined;
}
/**
* A NAMED VIEW's `columns` as a field-name list — the same identity fold as
* {@link tableColumnFieldNames}, at the two name slots a named view reaches
* (objectui#8254).
*
* ⭐ WHY THIS EXISTS NOW, AND WHY IT IS NOT A TOLERANCE LAYER. The header above
* used to justify forwarding the two view segments RAW on the ground that they
* "declare `string[]`". That ground is what objectui#7928's option A removes:
* the protocol's value type for `listViews` (`ObjectListViewSchema`,
* `@objectstack/spec/ui`) declares `columns` as the SAME `string[] |
* ListColumn[]` union `table.columns` carries — measured on this branch by
* `__tests__/ObjectView.specShapedNamedView-8254.test.tsx`, which builds its
* fixture by PARSING it with that schema rather than by asserting it looks
* right. So a spec-shaped named view can hold the `ListColumn[]` half, and
* handing it down raw is verbatim the failure the header above describes: a
* non-empty card field list naming nothing. Narrowing a declared union to the
* branch a slot can hold is the boundary fix objectui#5269 already ruled for
* `table.columns`; it accepts no spelling `columnIdentity` did not already
* accept, and the union slots on the same branches (`gridSchema.columns`, the
* delegated `list-view` `columns`) keep taking the value raw because their
* declared shape holds it.
*
* ⚠️ PRESENCE-PRESERVING, and that is the ONE way it differs from
* {@link tableColumnFieldNames}: `[]` in, `[]` out. That sibling folds an empty
* list to `undefined` so its `||` chain falls through to the deprecated
* `table.fields` alias — a PRECEDENCE decision belonging to that chain. This
* fold changes SHAPE only: an authored empty `columns` (which
* `ObjectListViewSchema` accepts) still stops the `||` chain exactly where it
* stops today, so no view's source of columns moves. A list whose every entry
* resolves to no identity does collapse to `[]` — the improvement, not a
* precedence change: `ObjectKanban` then reaches its `highlightFields`
* fallback instead of rendering a non-empty list of nameless columns.
*/
function viewColumnFieldNames(columns: unknown): string[] | undefined {
if (!Array.isArray(columns)) return undefined;
return columns.map(columnIdentity).filter((n): n is string => !!n);
}
/**
* objectui#10885 — a named view's `hiddenFields`, applied to the column
* projection route 2 hands `ObjectGrid`.
*
* The protocol composes three members of a named list view: `columns`
* projects, `hiddenFields` subtracts, `fieldOrder` orders what survives
* (objectstack#15184 ruling B). `ObjectGrid` has no `hiddenFields` read, and
* `object-grid` declares no such key, so relaying the member by name would put
* a key on the grid node that nothing reads. The subtraction is therefore made
* here, on the resolved projection, as `ListView` subtracts it for the host
* delegation (its `effectiveFields`), except that an entry with no field
* identity is kept: `ListView` drops such an entry whenever `hiddenFields` is
* non-empty.
*
* - Only a DECLARED projection is narrowed. With no `columns` anywhere the grid
* derives its own defaults, and this returns `undefined` unchanged, as
* `ListView` does.
* - An entry is dropped only when `columnIdentity` names a hidden field. Every
* other entry, and the entry's own shape, is kept.
* - A projection that every entry leaves is kept as the empty projection the
* author wrote; it does not fall back to the grid's defaults.
*
* Generic over the whole array type because the `columns` slot is a union of
* two array types (`string[] | ListColumn[]`): filtering keeps each entry as it
* was, so the result has the type the input had, which the one cast states.
*/
function withoutHiddenFields<C extends readonly unknown[]>(columns: C | undefined, hidden: readonly string[] | undefined): C | undefined {
if (!Array.isArray(columns) || !Array.isArray(hidden) || hidden.length === 0) return columns;
const drop = new Set(hidden);
return (columns as readonly unknown[]).filter((entry) => {
const name = columnIdentity(entry);
return !name || !drop.has(name);
}) as unknown as C;
}
/**
* objectui#10885 — a named view's `fieldOrder`, the third step of the same
* composition: it orders what `withoutHiddenFields` left. `ObjectGrid` has no
* `fieldOrder` read and `object-grid` declares no such key, so the order is
* applied here, to both projection slots.
*
* The application is `ListView`'s own (its `effectiveFields`), step for step,
* so both routes hand `ObjectGrid` the same order for the same view: a stable
* sort by each entry's position in `fieldOrder`. An entry `fieldOrder` does not
* name, or one with no field identity, sorts after the named ones and keeps its
* place among them; a name the projection does not carry orders nothing; with
* no projection nothing is invented.
*/
function inFieldOrder<C extends readonly unknown[]>(columns: C | undefined, order: readonly string[] | undefined): C | undefined {
if (!Array.isArray(columns) || !Array.isArray(order) || order.length === 0) return columns;
const rank = new Map<string, number>(order.map((name, i) => [name, i]));
const at = (entry: unknown): number => rank.get(columnIdentity(entry) as string) ?? Infinity;
return [...(columns as readonly unknown[])].sort((a, b) => at(a) - at(b)) as unknown as C;
}
/**
* objectui#10885 — a named view's `exportOptions`, in the one shape the
* `object-grid` slot holds.
*
* The protocol declares the member on a named view as `{ formats?, maxRecords?,
* includeHeaders?, fileNamePrefix?, streaming? }`, and declares a bare format
* array as its legacy spelling, which "lifts to `{ formats: [...] }` at parse"
* (the member's own description in `@objectstack/spec`). A named view reaches
* this component unparsed, so the bare array can arrive as written. `ObjectGrid`
* reads `exportOptions.formats`, which an array does not have: relayed as is,
* the grid would offer its default formats instead of the ones the author
* listed. So the declared union is narrowed to the slot's branch here, by the
* protocol's own lift, the way `ListView` narrows it for the host delegation.
* It accepts no spelling the protocol does not; the node-shape fold of a
* declared union at the boundary is the objectui#5269 / objectui#8254 pattern
* `viewColumnFieldNames` follows.
*/
function gridExportOptions(options: NamedViewConfig['exportOptions']): ObjectGridSchema['exportOptions'] {
if (Array.isArray(options)) return { formats: options };
return options;
}
/**
* objectui#10976 — the `table` members this component hands the grid it draws
* VERBATIM, beside the ones the grid-node build below reads off `table` by
* name (`columns` / `fields`, `filter`, `sort`,
* `pagination` / `pageSize`, `selection` / `selectable`, `operations`, `title`,
* `className`).
*
* Each is a key `ObjectGrid` reads (`schema.KEY` in `ObjectGrid.tsx`), so a
* value an author writes on `table` reaches a read. Before this card the slot
* TYPED every one of them and the build copied none: `table: { editable: true }`
* type-checked and did nothing.
*
* Copied only when the author wrote the key — no default is injected, so a view
* that writes none of them hands the grid exactly what it did before. Where the
* active NAMED view declares the same member (the objectui#10885 rungs below),
* the named view wins and `table` is the fallback: the precedence `pagination`,
* `selection`, `filter` and `sort` already have.
*
* ⛔ The slot declares these keys and the by-name ones and no other grid member
* (`ObjectGridSlotKey` in `@object-ui/types`). A key added here is added there,
* or `object-view-slot-key-lists.test.ts` and this file's `satisfies` refuse it;
* `ObjectView.tableSlotRelay-10976.test.tsx` pins each one reaching `ObjectGrid`.
* ⛔ No alias: `batchActions` and `resizableColumns` are the legacy spellings of
* `bulkActions` and `resizable`, and the slot withholds them.
*/
export const OBJECT_VIEW_TABLE_RELAY_KEYS = [
'aggregations',
'bulkActionDefs',
'bulkActions',
'conditionalFormatting',
'editable',
'exportOptions',
'frozenColumns',
'grouping',
'label',
'reorderableColumns',
'resizable',
'rowActions',
'rowColor',
'rowHeight',
'searchableFields',
'showColumnTypeIcons',
'showPagination',
'showSearch',
'singleClickEdit',
] as const satisfies readonly (keyof NonNullable<ObjectViewSchema['table']>)[];
type TableRelayKey = (typeof OBJECT_VIEW_TABLE_RELAY_KEYS)[number];
type TableRelay = Partial<Pick<ObjectGridSchema, TableRelayKey>>;
/** One relayed member, copied only when the author wrote it. */
function copyAuthored<K extends TableRelayKey>(to: TableRelay, from: TableRelay, key: K): void {
if (from[key] !== undefined) to[key] = from[key];
}
/** The relayed `table` members the author wrote, and only those. */
function authoredTableRelay(table: ObjectViewSchema['table']): TableRelay {
const relay: TableRelay = {};
if (!table) return relay;
for (const key of OBJECT_VIEW_TABLE_RELAY_KEYS) copyAuthored(relay, table, key);
return relay;
}
/**
* One entry of `ObjectViewSchema.listViews` — the protocol's
* `ObjectListViewSchema`, by reference (objectui#7928). Derived from the member
* rather than named on its own, so this component reads exactly the type the
* contract declares.
*/
type NamedViewConfig = NonNullable<ObjectViewSchema['listViews']>[string];
/**
* The two authored filter segments this component chains, in precedence
* order: the active view's own filter (a named `listViews` entry, else the
* host's `views` entry), then the object-level `table.filter`.
*
* A third segment, the deprecated alias `table.defaultFilters`, was read as a
* legacy rung until objectui#12030: `@objectstack/spec` 18 retired
* `object-grid.defaultFilters` as a tombstone that refuses by name
* (objectstack#11509), and the read went with it, as objectui#12093 said it
* would at the pin that carries the tombstone.
*/
interface AuthoredFilterSegments {
view: NamedListView['filter'];
table: ObjectGridSchema['filter'];
}
/**
* objectui#11880 item 5 — the `table` rung of the filter this component hands
* the grid it draws: `table.filter`, unless it lowers to nothing.
*
* "Lowers to nothing" is the sink's own answer (`toFilterNodeSafely`: absent,
* `[]`, `{}`, a record of nulls), not a truthiness test; such a filter hands
* the grid no filter, as it did while the retired `table.defaultFilters` rung
* stood behind it and was absent.
*
* A REFUSED `table.filter` is kept, not skipped: it reaches `ObjectGrid`, which
* draws its malformed-filter panel, as it did before.
*/
function gridTableFilterRung(segments: AuthoredFilterSegments): ObjectGridSchema['filter'] {
const canonical = toFilterNodeSafely(segments.table);
if (!canonical.ok || canonical.node !== undefined) return segments.table;
return undefined;
}
/**
* objectui#10506 — resolve every filter placeholder in the authored filter
* segments ONCE, through `@object-ui/core`'s shared `resolveFilterPlaceholders`,
* against the session scope the host provides (`useFilterScope`).
*
* This is the one point where the segments meet, and all three doors a filter
* leaves this component by read from its result: the non-grid `find()`, the
* `object-grid` schema handed to `ObjectGrid`, and the `list-view` schema handed
* to a host's `renderListView`. Before it, this component had no read of the
* resolver at all, so `{ owner: '{current_user_id}' }` in a named view reached
* the query as the literal token while the app-shell host resolved it.
*
* ⛔ Not a second resolver, and no fallback: a token the scope cannot resolve
* is whatever `resolveFilterPlaceholders` makes of it (left intact, with one
* warning naming it).
*
* The result is HELD against its inputs rather than recomputed per render.
* `ObjectGrid` and `ListView` both key their fetch on the filter's identity, so
* a resolved copy minted on every render would refetch on every render; and a
* date macro such as `{now}` resolves to a new value at every call, so holding
* against the OUTPUT (compare, keep the old reference if equal) cannot stop
* that either. The key is the raw segments, compared by structure — a host that
* rebuilds an equal `views` array inline must not re-resolve (objectui#6460) —
* plus the scope's members read one by one, never the scope object's identity
* (AGENTS.md #10). The held pair lives in state, not in a ref read during
* render, so the value handed out is always the one React committed.
*/
function useResolvedFilterSegments(
segments: AuthoredFilterSegments,
scope: FilterTokenScope,
): AuthoredFilterSegments {
const [held, setHeld] = useState(() => resolveFilterSegments(segments, scope));
if (
held.currentUserId !== scope.currentUserId
|| held.currentOrgId !== scope.currentOrgId
|| held.recordId !== scope.recordId
|| held.onUnresolved !== scope.onUnresolved
|| !isStructurallyEqual(held.segments, segments)
) {
// React's documented "information from previous renders" shape: a set
// during render re-renders this component at once, before any child sees
// the discarded pass, and the re-render finds the inputs equal.
const next = resolveFilterSegments(segments, scope);
setHeld(next);
return next.resolved;
}
return held.resolved;
}
/** One resolution, remembered with the inputs it was computed from. */
interface HeldFilterSegments {
segments: AuthoredFilterSegments;
currentUserId: FilterTokenScope['currentUserId'];
currentOrgId: FilterTokenScope['currentOrgId'];
recordId: FilterTokenScope['recordId'];
onUnresolved: FilterTokenScope['onUnresolved'];
resolved: AuthoredFilterSegments;
}
function resolveFilterSegments(segments: AuthoredFilterSegments, scope: FilterTokenScope): HeldFilterSegments {
return {
segments,
currentUserId: scope.currentUserId,
currentOrgId: scope.currentOrgId,
recordId: scope.recordId,
onUnresolved: scope.onUnresolved,
resolved: resolveFilterPlaceholders(segments, scope),
};
}
/**
* Record-create verb, shared with the runtime object pages: both surfaces
* resolve `console.objectView.new` ("New" / 新建) so the Studio grid toolbar
* and the running app never disagree (framework#2615 P3). Falls back to
* English when no I18nProvider is mounted (standalone usage) — via the
* key-identity probe, not a caught throw.
*/
function useCreateVerb(): string {
// No try/catch: `useObjectTranslation` is provider-safe (optional context
// read + react-i18next global-instance fallback) and never throws, so the
// key-identity probe below is the whole "no provider" path. Wrapping a hook
// in try/catch violates rules-of-hooks — a throw after it ran would desync
// hook order on the next render (objectui#2879, same class as #2595/#2596).
const { t } = useObjectTranslation();
const value = t('console.objectView.new');
return value === 'console.objectView.new' ? 'New' : value;
}
/**
* English fallbacks for the headings this view resolves through `t()`
* (objectui#3459 for the split-mode record-detail heading — retired with the
* split face, objectstack#26677, the key staying as the probe — objectui#3462 for
* the create/edit/view form titles — both following #3426's shape).
*
* Every entry must exist HERE as well as in the locale packs: a provider-less
* host never reaches the packs, and `createSafeTranslation`'s fallback is what
* interpolates the placeholder.
*
* ── Why these keys, and not new ones ──────────────────────────────────────
* `detail.recordDetailWithLabel` is borrowed from the `detail.*` namespace
* rather than minted as `view.recordDetail`: `NavigationOverlay` — the very
* component that heading is handed to — already resolves that namespace, as do
* `ListView` / `ObjectGrid` / `ObjectKanban` / `ObjectTree`, and one heading on
* one control should not get several translations that can drift apart.
*
* `form.createTitle` / `form.editTitle` are reused for the same reason, and are
* not new: all ten packs already carry them, and `app-shell` already heads the
* PAGE-mode record form with exactly these (`RecordFormPage.tsx`,
* `AppContent.tsx`). The drawer / modal titles below are the same
* heading on a different surface, so they resolve the same keys — minting a
* parallel `console.objectView.*` family would have guaranteed the two spellings
* drift (zh already distinguishes 新建 from 创建). Only the third verb,
* `form.viewTitle`, had no sibling; it was added to all ten packs.
*
* Note the placeholder is `{{object}}`, not `{{label}}` — that is the variable
* the existing `form.*Title` family declares, and the pack-vs-en placeholder
* parity guard compares placeholder sets per key.
*
* `detail.recordDetailWithLabel` doubles as the probe key: under a provider
* `t()` returns the pack's template (≠ the key) so the real translator is used;
* with no provider the key comes back unchanged and this map supplies the
* English.
*/
const VIEW_DEFAULT_TRANSLATIONS: Record<string, string> = {
'detail.recordDetailWithLabel': '{{label}} Detail',
// Byte-for-byte the strings `getFormTitle` used to build with a template
// literal, so an English session and every e2e spec that addresses this
// chrome by name see no change at all.
'form.createTitle': 'Create {{object}}',
'form.editTitle': 'Edit {{object}}',
'form.viewTitle': 'View {{object}}',
// objectui#10383 — the grid's row / bulk Delete. Not new keys: these are the
// ones the console's own list delete resolves, all present in the ten packs.
// The `objectActions.*` rows are asked for by the shared `recordDelete` core
// (`@object-ui/core`), which this view hands `tView`, so a provider-less host
// reads them here. The dialog's copy is the core's too
// (`recordDelete.confirmCopy`, objectui#11695): the title, the
// `console.objectView.bulkDeleteConfirm` question and the Delete label;
// `actionConfirm.cancel` is this host's own chrome, in the console's
// `ActionConfirmDialog` shape.
'actionConfirm.cancel': 'Cancel',
'objectActions.deleteConfirmTitle': 'Delete {{label}} "{{name}}"?',
'objectActions.bulkDeleteConfirmTitle': 'Delete {{count}} {{label}} records?',
'objectActions.bulkDeleteConfirmTitle_one': 'Delete {{count}} {{label}} record?',
'objectActions.bulkDeleteConfirmTitle_other': 'Delete {{count}} {{label}} records?',
'objectActions.deleteConfirmButton': 'Delete',
'objectActions.deleteConfirm': 'Are you sure you want to delete this record?',
'console.objectView.bulkDeleteConfirm': 'Delete {{count}} selected records? This cannot be undone.',
// Count families (objectui#11445): `fallbackT` reads a family's `_one` /
// `_other` row for a numeric `count`, as i18next reads the `en` pack.
'console.objectView.bulkDeleteConfirm_one': 'Delete {{count}} selected record? This cannot be undone.',
'console.objectView.bulkDeleteConfirm_other': 'Delete {{count}} selected records? This cannot be undone.',
'objectActions.deleteSuccess': '{{label}} deleted successfully',
'objectActions.deleteFailed': 'Failed to delete {{label}}',
'objectActions.bulkDeleteSuccess': 'Deleted {{count}} {{label}} records',
'objectActions.bulkDeleteSuccess_one': 'Deleted {{count}} {{label}} record',
'objectActions.bulkDeleteSuccess_other': 'Deleted {{count}} {{label}} records',
'objectActions.bulkDeletePartial': '{{succeeded}} deleted, {{failed}} failed',
};
const useObjectViewTranslation = createSafeTranslation(
VIEW_DEFAULT_TRANSLATIONS,
'detail.recordDetailWithLabel',
);
export interface ObjectViewProps {
/**
* The schema configuration for the view
*/
schema: ObjectViewSchema;
/**
* Data source (ObjectQL or ObjectStack adapter) — REQUIRED. This component
* never resolves one for itself.
*
* This comment used to close with "If not provided, falls back to
* SchemaRendererProvider context", one line above a declaration that has
* been required for its whole life (objectui#7842). The measurement that
* settled which of the two was wrong: `ObjectView` holds no context read at
* all — no `useContext`, no `SchemaRendererContext`, and not
* `useElementDataSource`, which is how `@object-ui/react` spells that
* fallback for the components that genuinely have one. The value travels
* from this prop into `useSettledSchema(schemaKey, dataSource)` (which has
* no context read either) and into the two effects below, and every one of
* those sites GUARDS on it instead of resolving one —
* `if (!dataSource?.onMutation …) return;` and
* `if (!dataSource || !schema.objectName) return;`.
*
* The promise was not invented, it was MISFILED. `ObjectViewRenderer`
* (`./index.tsx`) — the renderer registered for the `object-view` and `view`
* schema tags — is the thing that does exactly what that sentence described:
* it reads `useContext(SchemaRendererContext)` and hands `ctx?.dataSource`
* down to this prop. A schema-driven host therefore does get the provider's
* adapter; a caller writing `<ObjectView …>` in TSX does not, and tsc
* refuses the omission at the call site.
*
* What happens if it is absent anyway (an untyped JS host, or that
* registered renderer with no provider mounted, which passes `null`):
* nothing throws and nothing is fetched. `useSettledSchema` settles with
* `def: null`, both effects return early, and the value is forwarded
* verbatim to `ObjectGrid` / `SchemaRenderer`, whose own `dataSource` is
* declared optional. The view renders its chrome and stays empty.
*
* ⛔ Making this prop optional would WIDEN a published accept set — a
* maintainer's ruling, not a passing edit (objectui#7842). Pinned by
* `__tests__/ObjectView.dataSourceContextFallback-7842.test.tsx`.
*/
dataSource: DataSource;
/**
* Additional CSS class
*/
className?: string;
/**
* Views available for the ViewSwitcher.
* Each view defines a type (grid, kanban, calendar, etc.) and display columns/config.
* If not provided, uses schema.listViews or falls back to default grid view.
*
* `sort` spells its direction key `order`, like every other sort surface in
* the repo (`SortConfig`, `NamedListView.sort`, `ObjectGridSchema.sort`)
* and like the shared sink `convertSortToQueryParams` reads
* it. It used to be declared as `direction` (objectui#5293), which NO
* consumer of THIS prop ever read: all three consumers of the resolved
* `activeView.sort` read `order`, so a host writing `direction: 'desc'` got a
* SILENTLY ascending list — the sink's `entry.order === 'desc'` is false for
* a missing key, the grid built the wire string `name undefined`, and
* `parseSchemaSort` drew an ascending arrow above it. The rename does not
* remove a working feature; it converts that silent wrong answer into a loud
* type error.
*
* The claim is scoped to those three consumers on purpose. The published
* `toSortItems` export elsewhere in this package used to fold
* `s.order || s.direction` for the studio inspector-draft — a different
* surface, unreachable from this prop, which is why it was not retired with
* this rename. It has since been retired on its own card (objectui#6011), so
* `order` is now the only sort spelling this package reads on either surface.
*
* ⛔ Deliberately NOT a tolerant dual-read (`direction ?? order`) — that is
* the tolerance layer objectui#4869 ruled against, and re-adding it here
* would restore the very spelling drift this declaration now closes.
*/
views?: Array<{
id: string;
label: string;
type: ViewType;
columns?: string[];
sort?: Array<{ field: string; order: 'asc' | 'desc' }>;
filter?: any[];
/**
* Per-view `tree` config — the block the `'tree'` branch of
* `generateViewSchema` below reads (objectui#8253, ruling batch #78,
* option (a), maintainer 「同意」).
*
* ⭐ This declaration can only NARROW, and that is the whole of its value.
* The `[key: string]: any` on the line under it already ADMITTED a `tree`
* key of any shape, so nothing that used to be refused becomes accepted;
* what changes is that a host writing this entry as an object LITERAL now
* gets `parentFeild` reported as an excess property instead of stored,
* dropped and never mentioned. That is the class-(c) defect this card was
* filed for.
*
* ⛔ Declared, ⛔ not re-declared: the shape is `TreeViewConfig` in
* `@object-ui/types`, which `plugin-tree`'s resolver imports as well. One
* declaration, three readers.
*
* ⭐ And since objectui#8841 that one declaration is the PROTOCOL's:
* `TreeViewConfig` is `NonNullable<ListView['tree']>` from
* `@objectstack/spec/ui`, not a hand copy of it under a second name. What
* this prop admits is therefore exactly what `@objectstack/spec` admits on
* `ListView.tree` — including its refusal of `titleField`, which the copy
* declared and the protocol rejects.
*
* ⚠️ Reach, measured on this tree and NOT claimed wider than it is: the
* console's own call site passes `mergedViews`, built by
* `app-shell/src/views/ObjectView.tsx` as `views.map((v: any) => …)` over
* STORED view records, so it arrives here as `any[]` and this declaration
* reports nothing about it. It bites a host that composes the entry inline
* against this prop's type. Typing the stored-record path is a separate
* change on app-shell, recorded rather than smuggled in here.
*/
tree?: TreeViewConfig;
[key: string]: any;
}>;
/**
* The currently active view ID.
* Used for controlled ViewSwitcher state.
*/
activeViewId?: string;
/**
* Callback when the active view changes
*/
onViewChange?: (viewId: string) => void;
/**
* Callback when a row is clicked (for record detail navigation)
*
* TWO parameters since objectui#9462, and the second is not decoration. The
* view's own `handleRowClick` is what `ObjectGrid` hands to
* `useNavigationOverlay`, and that hook invokes it as
* `onRowClick(record, event)` — the modifier payload (`metaKey` / `ctrlKey` /
* `button`) a host needs to implement Cmd/Ctrl/middle-click for itself.
* `handleRowClick` used to forward one argument, so this prop delivered
* nothing on the second and a host's "open in a new tab" degraded to an
* ordinary navigation. Spelled `any` and not `HandleClickModifiers` for the
* reason objectui#9341 measured on `ObjectKanbanSchema.onCardClick`: a host
* that discovered the payload from the implementation annotated it
* `React.MouseEvent`, which a narrower declaration refuses contravariantly.
*
* Supplying it hands the host the WHOLE decision, modifier clicks included.
* With no handler, the view answers a Cmd/Ctrl/middle-click itself by opening
* the record in a new browser tab (objectui#9806). A row the view made inert
* stays inert: under `navigation.mode: 'none'`, `navigation.preventNavigation`,
* or `operations.read: false` with no navigation config, a modifier click does
* nothing, as a plain click does.
*/
onRowClick?: (record: Record<string, unknown>, event?: any) => void;
/**
* Callback when edit is triggered on a record
*/
onEdit?: (record: Record<string, unknown>) => void;
/**
* Render a custom ListView implementation for multi-view support.
* When provided, this replaces the default view rendering for the content area.
*/
/**
* ADR-0053: when the host (app-shell ObjectView) already renders the view
* switcher (ViewTabBar), set this so the inner view doesn't render its own
* duplicate named-view tab row. Standalone consumers leave it unset.
*/
hideNamedViewTabs?: boolean;
renderListView?: (props: {
schema: any;
dataSource: DataSource;
onEdit?: (record: Record<string, unknown>) => void;
/**
* The view's own `handleRowClick`, verbatim — so TWO parameters since
* objectui#9462, for the same reason {@link ObjectViewProps.onRowClick}
* carries them: a custom list view that has a DOM click event in hand may
* pass it, and it reaches the host through the forward below.
*/
onRowClick?: (record: Record<string, unknown>, event?: any) => void;
className?: string;
/** Current refresh counter — increment signals that a mutation occurred */
refreshKey?: number;
/** Same handler the built-in toolbar's "+ New" button uses — forward it
* into the custom list view's own add-record affordance (e.g. ListView's
* `addRecord.enabled` toolbar button) so callers can fold record creation
* into their list's toolbar instead of the separate `showCreate` row. */
onAddRecord?: () => void;
}) => React.ReactNode;
/**
* Toolbar addon: extra elements to render in the toolbar (e.g., MetadataToggle)
*/
toolbarAddon?: React.ReactNode;
/**
* Callback when the "+" create view button is clicked in ViewSwitcher.
*/
onCreateView?: () => void;
/**
* Callback when a per-view action is triggered in ViewSwitcher.
*/
onViewAction?: (action: string, viewType: ViewType) => void;
}
type FormMode = 'create' | 'edit' | 'view';
/**
* HOST-COMPOSITION SURFACE on the `object-view` node — the keys the
* `renderListView` delegation branch reads off the node that are deliberately
* NOT declared members of `ObjectViewSchema`, and ⛔ not to be taught as
* schema keys anywhere in the docs (objectui#5097).
*
* ## The verdict
*
* The delegation branch in `renderContent` below reads 30 distinct keys off
* the object-view node and forwards them to the host's list renderer. Three
* of them — `data`, `navigation`, `searchableFields`, listed in
* {@link OBJECT_VIEW_DECLARED_FORWARDED_KEYS} — are declared members of
* `ObjectViewSchema` and are read without a cast. The other 27, listed here,
* are read through `(schema as any).K`, are not declared, and stay that way:
* they are HOST-COMPOSITION surface, not authored surface. This constant is
* their single home; the branch is fenced by `#region` markers so the pin in
* `src/__tests__/objectViewHostSurface.test.tsx` fails BY NAME when a read is
* added or removed without touching this list.
*
* ## The ruling that made it deliberate
*
* Maintainer, 2026-08-18, on objectui#5097, verbatim 「同意」: the 27 keys are
* HOST surface, exempted with reasons — not authored surface. Basis: measured
* reachability. The delegation branch is entered ONLY when a host passes the
* `renderListView` prop; the registered renderer does not pass it; so the
* schema-registration path documented to authors cannot reach these keys at
* all, and declaring them on `ObjectViewSchema` would promise authors a
* surface that does nothing on their path.
*
* ⛔ Do not declare these on `ObjectViewSchema`, and ⛔ do not delete a read as
* a tidy-up — deleting a read is what silently blanks a stored app-shell
* document, and it is exactly what a reader of "not authored surface" is most
* likely to think is the clean finish. The structural follow-through (typing
* this block as an explicit host-side prop contract, so host surface and
* authored surface are separated in types, and retiring the `(schema as any)`
* reads) is owned by the objectui#5043 family track, not by this exemption.
*
* ## Who supplies the prop — what makes "host surface" checkable
*
* Every in-tree non-test supplier lives in `@object-ui/app-shell`, and there
* are TWO of them. Re-measured on `main` at `e03dfa5ea`; both were already
* present at the ruling's base `9fbb9b52f`, which named only the first:
*
* - `packages/app-shell/src/views/ObjectView.tsx:1718` — the React host
* defines the callback; it is passed at `:2481` and `:2524`.
* - `packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx:2575`
* — the Studio design surface, as `renderListView={renderStudioGridList}`.
*
* The registered renderer is `ObjectViewRenderer` (`./index.tsx:58`), which
* renders `ObjectView` with `schema` and `dataSource` only and passes no
* `renderListView`. It is registered twice — under `object-view`
* (`./index.tsx:66`) and under the alias `view` (`./index.tsx:100`) — and
* neither registration can reach this branch.
*
* ## What the contract says about these keys
*
* Nothing at all, and that is the shape of the answer here — unlike the
* sibling `object-grid` exemption (objectui#5091, PR #5241), where the spec
* answered `unrecognized_keys` by name. `@objectstack/spec`'s
* `ComponentPropsMap` carries no `object-view` entry, so the repo-wide
* `registry-inputs-spec-parity` gate — which derives its expectations FROM
* `ComponentPropsMap` — never covers this node in either direction and is owed
* nothing here. The node's published authoring surface is the registry
* `inputs` list at `./index.tsx:71-86` (15 names; the alias `view` declares no
* `inputs` at all), and none of the 27 appears on either registration.
*
* ## The one asymmetry — `conditionalFormatting` — RESOLVED (objectui#5248)
*
* As ruled on 2026-08-18, 26 of the 27 were read ONLY inside the host-only
* branch, and `conditionalFormatting` had a SECOND read site in
* `generateViewSchema`'s kanban branch — reachable through the REGISTERED
* renderer, so for that one key the ruling's "the authored path cannot reach
* it" basis was narrower than for its 26 neighbours. objectui#5097 recorded the
* gap rather than acting on it and filed the contract question as
* objectui#5248.
*
* That question is now answered, and the gap is closed. Maintainer ruling of
* 2026-08-19 (verbatim 「全部接受」, recorded on objectui#5248): a conditional —
* Option 2 gated on a liveness check, Option 1 (declare the key) had the check
* found real authored usage. The liveness check came back EMPTY:
*
* - objectui `content/docs/**`, `skills/**`, `examples/**`, `apps/**`:
* `conditionalFormatting` occurs in exactly two files, on `object-grid`
* (`content/docs/plugins/plugin-grid.mdx`) and on `list-view`
* (`skills/objectui/guides/schema-expressions.md`) — both DECLARED homes,
* neither an object-view node.
* - objectstack: no authored `object-view` node exists at all (two prose
* mentions repo-wide), against 54 files carrying `object-form` and 19
* carrying `object-grid` as the control.
* - No in-repo fixture or catalog schema carries both an object-view node and
* the key: the only files carrying both are this one, its pin test, the
* type declarations, app-shell's host (which reads the key into the
* delegated `list-view` node, not onto the object-view node) and prose.
*
* So the fallback read was dropped from the kanban branch (see
* `kanbanConditionalFormatting`). Every one of the 27 is now read ONLY inside
* the `#region` fence, and the exemption's stated basis holds for all of them
* without exception. The pin in `objectViewHostSurface.test.tsx` asserts the
* resolution directly: ZERO exempt keys are read outside the fence.
*/
export const OBJECT_VIEW_HOST_COMPOSITION_KEYS = [
'addDeleteRecordsInline',
'addRecord',
'addRecordViaForm',
'allowExport',
'allowPrinting',
'aria',
'bulkActions',
'clickIntoRecordDetails',
'collapseAllByDefault',
'color',
'compactToolbar',
'conditionalFormatting',
'emptyState',
'fieldTextColor',
'hiddenFields',
'inlineEdit',
'pagination',
'prefixField',
'resizable',
'rowActionDefs',
'rowActions',
'selection',
'sharing',
'showDescription',
'showRecordCount',
'userFilters',
'wrapHeaders',
] as const;
/**
* The other three keys the same branch reads off the node: these ARE declared
* members of `ObjectViewSchema` (`data` via `BaseSchema`), so they are
* authored surface, are read as `schema.K` with no cast, and are NOT part of
* the objectui#5097 exemption.
* They are listed so the pin can assert the split, not just the exempt half —
* a read that moves from this list into the one above is a key losing its
* declaration, and must fail loudly.
*
* `filterableFields` was the fourth until objectui#13118: `@objectstack/spec`
* retires it in 18.0 (objectstack#24640, ruling C) and no per-view Filter-panel
* whitelist replaces it, so this branch no longer forwards it from any source.
* `ObjectViewSchema` keeps it only as the spec's slot by reference, deprecated,