Skip to content

feat(dashboard): refactor agent page to use react-hook-form and zod schemas from agents-core#1799

Draft
dimaMachina wants to merge 47 commits intomainfrom
prd-5298-2
Draft

feat(dashboard): refactor agent page to use react-hook-form and zod schemas from agents-core#1799
dimaMachina wants to merge 47 commits intomainfrom
prd-5298-2

Conversation

@dimaMachina
Copy link
Collaborator

@dimaMachina dimaMachina commented Feb 7, 2026

json editors now uses GenericJsonEditor and have expand button too
image

@changeset-bot
Copy link

changeset-bot bot commented Feb 7, 2026

⚠️ No Changeset found

Latest commit: 3506f56

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

@vercel
Copy link

vercel bot commented Feb 7, 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 12, 2026 8:55pm
agents-docs Ready Ready Preview, Comment Feb 12, 2026 8:55pm
agents-manage-ui Ready Ready Preview, Comment Feb 12, 2026 8:55pm

Request Review

Comment on lines -406 to -407
min="1"
max="100"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed because we have zod validation for min/max

@inkeep
Copy link
Contributor

inkeep bot commented Feb 7, 2026

No docs changes detected.

This PR refactors internal dashboard state management to use react-hook-form and consolidates Zod schemas within agents-core. These are internal implementation improvements that don't affect public APIs or documented features.

Comment on lines 164 to +165
agentData: FullAgentDefinition
): Promise<ActionResult<FullAgentDefinition>> {
): Promise<ActionResult<FullAgentResponse>> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

mistake, should be response and not definition

Comment on lines -166 to +130
): Promise<ActionResult<FullAgentDefinition>> {
): Promise<ActionResult<FullAgentResponse>> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

mistake, should be response and not definition

Comment on lines -43 to +95
export type GetAgentResponse = SingleResponse<FullAgentDefinition>;
export type UpdateFullAgentResponse = SingleResponse<FullAgentDefinition>;
export type GetAgentResponse = SingleResponse<FullAgentResponse>;
export type UpdateFullAgentResponse = SingleResponse<FullAgentResponse>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

mistake, should be response

Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

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

PR Review Summary

0 Key Findings | Risk: Low

Delta review — scoped to 21 commits since last automated review. The delta introduces the Editor composition pattern and new GenericJsonEditor/GenericPromptEditor form components.

💭 Consider (2) 💭

💭 1) generic-json-editor.tsx / generic-prompt-editor.tsx Accessibility: editor components lack explicit label association

Issue: Both GenericJsonEditor and GenericPromptEditor render FormLabel and editor components as siblings without explicit htmlFor/id pairing or aria-labelledby. The commented-out // aria-labelledby={id} in generic-prompt-editor.tsx:61 suggests this was considered but not implemented.
Why: Monaco-based editors are complex custom widgets. Without explicit ARIA labeling, screen readers may not announce the label when focus moves to the editor.
Fix: Add id association: <FormLabel id={\${name}-label`}>paired witharia-labelledby={`${name}-label`}` on the editor, or verify if the underlying editor components already handle labeling internally.
Refs: generic-prompt-editor.tsx:61

💭 2) knip.config.ts:16-17 Knip ignore entries may be unnecessary

Issue: The new entries for generic-prompt-editor.tsx and generic-json-editor.tsx use ['files'] to suppress unused file warnings. However, these files are now actively imported (per the diff showing import path changes to @/components/form/).
Why: Unnecessary knip ignores can mask legitimate issues in the future.
Fix: Verify if these entries are still needed after the import path changes. If the components are now imported, remove the ignore entries. If needed, consider ['exports'] for unused export warnings vs ['files'] for unused file warnings.
Refs: knip.config.ts:16-17

🕐 Pending Recommendations (3)

Prior feedback from previous review that remains unaddressed:


💡 APPROVE WITH SUGGESTIONS

Summary: The delta introduces a clean Editor composition pattern following Vercel composition patterns, with well-structured GenericJsonEditor and GenericPromptEditor components. The refactoring correctly preserves behavior while improving reusability. No bugs or issues found in the delta — just two minor "consider" items for accessibility and configuration cleanup.

The 3 pending recommendations from the previous review remain unaddressed on unchanged code. The Major issue (navigation after failed save) is worth addressing before merge to prevent potential data loss.

Overall, nice work on the editor composition refactoring! 🎨


Discarded (4)
Location Issue Reason Discarded
editor.tsx:25-26 Children rendered twice in EditorDialog Intentional design — shows content in both collapsed and expanded states with URI prefixing to maintain separate Monaco instances
generic-prompt-editor.tsx Doesn't use FormFieldWrapper abstraction Justified deviation — complex label content (AddVariableAction, DialogTrigger) doesn't fit FormFieldWrapper pattern
generic-json-editor.tsx Doesn't use FormFieldWrapper abstraction Same justification as above — Editor.Dialog wrapper requires different structure
generic-json-editor.tsx:48-55 Accessibility label association Merged with similar finding for GenericPromptEditor — addressed as single Consider item
Reviewers (3)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-frontend 3 0 1 0 0 0 2
pr-review-consistency 4 0 1 0 0 0 3
pr-review-standards 0 0 0 0 0 0 0
Total 7 0 2 0 0 3 5

Note: pr-review-standards found no issues — the delta code is clean and follows existing patterns well.

@github-actions github-actions bot deleted a comment from claude bot Feb 10, 2026
Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

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

PR Review Summary

0 Key Findings | Risk: Low

Delta review — scoped to 4 commits since last automated review. The delta includes layout/styling fixes for the editor components and Sentry configuration improvements.

Delta Changes Reviewed

The delta introduces:

  1. Layout fixes in expandable-field.tsx, generic-json-editor.tsx, generic-prompt-editor.tsx — Added space-y-2 wrapper and flex container with inline-flex on FormLabel for proper alignment
  2. Sentry configuration in next.config.ts — Added authToken, deleteSourcemapsAfterUpload: true, and reactComponentAnnotation
  3. Documentation — New manage-database-usage skill and docs (out of scope for this PR's core functionality)

Findings: No issues found in the delta. The layout changes are clean refactoring. The Sentry config improvements are actually security-positive (sourcemaps deleted after upload prevents public exposure while maintaining Sentry debugging capability).

🕐 Pending Recommendations (3)

Prior feedback from previous automated reviews that remains unaddressed:


💡 APPROVE WITH SUGGESTIONS

Summary: The delta is clean — layout fixes and Sentry config improvements are well-done. The 3 pending recommendations from previous reviews remain unaddressed on unchanged code. The Major issue (navigation after failed save) is worth addressing before merge to prevent potential data loss, but this is not a blocker for the delta changes themselves.

Nice polish on the editor components! 🎨


Discarded (0)

No findings discarded — all reviewer findings were either clean passes or already covered in prior reviews.

Reviewers (3)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-frontend 0 0 0 0 0 0 0
pr-review-devops 0 0 0 0 0 0 0
pr-review-standards 0 0 0 0 0 0 0
Total 0 0 0 0 0 3 0

Note: All reviewers found no issues in the delta — the code changes are clean and follow existing patterns.

@github-actions github-actions bot deleted a comment from claude bot Feb 10, 2026
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.

  • I noticed that there are a few fields Im not able to remove after I've set the values:
    context config, headers json, max transfers, provider options on the base model
    example loom
    Could you go through and double check all of the fields are able to be removed, I may have missed some in my testing.
  • After I hit save "try it" is still disabled and I still see the Unsaved changes modal
  • Editing the Provider options field for the base model of an agent does not re-enable the "save" button
  • When I try updating a field like the agent description using the copilot the field is updated but it's not reflected in the UI, the UI shows the old description (it does work for the subagent fields so I think it's like something with the refactor?)
  • Can you take a look at the comments Claude left I think some may be accurate.

};
// biome-ignore lint/correctness/useExhaustiveDependencies: -- only on mount
useEffect(() => {
// make sure to unsubscribe;
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to unsubscribe when this is unmounted?

@dimaMachina dimaMachina marked this pull request as draft February 12, 2026 00:56
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

Comments