fix(components): 表单内置 textarea 分支只读 mobile_fullscreen,删掉无生产者的 fullscreen 别名 (#3303) - #3397
Merged
Merged
Conversation
…3303) The built-in `textarea` branch resolved the flag as `mobile_fullscreen || fullscreen`, and both prop strips carried a matching entry discarding a `fullscreen` key. That alias had zero producers: neither this repo nor `@objectstack/spec` publishes a form-field `fullscreen` property (the only `fullscreen` keys that exist belong to the unrelated feedback/loading overlay), so the second term was undefined from the day it was written. Its cost was not a wrong value, it was a second spelling: the renderer advertised a flag that quietly does nothing, which is the lenient consumer fallback AGENTS.md #0.1 forbids and the same mechanism as #3245 / #3301. `ObjectForm` is the sole producer and stamps `mobile_fullscreen` (#3245/#3300) — also the single spelling `TextAreaField` and `RichTextField` read, so the built-in branch was the last place where a producer-less spelling still "worked". Removing the strip entries puts `fullscreen` in the ordinary unknown-key class rather than giving a key nobody produces a dedicated discard. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
marked this pull request as ready for review
August 5, 2026 16:25
This was referenced Aug 5, 2026
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.
Fixes #3303
做了什么
按 PM 裁定的 A 方案收敛:表单渲染器内置
textarea分支只读mobile_fullscreen一种拼法。packages/components/src/renderers/form/form.tsx内置textarea分支:mobile_fullscreen || fullscreen→mobile_fullscreen。stripRendererOnlyProps与stripRegisteredFieldProps各自丢弃fullscreen键的那一条(别名的最后残留)一并删除。packages/components/src/renderers/form/__tests__/form-fullscreen-flag-single-spelling.test.tsx。前提复核(issue 行号基于 08-03 快照)
issue 写的是
form.tsx:1945-1947,而今天 #3392 刚改过同一文件。已对当前origin/main(4eeb932aa)复核,别名读取仍在,只是行号漂到 2016-2018;两处 strip条目漂到 259 / 321。前提成立。
「
fullscreen零生产者」也机械复核过:全仓 + 全扩展名 grep 一个裸fullscreen键,只剩两类无关命中 —— feedback/loading 遮罩的同名属性
(
packages/types/src/zod/feedback.zod.ts、renderers/feedback/loading.tsx,按裁定不碰),以及各 locale 文件里的
fullscreen:词条命名空间。没有任何一处是表单字段。为什么这不是「多一层保险」
ObjectForm是唯一生产者,产出的键叫mobile_fullscreen(#3245/#3300),也是TextAreaField/RichTextField单读的那一个。所以|| fullscreen从写下起恒为undefined —— 它的代价不是取错值,而是多了一种拼法:下一个作者(尤其是写表单元数据的
AI)从渲染器里读到
fullscreen,照着写,静默无效、没有任何一处报错。这正是 AGENTS.md0.1 禁止的消费侧宽容兜底,与 #3245、#3301 同一机制。
两处 strip 条目同理:一个没人产出的键不该享有专门的丢弃条目,它应该落回普通的
「不认识的键」那一类,这样拼错才和其它拼错一样可见,而不是被悄悄吞掉。
顺带说明,#3232 那份 changeset 当初明确把这个内置分支记为「另一条仍接受两种拼法的活路径」,
本 PR 就是把那条 forward reference 关掉,#3232/#3233/#3245/#3301 这一串收敛到此收口。
反向验证(方向是先定后跑的)
跑之前先记下预期:钉子里「金丝雀」用例(元数据只写
fullscreen: true)应当改前红、改后绿;因为 fixture 故意不写规范键,
||的第二项才是决定项 —— 这不是canonical-key-first 那种「改前后都红」的反转家族。
改前(未动源码,只加测试)实测:
两条红的正是要钉的两条:别名用例渲染出了展开按钮(dump 里能看到
lucide-maximize2的 button),strip 用例里props.fullscreen是undefined(说明当时确实有专门的丢弃条目)。两条限肢都是活的,不是空绿。
改后:
钉子怎么写的
失效时它同样通过。所以同一 describe 里先钉住
mobile_fullscreen确实渲染展开按钮、且开-改-Done 的 draft/commit 语义仍然完好。
回去不会有任何东西变红。所以用一个探针 field widget 断言:
mobile_fullscreen仍被 strip掉(它只走
field这一个载体),而fullscreen现在与一个随手编的not_a_real_flag行为完全一致。断言写成两者相等,意思不是「widget 应该收到
fullscreen」,而是「渲染器不再为它保留专门条目」。
消费半径已扫
两个 strip 只在 form.tsx 的
renderFieldComponent里被调用,但它们的下游是所有注册字段 widget。按消费半径(不是按改动包)扫了 fixture:全仓没有任何 fixture 拼过表单字段级的
fullscreen,所以没有需要改拼写 / 补声明 / 整条替换的 fixture。明确没做(按裁定)
FullscreenTextarea第三份实现与packages/fields的FullscreenFieldEditor合并 —— components 依赖 fields 方向反,需单独裁决。
为什么补了 changeset
PM 说纯收敛可免、由 dev 判。判下来是补:这一族(#3232/#3245/#3301)每一单都发了
changeset,且 #3232 那份正文里对本分支留了 forward reference,不补会让发布说明里这串收敛
断在半路。定为
patch/@object-ui/components;check-changeset-no-major已过。验证
--reporter=verbose按文件名确认确实跑到了(objectui#3288/pnpm --filter @object-ui/app-shell test跑的是 @object-ui/console 的 22 个文件,app-shell 自己的 276 个一个没跑,却报绿 #3378的路径过滤被吞陷阱)。
plugin-form 的 ObjectForm、types 的字段元数据)一起从仓根跑:
Test Files 31 passed (31) / Tests 153 passed (153)。turbo run type-check --filter=@object-ui/components:8/8 successful。turbo run lint --filter=@object-ui/components:0 errors(770 条既有 warning 全在src/ui/**免动区等无关文件;新测试文件只有 3 条no-explicit-any,与同目录既有探针测试form-field-carrier.test.tsx同款)。pnpm check:control-bytes:OK。Generated by Claude Code