Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 17, 2026

The ObjectForm and ObjectTable components only supported a subset of ObjectQL field types, missing newly added types like markdown, html, time, phone, image, file, location, formula, summary, auto_number, object, vector, and grid.

Changes

ObjectForm

  • Added mappings for all 27 field types from @objectql/types v3.0.1
  • Auto-set computed fields (formula, summary, auto_number) to read-only
  • Added inputType attributes for email, phone, url, password, time
  • Fixed property mappings: maxLengthmax_length, minLengthmin_length
  • Added file size formatting helper with validation for file/image fields

ObjectTable

  • Added type-aware column configuration (date, boolean, number)
  • Custom cell renderers for file/image fields showing count with proper pluralization
  • Custom cell renderers for lookup/master_detail fields with safe object fallback

Example

// ObjectForm now properly handles all field types
const schema: ObjectFormSchema = {
  type: 'object-form',
  objectName: 'documents',
  mode: 'create',
  fields: ['title', 'content', 'attachments', 'status']
  // Automatically maps:
  // - 'title' (text) → input
  // - 'content' (markdown) → textarea  
  // - 'attachments' (file, multiple) → file-upload with accept handling
  // - 'status' (formula) → input (read-only)
};
Original prompt

根据最新的objectql定义,优化确认所有的组件


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

@vercel
Copy link

vercel bot commented Jan 17, 2026

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

Project Deployment Review Updated (UTC)
objectui-docs Error Error Jan 17, 2026 10:55am

…v3.0.1 field types

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

Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Copy link
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 updates the ObjectForm and ObjectTable components to fully support all 27 field types defined in ObjectQL v3.0.1, enhancing field property handling and adding type-aware formatting for better data representation.

Changes:

  • Extended ObjectForm field type mapping from basic types to comprehensive coverage of all 27 ObjectQL field types
  • Enhanced field property handling with proper support for min_length, max_length, multiple, accept, and other field-specific attributes
  • Added type-aware column formatting in ObjectTable for dates, booleans, numbers, files, lookups, and URLs

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/plugin-object/src/ObjectForm.tsx Expanded field type mappings to cover all 27 ObjectQL v3.0.1 types, added property handling for file uploads, contact fields, and computed fields, and introduced formatFileSize helper
packages/plugin-object/src/ObjectTable.tsx Added type-specific column formatters for dates, booleans, numbers, files, relationships, and URLs to improve data display

column.cell = (value: any) => {
if (!value) return '-';
if (Array.isArray(value)) {
const count = value.length;
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

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

The pluralization logic is incorrect. When value.length is 1, it will display 'file(s)' instead of 'file'. Consider using conditional logic: ${value.length} ${field.type}${value.length !== 1 ? 's' : ''}

Suggested change
const count = value.length;
return `${value.length} ${field.type}${value.length !== 1 ? 's' : ''}`;

Copilot uses AI. Check for mistakes.
formField.accept = field.accept?.join(',');
// Add validation hints for file size and dimensions
if (field.max_size) {
const sizeHint = `Max size: ${formatFileSize(field.max_size)}`;
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

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

String concatenation for description updates could lead to duplicate size hints if this logic runs multiple times. Consider checking if the description already contains the size hint before appending, or use a more structured approach to store metadata separately from user-facing descriptions.

Suggested change
const sizeHint = `Max size: ${formatFileSize(field.max_size)}`;
const sizeHint = `(Max size: ${formatFileSize(field.max_size)})`;
const currentDescription = formField.description || '';
if (!currentDescription.includes(sizeHint)) {
formField.description = currentDescription
? `${currentDescription} ${sizeHint}`
: sizeHint;
}

Copilot uses AI. Check for mistakes.
Comment on lines +362 to +363
return '0 B';
}
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

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

The formatFileSize function uses toFixed() which returns a string, then interpolates it into another string. This can result in trailing zeros (e.g., '5.0 MB'). Consider using Number(size.toFixed(...)) or format the number differently to avoid unnecessary decimal points for whole numbers.

Suggested change
return '0 B';
}
const decimals = unitIndex > 0 ? 1 : 0;
const formattedSize = Number(size.toFixed(decimals));
return `${formattedSize} ${units[unitIndex]}`;

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1494.76KB 349.01KB
core (index.js) 0.27KB 0.14KB
data-objectql (ObjectQLDataSource.js) 12.31KB 2.87KB
data-objectql (hooks.js) 5.43KB 1.32KB
data-objectql (index.js) 0.42KB 0.26KB
designer (index.js) 1.27KB 0.40KB
plugin-charts (AdvancedChartImpl-LUnT2ZAf.js) 74.89KB 15.82KB
plugin-charts (BarChart-CRc8MAtI.js) 551.60KB 127.51KB
plugin-charts (ChartImpl-DiqV9Evl.js) 3.17KB 1.10KB
plugin-charts (index-BcjHuFVN.js) 24.05KB 7.06KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-editor (MonacoImpl-BSiaJCGx.js) 18.15KB 5.59KB
plugin-editor (index-Bx39x2XN.js) 21.72KB 6.53KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-kanban (KanbanImpl-mGLdSHcd.js) 76.50KB 20.46KB
plugin-kanban (index-i_5clVsp.js) 23.51KB 6.90KB
plugin-kanban (index.js) 0.18KB 0.15KB
plugin-markdown (MarkdownImpl-Dp8rFxgw.js) 256.79KB 64.50KB
plugin-markdown (index-DDihmVdn.js) 21.25KB 6.37KB
plugin-markdown (index.js) 0.19KB 0.15KB
react (SchemaRenderer.js) 1.25KB 0.62KB
react (index.js) 0.13KB 0.11KB
react (index.test.js) 0.14KB 0.14KB
types (api-types.js) 0.24KB 0.19KB
types (app.js) 0.19KB 0.17KB
types (base.js) 0.24KB 0.19KB
types (complex.js) 0.17KB 0.16KB
types (crud.js) 0.24KB 0.20KB
types (data-display.js) 0.19KB 0.17KB
types (data.js) 0.23KB 0.18KB
types (disclosure.js) 0.18KB 0.17KB
types (feedback.js) 0.18KB 0.16KB
types (form.js) 0.17KB 0.16KB
types (index.js) 1.46KB 0.74KB
types (layout.js) 0.23KB 0.18KB
types (navigation.js) 0.17KB 0.16KB
types (objectql.js) 0.26KB 0.21KB
types (overlay.js) 0.18KB 0.16KB
types (registry.js) 0.01KB 0.04KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

…backs

Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
@github-actions
Copy link

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1494.76KB 349.01KB
core (index.js) 0.27KB 0.14KB
data-objectql (ObjectQLDataSource.js) 12.31KB 2.87KB
data-objectql (hooks.js) 5.43KB 1.32KB
data-objectql (index.js) 0.42KB 0.26KB
designer (index.js) 1.27KB 0.40KB
plugin-charts (AdvancedChartImpl-LUnT2ZAf.js) 74.89KB 15.82KB
plugin-charts (BarChart-CRc8MAtI.js) 551.60KB 127.51KB
plugin-charts (ChartImpl-DiqV9Evl.js) 3.17KB 1.10KB
plugin-charts (index-BcjHuFVN.js) 24.05KB 7.06KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-editor (MonacoImpl-BSiaJCGx.js) 18.15KB 5.59KB
plugin-editor (index-Bx39x2XN.js) 21.72KB 6.53KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-kanban (KanbanImpl-mGLdSHcd.js) 76.50KB 20.46KB
plugin-kanban (index-i_5clVsp.js) 23.51KB 6.90KB
plugin-kanban (index.js) 0.18KB 0.15KB
plugin-markdown (MarkdownImpl-Dp8rFxgw.js) 256.79KB 64.50KB
plugin-markdown (index-DDihmVdn.js) 21.25KB 6.37KB
plugin-markdown (index.js) 0.19KB 0.15KB
react (SchemaRenderer.js) 1.25KB 0.62KB
react (index.js) 0.13KB 0.11KB
react (index.test.js) 0.14KB 0.14KB
types (api-types.js) 0.24KB 0.19KB
types (app.js) 0.19KB 0.17KB
types (base.js) 0.24KB 0.19KB
types (complex.js) 0.17KB 0.16KB
types (crud.js) 0.24KB 0.20KB
types (data-display.js) 0.19KB 0.17KB
types (data.js) 0.23KB 0.18KB
types (disclosure.js) 0.18KB 0.17KB
types (feedback.js) 0.18KB 0.16KB
types (form.js) 0.17KB 0.16KB
types (index.js) 1.46KB 0.74KB
types (layout.js) 0.23KB 0.18KB
types (navigation.js) 0.17KB 0.16KB
types (objectql.js) 0.26KB 0.21KB
types (overlay.js) 0.18KB 0.16KB
types (registry.js) 0.01KB 0.04KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@github-actions
Copy link

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

@github-actions
Copy link

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

Copilot AI changed the title [WIP] Optimize all components based on latest objectql definition Update ObjectQL components to support all v3.0.1 field types Jan 17, 2026
Copilot AI requested a review from huangyiirene January 17, 2026 10:56
@github-actions
Copy link

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1494.76KB 349.01KB
core (index.js) 0.27KB 0.14KB
data-objectql (ObjectQLDataSource.js) 12.31KB 2.87KB
data-objectql (hooks.js) 5.43KB 1.32KB
data-objectql (index.js) 0.42KB 0.26KB
designer (index.js) 1.27KB 0.40KB
plugin-charts (AdvancedChartImpl-LUnT2ZAf.js) 74.89KB 15.82KB
plugin-charts (BarChart-CRc8MAtI.js) 551.60KB 127.51KB
plugin-charts (ChartImpl-DiqV9Evl.js) 3.17KB 1.10KB
plugin-charts (index-BcjHuFVN.js) 24.05KB 7.06KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-editor (MonacoImpl-BSiaJCGx.js) 18.15KB 5.59KB
plugin-editor (index-Bx39x2XN.js) 21.72KB 6.53KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-kanban (KanbanImpl-mGLdSHcd.js) 76.50KB 20.46KB
plugin-kanban (index-i_5clVsp.js) 23.51KB 6.90KB
plugin-kanban (index.js) 0.18KB 0.15KB
plugin-markdown (MarkdownImpl-Dp8rFxgw.js) 256.79KB 64.50KB
plugin-markdown (index-DDihmVdn.js) 21.25KB 6.37KB
plugin-markdown (index.js) 0.19KB 0.15KB
react (SchemaRenderer.js) 1.25KB 0.62KB
react (index.js) 0.13KB 0.11KB
react (index.test.js) 0.14KB 0.14KB
types (api-types.js) 0.24KB 0.19KB
types (app.js) 0.19KB 0.17KB
types (base.js) 0.24KB 0.19KB
types (complex.js) 0.17KB 0.16KB
types (crud.js) 0.24KB 0.20KB
types (data-display.js) 0.19KB 0.17KB
types (data.js) 0.23KB 0.18KB
types (disclosure.js) 0.18KB 0.17KB
types (feedback.js) 0.18KB 0.16KB
types (form.js) 0.17KB 0.16KB
types (index.js) 1.46KB 0.74KB
types (layout.js) 0.23KB 0.18KB
types (navigation.js) 0.17KB 0.16KB
types (objectql.js) 0.26KB 0.21KB
types (overlay.js) 0.18KB 0.16KB
types (registry.js) 0.01KB 0.04KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

// For relationship fields, display the name property if available
column.cell = (value: any) => {
if (!value) return '-';
if (typeof value === 'object' && value !== null) {

Check warning

Code scanning / CodeQL

Comparison between inconvertible types Warning

Variable 'value' is of type date, object or regular expression, but it is compared to
an expression
of type null.

Copilot Autofix

AI 1 day ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

@github-actions
Copy link

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

@hotlong hotlong marked this pull request as ready for review January 17, 2026 11:53
@hotlong hotlong merged commit a8c8ecd into main Jan 17, 2026
11 of 12 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