Skip to content

Code Review Bench PR #20209 - Add block document reference support to schema form#4

Open
tomerqodo wants to merge 2 commits intobase_pr_20209_20260125_3837from
corrupted_pr_20209_20260125_3837
Open

Code Review Bench PR #20209 - Add block document reference support to schema form#4
tomerqodo wants to merge 2 commits intobase_pr_20209_20260125_3837from
corrupted_pr_20209_20260125_3837

Conversation

@tomerqodo
Copy link

Code Review Bench PR PrefectHQ#20209

Original PR Title: Add block document reference support to schema form
Original PR Description: Implements block document reference support for schema form properties. When a schema property has a blockTypeSlug field, it now renders a block document selector with optional inline creation instead of throwing a "not implemented" error.

This adds three new components:

  • BlockDocumentCombobox: A searchable combobox for selecting block documents filtered by block type slug, with an optional "Create new" button
  • BlockDocumentCreateDialog: A dialog for inline block document creation using the existing schema form and block creation patterns
  • SchemaFormInputBlockDocument: A wrapper that integrates the combobox and dialog, outputting values in { $ref: blockDocumentId } format

The integration in schema-form-input.tsx replaces the previous throw new Error("not implemented") with the new component.

Related to PrefectHQ#15512

Updates since last revision

  • Added reactQueryDecorator to properties.stories.tsx to fix Storybook error for blockTypeSlug stories (they require QueryClientProvider for TanStack Query)

Screenshots

BlockDocumentCombobox in Storybook

Human Review Checklist

  • Verify the { $ref: blockDocumentId } format is the correct structure for block document references in Prefect schemas
  • The type assertion in schema-form-input.tsx (line 82) casts value as { $ref: string } | undefined - confirm this is safe
  • The as unknown as PrefectSchemaObject cast in block-document-create-dialog.tsx for blockSchema.fields - confirm this is safe
  • The combobox does both server-side filtering (like_ in API query) and client-side filtering (filteredData) - this may be redundant

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • If this pull request removes docs files, it includes redirect settings in mint.json.
  • If this pull request adds functions or classes, it includes helpful docstrings.

Link to Devin run: https://app.devin.ai/sessions/36e0160cacd7477db78917771f4b27f4
Requested by: @desertaxle
Original PR URL: PrefectHQ#20209

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant