Closed jacob-ai-bot[bot] closed 1 month ago
Hello human! 👋
This PR was created by JACoB to address the issue Toast Error Notification Appears When Canceling File Save
Please review the PR carefully. Auto-generated code can and will contain subtle bugs and mistakes.
If you identify code that needs to be changed, please reject the PR with a specific reason. Be as detailed as possible in your comments. JACoB will take these comments, make changes to the code and push up changes. Please note that this process will take a few minutes.
Once the code looks good, approve the PR and merge the code.
Summary:
Description
When attempting to save a file in the chat interface, if the user cancels the save operation, a toast error notification is unexpectedly displayed. This behavior can confuse users, as canceling an action should not trigger an error message.
Steps to Reproduce
Expected Behavior
Canceling the save operation should close the save dialog without displaying any error notifications.
Actual Behavior
After canceling the save operation, a toast error notification appears, indicating a failure to save the file.
@jacob-ai-bot --skip-build
Plan:
Step 1: Edit
/src/app/dashboard/[org]/[repo]/chat/components/Artifact.tsx
Task: Prevent error toast when user cancels file save in Artifact component
Instructions: In the
Artifact
component'shandleSave
function, update the error handling logic in thecatch
block. Check if the caught error is aDOMException
with thename
property equal toAbortError
, which indicates that the user canceled the save operation. If it is, do not display the error toast notification. For other errors, continue to display the error toast as before.Exit Criteria: No error toast is displayed when the user cancels the file save operation. Error toast notifications still appear for other save errors.