fix(app-shell): lookup-param helpText only renders when the param actually degraded to a raw-id input (#3094) - #3095
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…ually degraded to a raw-id input (#3094) The action params dialog rendered `actionDialog.lookupHelpText` ("no reference object configured, picker unavailable, paste a record id") for EVERY lookup/reference param without a custom helpText — even when `reference` was configured and the record picker worked. The condition only checked "is a lookup param"; the degradation it describes lives in paramToField() (lookup + no referenceTo → text input) and was never consulted. Gate the message on `field.type === 'text'`, mirroring the adjacent lookupPlaceholder branch that already checks it. Tests pin all three states: working picker → no warning; targetless param → text input + warning; custom helpText → custom text wins. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #3094
问题
Action 参数对话框(RecordDetailView 记录头动作)里,
lookup/reference类型参数无条件渲染actionDialog.lookupHelpText("该参数未配置引用对象,无法使用记录选择器。请直接填写记录 ID…")——即使reference已正确配置、记录选择器完全可用。用户被误导去贴裸记录 ID,而不去用旁边正常工作的选择器。根因
ActionParamDialog.tsx中该警告的渲染条件只有isLookupParam && !param.helpText,从不检查参数是否真的降级。警告文案描述的降级判定在paramToField()里(lookup 且无referenceTo→ 降为 text 输入),但不参与该条件;同文件上方lookupPlaceholder分支是有field.type === 'text'检查的,两个分支不对称。修复
一行改动:给 helpText 分支补上
field.type === 'text',与 placeholder 分支镜像——只有参数真降级成"贴 ID"文本框时才显示警告。测试
ActionParamDialog.test.tsx新增三个用例钉住三种状态:referenceTo→ 渲染真选择器(trigger 挂载)且无警告(本 issue 的回归用例);referenceTo→ 降级为 text 输入 + 显示警告;helpText→ 显示自定义文案,内置警告不出现。该文件 31 用例全过;相邻
ActionParamDialog.uploading/paramToField/resolveActionParams套件 28 用例全过;turbo build --filter=@object-ui/app-shell通过。纯 bug 修复,按 AGENTS.md 无需 changeset。🤖 Generated with Claude Code