(&mut self)
| 2022 | } |
| 2023 | |
| 2024 | fn handle_redo(&mut self) { |
| 2025 | let Some(_session_id) = self.current_session_id() else { |
| 2026 | self.alert_dialog.set_message("No active session for redo."); |
| 2027 | self.alert_dialog.open(); |
| 2028 | return; |
| 2029 | }; |
| 2030 | // Redo re-submits the current prompt content (which was restored by undo) |
| 2031 | let input = self.prompt.get_input().trim().to_string(); |
| 2032 | if input.is_empty() { |
| 2033 | self.alert_dialog |
| 2034 | .set_message("Nothing to redo. Prompt is empty."); |
| 2035 | self.alert_dialog.open(); |
| 2036 | return; |
| 2037 | } |
| 2038 | // Re-submit the prompt to effectively redo |
| 2039 | if let Err(err) = self.submit_prompt() { |
| 2040 | self.alert_dialog |
| 2041 | .set_message(&format!("Failed to redo:\n{}", err)); |
| 2042 | self.alert_dialog.open(); |
| 2043 | } |
| 2044 | } |
| 2045 | |
| 2046 | fn handle_copy_session(&mut self) { |
| 2047 | let Some(session_id) = self.current_session_id() else { |
no test coverage detected