-
Notifications
You must be signed in to change notification settings - Fork 156
Description
Motivation
Accidentally deleting a chat session means losing all its messages forever. Right now, there's no warning—one click and it's gone. Adding a confirmation dialog helps prevent mistakes and protects important conversations.
Current Behavior
When a user clicks the delete button on a session, the session is immediately and permanently deleted without any confirmation or warning. There is no opportunity for the user to cancel the action if it was accidental.
Reproduction Steps:
- Launch the chat application
- Run
yarn install
yarn run start- Note: You might have a warning for
sass-loader, pressXfor now.
- Create a new chat session and send some messages
- Locate the delete button for the session in the session list
- Click the delete button once
- Observe that the session is immediately deleted without any confirmation dialog
- Note that there is no way to undo or recover the deleted session
- Recognize the risk: an accidental click results in permanent data loss
Expected Behavior
When a user clicks the delete button on a session, a confirmation dialog should appear asking the user to confirm the deletion. The dialog should clearly identify which session is being deleted and provide both "Cancel" and "Delete" options. Only when the user explicitly confirms by clicking "Delete" in the dialog should the session actually be removed.
Acceptance Criteria:
- Clicking the delete button opens a confirmation dialog instead of immediately deleting the session
- The dialog displays the name or identifier of the session being deleted
- The dialog has a "Cancel" button that closes the dialog without deleting anything
- The dialog has a "Delete" button that confirms the deletion and removes the session
- The dialog follows the same design pattern and styling as other dialogs in the application
- Sessions are only deleted when the user explicitly confirms through the dialog
Verification
Manual Testing:
- Launch the application and create multiple chat sessions with different names
- Click the delete button on one of the sessions
- Verify that a confirmation dialog appears instead of immediate deletion
- Check that the dialog shows the correct session name/identifier
- Click "Cancel" and verify the dialog closes and the session remains intact
- Click delete again, then click "Delete" in the dialog and verify the session is removed
- Test with multiple sessions to ensure the correct session is always identified in the dialog
- Verify the dialog styling is consistent with other dialogs in the application
Edge Cases:
- Test clicking outside the dialog or pressing ESC to ensure proper cancel behavior
- Verify that deleting the last session works correctly
- Test rapid clicks to ensure the dialog state is managed properly
Submission
Download https://cap.so/ to record your screen (use Studio mode). Export as an mp4, and drag and drop into an issue comment below.
Guide to submitting pull requests: https://hackmd.io/@timothy1ee/Hky8kV3hlx