From 30a07bb6d715163caed5f204a1675f9abea130ee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 09:50:16 +0000 Subject: [PATCH 1/3] Initial plan From 0aa6ece23d6f28d742f522e536728fdc755c33a8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 10:17:36 +0000 Subject: [PATCH 2/3] fix: resolve CI build and test errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix appConfig → appConfigs[0] in i18n-translations.test.ts (lines 138, 165) - Remove unused import resolveI18nLabel from HomePage.tsx - Remove unused imports Upload and FileText from QuickActions.tsx - Export customReportsConfig from objectstack.shared.ts and include in mock server/browser to make sales_performance_q1 report available in test metadata Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/9f8790f4-e34a-4ac2-9322-7a3347f499c6 Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com> --- apps/console/objectstack.shared.ts | 34 ++++++++++++------- .../src/__tests__/i18n-translations.test.ts | 4 +-- apps/console/src/mocks/browser.ts | 4 +-- apps/console/src/mocks/server.ts | 4 +-- apps/console/src/pages/home/HomePage.tsx | 1 - apps/console/src/pages/home/QuickActions.tsx | 2 +- 6 files changed, 28 insertions(+), 21 deletions(-) diff --git a/apps/console/objectstack.shared.ts b/apps/console/objectstack.shared.ts index fa3580a6..15df0e82 100644 --- a/apps/console/objectstack.shared.ts +++ b/apps/console/objectstack.shared.ts @@ -51,6 +51,26 @@ export const setupAppConfig = { manifest: { id: 'setup', name: 'setup' }, }; +// Custom reports not part of any individual app config but needed by tests/aggregated config +export const customReportsConfig = { + reports: [ + { + name: 'sales_performance_q1', + label: 'Q1 Sales Performance', + description: 'Quarterly analysis of sales revenue by region and product line', + objectName: 'opportunity', + type: 'summary', + columns: [ + { field: 'name', label: 'Deal Name' }, + { field: 'amount', label: 'Amount', aggregate: 'sum' }, + { field: 'stage', label: 'Stage' }, + { field: 'close_date', label: 'Close Date' } + ] + } + ], + manifest: { id: 'custom-reports', name: 'custom-reports' }, +}; + // Patch CRM App Navigation to include Report using a supported navigation type const apps = [ ...JSON.parse(JSON.stringify(appConfigs.flatMap((c: any) => c.apps || []))), @@ -92,19 +112,7 @@ export const sharedConfig = { dashboards: appConfigs.flatMap((c: any) => c.dashboards || []), reports: [ ...appConfigs.flatMap((c: any) => c.reports || []), - { - name: 'sales_performance_q1', - label: 'Q1 Sales Performance', - description: 'Quarterly analysis of sales revenue by region and product line', - objectName: 'opportunity', - type: 'summary', - columns: [ - { field: 'name', label: 'Deal Name' }, - { field: 'amount', label: 'Amount', aggregate: 'sum' }, - { field: 'stage', label: 'Stage' }, - { field: 'close_date', label: 'Close Date' } - ] - } + ...customReportsConfig.reports, ], pages: appConfigs.flatMap((c: any) => c.pages || []), manifest: { diff --git a/apps/console/src/__tests__/i18n-translations.test.ts b/apps/console/src/__tests__/i18n-translations.test.ts index d2d83dc8..ab8ca870 100644 --- a/apps/console/src/__tests__/i18n-translations.test.ts +++ b/apps/console/src/__tests__/i18n-translations.test.ts @@ -135,7 +135,7 @@ describe('i18n translations pipeline', () => { }); it('appConfig.translations is spec-format array for AppPlugin', () => { - const translations = (appConfig as any).translations; + const translations = (appConfigs[0] as any).translations; expect(Array.isArray(translations)).toBe(true); expect(translations.length).toBeGreaterThan(0); @@ -162,7 +162,7 @@ describe('i18n translations pipeline', () => { const svc = createMemoryI18n(); // Simulate AppPlugin.loadTranslations() iterating the spec-format translations array - const translations = (appConfig as any).translations; + const translations = (appConfigs[0] as any).translations; for (const bundle of translations) { for (const [locale, data] of Object.entries(bundle)) { if (data && typeof data === 'object') { diff --git a/apps/console/src/mocks/browser.ts b/apps/console/src/mocks/browser.ts index a22395e3..44fb9f69 100644 --- a/apps/console/src/mocks/browser.ts +++ b/apps/console/src/mocks/browser.ts @@ -16,7 +16,7 @@ import { setupWorker } from 'msw/browser'; import { ObjectKernel } from '@objectstack/runtime'; import { InMemoryDriver } from '@objectstack/driver-memory'; import type { MSWPlugin } from '@objectstack/plugin-msw'; -import { appConfigs, setupAppConfig } from '../../objectstack.shared'; +import { appConfigs, setupAppConfig, customReportsConfig } from '../../objectstack.shared'; import { createKernel } from './createKernel'; import { createAuthHandlers } from './authHandlers'; @@ -43,7 +43,7 @@ export async function startMockServer() { if (import.meta.env.DEV) console.log('[MSW] Starting ObjectStack Runtime (Browser Mode)...'); const result = await createKernel({ - appConfigs: [...appConfigs, setupAppConfig], + appConfigs: [...appConfigs, setupAppConfig, customReportsConfig], mswOptions: { enableBrowser: false, baseUrl: '/api/v1', diff --git a/apps/console/src/mocks/server.ts b/apps/console/src/mocks/server.ts index bc1c3baf..f5a20df1 100644 --- a/apps/console/src/mocks/server.ts +++ b/apps/console/src/mocks/server.ts @@ -16,7 +16,7 @@ import { ObjectKernel } from '@objectstack/runtime'; import { InMemoryDriver } from '@objectstack/driver-memory'; import { setupServer } from 'msw/node'; import type { MSWPlugin } from '@objectstack/plugin-msw'; -import { appConfigs, setupAppConfig } from '../../objectstack.shared'; +import { appConfigs, setupAppConfig, customReportsConfig } from '../../objectstack.shared'; import { createKernel } from './createKernel'; import { createAuthHandlers } from './authHandlers'; @@ -34,7 +34,7 @@ export async function startMockServer() { console.log('[MSW] Starting ObjectStack Runtime (Test Mode)...'); const result = await createKernel({ - appConfigs: [...appConfigs, setupAppConfig], + appConfigs: [...appConfigs, setupAppConfig, customReportsConfig], persistence: false, mswOptions: { enableBrowser: false, diff --git a/apps/console/src/pages/home/HomePage.tsx b/apps/console/src/pages/home/HomePage.tsx index df7d22f7..4dbf264b 100644 --- a/apps/console/src/pages/home/HomePage.tsx +++ b/apps/console/src/pages/home/HomePage.tsx @@ -21,7 +21,6 @@ import { useMetadata } from '../../context/MetadataProvider'; import { useRecentItems } from '../../hooks/useRecentItems'; import { useFavorites } from '../../hooks/useFavorites'; import { useObjectTranslation } from '@object-ui/i18n'; -import { resolveI18nLabel } from '../../utils'; import { QuickActions } from './QuickActions'; import { AppCard } from './AppCard'; import { RecentApps } from './RecentApps'; diff --git a/apps/console/src/pages/home/QuickActions.tsx b/apps/console/src/pages/home/QuickActions.tsx index 06b05f84..37a722c9 100644 --- a/apps/console/src/pages/home/QuickActions.tsx +++ b/apps/console/src/pages/home/QuickActions.tsx @@ -10,7 +10,7 @@ import { useNavigate } from 'react-router-dom'; import { useObjectTranslation } from '@object-ui/i18n'; import { Card, CardContent } from '@object-ui/components'; -import { Plus, Upload, Settings, Database, FileText } from 'lucide-react'; +import { Plus, Settings, Database } from 'lucide-react'; import { cn } from '@object-ui/components'; interface QuickAction { From 6ff8d038bfb02aee3aee30abd29b23e6a892ea06 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 10:20:42 +0000 Subject: [PATCH 3/3] fix: improve customReportsConfig docs and manifest naming, update CHANGELOG Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/9f8790f4-e34a-4ac2-9322-7a3347f499c6 Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com> --- CHANGELOG.md | 2 ++ apps/console/objectstack.shared.ts | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abde745a..e6562a82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- **CI build errors** (`@object-ui/console`): Removed unused imports (`resolveI18nLabel` in `HomePage.tsx`, `Upload`/`FileText` in `QuickActions.tsx`) that caused TS6133 errors. Fixed `appConfig` → `appConfigs[0]` in `i18n-translations.test.ts` (TS2552). Extracted `customReportsConfig` from aggregated `sharedConfig` into a standalone export so the mock server kernel includes the `sales_performance_q1` report, fixing `ReportView.test.tsx` failures. + - **Charts groupBy value→label resolution** (`@object-ui/plugin-charts`): Chart X-axis labels now display human-readable labels instead of raw values. Select/picklist fields resolve value→label via field metadata options, lookup/master_detail fields batch-fetch referenced record names, and all other fields fall back to `humanizeLabel()` (snake_case → Title Case). Removed hardcoded `value.slice(0, 3)` truncation from `AdvancedChartImpl.tsx` XAxis tick formatters — desktop now shows full labels with angle rotation for long text, mobile truncates at 8 characters with "…". - **Analytics aggregate measures format** (`@object-ui/data-objectstack`): Fixed `aggregate()` method to send `measures` as string array (`['amount_sum']`, `['count']`) instead of object array (`[{ field, function }]`). The backend `MemoryAnalyticsService.resolveMeasure()` expects strings and calls `.split('.')`, causing `TypeError: t.split is not a function` when receiving objects. Also fixed `dimensions` to send an empty array when `groupBy` is `'_all'` (single-bucket aggregation), and added response mapping to rename measure keys (e.g. `amount_sum`) back to the original field name (`amount`) for consumer compatibility. Additionally fixed chart rendering blank issue: the `rawRows` extraction now handles the `{ rows: [...] }` envelope (when the SDK unwraps the outer `{ success, data }` wrapper) and the `{ data: { rows: [...] } }` envelope (when the SDK returns the full response), matching the actual shape returned by the analytics API (`/api/v1/analytics/query`). diff --git a/apps/console/objectstack.shared.ts b/apps/console/objectstack.shared.ts index 15df0e82..08d98367 100644 --- a/apps/console/objectstack.shared.ts +++ b/apps/console/objectstack.shared.ts @@ -51,7 +51,12 @@ export const setupAppConfig = { manifest: { id: 'setup', name: 'setup' }, }; -// Custom reports not part of any individual app config but needed by tests/aggregated config +/** + * Additional reports that are not part of any individual app config. + * Loaded as a separate AppPlugin instance by the mock server (server.ts) + * and browser mock (browser.ts) so that these reports appear in the + * kernel's metadata alongside the app-specific reports. + */ export const customReportsConfig = { reports: [ { @@ -68,7 +73,7 @@ export const customReportsConfig = { ] } ], - manifest: { id: 'custom-reports', name: 'custom-reports' }, + manifest: { id: 'reports', name: 'reports' }, }; // Patch CRM App Navigation to include Report using a supported navigation type