Uh oh!
There was an error while loading. Please reload this page.
feat(components,app-shell): Studio Data 网格列头「+ 添加字段」(Airtable 式) - #2069
Merged
Conversation
…table column header Adds an opt-in GridFieldAuthoring context to @object-ui/components: the data-table renders a trailing "+" header cell (and matching body cell) ONLY when a host provides the context, so every runtime table renders byte-identically. Studio's Data pillar wraps the object grid in the provider, opening an add-field form (label + type) that patches the object's `fields`, saves a draft + publishes the env overlay, busts the data-layer schema cache (adapter.clearCache) and remounts the grid so the new column appears live. Note: packaged object schema is `allowOrgOverride: false` by default (objects are locked — schema changes imply migrations). Adding a field requires the env to permit object overlays via OS_METADATA_WRITABLE, which a Studio/design environment enables. When it isn't permitted, the backend's clear "not_overridable" error surfaces in the form. Verified live (showcase_account, OS_METADATA_WRITABLE=object): + → form → publish writes the field to the env overlay (effective fields 16→18), the new column appears without a reload; non-latin labels slug to field_N. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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 freeto 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.
什么
Studio Data 支柱的对象网格现在支持 Airtable 式「列头末尾 + 添加字段」(#8,用户点名的下一步优化重点)。
机制 — 不耦合运行时网格(零回归)
网格是 3 层 SDUI 间接(
object-view→object-grid→data-table),每层 schema 都序列化,所以"列头上的 + 回调"既不能走 schema,也不该把设计态焊进共享data-table。方案:opt-in React context。@object-ui/components的GridFieldAuthoringcontext(useGridFieldAuthoring/GridFieldAuthoringProvider)。data-table读它:有 provider 才渲染末尾「+」列头(+ 行内占位 cell + 两处 colSpan +1);无 provider 时每个运行时表格字节级不变。DataPillar用 provider 包住对象网格,「+」打开加字段表单(名称 + 类型)→ 写对象fields→save(draft)+publish到 env overlay →adapter.clearCache()冲数据层 schema 缓存 + 重挂网格 → 新列免刷新即现。打包对象 schema 默认
allowOrgOverride: false(对象/字段改动 = 迁移,刻意锁)。加字段需运行时经OS_METADATA_WRITABLE放开 object 覆盖 —— 这是 Studio/设计环境该开的开关。未放开时,后端清晰的not_overridable错误会直接显示在表单里(含修复提示)。验证(浏览器实测,showcase_account,
OS_METADATA_WRITABLE=object)「+」→ 表单(客户备注/text、回访日期/date)→ 添加并发布:
code(包源)overlay(发布) /effectiveoverlayScope:env)新列免整页刷新即出现(
clearCache+ 重挂);非拉丁标签 slug 成field_N(如field_18)。eslint .0 error /tsc0 error(@object-ui/components那个sdui-parser报错是 main 上既有、与本 PR 无关)。限制 / 后续
allowOrgOverride/OS_METADATA_WRITABLE)门控,避免在锁定环境点了报错(后续可加)。/studio/:packageId/data,未进产品 nav,仅 objectui main 未 live(需.objectui-shabump + cloud pin)。🤖 Generated with Claude Code