discourse-ai/spec/system/page_objects/components
Sam 3800728d52
FIX: clear uploads after successfully posting new PM (#1307)
This PR addresses a bug where uploads weren't being cleared after successfully posting a new private message in the AI bot conversations interface. Here's what the changes do:

## Main Fix:
- Makes the `prepareAndSubmitToBot()` method async and adds proper error handling
- Adds `this.uploads.clear()` after successful submission to clear all uploads
- Adds a test to verify that the "New Question" button properly resets the UI with no uploads

## Additional Improvements:
1. **Dynamic Character Length Validation**:
   - Uses `siteSettings.min_personal_message_post_length` instead of hardcoded 10 characters
   - Updates the error message to show the dynamic character count
   - Adds proper pluralization in the localization file for the error message

2. **Bug Fixes**:
   - Adds null checks with optional chaining (`link?.topic?.id`) in the sidebar code to prevent potential errors

3. **Code Organization**:
   - Moves error handling from the service to the controller for better separation of concerns
2025-05-02 13:46:22 +10:00
..
ai_caption_popup.rb FIX: Image caption feature should respect composer AI helper groups (#522) 2024-03-11 15:35:20 -07:00
ai_composer_helper_menu.rb DEV: Move composer AI helper to toolbar (#796) 2024-09-13 11:59:30 -07:00
ai_pm_homepage.rb FIX: clear uploads after successfully posting new PM (#1307) 2025-05-02 13:46:22 +10:00
ai_post_helper_menu.rb FEATURE: Show post helper as bottom modal on mobile (#704) 2024-07-10 11:01:05 -07:00
ai_split_topic_suggester.rb FEATURE: AI suggestion buttons in `move-to-topic` modal (#360) 2023-12-15 12:11:14 -08:00
ai_suggestion_dropdown.rb REFACTOR: Helper suggestions (#914) 2024-11-27 12:21:03 -08:00
ai_summary_box.rb UX: move topic summary from DMenu to DModal (#992) 2024-12-03 13:30:15 -05:00