Repository navigation
Confirm copies to screen readers and say when copying fails #343
Description
MessageCopyButton confirms success only with an icon; code-block copying changes its text and accessible name to "Copied". Neither provides a dedicated live confirmation, and neither shows clipboard failures.
Where to start
- The thread has two copy implementations: MessageCopyButton swallows errors and disables itself while it shows the check; the code block CopyButton has no error handling at all.
- Make one small shared copy helper (copied and failed state plus a polite live-region message) and use it in both.
- Show a short "Couldn't copy" state on failure, and keep the button enabled while it shows "Copied".
Code to look at:
frontend/components/session-ui/message-copy-button.tsx:50frontend/components/session-ui/message-copy-button.tsx:68frontend/components/ai/code-block.tsx:65
Done when
- Both buttons go through one helper.
- A unit test mocks navigator.clipboard to resolve and to reject and checks both states.
- VoiceOver or NVDA reads "Copied" after a copy.
Free to try
Sign up free at app.useagent.org. New accounts get free model credits (GLM or Claude Opus, up to a limit) and free cloud sandbox time, enough to finish this task without paying or adding a key.
Send it a small task in plain words and watch it work. You'll see the screens this issue is about. The link in the sign-up email works for 24 hours. Not there? Check spam.
Stuck? Comment here with a screenshot and we'll help.
Keep private details out of here
This page is public. Don't post your real email, phone number, address, payment details, API keys, or screenshots that show any of them. Send anything private, including how you'd like to be paid, to [email protected] with a link to your comment here.
Claim it
Comment /take and the issue is assigned to you. First come, first served.
Rules
- Use the app while you work, and put before and after screenshots or a short recording in your pull request. For backend or docs work, show the result end to end.
- One change per pull request. Run the checks in CONTRIBUTING.md.
- AI help is fine, blind AI output is not. You must understand, run and explain every line you submit.
- Untested or generated pull requests, and pull requests on an issue someone else claimed, are closed without a reply and don't count for Hacktoberfest.
Activity
sharmis-tp commentedon Oct 21, 2026
I can pick this up. I'd make one small shared copy helper with copied and failed states plus a polite live-region message, use it in both
MessageCopyButtonand the code blockCopyButton, show a short "Couldn't copy" state on failure and keep the button enabled while it shows "Copied", with tests that mock the clipboard for success and rejection. Could you assign it to me?