Repository navigation
fix(studio): list an order-only field change in the publish review and pin platform fields on the form canvas - #27646
Merged
Conversation
…on the form canvas The publish review sheet compared an object's fields by name only, so a draft that only reorders them read "No differences detected" although the publish door hashes field order and saves it. The drill-in now compares the order of the fields both bodies declare, leaving out the columns the reads inject and the writes strip, and lists a "Field order changed" row. The form designer let an authored field sit above an ungrouped field whose definition is the platform's own (owner_id). The draft write strips that column and every read puts it back ahead of the declared fields, so the arrangement reverted on reload. The canvas now settles such fields first in the ungrouped bucket on every drop, and the drop announcement names the settled place. Claude-Session: https://claude.ai/code/session_01Utp6CZkEeDsL4LuR4hwqTN Co-authored-by: Claude <noreply@anthropic.com>
…latform fields Claude-Session: https://claude.ai/code/session_01Utp6CZkEeDsL4LuR4hwqTN Co-authored-by: Claude <noreply@anthropic.com>
…nvas pins Claude-Session: https://claude.ai/code/session_01Utp6CZkEeDsL4LuR4hwqTN Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#3 · os-bill · session_01Utp6CaJoinvGQSbHeDaWBe 席位核对ACCEPT · head
Generated by Claude Code |
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.
Requested by Bill · project thread
Fixes #27516
Clause-②: no
Metadata-protocol: none
维护者速读
DraftChangesPanel.tsx的fieldOrderChanged(排除哪些平台注入列);ObjectFormDesigner.tsx的settlePinned/dropLayout(onDragEnd 与播报共用一套落点计算);两份新测试。pnpm --dir ui exec vitest run packages/app-shell/src/preview/__tests__/DraftChangesPanel.fieldOrder-27516.test.tsx packages/app-shell/src/views/studio-design/ObjectFormDesigner.pinnedFields-27516.test.tsx,预期 13 个用例全绿。What changes
DraftChangesPanel) —computeChangeDetailnow reportsfields.reorderedfor anobjectwhose two versions declare their shared fields in a different order, and the drill-in prints a~ Field order changedrow (new keypreview.changes.fieldOrderChanged).isEmptyChangeDetailcounts it, so such an entry keeps its Update badge instead of the "No differences detected" glyph.isInjectedColumnDefinitionoverinjectedSystemColumnDefs, both from@objectstack/spec/data), which the/metareads prepend and the draft write strips; and a column the platform injects and hides (isStudioHiddenSystemField, the search companion among them). Only fields both versions declare are compared; an added or removed field is already a row.type === 'object', the one row of the door's ordered-map table; the comment onfieldOrderChangednames that table as the authority.ObjectFormDesigner) —settlePinnedplaces every shown ungrouped field whose definition, without itsgroup, is the platform's own first in the ungrouped bucket, in the injection's order. It runs on the derived layout and on every drop.onDragEndand the live-regiondropPlaceInnow share onedropLayout(the arithmeticdropPlaceInused to restate), so the place announced is the settled place committed. A pinned field moved into a section carriesgroupand is the author's from then on; an edited one (a changed label) likewise.FieldControlPreviewis untouched.preview.changes.fieldOrderChangedin all ten locale packs.@object-ui/app-shelland@object-ui/i18npatch.Tests
DraftChangesPanel.fieldOrder-27516.test.tsx(9 cases): a pure reorder of authored fields, the array shape offields, a same-order control, platform columns placed differently on the two reads (registry-backed vs overlay-backed) compare equal, an author-declaredowner_idcounts, added/removed fields are not a reorder, non-objecttypes are not compared; on the panel, the row prints and the Update mark stays, with a same-order control still reading "No differences detected".ObjectFormDesigner.pinnedFields-27516.test.tsx(4 cases), on the realDndContextwith the band geometry of the objectui#11802 suite, and areloadthat replays the round trip with the spec's helpers (strip what equals the platform's definition, prepend the injected columns): Condition dropped on Owner lands at 2 of 3, is announced there, and the reloaded canvas shows the same order; author reorders below Owner survive the reload; an author-changedowner_idkeeps the place it is given; Owner moved into a section keeps its section order through the reload.scripts/ablation-replace.mjs(anchor 1 → 0, blob changed, restored withgit diff HEADempty); app-shell tests import the source, no build in the path:reorderedforced falsesettlePinnedreturns the layout unsettledpnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/ packages/app-shell/src/preview/: 293 files, 2076 tests passed (includes the objectui#11802 announcement suite, whose drop-vs-commit control now runs through the shareddropLayout).pnpm --dir ui exec vitest run packages/i18n/: 90 files, 1379 passed, 13 skipped (locale key parity included).type-checkfor@object-ui/app-shelland@object-ui/i18n: exit 0. eslint on the four touched source/test files: 0 errors (8 warnings, all on lines this PR does not touch).Acceptance notes
canonicalize(body, 'object')in@objectstack/metadata-core(itsORDERED_MAPStable keeps the order of anobject'sfields). It cannot be imported here as is: the module importsnode:cryptoat its top, and@object-ui/app-shelldoes not depend on@objectstack/metadata-core. The sheet therefore restates that one row's rule, keyed on the same type, and reuses the spec's exported injection helpers rather than a second list of platform columns. The seat approved this before it was written.owner_idis re-injected, measured. The/metaread exits callgovernServedItem, whoseapplyInjectedSystemColumns(@objectstack/metadata-core) buildsfieldsas the injected-but-undeclared columns followed by the declared ones; the draft write'sstripInjectedSystemColumnsremoves a column whose definition equals the platform's (isInjectedColumnDefinition). The canvas pins exactly that set, read through the same spec helpers.ui/packages/i18n/src/locales/*.tspacks (one key each) were added to the claim's file surface with the seat's approval.Verification
dispatch-gates --commands): 34 families run locally, 33 exit 0.pnpm --dir ui exec vitest run scripts/exited 1 on one 15 s timeout (check-vi-mock-inherit.test.ts, run beside a locked vitest run); that file alone under the lock: 83/83 passed.--ranreconciliation: 34 derived, 34 run, 0 NOT-MEASURED.node scripts/check-sdui-manifest.mjsexit 0.origin/mainmerged (a7a422a4); it touched neitherDraftChangesPanel.tsxnorObjectFormDesigner.tsx. After rebuilding the merged ui packages: the two new files, the objectui#11802 announcement suite and both locale parity suites, 69/69 passed;@object-ui/app-shelltype-checkexit 0.Generated by Claude Code