Repository navigation
fix(app-shell): hold a new state_machine / format / json_schema validation rule until it has a field and a message - #26855
Merged
Conversation
… and a message A new state_machine / format / json_schema rule was written to the object draft at once, on the object's first listed field and with no message. It now waits in the Validations panel, the hold guarded rules already take, with no field picked for the author. "Add transition" keeps its blank row local until it has a from-state instead of writing the key "". A conditional rule's `when` gets its own caption (en, zh) instead of the script rule's fail-condition one. Claude-Session: https://claude.ai/code/session_01JQwxbaA4X9WGDi4ZgwZ4PZ Co-authored-by: Claude <noreply@anthropic.com>
…ead transition keys directly Claude-Session: https://claude.ai/code/session_01JQwxbaA4X9WGDi4ZgwZ4PZ Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
Test UI (5/16) red — not this PR's; base
Generated by Claude Code |
…eld and message before it is written Claude-Session: https://claude.ai/code/session_01JQwxbaA4X9WGDi4ZgwZ4PZ Co-authored-by: Claude <noreply@anthropic.com>
…logue before its zh-CN banner case Claude-Session: https://claude.ai/code/session_01JQwxbaA4X9WGDi4ZgwZ4PZ Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对ACCEPT · seat 席位意见:新建的状态机 / 格式 / JSON Schema 规则不再预填第一个字段,补齐字段和错误消息之前留在面板里不写入草稿,沿用 #11820 的同一套“暂存”机制;空的状态转移行在填写起始状态前不写入;条件规则的
Generated by Claude Code |
This was referenced Oct 27, 2026
This was referenced Oct 27, 2026
Closed
zhuangjianguo
pushed a commit
that referenced
this pull request
Oct 27, 2026
…ries main's #26855 added the same module-scope `loadStudioCatalogue('zh')` await to `ResourceEditPage.environmentOverlay-12141.test.tsx`; with this branch's copy the merged file declared the import twice and failed to transform. Keep main's copy. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVTqmjzhQU2Rqq79mu
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 Warren · project thread
Fixes #26731
Clause-②: no
Metadata-protocol: none
维护者速读
when换成自己的说明文字(中英文)。created_at)上、消息为空,空转换行以"": []存进去并会被发布;条件规则的说明写成「失败条件,为真时拒绝保存」,与when的真实含义相反。ObjectValidationsPanel.tsx的missingPart与makeSkeleton(新规则不再预填字段);同文件TransitionsField的空行;ObjectValidationsPanel.newRuleComplete-26731.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/ObjectValidationsPanel,预期 11 个文件 113 条全绿。What changes
state_machine,formatandjson_schemanow take the same in-panel hold guarded rules got in objectui#11820. A new one starts with no field (thepickFieldplaceholder), is listed and marked not saved, and is written to the draft once, when it has a field and a non-blank message.missingPartwraps the unchangedmissingGuard; the held line and the list mark name what is missing (engine.studio.held.needsRuleField/needsRuleMessage,engine.studio.rules.notSavedField/notSavedMessage), and the hold's input hint sits under the field picker or the message input.TransitionsFieldstate; it is written when it gets a from-state. The blank row renders at the index its written row takes, so typing its first letter keeps focus.conditionalrule'swhengroup now reads "Guard (CEL) — when the condition is true, the “Then” rule below applies; otherwise the “Otherwise” rule, if one is set." (engine.studio.rules.whenPre/whenMid, en and zh). Script and cross-field keep the fail-condition caption.'false'placeholder and the first field), presets, and the spec.Why
Triage first grade on the card: a new state_machine / format / json_schema validation saved immediately as a live rule on
created_atwith an empty message, and the conditional rule's wording invertedwhen. On basef79ec289,makeSkeletonseeded those three types withfirstField(the first non-hidden field; asystemaudit column is not skipped, so a served object yieldscreated_at) andmessage: '', andplaceNewRulewrote any guard-less rule at once.Tests
ObjectValidationsPanel.newRuleComplete-26731.test.tsx(10 tests): per type, held with no field, then field, then message → written once and parses throughValidationRuleSchema; message-first order; blank message does not complete; control that an existing rule's type switch still seeds the first field; blank transition row writes nothing until it has a from-state, and deleting it writes nothing; the conditional caption differs from the script caption in en and zh.ObjectValidationsPanel.test.tsx,whenKey,runsOn-11923pick a field and type a message before reading the written rule. presets-11861 is untouched and green.StudioEmptyState.panels-12514.test.tsx("a pick from it writes the rule the header's pick writes") now picks the field and types the message after picking Format from the empty block, then expects exactly one write (c6be0644).ResourceEditPage.environmentOverlay-12141.test.tsxgains a module-scopeawait loadStudioCatalogue('zh'): its lock banner's zh row lives in the lazystudionamespace since feat(ui): the remaining Studio inspector strings and the package, form and editor strings move into the studio i18n namespace (#25922 slice S3) #26815 (app-shell: a published library that is 66% Console product surface — retire the 67 zero-reference exports now, decide the split, and fold the second i18n table into @object-ui/i18n #25922 S3), and without the preload the zh-CN banner case is red on every run (seat Claim widened 6451337559). Red without it (1 failed / 11 passed), green with it (12/12).missingPart's field-type branch replaced withif (false) {throughscripts/ablation-replace.mjs→ 5 of 10 new tests red (all three per-type tests, message-first, blank message); restored, blob equal to HEAD,git diff HEADempty.Acceptance notes
"": []transitions key is still shown as a row (and keeps "Add transition" disabled) — this PR stops writing it, it does not rewrite stored rules.Verification
Head
5e35145d(origin/maina20824f3, with #26859, merged in): affected set 14 files / 156 tests green; 24/24 derived gates exit 0,--ran0 NOT-MEASURED; PR CI 42 success · 10 skipped · 0 failure.Local runs at head 6643455 (origin/main aeb9cf0 merged)
pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/ObjectValidationsPanel— Test Files 11 passed (11), Tests 113 passed (113); lock VERDICT command-exit 0.pnpm --filter @object-ui/app-shell run type-check— VERDICT command-exit 0.node scripts/pm/dispatch-gates.mjs --commands— 24 families, each exit 0;--ranreconciliation: 24 derived, 24 run, 0 NOT-MEASURED, 0 UNRUN. Also run outside the derivation, exit 0:pnpm --dir ui run check:new-line-citations,pnpm check:i18n-stale-fill.@object-ui/app-shellisprivate: true(labelskip-changeset).Human Minimum
packages/specholds no runtime logic.pnpm lintpasses (CI-owned run).main, one pull request.skip-changeset); both declaration lines are filled in here.packages/specnot touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbaA4X9WGDi4ZgwZ4PZ
Generated by Claude Code