Skip to content

feat(components,app-shell): Studio 列拖动重排 → 写回字段元数据顺序 - #2092

Merged
os-zhuang merged 1 commit into
mainfrom
feat/studio-field-reorder
Jun 29, 2026
Merged

feat(components,app-shell): Studio 列拖动重排 → 写回字段元数据顺序#2092
os-zhuang merged 1 commit into
mainfrom
feat/studio-field-reorder

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

按用户方向:列拖动重排是表格组件已有功能,不重复开发——只在设计模式启用它,并把新顺序保存到对象的字段元数据(字段显示顺序 = 元数据顺序;拖动即改元数据顺序)。

改了什么

  • GridFieldAuthoring context 加 onReorderFields(orderedFieldNames)。提供它就启用 data-table 内建的列拖拽(reorderEnabled)并把 drop 的新列序回调给宿主。
  • data-table 在列 drop 时调 fieldAuthoring.onReorderFields(与它原有的 onColumnsReorder 并存),拖拽手柄/draggable 都 gate 在 reorderEnabled
  • DataPillar 把对象 fields 重排成新序——只重排可见字段(在它们各自的槽位内),系统/隐藏字段(不作为列显示的,如 organization_id/created_at)保持原位——再 save+publish+重挂网格。

验证(浏览器实测,showcase_account)

Industry 拖到最前 → effective 字段顺序 [owner_id, name, industry, …][industry, owner_id, name, …];系统字段(organization_id/created_at/…)仍在最前(没被挤走);写入 env overlay 持久化、刷新后保持。

注:HTML5 原生拖放在合成事件下难驱动(同 #11),但这是表格的既有生产能力,用户已确认;本 PR 只接「启用 + 存顺序」,已用元数据校验确认 drop→onReorderFields→重排→发布 全链路落盘。

eslint . 0 error / tsc 0 error / data-table 6 测通过。仅 objectui main,未 live。

🤖 Generated with Claude Code

…rsist field order
The data-table already implements column drag-reorder; this enables it in the
Studio Data grid (design mode) and persists the new order to the object's FIELD
METADATA (field display order = metadata order), per spec — no drag re-implemented.
- GridFieldAuthoring context gains onReorderFields(orderedFieldNames). Providing it
enables the table's built-in reorder (reorderEnabled) and routes the drop's new
column order to the host.
- data-table calls fieldAuthoring.onReorderFields on column drop (alongside its
existing onColumnsReorder) and gates the drag affordances on reorderEnabled.
- DataPillar reorders the object's fields to match — keeping system/hidden fields
(not shown as columns) in place, reordering only the visible fields among their
slots — then save + publish + remount.
Verified live (showcase_account): drag Industry to the front → effective field order
[owner_id,name,industry,...] → [industry,owner_id,name,...]; system fields
(organization_id/created_at/...) stay first; persisted to the env overlay.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercelBot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
objectuiIgnoredIgnoredJun 29, 2026 10:32am

Request Review

@os-zhuang
os-zhuang merged commit f98f696 into mainJun 29, 2026
6 of 10 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

❌ Console Performance Budget

MetricValueBudget
Main entry (gzip)** KB**KB
Entry file``
StatusFAIL

📦 Bundle Size Report

PackageSizeGzipped

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@os-zhuang
os-zhuang deleted the feat/studio-field-reorder branch June 29, 2026 10:33
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@os-zhuang