Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

Storybook tests for object-grid and page components were failing because they used the local SchemaRenderer which doesn't provide context, but their child components (ObjectGrid, data-table) call useDataScope()useSchemaContext().

Changes

Updated imports in affected stories:

- import { SchemaRenderer } from '../SchemaRenderer';
+ import { SchemaRenderer, SchemaRendererProvider } from '@object-ui/react';

Wrapped renderers with provider:

- render: (args) => <SchemaRenderer schema={args} />
+ render: (args) => (
+   <SchemaRendererProvider dataSource={{}}>
+     <SchemaRenderer schema={args} />
+   </SchemaRendererProvider>
+ )

Files modified:

  • packages/components/src/stories-json/object-grid.stories.tsx
  • packages/components/src/stories-json/page.stories.tsx

This follows the pattern already established in packages/components/src/stories/MockedData.stories.tsx and CRMApp.stories.tsx.

Original prompt

引用: https://github.com/objectstack-ai/objectui/actions/runs/21470609319/job/61842008798#step:7:1


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

@vercel
Copy link

vercel bot commented Jan 29, 2026

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

Project Deployment Review Updated (UTC)
objectui Ready Ready Preview, Comment Jan 29, 2026 8:29am
objectui-components Ready Ready Preview, Comment Jan 29, 2026 8:29am
objectui-crm-app Error Error Jan 29, 2026 8:29am

Request Review

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix GitHub Actions for hyperparameter tuning Fix Storybook tests by providing SchemaRendererContext Jan 29, 2026
Copilot AI requested a review from hotlong January 29, 2026 08:28
@hotlong hotlong marked this pull request as ready for review January 29, 2026 08:31
Copilot AI review requested due to automatic review settings January 29, 2026 08:31
@hotlong hotlong merged commit b754c2a into copilot/update-crm-app-to-msw-mode Jan 29, 2026
5 of 6 checks passed
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 fixes failing Storybook tests for the page and object-grid JSON stories by ensuring the runtime schema context is provided via SchemaRendererProvider from @object-ui/react, matching patterns used in other stories.

Changes:

  • Updated page.stories.tsx and object-grid.stories.tsx to import SchemaRenderer and SchemaRendererProvider from @object-ui/react instead of the local SchemaRenderer.
  • Wrapped the stories’ render functions in SchemaRendererProvider with a dataSource prop (an empty object), so nested components that call useDataScope() / useSchemaContext() no longer throw.

Reviewed changes

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

File Description
packages/components/src/stories-json/page.stories.tsx Switches to the @object-ui/react SchemaRenderer and wraps it in SchemaRendererProvider to provide context for nested components like data-table.
packages/components/src/stories-json/object-grid.stories.tsx Uses SchemaRenderer/SchemaRendererProvider from @object-ui/react and wraps the shared renderStory helper so object-grid stories run under a proper schema context.

@github-actions
Copy link

✅ All checks passed!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants