# ui: Improve performance in the \`CopyButton\` component \(\#47292\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/e1e7676b5a43518a09693039b024c04a26620173)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: e1e7676b5a43518a09693039b024c04a26620173

Requested commit: e1e7676b5a43518a09693039b024c04a26620173

Commit: e1e7676b5a43518a09693039b024c04a26620173

Tree: b1c47b3e31a187c4c2497a8c312c2e117677b5bc

Author: Danilo Leal

Committer: GitHub

## Message

```
ui: Improve performance in the `CopyButton` component (#47292)

This PR improves the performance of the `CopyButton` component by
tracking the copied state locally through a `CopyButtonState` struct
instead of making an OS call every time the component re-renders. Also
pushing a slight improvement here by resetting the state after two
seconds so as to make the check mark go away after you clicked to copy.

Release Notes:

- N/A
```

## Parents

- [099650fdfb6cd9760998c7876af630c18d9b5078](https://git.cafe/gitcafe/zed/commit/099650fdfb6cd9760998c7876af630c18d9b5078?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/e1e7676b5a43518a09693039b024c04a26620173?format=markdown)
