jacob-ai-bot / jacob

Just Another Coding Bot
https://jacb.ai
Apache License 2.0
131 stars 20 forks source link

JACoB PR for Issue Toast Error Notification Appears When Canceling File Save #217

Closed jacob-ai-bot[bot] closed 1 month ago

jacob-ai-bot[bot] commented 1 month ago

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

  1. Click on the Save button
  2. In the save dialog, click Cancel to abort the save operation.

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's handleSave function, update the error handling logic in the catch block. Check if the caught error is a DOMException with the name property equal to AbortError, 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.

jacob-ai-bot[bot] commented 1 month ago

Hello human! 👋

This PR was created by JACoB to address the issue Toast Error Notification Appears When Canceling File Save

Next Steps

  1. Please review the PR carefully. Auto-generated code can and will contain subtle bugs and mistakes.

  2. 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.

  3. Once the code looks good, approve the PR and merge the code.