העתק רכיב הפוסט

Thanks for identifying that @Moin. I’ve pushed a fix:
https://github.com/discourse/discourse-copy-post/pull/5

6 לייקים

I just get this error message whenever I click the copy button:

לייק 1

Do you see any error in the browser’s console?

I mentioned this issue on the other topic.

לייק 1

I noticed an error on a site using the component as anonymous:

I made a PR to fix it:

https://github.com/discourse/discourse-copy-post/pull/14

4 לייקים

The PR is now merged; thanks, Keegan!

3 לייקים

האם משתמשים של הרכיב הזה נתקלים בשגיאה הזו יותר לאחרונה

Just installed it, here’s an idea:

Click the copy button on multiple posts to “build up” your clipboard. That way you can quickly copy an entire section of a thread selectively.

Let’s say that there are five posts:

Post A
Post B
Post C
Post D
Post E

You copy D, then B, then E. What’s in your clipboard is actually:

B
D
E

So the clipboard is arranged based on their chronology in the conversation, not the order in which you copy them.

i had an error on this, and because it’s a client-side JS error, i can’t find it in /logs. My Discourse version is 2026.7.0-latest +188

I investigated this further against the exact Discourse revision from when I originally saw the problem, and against current main.

On a reconstructed historical July setup, I was able to reproduce a clipboard-related failure: Copy Post could show the success/check indication while the clipboard contents were not actually replaced. I cannot confirm that this was the same underlying error as the theme/component error shown in my original July screenshot.

However, the same Copy Post implementation now works on my current production instance, including in an iOS Safari PWA.

I compared the relevant code between the July Discourse revision and current main. The Copy Post clipboard implementation itself has not changed, and I could not find a relevant change in:

  • clipboardCopy / clipboardCopyAsync
  • DButton action dispatch, including the iOS path
  • the legacy DButton shim
  • the post-menu transformer path
  • the GET path in discourse/lib/ajax

I also wrote an experimental system spec which pauses the raw-post request and checks whether navigator.clipboard.write() has started before the request completes. That test passes if Copy Post is changed to use clipboardCopyAsync, and fails against the current implementation.

However, current Copy Post works in the browsers/devices I have tested, including iOS Safari PWA, so that test appears to enforce a stronger implementation constraint rather than demonstrate a current user-facing regression.

For that reason I am not currently proposing that test or the clipboardCopyAsync change as a fix. The historical failure may have depended on browser/WebKit behaviour rather than a change in the Copy Post component itself.

לייק 1

Following up on this, I’ve opened a small PR which changes the success/check indication so it is only shown after the clipboard write has completed successfully, with a regression system spec:

The GitHub Actions workflow is currently awaiting maintainer approval before the CI jobs can run.

לייק 1