Skip to content

feat(spec): add fieldGroups MVP to ObjectSchema#1199

Merged
xuyushun441-sys merged 5 commits intomainfrom
copilot/add-field-groups-mvp
Apr 21, 2026
Merged

feat(spec): add fieldGroups MVP to ObjectSchema#1199
xuyushun441-sys merged 5 commits intomainfrom
copilot/add-field-groups-mvp

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

examples/app-crm — showcase fieldGroups MVP

Wires the new fieldGroups protocol (added in this same PR's spec commit) into the CRM reference example so users have a realistic, multi-group starting point when designing forms and detail pages.

  • Plan CRM fieldGroups showcase
  • account.object.ts — 6 groups (basic / financials / contact_info / ownership / branding / system)
  • contact.object.ts — 6 groups (identity / account_info / contact_info / mailing_address / additional / preferences)
  • opportunity.object.ts — 7 groups (basic / financials / sales_process / classification / competition / notes / forecast)
  • lead.object.ts — 9 groups (identity / company_info / contact_info / qualification / assignment / address / additional / preferences / conversion)
  • CHANGELOG [Unreleased] → Changed entry
  • ObjectSchema.safeParse() on all four objects → parsed=true, 0 ungrouped, 0 orphaned field → group references
  • No new typecheck errors introduced (pre-existing errors in src/views/lead.view.ts and objectstack.config.ts are unrelated to this change)

Earlier commits in this PR (context)

  • ObjectFieldGroupSchema + ObjectSchema.fieldGroups added to packages/spec/src/data/object.zod.ts
  • 12 round-trip tests in object.test.ts (all green; full spec suite 6827/6827)
  • "Field Groups (MVP)" section in skills/objectstack-schema/SKILL.md
  • "Field Groups" section in content/docs/guides/data-modeling.mdx
  • Skill Zod references regenerated via gen:skill-refs

Design notes (recap)

  • No business logic in packages/spec — schema-only.
  • Zod-first, snake_case group keys, TSDoc on every property.
  • Array order = display order — no order property on groups.
  • Field.group is the sole field → group assignment mechanism; in-group display order = ObjectSchema.fields traversal order.
  • Supported migrations at this layer: add / rename / delete / reorder groups, assign Field.group. Explicit per-field in-group ordering deferred.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 20, 2026

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

Project Deployment Actions Updated (UTC)
objectstack-demo Ready Ready Preview, Comment Apr 21, 2026 2:26am
spec Ready Ready Preview, Comment Apr 21, 2026 2:26am

Request Review

Adds simplified metadata-layer field grouping:
- New ObjectFieldGroupSchema (key/label/icon/description/defaultExpanded/visibleOn)
- Optional fieldGroups: ObjectFieldGroup[] on ObjectSchema; array order = display order
- Group keys validated unique + snake_case; field→group via existing Field.group
- 12 new tests; CHANGELOG updated under [Unreleased]

Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/9a38bcfa-8efb-46a2-a910-88a4f33364d8

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Copilot AI changed the title [WIP] Add simplified field groups protocol for metadata layer MVP feat(spec): add fieldGroups MVP to ObjectSchema Apr 20, 2026
Copilot AI requested a review from xuyushun441-sys April 20, 2026 14:07
…ing guide

- Add "Field Groups (MVP)" section to skills/objectstack-schema/SKILL.md with a
  full worked example, ObjectFieldGroup property table, and migration scope
- Link fieldGroups in the "Important optional properties" table and references list
- Add "Field Groups" section to content/docs/guides/data-modeling.mdx (with TOC entry)
- Regenerate skill references via `pnpm --filter @objectstack/spec gen:skill-refs`
  so every skill's object.zod.ts copy now includes ObjectFieldGroupSchema
  (sync also picks up unrelated drift in manifest.zod.ts / dashboard.zod.ts /
  filter+query → objectstack-query move, per the script's source-of-truth role)

Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/2dfd93fb-72b4-4e49-bbba-c239c6b5b81c

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
…unity/Lead

Declare logical `fieldGroups` on each of the four primary CRM objects and
opt every field in via `group: '<key>'`. No business-logic changes — only
form-layout metadata — so validations, workflows, indexes, and state
machines are unaffected.

- Account: basic / financials / contact_info / ownership / branding / system
- Contact: identity / account_info / contact_info / mailing_address /
           additional / preferences
- Opportunity: basic / financials / sales_process / classification /
               competition / notes / forecast
- Lead: identity / company_info / contact_info / qualification / assignment /
        address / additional / preferences / conversion

Verified every field maps to a declared group key (0 orphaned, 0 ungrouped)
and all four objects parse successfully with `ObjectSchema.safeParse`.
Pre-existing typecheck errors in `src/views/lead.view.ts` and
`objectstack.config.ts` (unrelated `'1'|'2'|'3'|'4'` string enum and
sharing-rule types) are untouched by this change.

CHANGELOG entry added under `[Unreleased] → Changed`.

Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/c2759af4-65bb-4cff-8b2b-ed605c936273

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
@xuyushun441-sys
Copy link
Copy Markdown
Contributor

@claude[agent] resolve the merge conflicts in this pull request

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: objectstack-demo.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: spec.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@github-actions github-actions Bot added documentation Improvements or additions to documentation protocol:data tests size/l labels Apr 21, 2026
@xuyushun441-sys xuyushun441-sys merged commit 2b48e62 into main Apr 21, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:data size/l tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

字段分组(fieldGroups)协议简化版:元数据层MVP

2 participants