Skip to content

feat(studio): the field inspector, field designer and object settings write Field change values (#36290 part 1) - #36641

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-qldp6w
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-qldp6w

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Part of #36290

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 管理员在 Studio 的字段设置和字段设计器里,原来的「记录历史」开关换成「字段修改值」三选一(默认 / 开 / 关),对象设置的「功能开关」里新增「字段修改值」;普通用户无感。
  • 属于记录页「字段修改前后值」专题,落实「默认显示、对象或单个字段可关」的裁决:以前 Studio 写的是不再起作用的旧开关,管理员在界面上关不掉前后值。
  • 若出错,管理员可能看到「默认」标成开而动态里实际不显示前后值(或相反),或关掉后回不到默认;改动只在设置界面,可直接撤回。
  • 要你做的:无。

What changes

Card #36290 part ① (PR 3 of 4; ruling 7076513167 point 1: "Old → new is shown by default on every object's record page; an object, or a single field, can turn it off."). PR 1 (#36399) gave the runtime fieldHistory (field) and enable.fieldHistory (object); #36580 gave the metadata form a three-way field-history widget. The Studio's own producers still wrote the old key. This PR moves all three named in the release comment.

Field inspector (ObjectFieldInspector.tsx, Advanced section)

  • The "Track history" box (value={!!def.trackHistory}, patchDef({ trackHistory: v || undefined })) is gone. Measured reason: since PR 1 a field's trackHistory: false reads like absent and true does only what fieldHistory: true does for a media or JSON type (spec describe of FieldSchema.trackHistory), so a second box beside Field change values could only mislead. A stored trackHistory is never written or removed here; it is still read, because resolveFieldHistory reads it.
  • New row "Field change values": Default / On / Off over the field's fieldHistory. Default removes the key (unsetDefKey, not a patch to undefined); On / Off write true / false.
  • Default names what it resolves to through resolveFieldHistory from @objectstack/spec/data, the predicate the activity writer uses. Unlike the form widget, this rail holds the object document, so it passes the object: an object with enable.fieldHistory: false makes every field's Default read "Default (Off)", and a note under the row says the object's off wins.
  • The row sits inside the existing DisplayPatchLock, so on a read-only base field it is locked with the same reason as its neighbours (fieldHistory is not on BASE_FIELD_DISPLAY_WHITELIST).

Object settings (ObjectSettingsPanel.tsx, Features card)

  • New row "Field change values" (enable.fieldHistory), next to "Field change history" (enable.trackHistory). Ticked unless the stored value is a literal false. Unticking writes false; ticking again REMOVES the key (unset already means on, so no true the author did not need). Sibling enable keys are kept, as for every other row.
  • The Field change history description no longer says "pair with per-field history tracking to pick which field diffs are summarized" (no longer true); it points to Field change values.

Field designer (plugin-designer FieldDesigner.tsx, the drawer behind MetadataFieldsPage and the field-designer SDUI type)

  • The Advanced section's Track History switch wrote trackHistory: data.trackHistory === true on every save, create and edit. It is replaced by Field Change Values with the same three choices. The update path no longer names trackHistory: a stored value rides the ...editingField spread, and a created field carries neither key at Default.
  • Default's label depends on the type, which the author can change in the same drawer, and a drawer select's options are static. So the choice is drawn as two rows under form-local names, one per resolved default, each shown by a visibleWhen built from resolveFieldHistory over DESIGNER_FIELD_TYPES (with the field's stored trackHistory). The save reads the row shown for the saved type, which is the one on screen at the click. Neither form-local name reaches the model.
  • DesignerFieldDefinition (@object-ui/types) and its zod mirror gain an optional fieldHistory. Both save paths carry it: MetadataFieldsPage (toDesignerField / fromDesignerField) and MetadataService.toFieldPayload. Default writes fieldHistory: undefined, which overrides the carried value and is dropped on the wire, so a stored key is removed. That is the converters' existing clear-by-absence rule.
  • It cannot import fieldHistoryChoice.ts, because app-shell depends on plugin-designer. What it shares is the rule (resolveFieldHistory from @objectstack/spec/data). Its own copy of the choice-to-value mapping is two lines. Its strings are the language-pack keys appDesigner.fieldDesigner.fieldHistory, fieldHistoryDefault, fieldHistoryOn and fieldHistoryOff, in all 11 locales and the designer's defaults table. They replace appDesigner.fieldDesigner.trackHistory.

Shared logic (metadata-admin/fieldHistoryChoice.ts, new): the three choices, the value each writes and their wording, used by both the inspector row and the #36580 field-history widget (refactored onto it; its behaviour and its 10 pins unchanged). The controls stay separate on purpose: the widget is a WidgetProps renderer that sees one form row and no object; the inspector row is an InspectorSelectField with the inspector's label and lock semantics and the whole object in hand.

Strings (studio namespace, en + zh; the other locales fall back to en by that namespace's design): designer.field.fieldHistory, designer.field.fieldHistoryObjectOff, engine.studio.settings.capFieldHistory, engine.studio.settings.capFieldHistoryDesc; engine.studio.settings.capTrackHistoryDesc reworded; designer.field.trackHistory removed with its box.

Not in this PR: record-page rows (part ②, landed as #36613), the per-field history card (part ③).

Tests

  • New ObjectFieldInspector.fieldHistory-36290.test.tsx (7): Default (On) for a one-line type; Default (Off) for image / json / password and Default (On) once trackHistory: true; Off writes false, On writes true; Default after Off removes the key; no Track history box, no trackHistory written, a stored one kept; the object's off makes Default (Off) and shows the note; control: no note otherwise.
  • New describe in ObjectSettingsPanel.test.tsx (4): checked for unset and true, unchecked only for false; untick writes false with siblings kept; re-tick removes the key with siblings kept; labelled by its own title.
  • New FieldDesigner.fieldHistory-36290.test.tsx (9), on the real FieldDesigner with a drawer double that captures its schema and calls its own onSuccess. The cases: two rows and no Track History row, with the labels; for every designer type exactly one row's visibleWhen evaluates true (through evalFieldPredicate, the form's own evaluator), and it is the one resolveFieldHistory names; a stored trackHistory: true moves a media type to the Default (On) row; an untouched edit writes neither key; Off writes false, On on a media type writes true; a stored false opens as Off and Default removes it; a stored trackHistory is kept; a type changed in the drawer saves what is on screen; a created field at Default carries neither key.
  • New MetadataFieldsPage.fieldHistory-36290.test.tsx (4), on PUT bytes through the real page and a real MetadataClient. A stored fieldHistory: false survives and no trackHistory is written; a stored trackHistory: true survives and gains no fieldHistory; a field with neither key gains neither; every PUT field parses through FieldSchema.
  • Extended: MetadataService.fieldKeyCarryOver.test.ts adds fieldHistory to its populated entry and its clearable keys; designer-zod-arms-10859.test.ts adds fieldHistory to the fully populated field-designer document.
  • Forced test changes: ObjectFieldInspector.displayPatchReason-28986.test.tsx names the Field change values combobox instead of the removed Track history checkbox among the locked controls; ObjectSettingsPanel.businessWording-36512.test.tsx lists enable.fieldHistory among the keys the tab writes. ObjectFieldInspector.externalIdNotOffered-26674.test.tsx and ObjectFieldInspector.retiredIndexed.test.tsx listed Track history among the Advanced siblings that still render; they name Field change values, and (being edited) now pay the formula and lint loads at module top, as check:test-source-alias requires. FieldDesigner.externalIdNotOffered-26674.test.tsx and MetadataFieldsPage.externalIdRoundTrip-26674.test.tsx used the Track History row as their positive control; they now use the Field Change Values row.

Acceptance notes

  • The field designer's Default label follows the drawer's type and the object is not in hand, so an object with enable.fieldHistory: false is not reflected there, the same accepted bound as feat(studio): the Field History setting offers Default, On and Off, and Default says what it resolves to #36580's widget. Neither FieldDesigner nor MetadataFieldsPage is mounted by the Console today; both are published exports, and field-designer is a registered SDUI type.
  • A stored field trackHistory: true on a media or JSON type makes Default read "Default (On)"; such a field can still be turned off with Off, but not returned to the type's off-by-default without editing the key in the form. That is the resolver's answer, not a UI choice.
  • ui/AGENTS.md ✨ Set up Copilot instructions #2 (package README and content/docs/frontend/ page) not edited: outside this part's file surface.
  • Screenshots NOT MEASURED (no Console build or backend run here).

Verification

Read first, by risk:

  1. ui/packages/plugin-designer/src/FieldDesigner.tsx: the fieldHistoryRows memo (two rows, visibleWhen built from resolveFieldHistory) and fieldHistoryFromForm, which picks the row for the SAVED type on both save paths.
  2. ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.tsx: patchEnable with unsetWhenOn (re-ticking removes enable.fieldHistory, keeps siblings).
  3. ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.tsx: the Field change values row and the object-off note inside DisplayPatchLock.

Two-minute check: open Studio, an object, Settings, Features: "Field change values" is ticked. Untick, save, and reopen the object JSON: it shows enable.fieldHistory: false. Tick again: the key is gone. Then open a field's Advanced section: "Field change values" reads "Default (Off)" with the note under it.

Runs (local, head 3b5b130 after merging origin/main 9e2a4ac)

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmPq6z7KER4Sr6Uu7Ht

…nge values (#36290 part 1)

The field inspector's Track history box becomes a Field change values
choice (Default / On / Off over the field's fieldHistory, Default resolved
by resolveFieldHistory against the object in hand); the object settings'
Features card gains an enable.fieldHistory switch that writes false to turn
values off and removes the key to turn them back on. The choice, the value
each choice writes and its wording move to fieldHistoryChoice.ts, shared
with the metadata form's field-history widget.

Claude-Session: https://claude.ai/code/session_01ADHkmPq6z7KER4Sr6Uu7Ht
Co-authored-by: Claude <noreply@anthropic.com>
…t Track history (#36290)

The Advanced row's Track history box became the Field change values choice;
the External ID and Indexed retirement pins listed it among the siblings
that still render. Both files now pay the formula and lint loads at
collection (check:test-source-alias judges a file a change edits).

Claude-Session: https://claude.ai/code/session_01ADHkmPq6z7KER4Sr6Uu7Ht
Co-authored-by: Claude <noreply@anthropic.com>
…k History (#36290 part 1)

The FieldDesigner drawer's Track History switch wrote trackHistory: false on
every save. It becomes Field Change Values (Default / On / Off over the
field's fieldHistory), drawn as two rows shown by visibleWhen for the types
whose Default resolves on or off (resolveFieldHistory), so Default names the
right state after a type change; the save reads the row shown for the saved
type. A stored trackHistory rides the edit spread and is never written.
DesignerFieldDefinition and its zod mirror gain fieldHistory; MetadataFieldsPage
and MetadataService.toFieldPayload carry it. The eleven language packs swap
appDesigner.fieldDesigner.trackHistory for the four fieldHistory keys.

Claude-Session: https://claude.ai/code/session_01ADHkmPq6z7KER4Sr6Uu7Ht
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 23, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmPq6z7KER4Sr6Uu7Ht

Contract-review-claim: session_01ADHkmPq6z7KER4Sr6Uu7Ht · head 3b5b130 · 2026-11-23T06:46Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmPq6z7KER4Sr6Uu7Ht

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 3b5b130c032826c165b7cfe6796bc7c4a09eff23
Local-runs: none

Face: declaration only (Clause-②: yes (widening)). record-recognisers.mjs --paths on the 36-file list decides no schema, rules or narrowing face; check-governed-merges.mjs --pr 36641: NOT governed (0 of 36 paths hit the register). No packages/spec/src/** change.

① Derived judgments

  • @object-ui/types: DesignerFieldDefinition and its zod mirror DesignerFieldDefinitionSchema (a z.looseObject) gain an optional fieldHistory: boolean. Added only; existing values still parse. A widening of a UI model that mirrors the spec's FieldSchema.fieldHistory (spec key unchanged, merged in PR 1 feat(audit): the activity stream shows each changed field's old → new values by default, served only for fields the reader may read #36399).
  • @object-ui/i18n language pack: appDesigner.fieldDesigner.fieldHistory, fieldHistoryDefault, fieldHistoryOn, fieldHistoryOff added in all 11 locales (4 each, counted at the head); appDesigner.fieldDesigner.trackHistory removed in all 11 (0 left, and no reader left in ui/**). Studio namespace (en, zh): designer.field.fieldHistory, designer.field.fieldHistoryObjectOff, engine.studio.settings.capFieldHistory, capFieldHistoryDesc added; designer.field.trackHistory removed; capTrackHistoryDesc reworded.
  • @object-ui/app-shell: FieldMetadataPayload.fieldHistory? added; new module metadata-admin/fieldHistoryChoice.ts is internal (not on the package entry). @object-ui/plugin-designer: no exported signature changes.
  • Authored metadata accept set: unchanged (the spec's fieldHistory already accepts the values these producers write). Metadata-protocol: none is right.

② Semver level

Clause-②: yes (widening)

.changeset/36290-field-history-producers.md: patch on @object-ui/app-shell, @object-ui/i18n, @object-ui/types, @object-ui/plugin-designer, the four published packages whose shipped code moves. A non-protocol change ships patch under AGENTS.md's changeset rule. Both declaration lines are line-initial in the PR body and the changeset and agree; Check Changeset is success at this head.

③ Boundary flags

  • Removed language-pack keys (appDesigner.fieldDesigner.trackHistory, Studio designer.field.trackHistory): a removal from a published pack, not a narrowing of an accept set. The label they named is gone with its control, and the repo's dead-key gate (check:i18n-dead-keys, exit 0 at this head) refuses an unused key, so keeping them is not an option. A consumer calling t() with the old key gets the fallback text. Judged acceptable at patch; named here so the release reader sees it.
  • Ruling 7076513167 point 1 (on by default, an object or a single field turns it off): Default writes no key (inspector unsetDefKey, designer undefined, settings removes enable.fieldHistory), Off writes false, On writes true; nothing writes trackHistory, a stored one is carried. Matches the writer's literal-only reads.
  • Dev out_of_scope_findings: (a) the designer drawer cannot see the object's enable.fieldHistory, so its Default label ignores an object-level off: the same bound feat(studio): the Field History setting offers Default, On and Off, and Default says what it resolves to #36580's widget carries, recorded in its L2 PASS 7088846404 as an accepted deviation; (b) a stored trackHistory: true on a media/JSON type makes Default read On: the resolver's answer, not a producer bug. Both in Acceptance notes; no card owed.
  • SQL push-down: no query, no id materialisation, no in-app join.

Implemented-by: claude/project-thread-qldp6w
Reviewed-by: session_01ADHkmPq6z7KER4Sr6Uu7Ht

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmPq6z7KER4Sr6Uu7Ht
L1 · 2026-11-23T06:48Z · PR #36641 @ 3b5b130 · card #36290 (part ①, PR 3 of 4) · card thread, area s2-A

席位核对

ACCEPT — one card part, one PR, not governed (check-governed-merges.mjs: NOT governed, 0 of 36 paths), +838/-59 over 36 files, Clause-② yes (widening; TIER_DEFAULT record 7093689363 PASS at this head), Metadata-protocol none.

  1. Shape. Part of #36290; no closing keyword on any card (l1-face.mjs and by eye). Files: app-shell (ObjectFieldInspector.tsx, ObjectSettingsPanel.tsx, widgets.tsx, new fieldHistoryChoice.ts, MetadataService.ts), plugin-designer (FieldDesigner.tsx, MetadataFieldsPage.tsx, useDesignerTranslation.ts), types (designer.ts, zod/designer.zod.ts), 11 locale files, studio en/zh, tests, one changeset. All inside claim 7089195922 as amended by 7092430394 (types and MetadataService added for the designer's model).
  2. Premise measured. At origin/main the inspector drew Track history over !!def.trackHistory, the settings card had no enable.fieldHistory row, and FieldDesigner wrote trackHistory: data.trackHistory === true on every save (release item 1, 7082230799).
  3. Code read. Inspector: a Default / On / Off select over fieldHistory; Default calls unsetDefKey('fieldHistory'), its label from resolveFieldHistory with the object document (so an object-level off reads Default (Off) plus a note). Settings: unticking writes enable.fieldHistory: false, ticking removes the key with siblings kept. Designer: two form-local select rows switched by visibleWhen on the type's resolved default; the save reads the visible row and writes fieldHistory (Default sends undefined, removing a stored key); trackHistory is carried by the edit spread, never written. MetadataFieldsPage (both directions) and MetadataService.toFieldPayload carry the key. fieldHistoryChoice.ts is shared by the inspector and feat(studio): the Field History setting offers Default, On and Off, and Default says what it resolves to #36580's widget (whose pins stay green); plugin-designer cannot import app-shell (dependency direction), so it shares resolveFieldHistory from @objectstack/spec/data instead.
  4. Tests and gates. New pins: inspector 7, settings 4, designer 9, MetadataFieldsPage 4 (PUT bytes through the real page plus FieldSchema parse); extended fieldKeyCarryOver and designer-zod-arms-10859; forced sibling pins named in the body. Post-merge union under the verify lock: Test Files 851 passed, Tests 16838 passed. Ablations red then restored (inspector 2/7, settings 1/14, designer 7/13). dispatch-gates 42/42 exit 0, 0 NOT-MEASURED (/mnt/project-files/objectstack-seat2/36290-p1-gates-ran.txt). Check-runs at this head: 45 success, 13 expected skip, 0 failed, 0 pending; Lint & Repo Gates and TypeScript Type Check success; mergeable_state clean.
  5. Changeset read sentence by sentence against the diff: inspector, designer and settings bullets, the Default/On/Off writes, the carried trackHistory, the shared module and why the designer cannot use it, and the added/removed key list all match the code and the locale counts.
  6. Accepted deviations. (a) The branch name is the thread's (claude/project-thread-qldp6w, recreated after feat(record-page): each changed field is its own line under an activity entry, old → new #36613's merge deleted it; no force). (b) The full union ran at ffa608de; 3b5b130c only types one test double, re-run 9/9 with plugin-designer type-check exit 0. (c) Screenshots NOT MEASURED; package README / frontend docs page not edited (outside surface), both named in Acceptance notes. (d) Language-pack keys appDesigner.fieldDesigner.trackHistory and Studio designer.field.trackHistory removed with their control (dead-key gate), judged in the TIER_DEFAULT record.
  7. Out of scope. The designer's Default label ignoring an object-level off, and a stored trackHistory: true making a media/JSON Default read On: bounds already accepted on feat(studio): the Field History setting offers Default, On and Off, and Default says what it resolves to #36580 / the resolver's answer, in Acceptance notes. Part ③ is not started by this thread (maintainer order relayed by the seat); its scope goes to repo:objectstack#1 with a Release: after this lands.

Landing: not this thread's to do. Non-governed and under 3000 lines; reported to the seat with this head and the record ids.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY

维护者速读

席位核对

ACCEPT → PR #36641 comment 7093706077 · TIER_DEFAULT contract review PASS → comment 7093689363 · Head-sha 3b5b130c032826c165b7cfe6796bc7c4a09eff23 · check-runs 45 success, 13 skipped, 0 failed · mergeable clean · check-governed-merges --pr 36641: not governed (0 of 36 paths), 897 changed lines ≤ 3000. Part of #36290.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 06:50
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 7e89bc6 Nov 23, 2026
59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-qldp6w branch November 23, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants