Skip to content

Update examples to demonstrate latest protocol features#41

Merged
huangyiirene merged 4 commits intomainfrom
copilot/update-examples-to-compliance
Jan 20, 2026
Merged

Update examples to demonstrate latest protocol features#41
huangyiirene merged 4 commits intomainfrom
copilot/update-examples-to-compliance

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 20, 2026

Examples were using deprecated patterns and missing recently-added field types. This updates all examples to showcase the complete protocol surface area and follow current best practices.

Field Types

Added demonstrations of all new field types introduced in recent specs:

// Modern field types now demonstrated
rating: Field.rating(5, { label: 'Lead Score', allowHalf: true }),
address: Field.address({ addressFormat: 'international' }),
location: Field.location({ displayMap: true, allowGeocoding: true }),
color: Field.color({ colorFormat: 'hex', presetColors: [...] }),
code: Field.code('javascript', { lineNumbers: true }),
signature: Field.signature({ label: 'Customer Signature' }),
richtext: Field.richtext({ label: 'Notes' }),

Updated objects: Account, Lead, Case, Opportunity, TodoTask

App Configuration

Fixed invalid settings pattern in CRM app:

// Before (invalid)
settings: {
  theme: { primaryColor: '#4169E1', logo: '/assets/crm-logo.png' },
  features: { enableGlobalSearch: true, ... }
}

// After (compliant with AppBrandingSchema)
icon: 'briefcase',
branding: {
  primaryColor: '#4169E1',
  logo: '/assets/crm-logo.png',
  favicon: '/assets/crm-favicon.ico',
}

Field Definitions

Converted inline field definitions to Field helpers for consistency:

// Before
status: {
  type: 'select',
  label: 'Status',
  options: [...]
}

// After
status: Field.select({
  label: 'Status',
  options: [...]
})

Metadata & Performance

  • Added nameField to all objects (was inconsistently applied)
  • Added indexes on frequently-queried fields
  • Added apiMethods whitelist for security (demonstrates explicit API surface control)

Impact

All examples now compile cleanly and demonstrate the full protocol specification. Developers can reference these as canonical patterns.

Original prompt

基于最新的规范完善例子examples


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 20, 2026

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

Project Deployment Review Updated (UTC)
spec Ready Ready Preview, Comment Jan 20, 2026 10:51am

Request Review

Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
…g field

Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Copilot AI changed the title [WIP] Update examples to align with latest specifications Update examples to demonstrate latest protocol features Jan 20, 2026
Copilot AI requested a review from huangyiirene January 20, 2026 10:52
@huangyiirene huangyiirene marked this pull request as ready for review January 20, 2026 11:12
@huangyiirene huangyiirene merged commit 11c90b4 into main Jan 20, 2026
10 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.

2 participants