Feat #1255: update copy button status by displaying popup and setting…#1259
Feat #1255: update copy button status by displaying popup and setting…#1259dataCenter430 wants to merge 2 commits intoeigent-ai:mainfrom
Conversation
|
Hi, @Wendong-Fan , Could you please review the PR? |
thanks @dataCenter430 for the contribution! Could you add a short video or snapshot for your PR like how #1258 did? Thanks! |
|
Hi @Wendong-Fan I’m very excited about Eigent-ai and would love to continue contributing to the project. I truly appreciate any feedback you can share on how I can improve this PR or align better with the repository’s standards. Looking forward to your thoughts, thank you again! |
|
Hi @Wendong-Fan |
thanks @dataCenter430 for the contribution! Could @bytecii and @nitpicker55555 help reviewing this? |
hey @dataCenter430 , we have supported Ubuntu/linux version, you can download from https://github.com/eigent-ai/eigent/actions/runs/22019072282, but we haven't do comprehensive test on this system, feel free to check and provide any feedback, thanks in advance! |
@Wendong-Fan thank you for your consideration. |
Changes Made
Imported Check, useCallback, useState, useTranslation, and toast
Added copied state and async handleCopy with try/catch
On success: show toast "Copied to clipboard", set copied to true, reset after 2 seconds
On failure: show error toast
Copy icon switches to a green check icon for 2 seconds after a successful copy
Same copy feedback behavior and UI as above
Same copy feedback behavior and UI as above
Behavior
Toast: toast.success(t('setting.copied-to-clipboard')) on successful copy (using existing i18n key)
Icon: copy icon → green check icon for 2 seconds after copy
Error: toast.error('Failed to copy to clipboard') on clipboard failure
Uses async navigator.clipboard.writeText with proper error handling
Closes #1255