Repository navigation
refactor(plugin-view): read the three declared object-view keys without a cast - #27273
Merged
Merged
Conversation
…ut a cast `data`, `navigation` and `searchableFields` are declared members of `ObjectViewSchema`, so the `renderListView` relay reads them as `schema.K`. The 27 objectui#5097 host-composition reads keep their cast. The fence pin now derives the cast set (27) and the uncast declared set separately; the 7779 census pins follow the new source text. Claude-Session: https://claude.ai/code/session_01JQwxbaGCrvY8peSVMF3rQw Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
席位核对ACCEPT · seat 席位意见:ObjectView 里三个已在类型上声明的键(
Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Warren · project thread
Part of #25918 (the ListView reads and the lint rule stay open on the card).
Clause-②: no
Metadata-protocol: none
维护者速读
data、navigation、searchableFields)的(schema as any)读法改成直接schema.K;ObjectGrid 两处读法经核实都有真实生产者,保持不动。as any只是遮住类型检查,卡 lint/types: 14,366 no-explicit-any warnings can never red CI — make it an error on packages/types/src, delete the vestigial (schema as any) reads, and type ComponentRendererProps with unknown #25918 要求删掉这类残留写法。as any后生成的 JS 相同);27 个宿主组合键的读法一个没动;回滚即 revert 本 PR。ui/packages/plugin-view/src/ObjectView.tsx的renderListView区段;objectViewHostSurface.test.tsx改过的两条断言。pnpm --dir ui exec vitest run packages/plugin-view/src/__tests__/objectViewHostSurface.test.tsx,预期全部通过。What changes
ui/packages/plugin-view/src/ObjectView.tsx: inside the#region object-view HOST-COMPOSITION SURFACE (objectui#5097)fence, the three keys inOBJECT_VIEW_DECLARED_FORWARDED_KEYS(data,navigation,searchableFields) are now read asschema.K. All three are declared onObjectViewSchema(datathroughBaseSchema), so the cast hid nothing. The 27OBJECT_VIEW_HOST_COMPOSITION_KEYSreads keep their cast, per the objectui#5097 ruling. The fence comment, the two docblocks that described all 30 reads as casts, and thedatarung comment (which wrongly called nodedataone of the 27) now say what the code does.objectViewHostSurface.test.tsx: the fence pin now derives the cast set and the uncast set separately. It asserts the cast reads are exactly the 27 exempt keys, and that each declared key is read uncast. The named-view section's count drops from 27+3 to 27 for the same reason.object-view-unmirrored-keys-7779.test.ts(@object-ui/types): three literal source-text pins (thesearchableFieldsread twice, thedataread once) follow the new text. Its census regex already matched both spellings, so no count changed.ObjectGrid.tsxis unchanged. Both of its(schema as any)reads are on keys that a real producer writes onto anobject-gridnode, so neither read can stop here:rowActionDefs:DevRowActions.tsx(console dev page, anobject-gridnode literal),ListView's grid hand-off,RelatedListand app-shell'sobjectViewListRenderer. The key is declared onDataTableSchemabut not onObjectGridSchema, andComponentPropsMap['object-grid']refuses it by name.hideRowHeightToggle:ListView'sbasePropsset it totrueon theobject-gridnode it builds. It is declared nowhere.Both are already recorded as ruled non-author surface (objectui#5091) and pinned by
gridNonAuthorKeys.test.tsx. They are reported to the seat as findings and not filed here.Tests
Run on head
4c0dabbb(merge oforigin/main1e8e5296):pnpm --workspace-concurrency=2 --filter '@object-ui/plugin-view^...' buildunderos-verify-lock: VERDICT command-exit 0.pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-view/plus every test outside the package that readsplugin-view/src/ObjectView.tsxoff disk (six@object-ui/typescensus files, plugin-formaffordanceGrantMap-12082, plugin-listViewSwitcher.i18n-4024, two plugin-map files, reactnavigationOverlayConsumers.onRowClickArity-9357, schema-catalogcatalog-gallery-render): Test Files 89 passed (89), Tests 1738 passed (1738).pnpm --filter @object-ui/plugin-view run type-checkexit 0, andpnpm --filter @object-ui/types run type-checkexit 0. Both scripts includetsc -p tsconfig.test.json, so the edited tests are compiled.as anyemits the same JavaScript, and the existingforwards all 30 readsrender test still pins every value end to end.Acceptance notes
(activeView as any)?.dataand(activeView as any)?.rowActionDefsin the same fence are casts on the hostviewsprop entry, not onschema. They are outside this card's surface and are left as they are.skip-changeset): the emitted code of both published packages is unchanged. Only comments and type-level casts moved, and the@object-ui/typeschange is test-only.Verification
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 24 gate commands on this diff, and all 24 exited 0 (reconciled with--ran). Alsopnpm run check:new-line-citations(ui): 0 new citations.dispatch-gates --tier: no path-derived mandate.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses. (No formatter ran; lint was not run locally, CILint UIreads it.)main, one pull request.skip-changeset.)packages/spectouched: its generated artifacts are regenerated and committed. (Not applicable:packages/specuntouched.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbaGCrvY8peSVMF3rQw
Generated by Claude Code