-
Notifications
You must be signed in to change notification settings - Fork 3.2k
improvement(modal): fixed popover issue in custom tools modal, removed the ability to update if no changes made #2897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…d the ability to update if no changes made
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR fixes popover keyboard navigation issues when input fields are focused and adds change tracking to the custom tool modal to prevent accidental data loss. Key Changes:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant CustomToolModal
participant PopoverContent
participant ValidationSystem
participant ChangeTracking
User->>CustomToolModal: Opens modal (new or edit)
CustomToolModal->>ChangeTracking: Store initial values
User->>CustomToolModal: Types in schema editor
CustomToolModal->>PopoverContent: Shows parameter dropdown
PopoverContent->>PopoverContent: Check if input focused
Note over PopoverContent: New: Skip keyboard nav if input focused
User->>PopoverContent: Presses Arrow/Enter/Space
PopoverContent->>CustomToolModal: Navigate/select parameter
CustomToolModal->>CustomToolModal: Insert parameter
User->>CustomToolModal: Modifies schema/code
CustomToolModal->>ValidationSystem: Validate schema
ValidationSystem->>CustomToolModal: Return validation result
CustomToolModal->>ChangeTracking: Check for changes
ChangeTracking->>CustomToolModal: Enable/disable save button
User->>CustomToolModal: Attempts to close
CustomToolModal->>ChangeTracking: Check hasUnsavedChanges
alt Has unsaved changes
CustomToolModal->>User: Show discard alert
User->>CustomToolModal: Confirm or cancel
else No unsaved changes
CustomToolModal->>User: Close immediately
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, 2 comments
...omponents/sub-block/components/tool-input/components/custom-tool-modal/custom-tool-modal.tsx
Outdated
Show resolved
Hide resolved
...omponents/sub-block/components/tool-input/components/custom-tool-modal/custom-tool-modal.tsx
Outdated
Show resolved
Hide resolved
…d the ability to update if no changes made
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
15 files reviewed, 1 comment
...omponents/sub-block/components/tool-input/components/custom-tool-modal/custom-tool-modal.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| variant='tertiary' | ||
| onClick={handleSave} | ||
| disabled={!isSchemaValid || !!schemaError} | ||
| disabled={!isSchemaValid || !!schemaError || !hasChanges} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cancel button bypasses unsaved changes confirmation
Medium Severity
The Cancel buttons call handleClose directly instead of handleCloseAttempt, bypassing the newly-added unsaved changes confirmation. This creates inconsistent behavior where pressing Escape or clicking outside shows a discard confirmation dialog, but clicking Cancel closes immediately without warning, potentially causing users to lose their work unexpectedly.
Summary
Type of Change
Testing
Tested manually
Checklist