Skip to content

prd-5972#1744

Open
anubra266 wants to merge 1 commit intomainfrom
prd-5972
Open

prd-5972#1744
anubra266 wants to merge 1 commit intomainfrom
prd-5972

Conversation

@anubra266
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Feb 5, 2026

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

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Feb 5, 2026 9:53pm
agents-manage-ui Ready Ready Preview, Comment Feb 5, 2026 9:53pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
agents-docs Skipped Skipped Feb 5, 2026 9:53pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 5, 2026

⚠️ No Changeset found

Latest commit: 0494e42

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@claude
Copy link
Contributor

claude bot commented Feb 5, 2026

Claude finished @anubra266's task in 3m 9s —— View job


PR Review Summary

1 Key Finding | Risk: Low

This PR adds a toggle switch to the function-tool-node-editor allowing users to switch between raw JSON editing and a visual JsonSchemaBuilder for input schemas. The implementation correctly follows the existing pattern established by the JsonSchemaInput component.

🟠🔶⚠️ Major (1) 🟠🔶⚠️

🟠 1) function-tool-node-editor.tsx:197-201 Missing readOnly prop for JsonSchemaBuilder

Issue: The JsonSchemaBuilder component is not passed a readOnly prop, while the component supports this prop (see json-schema-builder.tsx:266). The existing JsonSchemaInput component passes readOnly to JsonSchemaBuilder (line 82 in json-schema-input.tsx). Without this, users who lack edit permissions (canEdit = false) can still modify the schema via the visual builder.

Why: This creates an inconsistent permission model. The component uses canEdit from useProjectPermissions() to conditionally hide the delete button (line 261), but this permission isn't enforced on the schema editors. While the StandaloneJsonEditor also doesn't receive a disabled/readOnly prop in this component, the visual builder with its interactive form controls is more obviously editable.

Fix: Pass readOnly={!canEdit} to the JsonSchemaBuilder:

<JsonSchemaBuilder
  value={inputSchema}
  onChange={handleInputSchemaChange}
  hasError={!!getFieldError('inputSchema')}
  readOnly={!canEdit}
/>

Point-fix Edits (0)

No inline suggestions posted - the fix is straightforward but requires author confirmation on whether this is the intended behavior.


💡 APPROVE WITH SUGGESTIONS

Summary: This is a well-implemented feature that correctly follows existing patterns. The implementation is consistent with JsonSchemaInput and uses the shared global state appropriately. The one consideration is whether readOnly should be passed to enforce permissions - this may be intentional if the parent form already prevents saving, but worth confirming.


Other Findings (4)

Potentially valid

(these are minor or info and not confident enough to flag)

Location Issue Reason Excluded
function-tool-node-editor.tsx:171-173 Switch lacks explicit aria-label for accessibility Follows existing pattern in JsonSchemaInput; label "JSON" is adjacent; Radix Switch is accessible by default
function-tool-node-editor.tsx:172 Label "JSON" could be clearer (e.g., "JSON Mode" or "Raw JSON") Consistent with existing JsonSchemaInput; existing pattern is established

Discarded as invalid or not applicable

Location Issue Reason Excluded
Global state concern Toggle affects all schema editors globally Intentional design - user preference that persists; consistent with existing behavior
Data loss on mode switch Switching modes could lose unsaved changes Both editors use same underlying state (inputSchema string); changes sync properly via shared onChange handler

Copy link
Contributor

@sarah-inkeep sarah-inkeep left a comment

Choose a reason for hiding this comment

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

Could we add a little bit of space (vertically) between the rows?
Image

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.

2 participants