Skip to content

Add block document reference support to schema form#20209

Merged
desertaxle merged 10 commits intomainfrom
ui-v2/schema-form-block-document-references
Jan 13, 2026
Merged

Add block document reference support to schema form#20209
desertaxle merged 10 commits intomainfrom
ui-v2/schema-form-block-document-references

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 13, 2026

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 #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

- Create BlockDocumentCombobox component for selecting block documents
- Create BlockDocumentCreateDialog for inline block document creation
- Create SchemaFormInputBlockDocument wrapper component
- Update schema-form-input.tsx to handle blockTypeSlug properties
- Add tests for new components
- Add Storybook stories

Co-Authored-By: alex.s@prefect.io <ajstreed1@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions github-actions bot added enhancement An improvement of an existing feature ui-replatform Related to the React UI rewrite labels Jan 13, 2026
devin-ai-integration bot and others added 9 commits January 13, 2026 16:23
… fields

Co-Authored-By: alex.s@prefect.io <ajstreed1@gmail.com>
Co-Authored-By: alex.s@prefect.io <ajstreed1@gmail.com>
- Create BlockDocumentCombobox component for selecting block documents
- Create BlockDocumentCreateDialog component for creating new blocks
- Create SchemaFormInputBlockDocument wrapper component
- Modify schema-form-input.tsx to use new component for blockTypeSlug properties
- Add tests and Storybook stories for all new components

Co-Authored-By: alex.s@prefect.io <ajstreed1@gmail.com>
Co-Authored-By: alex.s@prefect.io <ajstreed1@gmail.com>
Co-Authored-By: alex.s@prefect.io <ajstreed1@gmail.com>
…tories

Co-Authored-By: alex.s@prefect.io <ajstreed1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An improvement of an existing feature ui-replatform Related to the React UI rewrite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant