Skip to content

fix: comprehensive view component spec UI protocol compliance audit#832

Merged
hotlong merged 4 commits intomainfrom
copilot/fix-view-components-ui-spec
Feb 24, 2026
Merged

fix: comprehensive view component spec UI protocol compliance audit#832
hotlong merged 4 commits intomainfrom
copilot/fix-view-components-ui-spec

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 24, 2026

ViewType, view-related Zod validators, and component registrations were out of sync with the @objectstack/spec/ui ListView type enum and their own TS interfaces.

ViewType enum

Spec defines ListView type as grid | kanban | gallery | calendar | timeline | gantt | map. ObjectUI's ViewType was missing gallery and gantt.

// before
export type ViewType = 'list' | 'detail' | 'grid' | 'kanban' | 'calendar' | 'timeline' | 'map';

// after
export type ViewType = 'list' | 'detail' | 'grid' | 'kanban' | 'calendar' | 'timeline' | 'map' | 'gallery' | 'gantt';

Zod ↔ TS interface drift in views.zod.ts

  • DetailViewFieldSchema.type — Zod had 10 values, TS interface had 21. Added missing data-oriented types: number, currency, percent, boolean, select, lookup, master_detail, email, url, phone, user
  • DetailViewFieldSchema — Missing properties: options, reference_to, reference_field, currency
  • DetailViewSectionSchema — Missing properties: showBorder, headerColor

plugin-view ViewSwitcher

Added gallery (Images icon) and gantt (GanttChartSquare icon) to DEFAULT_VIEW_LABELS and DEFAULT_VIEW_ICONS maps.

plugin-list component registrations

The list-view and list component registrations had invalid viewType enum values ('list' and 'chart' are not valid spec types) and were missing 'gallery', 'timeline', 'gantt', and 'map'. Fixed to match spec's grid | kanban | gallery | calendar | timeline | gantt | map.

plugin-detail component registrations

  • detail-view registration was missing 8 inputs that exist on DetailViewSchema: layout, columns, loading, backUrl, editUrl, deleteConfirmation, header, footer.
  • detail-section registration was missing showBorder and headerColor inputs that are already implemented in the DetailSection.tsx component and TS interface.
Original prompt

审查所有view相关的组件,不符合 spec ui 协议的部分进行修正


✨ 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 Feb 24, 2026

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

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Feb 24, 2026 11:52am
objectui-demo Ready Ready Preview, Comment Feb 24, 2026 11:52am
objectui-storybook Ready Ready Preview, Comment Feb 24, 2026 11:52am

Request Review

Copilot AI and others added 2 commits February 24, 2026 11:22
- Add 'gallery' and 'gantt' to ViewType in views.ts
- Add 'gallery' and 'gantt' to ViewTypeSchema in views.zod.ts
- Sync DetailViewFieldSchema type enum with TS interface (add data-oriented types)
- Add missing options, reference_to, reference_field, currency fields to DetailViewFieldSchema
- Add missing showBorder, headerColor fields to DetailViewSectionSchema
- Add gallery and gantt icons/labels to plugin-view ViewSwitcher

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] Fix view components to comply with UI specification fix: align view types and Zod schemas with @objectstack/spec UI protocol Feb 24, 2026
Copilot AI requested a review from hotlong February 24, 2026 11:28
@hotlong
Copy link
Copy Markdown
Collaborator

hotlong commented Feb 24, 2026

@copilot 检查所有的问题,包括每一个控件的细节

…nputs with spec

- plugin-list: Remove invalid 'list'/'chart' types from viewType enum, add
  'gallery'/'timeline'/'gantt'/'map' to match spec ListView type values
- plugin-detail: Add missing detail-view inputs (layout, columns, loading,
  backUrl, editUrl, deleteConfirmation, header, footer)
- plugin-detail: Add showBorder and headerColor to detail-section inputs

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 24, 2026

@copilot 检查所有的问题,包括每一个控件的细节

Deep audit completed in aec77d0. Found and fixed 3 additional issues beyond the original commit:

plugin-list/index.tsxlist-view and list registrations had invalid viewType enum values ('list', 'chart' are not valid spec types). Replaced with full spec-compliant set: grid | kanban | gallery | calendar | timeline | gantt | map.

plugin-detail/index.tsxdetail-view registration was missing 8 inputs that exist on DetailViewSchema: layout, columns, loading, backUrl, editUrl, deleteConfirmation, header, footer.

plugin-detail/index.tsxdetail-section registration was missing showBorder and headerColor inputs (already implemented in DetailSection.tsx component and TS interface).

All 2015 tests pass (898 view-related + 1117 compliance).

Copilot AI changed the title fix: align view types and Zod schemas with @objectstack/spec UI protocol fix: comprehensive view component spec UI protocol compliance audit Feb 24, 2026
@hotlong hotlong marked this pull request as ready for review February 24, 2026 12:00
Copilot AI review requested due to automatic review settings February 24, 2026 12:00
@hotlong hotlong merged commit 8b93a0d into main Feb 24, 2026
5 checks passed
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 comprehensively audits and fixes spec UI protocol compliance for view-related components across the ObjectUI codebase. The changes synchronize ViewType enums, Zod validators, TypeScript interfaces, and component registrations to align with the @objectstack/spec ListView type definitions and ensure internal consistency.

Changes:

  • Extended ViewType enum with missing 'gallery' and 'gantt' view types to match spec ListView type enum
  • Synchronized DetailViewFieldSchema Zod validator with TS interface by adding 11 data-oriented field types and 4 missing properties
  • Enhanced DetailViewSectionSchema with showBorder and headerColor properties in both Zod and component registrations
  • Updated ViewSwitcher default labels and icons for gallery (Images) and gantt (GanttChartSquare) views
  • Fixed component registration enum values in plugin-list to remove invalid types ('list', 'chart') and add spec-compliant types
  • Added 8 missing inputs to detail-view component registration (layout, columns, loading, backUrl, editUrl, deleteConfirmation, header, footer)

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/types/src/views.ts Added 'gallery' and 'gantt' to ViewType enum to complete spec ListView type coverage
packages/types/src/zod/views.zod.ts Added missing field types and properties to DetailViewFieldSchema and DetailViewSectionSchema Zod validators
packages/plugin-view/src/ViewSwitcher.tsx Added gallery and gantt view labels/icons with proper Lucide icon imports (Images, GanttChartSquare)
packages/plugin-list/src/index.tsx Fixed viewType enum in list-view and list registrations to match spec (removed 'list'/'chart', added 'gallery'/'timeline'/'gantt'/'map')
packages/plugin-detail/src/index.tsx Added 8 missing inputs to detail-view registration and 2 to detail-section registration to match schema definitions
ROADMAP.md Documented all compliance fixes with checkboxes marking completed items

{ name: 'resourceId', type: 'string', label: 'Resource ID' },
{ name: 'api', type: 'string', label: 'API Endpoint' },
{ name: 'data', type: 'object', label: 'Data' },
{ name: 'layout', type: 'enum', label: 'Layout Mode', enum: ['vertical', 'horizontal', 'grid'] },
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The enum format for the 'layout' input is inconsistent with other enum inputs in the codebase. It uses a plain string array ['vertical', 'horizontal', 'grid'] instead of an object array with label/value pairs like other enum inputs (e.g., the 'viewType' enum in plugin-list uses [{ label: 'Grid', value: 'grid' }, ...]). For consistency and better UX in component editors, this should use the object array format: enum: [{ label: 'Vertical', value: 'vertical' }, { label: 'Horizontal', value: 'horizontal' }, { label: 'Grid', value: 'grid' }].

Suggested change
{ name: 'layout', type: 'enum', label: 'Layout Mode', enum: ['vertical', 'horizontal', 'grid'] },
{
name: 'layout',
type: 'enum',
label: 'Layout Mode',
enum: [
{ label: 'Vertical', value: 'vertical' },
{ label: 'Horizontal', value: 'horizontal' },
{ label: 'Grid', value: 'grid' },
],
},

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants