Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…istrations Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
@copilot plugin grid Application error: a client-side exception has occurred while loading objectui-site-git-copilot-fix-plugin-loading-issue-object-stack.vercel.app (see the browser console for more information). |
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Fixed in commit 1ce0071. The plugin-grid interactive demo has been disabled to prevent the browser crash. The page now loads successfully with a note explaining the demo is temporarily disabled due to a data-table component issue. All code examples remain available. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Fixes docs demo pages getting stuck on “Loading plugins…” by removing component registry alias collisions between plugins and core components, and improves ObjectGrid’s handling of inline demo data/columns to avoid crashes and format mismatches.
Changes:
- Removed conflicting component registrations so plugins no longer override core
form/ layoutgridtypes. - Enhanced
ObjectGridto accept inlinedataarray shorthand and to detect/convert between column formats. - Updated plugin-grid docs demo to use
type: "object-grid"and temporarily disabled the interactive demo with a user-facing note.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/plugin-grid/src/index.tsx | Stops registering the conflicting grid alias; keeps only object-grid. |
| packages/plugin-grid/src/ObjectGrid.tsx | Adds inline data array shorthand support and column format detection/conversion. |
| packages/plugin-form/src/index.tsx | Stops registering the conflicting form alias; keeps only object-form. |
| content/docs/plugins/plugin-grid.mdx | Switches demo schema to object-grid and disables the interactive demo with a note. |
| if (schema.data) { | ||
| // Check if data is an array (shorthand format) or already a ViewData object | ||
| if (Array.isArray(schema.data)) { | ||
| // Convert array shorthand to proper ViewData format | ||
| return { | ||
| provider: 'value', | ||
| items: schema.data, | ||
| }; | ||
| } | ||
| // Already in ViewData format | ||
| return schema.data; | ||
| } |
There was a problem hiding this comment.
ObjectGridSchema.data is typed as ViewData, but getDataConfig now accepts schema.data as an array shorthand. This creates a public API mismatch: TypeScript users (and the Zod schema/spec alignment) can’t express data: [...] without casts, and it diverges from the stated ViewData contract. Consider updating @object-ui/types (and its Zod schema) to allow data?: ViewData | any[] (or a separate items/staticData shorthand) so docs/runtime/types stay consistent.
| // Check if columns are already in data-table format (have 'accessorKey') | ||
| // vs ListColumn format (have 'field') | ||
| if (cols.length > 0 && typeof cols[0] === 'object' && cols[0] !== null) { | ||
| return (cols as ListColumn[]) | ||
| .filter((col) => col?.field && typeof col.field === 'string') // Filter out invalid column objects | ||
| .map((col) => ({ | ||
| header: col.label || col.field.charAt(0).toUpperCase() + col.field.slice(1).replace(/_/g, ' '), | ||
| accessorKey: col.field, | ||
| ...(col.width && { width: col.width }), | ||
| ...(col.align && { align: col.align }), | ||
| sortable: col.sortable !== false, | ||
| })); | ||
| const firstCol = cols[0] as any; | ||
|
|
||
| // Already in data-table format - use as-is | ||
| if ('accessorKey' in firstCol) { | ||
| return cols; | ||
| } | ||
|
|
||
| // ListColumn format - convert to data-table format | ||
| if ('field' in firstCol) { |
There was a problem hiding this comment.
Column format detection only checks the first entry and then returns cols as-is when it finds accessorKey. If later entries are in ListColumn (field) format (or mixed), the conversion will be skipped and downstream rendering will be inconsistent. Consider normalizing based on every column (e.g., detect per-column or validate the array is uniform) and either convert all field columns or throw a clear error when formats are mixed.
| function getDataConfig(schema: ObjectGridSchema): ViewData | null { | ||
| // New format: explicit data configuration | ||
| if (schema.data) { | ||
| // Check if data is an array (shorthand format) or already a ViewData object | ||
| if (Array.isArray(schema.data)) { | ||
| // Convert array shorthand to proper ViewData format | ||
| return { | ||
| provider: 'value', |
There was a problem hiding this comment.
This PR adds new normalization behavior (array shorthand in getDataConfig and column format detection in generateColumns), but @object-ui/plugin-grid doesn’t appear to have Vitest coverage like other plugin packages (e.g., packages/plugin-aggrid/src/index.test.ts). Adding focused tests for these branches would help prevent regressions in the docs demos and runtime.
| pagination: false | ||
| }} | ||
| title="Basic Data Grid" | ||
| description="Grid with sorting, filtering, and pagination" |
There was a problem hiding this comment.
Even though the interactive demo is commented out, the title/description still say the example includes filtering and pagination, while the schema sets filterable: false and pagination: false. Consider aligning the text with the schema (or keep the schema flags true if the intent is to demonstrate those features once the underlying bug is fixed).
| description="Grid with sorting, filtering, and pagination" | |
| description="Grid with basic sorting (filtering & pagination disabled in this demo)" |

Plugin documentation demos were stuck on "Loading plugins..." due to component registry conflicts and inline data format mismatches. Additionally, the plugin-grid demo was causing browser crashes on the deployed site.
Changes
Removed conflicting type registrations:
plugin-formnow only registers'object-form'(was overriding base'form'component)plugin-gridnow only registers'object-grid'(was overriding layout'grid'component)Fixed ObjectGrid inline data handling:
data: [...]now auto-wraps to{provider: 'value', items: [...]}accessorKey) and ListColumn format (field)Updated documentation:
plugin-grid.mdxdemo now usestype: "object-grid"instead oftype: "grid"Results
Plugin-form: Now renders correctly with all interactive fields working:
Plugin-grid: Page loads successfully without crashes. Interactive demo temporarily disabled with clear notice:
Known Issue
Plugin-grid interactive demo triggers a pre-existing infinite loop in
@object-ui/componentsdata-table Select component. The demo has been disabled with a user-facing note until this underlying bug is fixed. All code examples remain available for reference.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.