repl: Show feedback when copying REPL output (#64276)
# Objective
The copy button on REPL output provides no visual confirmation after
copying. I noticed this when copying Python REPL output: it was unclear
whether the click had worked.
## Solution
Show a green checkmark and a “Copied!” popup below and to the right of
the copy button after copying. The feedback disappears after two
seconds, and clicking again restarts the timer.
Each output maintains its own feedback state. The change is limited to
REPL output controls; the shared CopyButton component is unchanged.
## Testing
The following checks passed on macOS:
- `cargo check -p repl --offline --locked`
- Rust formatting checks
- `git diff --check`
Manually tested on macOS:
- Copying REPL output puts the expected content on the clipboard.
- A green checkmark and a “Copied!” popup appear beside the copy button.
- The feedback disappears after two seconds.
- Clicking again restarts the timer.
- Copy feedback is independent for each output.
Manual verification steps:
1. Run `cargo run` and open a Python file with an available REPL kernel.
2. Execute `print("Copy feedback test")` and click the output's copy
button.
3. Confirm that a green checkmark and a “Copied!” popup appear
immediately, with the popup below and to the right of the button.
4. Paste the clipboard contents and confirm that they match the output.
5. Confirm that the feedback disappears after two seconds and repeated
clicks restart the timer.
6. Run multiple outputs and confirm that copying one does not change
another output's feedback.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
## Showcase
<img width="2530" height="598" alt="image"
src="https://github.com/user-attachments/assets/62be2f77-c186-4046-923b-22157210dc59"
/>
---
Release Notes:
- Fixed missing visual feedback when copying REPL output.
---------
Co-authored-by: dino <dinojoaocosta@gmail.com>
b7be0f185bJason Feng committed on 9/23/2026, 8:54:29 AM· committed by GitHubparent7fecbb2