chore: ADR-0079 — migrate record titles to nameField (framework v11)#420
Merged
Conversation
Retire the render-only `titleFormat` template on all 12 CRM objects in
favor of `displayNameField`, which names a REAL field holding the record
title (the installed @objectstack/spec v10.x key for ADR-0079's intent;
`nameField` does not exist in this framework version and is rejected by
ObjectSchema.create's unknown-key guard).
Single-field titles point straight at the field:
• task → subject
• contact → full_name (existing formula field)
Composite titles add a `display_title` formula field (CEL string concat,
mirroring the repo's existing Field.formula shape) and point
displayNameField at it:
• account, campaign, opportunity, knowledge_article, case, quote,
product, lead, forecast
Degraded (lookup segment cannot be referenced by a formula, ADR-0072):
• contract → displayNameField: 'contract_number'
(dropped '{crm_account.name}' dot-walk; only local field remains,
so no formula)
• forecast → display_title = period_label + (period_start)
(dropped leading '{owner}' lookup; date text()-coerced)
opportunity.stage (a select) is referenced by its stored value directly.
Verified green in the worktree: objectstack validate, tsc --noEmit,
objectstack build, objectstack lint, vitest (17/17). Pre-existing
dashboard widget-binding warnings and enable.* liveness warnings are
unrelated and unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Completes the ADR-0079 record-title migration on framework v11.2.0, which lands `nameField` as the canonical title key. v10 only had the `displayNameField` alias and rejected `nameField` outright (ADR-0032 unknown-key guard), so the first migration pass had to target the alias. - Bump all @objectstack/* ^10.0.0 → ^11.2.0 - Rename displayNameField → nameField across all 12 migrated objects (single-field titles + composite formula-field titles) Verified on v11.2.0: build OK, tsc clean, validate (pre-existing widget warnings only), vitest 17/17.
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.
ADR-0079 — 记录标题迁移到
nameField(canonical)退役 render-only 的
titleFormat(服务端无法返回 / 查询 / 排序它),改用 ADR-0079 的nameField—— 指向一个真实存储字段作为记录标题。改动
nameField是 v11 才落地的 canonical 键(v10 仅有displayNameField别名,且 ADR-0032 未知键守卫直接拒nameField)。nameField: 'the_field'。returnType: 'text'的 formula 字段并指定为nameField(服务端可返回 / 排序)。验证(v11.2.0)
build✓ /typecheck✓ /validate(仅既有 widget 警告)/test全过。配合 framework#2434(foundation)+ #2458(autoprov)+ #2463(lint gate)。