Skip to content

feat(record-page): each changed field is its own line under an activity entry, old → new - #36613

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

objectstack-fleet[bot] merged 8 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) — four new detail.* language-pack keys in every locale @object-ui/i18n ships, and new optional props on the exported FieldChangeItem; nothing removed or renamed
Metadata-protocol: none

PR 2 of 4 on the card (part ②: card items 1 and 2, and the activity half of item 5). PR 1 (#36399, merged as 70194ffc) made the activity stream serve each changed field's old and new values, narrowed per reader. This PR draws them on the record page. Part ① (the designer producers of fieldHistory) waits for #36580; part ③ (the per-field history card and the field and grid-cell entry points) closes the card. Ruling-ref: 7076513167.

维护者速读

  • 记录页「动态」里,每次保存现在先写改了哪些字段,下面每个字段一行「字段名:旧值 → 新值」;旧值为空写「空」,长文字截成一行,点「展开」看全文;单选显示选项名,关联记录和人员显示名字。
  • 属于「记录详情页重做」专题下的字段修改历史:以前动态里只写「更新了 客户备注」,看不到改前改后的值;服务器上周已经按读取权限发送这些值,这次是把它们画出来。
  • 出错时,用户会看到动态里的修改行排版不对或展开按钮失灵;不会多看到任何字段,因为没有读取权限的字段服务器本来就不发送;可以整体撤回,数据不受影响。
  • 无

What changes

The served values reach the timeline (ui/packages/plugin-detail/src/renderers/recordActivityFeed.ts)

  • New activityFieldChangesOf(row): reads the field-change code plugin-audit serves in sys_activity.metadata (summary_message, key fieldChanges) and turns it into one FieldChangeEntry per field. activityRowToFeedItem puts it on the item as fieldChanges. An option side keeps the option it matched; a yes/no side keeps the boolean; the writer's empty mark (∅, or an empty text) becomes an empty side. A code it cannot read whole gives nothing, and the row draws its summary as before.
  • Nothing is filtered in the browser. The server already drops a change of a field the reader may not read, and a reference change whose record title the reader is not served (PR 1, activity-field-redaction.ts). The timeline draws exactly the changes it is handed.

One line per changed field (RecordActivityTimeline.tsx, FieldChangeItem.tsx)

  • An entry with changes (an activity row's served code, an audit-log entry, or the audit entry paired onto an activity row) draws its usual one-line row, then one line per changed field under it: Label: old → new.
  • The row's own text: for an entry whose changes are its own, Updated Phone, Email (its stored summary would repeat the lines). An activity row carrying its paired audit entry keeps its own summary. The record's creation is unchanged (one row, values beside the summary).
  • Each side: an option reads as the field's option label in the reader's language (fieldOptionLabel, falling back to the schema label, then the served text); a lookup or user reads as the record name the server served; a yes/no reads as common.yes / common.no; an empty side as detail.fieldChangeEmpty.
  • Each side is cut to its line (truncate). A side that overflows (measured), holds a line break, or is longer than 48 characters offers Show all, which wraps both sides in full, and Show less.
  • The row's markers (data-stream-row, data-stream-system-row) sit on the whole entry (the line plus its field lines), so a reader of the row reads both; the 30 px line is data-stream-line.
  • The compact one-line change text (the activity panel's peek rows, the creation row's diff) now uses the same label, words and empty word: Status: New → Contacted, where it read Status New → Contacted with — for empty.
  • FieldChangeItem (exported, previously unused) is the line: new optional label, oldText / newText, emptyLabel, expandLabel / collapseLabel; with none of them it draws as before except the arrow is text and the empty word defaults to (empty).

Language packs (ui/packages/i18n/src/locales/*.ts, 11 locales; useDetailTranslation.ts defaults mirror en)

  • detail.fieldChangeLabel ({{field}}:; fullwidth colon in zh-Hans, zh-Hant, ja; {{field}} : in fr), detail.fieldChangeEmpty (Empty, 空), detail.fieldChangeExpand (Show all, 展开), detail.fieldChangeCollapse (Show less, 收起).

Tests

New pins, as top-level describes in the existing harness files:

  • renderers/__tests__/record-activity.test.tsx — record:activity — one line per changed field, old → new (objectstack#36290): one field (Customer notes: Old words → New words); phone and email in one save is ONE row with two lines; empty side reads Empty, never ∅; select, lookup, user and yes/no read as option label, record names and words; only the served changes draw (a field left out of the code has no line); a long value truncates and toggles; the stream fold opens to each save's own lines; CONTROL: a short value has no toggle, and a row with no code draws its summary.
  • renderers/__tests__/recordActivityFeed.test.ts — activityFieldChangesOf: mapping of text, option, boolean and the empty mark; the item carries the changes beside its summary; no code, another code, an empty or unreadable code give nothing.

Forced test changes (each because the line format moved from Label old → new on one element to Label: old → new drawn over several elements):

  • __tests__/recordTimelineStream-27055.test.tsx: a changeLines() reader over [data-field-change]; the six getByText(/… → …/) matches read it instead (a text matcher cannot see a line split over spans). The negative queryByText(/New → Contacted/) was moved too, since it would have become vacuous. The two creation-diff strings gain the colon.
  • __tests__/RecordTimelinePanel-27524.test.tsx: the peek line reads Status: New → Contacted.
  • ui/packages/app-shell/src/views/RecordDetailView.harness.test.tsx: the audit-date and currency diff readers read [data-field-change] lines, and their expected strings gain the colon (Close date: 3.3.2020 → 4.3.2020, Amount: €1,500.00 → €2,500.00). The values themselves are unchanged.
  • ui/packages/i18n/src/__tests__/untranslated-identity-4376.test.ts: detail.fieldChangeLabel joins LEGITIMATE_IDENTITIES as a format string (ko/ru/ar keep :), like grid.summary.pattern.

The permission half is the server's, pinned by PR 1 in packages/plugins/plugin-audit/src/activity-field-redaction.test.ts ([#36290] masked: …, [#36290] not served: the code and the summary are served without the change of the field not served, [#36290] control: a reader served every field is served the whole code). This PR adds the UI side: the timeline draws only what is served.

Acceptance notes

  • Card lines, as this PR covers them: 「改一条客户的「客户备注」并保存:动态里出现「客户备注:旧文字 → 新文字」。」 — yes (zh-Hans label template {{field}}:). 「一次保存同时改电话和邮箱:一条动态,下面两行。」 — yes. 「单选、关联记录、人员字段:前后值显示的是选项名和记录名,不是内部编号。」 — yes for single select, lookup and user (option label read per reader; record names as served). 「用一个没有某字段读取权限的账号:动态里没有那个字段的修改行」 — the server leaves the change out (PR 1); the UI draws what is served. The 「修改历史」 half of that line is part ③.
  • Screenshots of the activity: NOT MEASURED in this PR (no local backend and console build in this run). To reproduce: OS_PORT=3000 pnpm dev, open a showcase record, edit a long text field and, in one save, two short fields; the record's 动态 tab shows one entry per save with one line per field; a long value shows Show all.
  • The empty side is recognised by the writer's text ∅ (or an empty text), the notation plugin-audit's summaryValueOf writes and its tests pin; the served code carries no separate empty mark. A structural mark would be a server change, outside this PR.
  • Multi-select and tree sides still read as the stored text the writer wrote (PR 1 nits, not taken there either).
  • Docs: ui/AGENTS.md ✨ Set up Copilot instructions #2 asks for the package README and the content/docs/frontend/ page; both are outside this dispatch's file surface, so neither is edited here.
  • No change to which entries the activity shows, how consecutive edits fold, the activity filters, or audit storage.

Verification

Read first:

  1. ui/packages/plugin-detail/src/renderers/recordActivityFeed.ts — activityFieldChangesOf (the only new read of server data; the empty mark).
  2. ui/packages/plugin-detail/src/RecordActivityTimeline.tsx — fieldChangeLinesOf, changeSideText, and renderSystemLine (which entries get lines, and the row-marker move in streamRow).
  3. ui/packages/plugin-detail/src/FieldChangeItem.tsx — truncation, the measured overflow and the toggle.

Two-minute check: pnpm --dir ui exec vitest run packages/plugin-detail/src/renderers/__tests__/record-activity.test.tsx — expect 35 passed, among them the eight one line per changed field tests.

Readings below are at head f281417b (after merging origin/main once).

Tests (local, under the verify lock)
  • pnpm --dir ui exec vitest run packages/plugin-detail/ packages/i18n/ packages/app-shell/src/__tests__/defaults-maps-mirror-en-pack.test.tsx plus the 22 app-shell RecordDetailView.* / record-page activity test files, at f281417b: Test Files 543 passed | 1 skipped (544), Tests 6159 passed | 31 skipped (6190), lock VERDICT command-exit 0.
  • pnpm --filter @object-ui/plugin-detail run type-check and pnpm --filter @object-ui/i18n run type-check (each tsc --noEmit && tsc -p tsconfig.test.json; the test project lists the four edited test files): exit 0, before the merge.
  • ui: check:i18n-keys 0, check:i18n-drift 0, check:i18n-dead-keys 0, check:new-line-citations 0 (0 new citation(s)), before the merge.
Ablation

Committed head first, then node scripts/ablation-replace.mjs replaced const lines = fieldChangeLinesOf(item); in renderSystemLine with const lines = null … (anchor 1 → 0, blob 5cc789c3a1d9 → 0061c6cdd8de) and ran record-activity.test.tsx under the lock: Tests 8 failed | 27 passed (35) — all eight one line per changed field tests red, every older test green. Restored: blob after restore 5cc789c3a1d9 == HEAD, git diff HEAD empty. No dist is involved: the ui vitest config aliases @object-ui/plugin-detail to its source.

Gates

node scripts/pm/dispatch-gates.mjs --commands at f281417b: 41 commands, each run with its exit code recorded before any pipe; all 41 exit 0. --ran: Run reconciliation — 41 derived, 41 run, 0 NOT-MEASURED, 0 UNRUN. CI owns the rest (Lint UI, Type Check UI, Test UI, the repo-wide lint); not re-run here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmPq6z7KER4Sr6Uu7Ht

@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 633b84e · 2026-11-23T03:31Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmPq6z7KER4Sr6Uu7Ht

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 633b84e88b55a15242eb78a96604e29c2502de19
Local-runs: none

Face: declaration only (Clause-②: yes (widening)). No published spec schema and no governed path in the 22-file list (check-governed-merges.mjs --pr 36613: NOT governed).

① Derived judgments

  • Language pack: four new keys under detail.* (fieldChangeLabel, fieldChangeEmpty, fieldChangeExpand, fieldChangeCollapse), present in all 11 locale files @object-ui/i18n ships (counted per file at the head: 4 each), and mirrored in DETAIL_DEFAULT_TRANSLATIONS. Added only; no key removed or renamed. Published through the pack's exported types, so a widening.
  • @object-ui/plugin-detail entry: FieldChangeItem and FieldChangeItemProps were already exported; the props gain six optional members (label, oldText, newText, emptyLabel, expandLabel, collapseLabel). Existing callers compile unchanged; the defaults keep the old rendering words. A widening.
  • Not on the entry: activityFieldChangesOf, ActivityFieldChange, fieldChangeLinesOf, FIELD_CHANGE_LONG_VALUE_CHARS (the barrel index.tsx and core.ts at the head re-export none of them), so they add no public surface.
  • No metadata key, value or default moves: Metadata-protocol: none is right.

② Semver level

Clause-②: yes (widening)

.changeset/36290-activity-field-change-lines.md: patch on @object-ui/plugin-detail and @object-ui/i18n, the two published packages whose shipped code moves (the app-shell edit is a test only). Under AGENTS.md's changeset rule a non-protocol widening ships patch. Both declaration lines are line-initial in the PR body and the changeset and agree; Check Changeset is success at this head.

③ Boundary flags

  • Security floor of ruling 7076513167 ("a value the viewer cannot read is never sent to the browser"): the UI reads only the change code plugin-audit already narrows per reader (PR 1 pins in activity-field-redaction.test.ts); it adds no read and no browser-side filter. A new UI test pins that a change absent from the served list draws no line.
  • open_questions 1 (empty side recognised by the writer's ∅ text): answered as option A, keep the tested writer notation behind the one named constant WRITER_EMPTY_VALUE_TEXT. A structural empty mark is server work outside this card's UI parts and has no pull today.
  • out_of_scope_findings: the history-card half of the permission acceptance line is part ③ of this card; multi-select and tree sides showing stored text are the accepted PR 1 deviation (7080007398), unchanged.
  • SQL push-down: no query, no id materialisation, no in-app join in the diff.

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-23T03:33Z · PR #36613 @ 633b84e · card #36290 (part ②, PR 2 of 4) · card thread, area s2-A

席位核对

ACCEPT — one card part, one PR, not governed (check-governed-merges.mjs: NOT governed), +657/-54 over 22 files, Clause-② yes (widening, language-pack keys and optional props only; TIER_DEFAULT record 7090836069 PASS at this head), Metadata-protocol none.

  1. Shape. Part of #36290 (parts ① and ③ remain; no closing keyword on any card, read by l1-face.mjs and by eye). Files: plugin-detail (recordActivityFeed.ts, RecordActivityTimeline.tsx, FieldChangeItem.tsx, useDetailTranslation.ts), 11 locale files, tests in plugin-detail, i18n and one app-shell harness test, one changeset. All inside claim 7089195922's part ② surface.
  2. Premise measured. At origin/main activityRowToFeedItem never read the served field-change code, so a plain edit drew one cut summary line; fieldChanges reached the timeline only from sys_audit_log on trackHistory objects. Card items 1 and 2 were a real gap.
  3. Code read. activityFieldChangesOf parses metadata.summary_message (key: 'fieldChanges') into one entry per field and gives up whole on any change it cannot read (the row then draws its summary as before). fieldChangeLinesOf draws one FieldChangeItem line per served change under the row; the record's creation row is unchanged. Option sides re-read the option label in the reader's language through fieldOptionLabel, yes/no reads the pack's word, an empty side reads detail.fieldChangeEmpty (「空」). Each side is clamped to one line with an expand/collapse control offered on measured overflow or by length.
  4. Tests and gates. Dev's run: plugin-detail + i18n + 22 app-shell record-page files, Test Files 543 passed / 1 skipped, Tests 6159 passed; ablation forcing the lines off turned all 8 new pins red in record-activity.test.tsx, restored. dispatch-gates 41/41 exit 0, 0 NOT-MEASURED (/mnt/project-files/objectstack-seat2/36290-p2-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: each claim (values from the served code, nothing filtered in the browser, empty word, option / lookup / yes-no sides, clamp with control, audit entries drawn alike, creation unchanged, the peek row's compact text now Label: old → new) matches the code.
  6. Accepted deviations. (a) The PR body's readings cite f281417b; the two later commits touch only the changeset (git diff f281417b 633b84e8 -- ui is empty), and the body patch to update the sha was refused by the relay validator, so the body stays as written. (b) 维护者速读 has four lines per os-dev.md. (c) Screenshots NOT MEASURED (no local backend in the dev's run); the body gives reproduction steps. (d) The package README and its docs page were not edited (outside the part's file surface), named in Acceptance notes.
  7. Out of scope. The history-card half of the permission acceptance line and the per-field history card go to part ③. Multi-select and tree sides keep stored text (PR 1's accepted deviation). L2 nit on the tracked authoring hint (packages/spec/src/data/field.zod.ts:1688, from 7080007398) is spec prose outside this card thread's lane; handed to the seat.

Landing: not this thread's to do. Non-governed and under 3000 lines; reported to the seat with this head and the record ids. On merge, pm:dispatched stays on #36290 (parts ① and ③ remain).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY

维护者速读

  • 改了什么:记录页「动态」里的修改记录,每个改过的字段单独一行,显示「旧值 → 新值」。
  • 风险:非受管面,711 行;只加语言包键和可选 props。
  • 要你做什么:无,席位落地。

ACCEPT → PR #36613 comment 7090849791 · TIER_DEFAULT record PASS → comment 7090836069 · Head-sha 633b84e88b55a15242eb78a96604e29c2502de19 · check-runs 45 success, 13 skipped, 0 failed · check-governed-merges --pr 36613: not governed. Part of #36290 (segments ① and ③ follow).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 03:35
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 27895d7 Nov 23, 2026
59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-qldp6w branch November 23, 2026 03:57
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
… write Field change values (objectstack-ai#36290 part 1) (objectstack-ai#36641)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9NRmimMwnUgR1DbqgHtBWM3)_

Part of objectstack-ai#36290

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

## 维护者速读

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

## What changes

Card objectstack-ai#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 (objectstack-ai#36399) gave the runtime `fieldHistory`
(field) and `enable.fieldHistory` (object); objectstack-ai#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 objectstack-ai#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 objectstack-ai#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 objectstack-ai#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` objectstack-ai#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.

<details><summary>Runs (local, head 3b5b130 after merging origin/main
9e2a4ac)</summary>

- Builds under the verify lock: the
`@objectstack/{spec,formula,lint,client,sdui-parser}` closure, and
`@object-ui/app-shell^...` again after the merge (VERDICT command-exit 0
each).
- `type-check` (tsc plus `tsconfig.test.json`) of
`@object-ui/app-shell`, `@object-ui/i18n`, `@object-ui/types` and
`@object-ui/plugin-designer`: all four Done, exit 0 (after the merge;
plugin-designer again at 3b5b130).
- Post-merge union at ffa608d: `vitest run
packages/app-shell/src/views/metadata-admin/inspectors/
packages/app-shell/src/views/studio-design/ObjectSettingsPanel
packages/app-shell/src/views/metadata-admin/FieldHistoryWidget-36482.test.tsx
packages/app-shell/src/views/metadata-admin/SchemaForm
packages/plugin-designer/ packages/types/
packages/app-shell/src/services/ packages/i18n/
packages/app-shell/src/__tests__/defaults-maps-mirror-en-pack.test.tsx`
gave Test Files 851 passed (851) and Tests 16838 passed, 14 skipped.
3b5b130 changes only the designer pin's types; that file re-run: 9/9.
- Pre-merge union at 3fa510b (`metadata-admin/`, `studio-design/`,
`i18n/`) gave Test Files 1232 passed and 2 failed (1234). The 2 were
sibling pins still naming Track history, fixed in 58cef60.
- Ablations, each through `scripts/ablation-replace.mjs` (anchor 1 to
0), restored with blob equal to HEAD and `git diff HEAD` empty:
- The inspector writes `trackHistory` again: 2 of 7 new inspector pins
red.
- The settings switch writes `true` instead of removing the key: 1 of 14
red.
- The designer's update path writes `trackHistory: data.trackHistory ===
true` in place of `fieldHistory`: 7 of 13 red across the two new
designer files.
- `dispatch-gates --commands` at 3b5b130 derived 42 families; all 42
ran locally with exit 0; `--ran` reconciliation gives "42 derived, 42
run, 0 NOT-MEASURED, 0 UNRUN".
- `overlap-check` at 3b5b130: VERDICT clean exit 0 against origin/main
d7411fa (three commits past the merged 9e2a4ac; `git merge-tree` is
also clean) and objectstack-ai#36634, objectstack-ai#36629, objectstack-ai#36606, objectstack-ai#36587, objectstack-ai#36525.
- ui extras: `check:new-line-citations` 0, `check:i18n-keys` 0,
`check:i18n-drift` 0, `check:i18n-dead-keys` 0. eslint on the changed
source and test files: 0 errors, and no warnings on added lines.

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01ADHkmPq6z7KER4Sr6Uu7Ht

---------

Co-authored-by: Claude <noreply@anthropic.com>
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