You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 03be565
Browse filesBrowse the repository at this point in the historyBrowse files
fix(app-shell): New automation never saves a typed prefix as the trigger object (#30148)
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).
<details><summary>Run on the final head</summary>
```
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
```
</details>
<details><summary>Ablation (one-shot, through
scripts/ablation-replace.mjs, restored to HEAD after each leg)</summary>
- Leg A, `ObjectPicker.tsx`: `if (!objectsOnly || catalog.status !==
'loaded') {` replaced with `if (true) {` (objectsOnly ignored). Mutation
landed (anchor 1 to 0, blob e2118e0 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 fc99d66
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.
</details>
## 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](https://claude.ai/code/session_01QSeKYpFBMr917PmVkG9up7)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
fix(app-shell): New automation no longer saves a typed prefix as the trigger object (#30038)
7
+
8
+
Clause-②: no
9
+
Metadata-protocol: none
10
+
11
+
In Studio's New automation dialog, typing part of an object name and pressing Enter committed the typed text itself, so the flow was created bound to an object that does not exist. The trigger-object picker there now takes objects only: Enter or leaving the field commits the object the text names exactly, else the only match left in the list, else no object, and the picker says no object is chosen. A record preset then keeps the dialog open until an object is picked.
12
+
13
+
Every other object picker keeps its free text, because a flow reference may hold an expression.
0 commit comments