Add per-column settings on view fields

Closed
FE
2d ago
+1003-154

Adds a settings column on viewField so an added (non-canonical) column can override how one view displays its field: a label and, for one-to-many relations, a record limit. Canonical columns keep following field metadata. First PR of the configurable-columns stack, motivated by showing e.g. the next open action item in an Opportunities "Next step" column.

Changes

  • Schema: nullable jsonb core.viewField.settings, typed ViewFieldSettings in twenty-shared ({ label?: string | null; recordLimit?: number | null }). Fast instance command 2.59.0_AddViewFieldSettingsFastInstanceCommand_1794591685022, fenced with @WasIntroducedInUpgrade; additive, no backfill.
  • Validation in the view-field validator (shared by GraphQL, REST, AI tools and manifests), through one zod schema the AI tools also use:
    • settings on a canonical column are rejected ("Only added columns can be customized"), on create, update and when routed to overrides;
    • unknown keys rejected; label trimmed, 1 to 63 characters;
    • recordLimit an integer from 1 to 60, only on a one-to-many relation field.
  • Public surface: ViewField.settings and settings on CreateViewFieldInput / UpdateViewFieldInputUpdates; ViewFieldManifest.settings (documented in layout/views.mdx); the view-field AI tools take and return isCanonical and settings.
  • Seeding: re-seeding an object's initial view copies only canonical columns (an isCanonical still unreadable mid-upgrade counts as canonical).
  • Every place that builds a view field sets settings: null, including a type-only edit to the released 2-26 command. Front and client-sdk metadata clients regenerated.

Stack

The work is split into short tracks that can be reviewed and merged in parallel. Each PR targets main or the one PR it builds on. Two PRs need several others; they target an integration branch (felix/relaxed-einstein-vxil3q-base-*, not a PR) that merges exactly their dependencies, so their diff shows only their own changes. A PR can merge once everything in its "Builds on" column is merged; retarget it to main at that point.

Size counts changed lines outside tests and generated files: S < 300, M 300–800, L > 800. Sizes are a snapshot and are not kept in sync with every push.

TrackPRWhat it doesSizeCodeTests / generatedBuilds on
Server: views#30339 👈Per-column settings on view fields (label, record limit)S+300 −2+703 −152main
Server: views#30341A view can be owned by a one-to-many view field (scope view)M+584 −56+891 −4main
Server: views#30472Lookup: a view field shows one field of its related recordM+280 −38+428 −4#30339
Server: views#30466upsertViewFieldWithScope: save a column with its settings, lookup and scope in one migration (~600 lines moved out of view-widget-upsert)L+1330 −567+1117 −256#30339, #30341, #30472
Server: views#30450Expose column scopes and lookups in the view AI toolsS+31+222#30339, #30341, #30472
Server: query engine#30347Honor filter / orderBy / first on nested one-to-many relationsM+462 −86+509main
Server: query engine#30473One relation-selection tree through the common query layer (refactor, no behavior change)L+663 −685+277 −46#30347
Server: query engine#30465Each alias of a nested relation gets its own arguments and rowsL+595 −237+727 −21#30473
Front#30468Query a relation under an alias with its own filter, sort and limitS+140 −19—main
Front#30469Don't recreate a saved sort that comes back under a new idS+21 −17+8main
Front#30348Extra table columns and the Edit column panel, behind IS_COLUMN_SETTINGS_ENABLEDM+718 −76+152 −30#30339
Front#30349Scope one-to-many columns from the Edit column panelL+1053 −92+316 −18#30348, #30466, #30468, #30469, #30465
Front#30439Lookup columns in the table, editable from their cells (absorbs #30440)L+805 −223+283 −30#30349
Front#30458Lookup and scoped columns on boards and calendarsM+404 −284+140 −7#30439

The longest dependency chain is #30339 → #30348 → #30349 → #30439 → #30458; everything else is one or two levels deep. #30339, #30341 and #30472 each add a 2.59 instance command, so whichever merges after another may need a fresh timestamp.

Testing

  • Integration view-field-settings: create, rename and clear a label on an added column; reject a record limit on a non-relation field, an empty label, and settings on a canonical column (on create, on update, and routed to overrides on a standard view field).
  • Unit: validate-flat-view-field-settings, compute-missing-initial-object-view-operations (extra columns skipped), manifest round-trip fixtures and registry snapshots.
  • MCP view tools and app-sync snapshots updated.

Generated by Claude Code