Skip to content

DrawerForm never calls deriveFieldGroupSections — a drawer form ignores the object's declared fieldGroups that ObjectForm and ModalForm both honour #4774

Description

@yinlianghui

Found while implementing #4755 (PR for that card carries the flat-builder convergence). Filed unassigned and deliberately out of that card's scope — #4755 is about the four dropped keys, this is a different, adjacent gap that survives the fix.

What #4755 says, and where it is off

#4755's group paragraph reads:

The dropped group has a second effect: deriveFieldGroupSections's fieldGroups fallback has nothing to group on, so a drawer form cannot auto-derive sections from the object's declared field groups the way the modal can.

Carrying group is necessary but not sufficient, and the stated cause is mis-attributed: DrawerForm has no fieldGroups fallback to starve. It never calls deriveFieldGroupSections at all.

Verified on origin/main @ d971e51c0:

$ git grep -n "deriveFieldGroupSections" -- packages/plugin-form/src/
packages/plugin-form/src/ObjectForm.tsx:38:import { deriveFieldGroupSections } from './fieldGroups';
packages/plugin-form/src/ObjectForm.tsx:909:        : deriveFieldGroupSections(groupableFields, objectSchema?.fieldGroups),
packages/plugin-form/src/ModalForm.tsx:51:import { deriveFieldGroupSections } from './fieldGroups';
packages/plugin-form/src/ModalForm.tsx:258:    const sections = deriveFieldGroupSections(fs, (objectSchema as any)?.fieldGroups);

$ git grep -n "fieldGroups" -- packages/plugin-form/src/DrawerForm.tsx
(no output)

SplitForm / TabbedForm have no fallback either, but for them that is coherent — they are section-first surfaces (tabs / panes) with no flat render path at all. DrawerForm does have a flat render path (applyAutoLayout over formFields), which is exactly the shape ObjectForm and ModalForm upgrade into grouped sections.

Effect

An object that declares fieldGroups, with its fields opting in via field.group, renders as:

  • ObjectForm — one section per declared group (ObjectForm.tsx:905-911)
  • ModalForm — one section per declared group, with flat-path auto-layout parity (ModalForm.tsx:249-264)
  • DrawerForm — one ungrouped flat list, group headers nowhere

Same metadata, same object, three surfaces, two answers. The author who laid out groups in the object designer sees them honoured in the modal create dialog and dropped in the drawer.

After #4755's PR the drawer's runtime FormFields do carry group (the builders converged onto one shared buildFlatFields), so the input the fallback needs is present — the call site is what is missing.

Fix shape (not attempted)

Mirror ModalForm.tsx:249-264 in DrawerForm: a derivedSections memo gated on "no explicit sections, no customFields", running filterSystemFields (+ filterAutoGeneratedFields in create mode) before deriveFieldGroupSections, then feeding the existing sections render path. Worth checking at the same time whether that memo should itself be shared between the two containers rather than hand-copied a second time — a hand-copied second copy of a modal/drawer helper is precisely what #4755 was about.

Not measured

Not observed on a shipped app; found by reading the three containers side by side while converging the flat builders for #4755. Filing plainly for triage to grade rather than sitting on it.

Activity

  1. yinlianghui commented on Aug 16, 2026

    @yinlianghui
    CollaboratorAuthor

    【PM 分诊】座位 repo:objectui(session_01GTRjn8xBqp75dk7kFupVRt):晋级 pm:queue —— DrawerForm 缺 deriveFieldGroupSections 调用点(全仓仅 ObjectForm:909 / ModalForm:258 两处),同一对象在 ObjectForm/Modal 渲染分组 sections、在 drawer 渲染扁平列表;PR #4775 已让 drawer 的运行时字段带上 group(输入就位),缺的只是调用点。修法照 ModalForm 的 fallback 形态接入;#4755 正文的归因(「fallback 没东西可分组」)已由实测更正为「没有 fallback」,实施以本卡与 PR #4775 报告为准。SplitForm/TabbedForm 的 section-first 设计自洽,不属同一缺陷。等 PR #4775 落 main 后派(同文件面)。


    Generated by Claude Code

  2. self-assigned this
    on Aug 16, 2026
  3. yinlianghui commented on Aug 16, 2026

    @yinlianghui
    CollaboratorAuthor

    Claim: 批次 9(座位 repo:objectui,session_01GTRjn8xBqp75dk7kFupVRt,batch:5)
    Branch: claude/issue-4774-drawer-group-fallback
    File surface: packages/plugin-form/src/DrawerForm.tsx + 测试;前置 PR #4775 已落 main(469b604,group 输入已就位)。修法照 ModalForm:258 的 fallback 形态接入 deriveFieldGroupSections;与在飞 #4014(components/renderers/form)、#4766/#4767(app-shell)、#4768(components/custom)互斥。


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions