Skip to content

fix(app-shell): New automation never saves a typed prefix as the trigger object - #30148

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-30038-trigger-object-enter
Nov 5, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-30038-trigger-object-enter

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Refs #30038 (items 1, 2, 4)

Item 3 (the closure refusal on 问题 reads in English) does not land here: the text is produced server-side by packages/lint/src/validate-flow-trigger-readiness.ts:513, outside this card's ui/** lane. It is listed in the report for the seat to carry. The card stays open for it.

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:新建自动化对话框里的「对象」选择框只接受真实对象;输入前缀按 Enter,只剩一个匹配就选它,否则提示「未选择对象」,不再把半截文字存成触发对象。
  • 为什么改:运营人员像用搜索框一样按 Enter,结果流程绑到不存在的对象上,事后才在「问题」里看到英文报错。
  • 风险与回滚:只在新建自动化对话框这两处开启(新的可选开关 objectsOnly);其他用到该选择框的地方(流程引用可填表达式)行为不变。回滚即撤销本 PR。
  • 先看:ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectPicker.tsx(commitTyped 一段)、StudioDesignSurface.tsx(两处 objectsOnly)、ObjectPicker.test.tsx 末尾新增的 describe。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/inspectors/ObjectPicker.test.tsx packages/app-shell/src/views/studio-design/StudioDesignSurface.createTaken-26917.test.tsx,预期 25 个测试全部通过。
  • 需要你做的:无,席位落地。

What changes

  • ObjectPicker gains an opt-in prop objectsOnly (default off). With it, Enter and blur never commit the typed text as itself. They commit the pickable object named exactly so, else the only pickable option left in the filtered list, else no object (an empty commit), and the picker shows a role="alert" line: "No object chosen: "TEXT" is not an object. Choose one from the list." Options outside the package closure stay unpickable, as before. Before the catalog is read, nothing can be resolved and the typed text is committed as before.
  • The New automation dialog (StudioDesignSurface.tsx) turns objectsOnly on for both trigger-object pickers: the record preset and the Advanced trigger form. With a record preset and no object chosen, Create keeps the dialog open with the existing "Choose the object it watches." line.
  • Every other ObjectPicker use is unchanged. FlowReferenceField.tsx (an object-kind flow reference, where an expression is legal) passes no objectsOnly and keeps free text.
  • zh/en strings in ui/packages/i18n/src/namespaces/studio/{en,zh}.ts: engine.inspector.objectPicker.notChosen and engine.inspector.objectPicker.noMatchObjectsOnly. The default empty-list line ("Press Enter to keep what you typed") would mislead at an objects-only door.

Tests

  • ObjectPicker.test.tsx, new top-level describe "objectsOnly": a one-match prefix + Enter commits the match; a several-match prefix + Enter commits nothing and shows the refusal; a non-object name clears a chosen value on Enter and on blur; a full name commits as itself; and, without objectsOnly, the same one-match prefix is committed as typed (item 2).
  • StudioDesignSurface.createTaken-26917.test.tsx, new top-level describe (the shared New-automation harness): with the "updated" record preset, prefix tick + Enter + Create saves a Start node with objectName: 'acme_ticket'; prefix acme (two matches) + Enter + Create saves nothing, shows the refusal and "Choose the object it watches.", and the dialog stays open (item 1 at the door).
Run on the final head
pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/metadata-admin/inspectors/ObjectPicker.test.tsx packages/app-shell/src/views/studio-design/StudioDesignSurface.createTaken-26917.test.tsx
 Test Files  2 passed (2)
      Tests  25 passed (25)
os-verify-lock: VERDICT command-exit 0
pnpm exec turbo run type-check --filter=./ui/packages/app-shell
 Tasks:    68 successful, 68 total   (@object-ui/app-shell:type-check ran tsc --noEmit and tsc -p tsconfig.test.json)
os-verify-lock: VERDICT command-exit 0
Ablation (one-shot, through scripts/ablation-replace.mjs, restored to HEAD after each leg)
  • Leg A, ObjectPicker.tsx: if (!objectsOnly || catalog.status !== 'loaded') { replaced with if (true) { (objectsOnly ignored). Mutation landed (anchor 1 to 0, blob e2118e0a8872 to 53ef6e70092f). Result: 5 failed, 20 passed. The three objectsOnly picker cases and both door cases went red; the full-name case and the free-text (item 2) case stayed green, as they should. Restored: blob == HEAD, git diff HEAD empty.
  • Leg B, StudioDesignSurface.tsx: the record preset's objectsOnly replaced with objectsOnly={false}. Mutation landed (blob fc99d66e24c9 to b3f8845a7e8e). Result: 2 failed, 8 passed, both door cases red. Restored: blob == HEAD. The first attempt at this leg used a replacement already inside the anchor; the tool refused it as a no-op before running anything, and the anchor was changed.

Acceptance notes

  • Item 3 is not here. The refusal is the message of a packages/lint finding (validate-flow-trigger-readiness.ts:513, rule FLOW_TRIGGER_UNKNOWN_OBJECT). It is English prose with objectName and the package id written into it, and no structured parameters a ui renderer could localize from. Localizing it means a producer-side change (structured params or a code the Console keys on), outside this lane.
  • With this fix, the reported route (prefix + Enter + Save as draft) no longer creates a flow bound to a non-object, so this reader no longer reaches that refusal from this door.

Verification

Local gates, derived with node scripts/pm/dispatch-gates.mjs --commands from the merge base and reconciled with --ran. Exit codes are in the report. CI runs the full set.


Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling labels Nov 4, 2026
@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 5, 2026 00:37
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 03be565 Nov 5, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-30038-trigger-object-enter branch November 5, 2026 01:05
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/m tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant