improvement(modal): fixed popover issue in custom tools modal, removed the ability to update if no changes made#2897
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
|
...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
|
@greptile |
|
@greptile |
...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.
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.
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