Repository navigation
feat(studio): the field inspector, field designer and object settings write Field change values (#36290 part 1) - #36641
Conversation
…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>
…36290) Claude-Session: https://claude.ai/code/session_01ADHkmPq6z7KER4Sr6Uu7Ht Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-steve · session_01ADHkmPq6z7KER4Sr6Uu7Ht Contract-review-claim: session_01ADHkmPq6z7KER4Sr6Uu7Ht · head 3b5b130 · 2026-11-23T06:46Z |
|
repo:objectstack#2 · os-steve · session_01ADHkmPq6z7KER4Sr6Uu7Ht Contract reviewServed-tier: Face: declaration only ( ① Derived judgments
② Semver levelClause-②: yes (widening)
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmPq6z7KER4Sr6Uu7Ht 席位核对ACCEPT — one card part, one PR, not governed (
Landing: not this thread's to do. Non-governed and under 3000 lines; reported to the seat with this head and the record ids. |
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY 维护者速读
席位核对ACCEPT → PR #36641 comment 7093706077 ·
|
Requested by Steve · project thread
Part of #36290
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
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) andenable.fieldHistory(object); #36580 gave the metadata form a three-wayfield-historywidget. 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)value={!!def.trackHistory},patchDef({ trackHistory: v || undefined })) is gone. Measured reason: since PR 1 a field'strackHistory: falsereads like absent andtruedoes only whatfieldHistory: truedoes for a media or JSON type (spec describe ofFieldSchema.trackHistory), so a second box beside Field change values could only mislead. A storedtrackHistoryis never written or removed here; it is still read, becauseresolveFieldHistoryreads it.fieldHistory. Default removes the key (unsetDefKey, not a patch toundefined); On / Off writetrue/false.resolveFieldHistoryfrom@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 withenable.fieldHistory: falsemakes every field's Default read "Default (Off)", and a note under the row says the object's off wins.DisplayPatchLock, so on a read-only base field it is locked with the same reason as its neighbours (fieldHistoryis not onBASE_FIELD_DISPLAY_WHITELIST).Object settings (
ObjectSettingsPanel.tsx, Features card)enable.fieldHistory), next to "Field change history" (enable.trackHistory). Ticked unless the stored value is a literalfalse. Unticking writesfalse; ticking again REMOVES the key (unset already means on, so notruethe author did not need). Siblingenablekeys are kept, as for every other row.Field designer (
plugin-designerFieldDesigner.tsx, the drawer behindMetadataFieldsPageand thefield-designerSDUI type)trackHistory: data.trackHistory === trueon every save, create and edit. It is replaced by Field Change Values with the same three choices. The update path no longer namestrackHistory: a stored value rides the...editingFieldspread, and a created field carries neither key at Default.visibleWhenbuilt fromresolveFieldHistoryoverDESIGNER_FIELD_TYPES(with the field's storedtrackHistory). 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 optionalfieldHistory. Both save paths carry it:MetadataFieldsPage(toDesignerField/fromDesignerField) andMetadataService.toFieldPayload. Default writesfieldHistory: 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.fieldHistoryChoice.ts, because app-shell depends on plugin-designer. What it shares is the rule (resolveFieldHistoryfrom@objectstack/spec/data). Its own copy of the choice-to-value mapping is two lines. Its strings are the language-pack keysappDesigner.fieldDesigner.fieldHistory,fieldHistoryDefault,fieldHistoryOnandfieldHistoryOff, in all 11 locales and the designer's defaults table. They replaceappDesigner.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 #36580field-historywidget (refactored onto it; its behaviour and its 10 pins unchanged). The controls stay separate on purpose: the widget is aWidgetPropsrenderer that sees one form row and no object; the inspector row is anInspectorSelectFieldwith 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.capTrackHistoryDescreworded;designer.field.trackHistoryremoved with its box.Not in this PR: record-page rows (part ②, landed as #36613), the per-field history card (part ③).
Tests
ObjectFieldInspector.fieldHistory-36290.test.tsx(7): Default (On) for a one-line type; Default (Off) for image / json / password and Default (On) oncetrackHistory: true; Off writesfalse, On writestrue; Default after Off removes the key; no Track history box, notrackHistorywritten, a stored one kept; the object's off makes Default (Off) and shows the note; control: no note otherwise.ObjectSettingsPanel.test.tsx(4): checked for unset andtrue, unchecked only forfalse; untick writesfalsewith siblings kept; re-tick removes the key with siblings kept; labelled by its own title.FieldDesigner.fieldHistory-36290.test.tsx(9), on the realFieldDesignerwith a drawer double that captures its schema and calls its ownonSuccess. The cases: two rows and no Track History row, with the labels; for every designer type exactly one row'svisibleWhenevaluates true (throughevalFieldPredicate, the form's own evaluator), and it is the oneresolveFieldHistorynames; a storedtrackHistory: truemoves a media type to the Default (On) row; an untouched edit writes neither key; Off writesfalse, On on a media type writestrue; a storedfalseopens as Off and Default removes it; a storedtrackHistoryis kept; a type changed in the drawer saves what is on screen; a created field at Default carries neither key.MetadataFieldsPage.fieldHistory-36290.test.tsx(4), on PUT bytes through the real page and a realMetadataClient. A storedfieldHistory: falsesurvives and notrackHistoryis written; a storedtrackHistory: truesurvives and gains nofieldHistory; a field with neither key gains neither; every PUT field parses throughFieldSchema.MetadataService.fieldKeyCarryOver.test.tsaddsfieldHistoryto its populated entry and its clearable keys;designer-zod-arms-10859.test.tsaddsfieldHistoryto the fully populatedfield-designerdocument.ObjectFieldInspector.displayPatchReason-28986.test.tsxnames the Field change values combobox instead of the removed Track history checkbox among the locked controls;ObjectSettingsPanel.businessWording-36512.test.tsxlistsenable.fieldHistoryamong the keys the tab writes.ObjectFieldInspector.externalIdNotOffered-26674.test.tsxandObjectFieldInspector.retiredIndexed.test.tsxlisted 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, ascheck:test-source-aliasrequires.FieldDesigner.externalIdNotOffered-26674.test.tsxandMetadataFieldsPage.externalIdRoundTrip-26674.test.tsxused the Track History row as their positive control; they now use the Field Change Values row.Acceptance notes
enable.fieldHistory: falseis 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. NeitherFieldDesignernorMetadataFieldsPageis mounted by the Console today; both are published exports, andfield-designeris a registered SDUI type.trackHistory: trueon 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 andcontent/docs/frontend/page) not edited: outside this part's file surface.Verification
Read first, by risk:
ui/packages/plugin-designer/src/FieldDesigner.tsx: thefieldHistoryRowsmemo (two rows,visibleWhenbuilt fromresolveFieldHistory) andfieldHistoryFromForm, which picks the row for the SAVED type on both save paths.ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.tsx:patchEnablewithunsetWhenOn(re-ticking removesenable.fieldHistory, keeps siblings).ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.tsx: the Field change values row and the object-off note insideDisplayPatchLock.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)
@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 plustsconfig.test.json) of@object-ui/app-shell,@object-ui/i18n,@object-ui/typesand@object-ui/plugin-designer: all four Done, exit 0 (after the merge; plugin-designer again at 3b5b130).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.tsxgave 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.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.scripts/ablation-replace.mjs(anchor 1 to 0), restored with blob equal to HEAD andgit diff HEADempty:trackHistoryagain: 2 of 7 new inspector pins red.trueinstead of removing the key: 1 of 14 red.trackHistory: data.trackHistory === truein place offieldHistory: 7 of 13 red across the two new designer files.dispatch-gates --commandsat 3b5b130 derived 42 families; all 42 ran locally with exit 0;--ranreconciliation gives "42 derived, 42 run, 0 NOT-MEASURED, 0 UNRUN".overlap-checkat 3b5b130: VERDICT clean exit 0 against origin/main d7411fa (three commits past the merged 9e2a4ac;git merge-treeis also clean) and feat(studio): hooks, an installed app's added actions and flows save with Cancel and Save, live at once #36634, feat: an object's action layout per scope, pinned and more, set from the design mode (#36366) #36629, feat(console): create a dashboard from the design mode's Add menu item #36606, feat(console): preview images, PDF, text and CSV in the page from attachments and file fields #36587, feat: Change Owner cascade, transferBehavior on a relationship, ticked in the dialog #36525.check:new-line-citations0,check:i18n-keys0,check:i18n-drift0,check:i18n-dead-keys0. eslint on the changed source and test files: 0 errors, and no warnings on added lines.🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmPq6z7KER4Sr6Uu7Ht