Skip to content

Migrate examples to latest protocol: remove deprecated fields and UI config#151

Merged
hotlong merged 5 commits intomainfrom
copilot/optimize-examples-for-new-protocol
Jan 25, 2026
Merged

Migrate examples to latest protocol: remove deprecated fields and UI config#151
hotlong merged 5 commits intomainfrom
copilot/optimize-examples-for-new-protocol

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 25, 2026

Examples were using deprecated protocol fields (nameField, feedEnabled) and mixing data/UI layers (list_views, form_views in object definitions).

Changes

Protocol field migrations:

  • nameFieldtitleFormat with template expressions ('{name}', '{account_number} - {name}')
  • feedEnabledenable.feeds (moved to capabilities block)
  • Added compactLayout for card/hover/lookup field selection
  • Standardized enable block with activities and mru capabilities

Separation of concerns:

  • Removed 545 lines of UI configuration from object definitions
  • list_views and form_views belong in UI layer, not data layer

Example:

// Before
export const Account = ObjectSchema.create({
  nameField: 'name',
  enable: {
    feedEnabled: true,
    trackHistory: true,
  },
  list_views: { /* ... */ },
  form_views: { /* ... */ },
});

// After
export const Account = ObjectSchema.create({
  titleFormat: '{account_number} - {name}',
  compactLayout: ['account_number', 'name', 'type', 'owner'],
  enable: {
    trackHistory: true,
    apiEnabled: true,
    feeds: true,
    activities: true,
    mru: true,
  },
});

Scope

9 object files updated:

  • CRM: account, contact, opportunity, lead, case, task
  • Modern fields: product, event
  • Todo: task

Net -497 lines. TypeScript compiles clean.

Original prompt

去最新的协议重新优化examples


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 25, 2026

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

Project Deployment Review Updated (UTC)
spec Ready Ready Preview, Comment Jan 25, 2026 7:14am

Request Review

…tleFormat, feedEnabled with feeds, remove list_views and form_views

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI and others added 3 commits January 25, 2026 07:08
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Optimize examples for the latest protocol Migrate examples to latest protocol: remove deprecated fields and UI config Jan 25, 2026
Copilot AI requested a review from hotlong January 25, 2026 07:14
@hotlong hotlong marked this pull request as ready for review January 25, 2026 07:20
Copilot AI review requested due to automatic review settings January 25, 2026 07:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates example object definitions from deprecated protocol fields to the latest ObjectStack specification, implementing proper separation between data and UI layers.

Changes:

  • Replaced deprecated nameField with titleFormat template expressions and added compactLayout for field selection
  • Migrated feedEnabled to enable.feeds and added new capability flags (activities, mru)
  • Removed 545 lines of UI configuration (list_views, form_views) from object definitions, properly separating data and UI concerns

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
examples/todo/src/domains/todo/task.object.ts Migrated TodoTask to use titleFormat, compactLayout, and new capability flags
examples/modern-fields/src/product.object.ts Updated Product object with latest protocol patterns
examples/modern-fields/src/event.object.ts Updated Event object with latest protocol patterns
examples/crm/src/domains/crm/task.object.ts Migrated Task object and removed 100+ lines of UI views
examples/crm/src/domains/crm/opportunity.object.ts Migrated Opportunity object with contextual titleFormat and removed UI configuration
examples/crm/src/domains/crm/lead.object.ts Migrated Lead object and removed kanban/list views
examples/crm/src/domains/crm/contact.object.ts Migrated Contact object and removed form/list views
examples/crm/src/domains/crm/case.object.ts Migrated Case object with auto-numbered titleFormat and removed extensive UI views
examples/crm/src/domains/crm/account.object.ts Migrated Account object with composite titleFormat and removed UI layer mixing

@hotlong hotlong merged commit 49c8a79 into main Jan 25, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants