Skip to content

Add block document reference support to schema form#4

Open
tomerqodo wants to merge 2 commits into
codex_full_base_add_block_document_reference_support_to_schema_form_pr4from
codex_full_head_add_block_document_reference_support_to_schema_form_pr4
Open

Add block document reference support to schema form#4
tomerqodo wants to merge 2 commits into
codex_full_base_add_block_document_reference_support_to_schema_form_pr4from
codex_full_head_add_block_document_reference_support_to_schema_form_pr4

Conversation

@tomerqodo

Copy link
Copy Markdown

Benchmark PR from agentic-review-benchmarks#4

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 18b14dce7a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +126 to +130
<BlockDocumentCreateForm
blockTypeId={blockType.id}
blockSchemaId={blockSchema.id}
blockSchemaFields={blockSchema.fields as unknown as PrefectSchemaObject}
onCreated={onCreated}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove forbidden as unknown cast in schema fields

ui-v2/src/components/AGENTS.md explicitly says “NEVER use as unknown”; the cast blockSchema.fields as unknown as PrefectSchemaObject violates this rule and bypasses type safety. Please replace it with a safe conversion or a type guard so the schema is validated without unsafe casting.

Useful? React with 👍 / 👎.

Comment on lines +67 to +70
const filteredData = useMemo(() => {
return data.filter((blockDocument) =>
blockDocument.name?.toLowerCase().includes(deferredSearch.toLowerCase()),
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use tabs for indentation in TSX per AGENTS.md

AGENTS.md (repo root) requires tab indentation for TypeScript in ui-v2, but this block is indented with spaces. Please reindent this section with tabs to comply with the formatting rule.

Useful? React with 👍 / 👎.

Comment on lines +159 to +163
const onSave = async (zodFormValues: BlockNameFormSchema) => {
try {
await validateForm({ schema: values });
if (errors.length > 0) {
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid relying on stale schema errors before create

After await validateForm(...), errors is still the pre-validation state because validateForm only schedules a React state update. That means createBlockDocument can run even when validation fails (e.g., required schema fields missing), or can be blocked even after errors are cleared. Consider returning a validation result from validateForm and branching on that instead of the stale errors array.

Useful? React with 👍 / 👎.

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