workspace: Add copy button to ErrorMessagePrompt popup (#48107)

Dawid Harat created

My own uncreated issue. Super simple QOL change.
Just needed to copy errors and the only other place I'm aware of is
console.

The text inside the error popup is not selectable (at least on macos)


before:
<img width="461" height="213" alt="image"
src="https://github.com/user-attachments/assets/f0cc4239-759c-4e1e-aae0-d2908a81cdc6"
/>

after:
<img width="482" height="233" alt="image"
src="https://github.com/user-attachments/assets/61d458cc-3c25-4c1c-8bd7-3d6b83a51d28"
/>

Release Notes:

- Added `CopyButton` to `ErrorMessagePrompt`

Change summary

crates/workspace/src/notifications.rs | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

Detailed changes

crates/workspace/src/notifications.rs 🔗

@@ -519,8 +519,17 @@ impl Render for ErrorMessagePrompt {
                                     }),
                             )
                             .child(
-                                ui::IconButton::new("close", ui::IconName::Close)
-                                    .on_click(cx.listener(|_, _, _, cx| cx.emit(DismissEvent))),
+                                h_flex()
+                                    .gap_1()
+                                    .child(
+                                        CopyButton::new("copy-error-message", self.message.clone())
+                                            .tooltip_label("Copy Error Message"),
+                                    )
+                                    .child(
+                                        ui::IconButton::new("close", ui::IconName::Close).on_click(
+                                            cx.listener(|_, _, _, cx| cx.emit(DismissEvent)),
+                                        ),
+                                    ),
                             ),
                     )
                     .child(