[PR #723] [MERGED] fix: text copy issue #22655

Closed
opened 2026-02-21 20:19:27 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify/pull/723
Author: @MatriQ
Created: 8/2/2023
Status: Merged
Merged: 8/3/2023
Merged by: @crazywoola

Base: mainHead: fix/text-copy-issue


📝 Commits (2)

  • db412e5 fix: text copy issue
  • 0abc919 fix: directly use copy-to-clipboard instead of hook

📊 Changes

6 files changed (+11 additions, -42 deletions)

View changed files

📝 web/app/components/app/overview/embedded/index.tsx (+1 -2)
📝 web/app/components/app/overview/share-link.tsx (+1 -2)
📝 web/app/components/develop/secret-key/secret-key-modal.tsx (+1 -2)
📝 web/app/components/header/account-setting/members-page/invited-modal/invitation-link.tsx (+2 -3)
📝 web/app/components/share/text-generation/result/header.tsx (+6 -7)
web/hooks/use-copy-to-clipboard.ts (+0 -26)

📄 Description

Related to #701

CHANGES:

  • Removing the condition about navigator?.clipboard, it's not supported by all browsers, but the library copy-to-clipboard should be supported by all browsers.
  • Removing exception catching, writeText should be no possible to throw exceptions ( can be verified by reading the source code of copy-to-clipboard)

TO BE DISCUSSION:
It's unnecessary to use a state to save the copied text and return it from the hook, and there is also nowhere to use it. I even thought there is no need for this hook to exist and we should directly import copy-to-clipboard and use writeText instead.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify/pull/723 **Author:** [@MatriQ](https://github.com/MatriQ) **Created:** 8/2/2023 **Status:** ✅ Merged **Merged:** 8/3/2023 **Merged by:** [@crazywoola](https://github.com/crazywoola) **Base:** `main` ← **Head:** `fix/text-copy-issue` --- ### 📝 Commits (2) - [`db412e5`](https://github.com/langgenius/dify/commit/db412e561a9ce0b6c5233a8a3b80090078df12f1) fix: text copy issue - [`0abc919`](https://github.com/langgenius/dify/commit/0abc9198c77d1a7a5a7bdc9b49d114f683afabc7) fix: directly use copy-to-clipboard instead of hook ### 📊 Changes **6 files changed** (+11 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `web/app/components/app/overview/embedded/index.tsx` (+1 -2) 📝 `web/app/components/app/overview/share-link.tsx` (+1 -2) 📝 `web/app/components/develop/secret-key/secret-key-modal.tsx` (+1 -2) 📝 `web/app/components/header/account-setting/members-page/invited-modal/invitation-link.tsx` (+2 -3) 📝 `web/app/components/share/text-generation/result/header.tsx` (+6 -7) ➖ `web/hooks/use-copy-to-clipboard.ts` (+0 -26) </details> ### 📄 Description Related to #701 CHANGES: * Removing the condition about `navigator?.clipboard`, it's not supported by all browsers, but the library `copy-to-clipboard` should be supported by all browsers. * Removing exception catching, `writeText` should be no possible to throw exceptions ( can be verified by reading the source code of `copy-to-clipboard`) **TO BE DISCUSSION:** It's unnecessary to use a state to save the copied text and return it from the hook, and there is also nowhere to use it. I even thought there is no need for this hook to exist and we should directly import `copy-to-clipboard` and use `writeText` instead. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-21 20:19:27 -05:00
yindo closed this issue 2026-02-21 20:19:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#22655