Expose lookup columns in the view field AI tools
Merged
FE
17h ago+184+184+012345678901234567890123456789-0-0-0123456789
App manifests can already declare lookup columns (#30472). The view AI/MCP tools could not, and no manifest sync test declared one. This PR closes both gaps.
Changes
- View-field tools:
create_view_fieldandcreate_many_view_fieldsacceptisCanonical(defaulttrue) andrelationTargetFieldMetadataId, so they can add a lookup column next to a relation's own column.update_view_fieldandupdate_many_view_fieldsacceptrelationTargetFieldMetadataId;nullshows the related record again.create_view_field,update_view_fieldandget_view_fieldsreturn both fields.
- The tools only pass values through; the server validators enforce the rules.
- Not changed:
upsert_complete_viewreconciles columns by field and doesn't model extra columns.
Stack
Lookup columns show one field of the record a many-to-one relation points to (Company › Address on People); aggregate columns show a count or sum over a one-to-many relation (People › Count on Companies). Each PR targets the one it builds on; retarget it to main once that one merges.
Size counts changed lines outside tests and generated files: S < 300, M 300–800, L > 800.
| PR | What it does | Size | Code | Tests / generated | Builds on |
|---|---|---|---|---|---|
| #30472 | Server: a view field can show one field of its related record (relationTargetFieldMetadataId) | M | +401 −39 | +552 −3 | merged into main |
| #30450 👈 | Server: lookup columns in the view field AI tools | S | +32 | +152 | main |
| #30348 | Front: tables handle several columns of one field | S | +289 −70 | +193 | merged into main |
| #30439 | Front: lookup columns, added from the + menu | L | +1025 −234 | +421 −30 | main |
| #30482 | Server + front: aggregate columns (count, sum, avg, min, max) | L | +1200 −268 | +1725 −122 | #30439 |
Independent of this stack: #30347 (nested one-to-many filter / orderBy / first) and #30485 (upsertViewWidget keeps omitted filter group fields and clears them on null), both on main.
Testing
- Integration: new
successful-sync-application-lookup-view-field(an app declares a non-canonical many-to-one view field and its lookup target resolves); MCP view tools snapshot updated. - Server typecheck and oxlint.
Generated by Claude Code