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 eec2bc3
Browse filesBrowse the repository at this point in the historyBrowse files
fix(app-shell): object picker refusal says the current object is kept when it is (#38617)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9JeHmqv6CKCkW8ewrPBLekk)_Fixes#37926
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:Studio
字段设置里,查找字段的“关联对象”或汇总字段的“子对象”已选好时,输错对象名,提示从“未选择对象”改为“不是对象,已保留当前对象”;空字段时提示不变。
- 为什么做:这是上一轮“输错不再清掉已选对象”修复的收尾,替搭建应用的人消除提示与实际结果相矛盾的情况。
- 出错会怎样:只影响一行提示文字,保存下来的元数据不受影响,可直接撤回。
- 要你做什么:无。
## What changes
- `ObjectPicker` (objects-only mode): when typed text names no object
and the field already has a stored target, the refusal line now renders
the new studio key `engine.inspector.objectPicker.notAnObjectKept`
instead of `notChosen`. The choice is made at render time from `value`
(non-empty = the target `commitTyped` just restored), so the line can
never claim a kept target when there is none.
- `@object-ui/i18n` studio namespace: one new key in `en.ts` and
`zh.ts`, next to `notChosen` (whose text is unchanged):
- en: "“{text}” is not an object; the current object is kept."
- zh: 「“{text}”不是对象,已保留当前对象。」
- Patch changeset for `@object-ui/app-shell` and `@object-ui/i18n`.
**Read first (by risk):**
1.
`ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectPicker.tsx`,
the refusal notice hunk (the key choice).
2.
`ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectPicker.test.tsx`,
the objectsOnly describe block (pins per case and locale).
**Two-minute check:** from `ui/`, `pnpm exec vitest run
packages/app-shell/src/views/metadata-admin/inspectors/ObjectPicker.test.tsx`.
You should see 18 tests pass, four of them named `[en-US]` / `[zh-CN]`.
## Tests
The two existing objectsOnly refusal cases now run once per locale
(`en-US`, `zh-CN`) and assert the rendered line:
- empty field + refused prefix: the `notChosen` line;
- stored target + refused name (Enter and blur): the `notAnObjectKept`
line, and not the `notChosen` line.
For zh, each pin also asserts the line is not the en text, so an en
fallback cannot pass for zh. That assertion caught a real ordering
issue: the studio zh table loads lazily, so the file now awaits
`loadStudioCatalogue('zh')` at the top, as sibling tests do.
<details><summary>Run on HEAD (5 picker-related files + studio namespace
parity)</summary>
```
Test Files 5 passed (5)
Tests 54 passed (54)
os-verify-lock: VERDICT command-exit 0
```
</details>
<details><summary>Ablation: kept-case branch reverted to notChosen on
disk</summary>
```
× [en-US] a typed name that is no object keeps the chosen one and says it is kept, on Enter and on blur alike
× [zh-CN] a typed name that is no object keeps the chosen one and says it is kept, on Enter and on blur alike
Tests 2 failed | 16 passed (18)
os-verify-lock: VERDICT command-exit 1
```
Restored with `git checkout HEAD --`; `git status --porcelain` empty
afterwards.
</details>
## Acceptance notes
- The line does not name the kept object; the box already shows it, as
the card allows.
- Not checked in a browser; the reach is the component test with the
real studio catalogue.
## Verification
All readings at head `afaa2ba2`.
- `node scripts/pm/dispatch-gates.mjs --commands` derived 38 local
commands; each ran with its exit code captured before any pipe; all 38
exit 0 (plus `pnpm check:changeset-fixed`, exit 0, for the roster under
`.changeset`). `--ran` reconciliation: "38 derived, 38 run, 0
NOT-MEASURED, 0 UNRUN" (a derived zero, every line carrying its exit
code).
- `pnpm --dir ui exec vitest run scripts/`: 172 files passed, 2 skipped;
5159 tests passed.
- `pnpm --filter @object-ui/i18n run type-check` and `pnpm --filter
@object-ui/app-shell run type-check` (both `tsc --noEmit` and the
`tsconfig.test.json` program): exit 0.
- `node scripts/pm/overlap-check.mjs --branch=HEAD`: merges cleanly with
`origin/main` and the four open PRs sharing the studio `en.ts` /
`zh.ts`.
- Not run locally, left to CI: the type-check lanes, the repo-wide `pnpm
lint` and the full UI test run.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B
<!-- signed: repo:objectstack#3 · os-steve ·
session_01ADHkmSwS4mQyXWrddL4r6B -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
fix(app-shell): the object picker's refusal says the current object is kept when it is
7
+
8
+
Clause-②: no
9
+
Metadata-protocol: none
10
+
11
+
In Studio's field inspector, a Lookup's *Related object* or a roll-up's *Child object* that already has a target keeps it when the typed text names no object, but the refusal line still read "No object chosen". The line now reads "“{text}” is not an object; the current object is kept." (zh: 「“{text}”不是对象,已保留当前对象。」) whenever a stored target was kept; an empty field keeps the "No object chosen" line. `@object-ui/i18n` adds the `engine.inspector.objectPicker.notAnObjectKept` studio string in en and zh.
0 commit comments