Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions apps/console/src/components/ObjectView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ObjectGrid } from '@object-ui/plugin-grid';
import { ObjectKanban } from '@object-ui/plugin-kanban';
import { ObjectCalendar } from '@object-ui/plugin-calendar';
import { ObjectGantt } from '@object-ui/plugin-gantt';
import { Button, Tabs, TabsList, TabsTrigger } from '@object-ui/components';
import { Button } from '@object-ui/components';
import { Plus, Calendar as CalendarIcon, Kanban as KanbanIcon, Table as TableIcon, AlignLeft } from 'lucide-react';

export function ObjectView({ dataSource, objects, onEdit }: any) {
Expand Down Expand Up @@ -122,19 +122,19 @@ export function ObjectView({ dataSource, objects, onEdit }: any) {
key={key}
{...commonProps}
schema={{
type: 'gantt',
type: 'object-grid',
objectName: objectDef.name,
filter: {
gantt: {
startDateField: activeView.startDateField || 'start_date',
endDateField: activeView.endDateField || 'end_date',
titleField: activeView.titleField || 'name',
progressField: activeView.progressField || 'progress',
dependenciesField: activeView.dependenciesField,
colorField: activeView.colorField,
}
// Gantt config is read by ObjectGantt via getGanttConfig helper
// TypeScript workaround: gantt property not in ObjectGridSchema but supported by implementation
gantt: {
startDateField: activeView.startDateField || 'start_date',
endDateField: activeView.endDateField || 'end_date',
titleField: activeView.titleField || 'name',
progressField: activeView.progressField || 'progress',
dependenciesField: activeView.dependenciesField,
colorField: activeView.colorField,
}
}}
} as any}
Comment on lines 124 to +137
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The schema should use the ObjectGanttSchema type instead of ObjectGridSchema with a gantt config. According to packages/types/src/objectql.ts:722-736, there's a dedicated ObjectGanttSchema interface with type: 'object-gantt' that accepts gantt-specific fields (startDateField, endDateField, titleField, progressField, dependencyField) directly on the schema, not in a nested 'gantt' object. The use of 'as any' is masking this type mismatch and violates Rule #6 (Type Safety over Magic). Change the type to 'object-gantt' and move the gantt config properties to the root level of the schema object.

Copilot generated this review using guidance from repository custom instructions.
{...interactionProps}
/>
);
Expand Down
28 changes: 12 additions & 16 deletions examples/crm/objectstack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,47 +85,43 @@ export default defineStack({
// --- KPI Row ---
{
type: 'metric',
component: {
type: 'metric',
layout: { x: 0, y: 0, w: 1, h: 1 },
options: {
label: 'Total Revenue',
value: '$1,245,000',
trend: { value: 12.5, direction: 'up', label: 'vs last month' },
icon: 'DollarSign'
},
layout: { x: 0, y: 0, w: 1, h: 1 }
}
Comment on lines 86 to +94
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The widget structure violates the DashboardWidgetSchema type definition from @object-ui/types. According to DashboardWidgetSchema (packages/types/src/complex.ts:507-512), widgets should have:

  • id: string (required)
  • title?: string (optional)
  • component: SchemaNode (required) - this should contain the actual component schema
  • layout?: DashboardWidgetLayout (optional)

The correct structure should be:

  • Move 'type', 'label', 'value', 'trend', and 'icon' into a 'component' object
  • Add an 'id' field (required)
  • Keep 'layout' at the top level

Reference: See packages/components/src/stories-json/dashboard.stories.tsx:29-52 for the correct structure used in other parts of the codebase.

Copilot generated this review using guidance from repository custom instructions.
},
{
type: 'metric',
component: {
type: 'metric',
layout: { x: 1, y: 0, w: 1, h: 1 },
options: {
label: 'Active Deals',
value: '45',
trend: { value: 2.1, direction: 'down', label: 'vs last month' },
icon: 'Briefcase'
},
layout: { x: 1, y: 0, w: 1, h: 1 }
}
Comment on lines 96 to +104
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The widget structure violates the DashboardWidgetSchema type definition. The same issue exists here as with the first metric widget - the schema should wrap the component properties in a 'component' object and include an 'id' field.

Copilot generated this review using guidance from repository custom instructions.
},
{
type: 'metric',
component: {
type: 'metric',
layout: { x: 2, y: 0, w: 1, h: 1 },
options: {
label: 'Win Rate',
value: '68%',
trend: { value: 4.3, direction: 'up', label: 'vs last month' },
icon: 'Trophy'
},
layout: { x: 2, y: 0, w: 1, h: 1 }
}
Comment on lines 106 to +114
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The widget structure violates the DashboardWidgetSchema type definition. The same issue exists here as with the previous metric widgets.

Copilot generated this review using guidance from repository custom instructions.
},
{
type: 'metric',
component: {
type: 'metric',
layout: { x: 3, y: 0, w: 1, h: 1 },
options: {
label: 'Avg Deal Size',
value: '$24,000',
trend: { value: 1.2, direction: 'up', label: 'vs last month' },
icon: 'BarChart3'
},
layout: { x: 3, y: 0, w: 1, h: 1 }
}
Comment on lines 116 to +124
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The widget structure violates the DashboardWidgetSchema type definition. The same issue exists here as with the previous metric widgets.

Copilot generated this review using guidance from repository custom instructions.
},

// --- Row 2: Charts ---
Expand Down
1 change: 0 additions & 1 deletion packages/plugin-form/src/ObjectForm.msw.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { setupServer } from 'msw/node';
import { http, HttpResponse } from 'msw';
import { registerAllFields } from '@object-ui/fields';
import React from 'react';
// @ts-expect-error - Import from examples
import { ContactObject } from '../../../examples/crm/src/objects/contact.object';

// Register widget renderers
Expand Down
1 change: 0 additions & 1 deletion packages/plugin-grid/src/ObjectGrid.msw.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { setupServer } from 'msw/node';
import { http, HttpResponse } from 'msw';
import { registerAllFields } from '@object-ui/fields';
import React from 'react';
// @ts-expect-error - Import from examples
import { ContactObject } from '../../../examples/crm/src/objects/contact.object';

registerAllFields();
Expand Down
Loading