Discourse post direct copy link

AI-generated summary

This theme component, originally created by chapoi, added a direct-copy-to-clipboard button to post menus in Discourse, replacing the default share modal with a streamlined copy action. It displayed a toast notification and checkmark on success, and was desktop-only — mobile retained native share support. The component is now deprecated, as its functionality has been merged into Discourse core via pull request #24709 by martin. Site admins can now toggle between the new copyLink button or the legacy share button via the post_menu site setting. Lilly and Canapin clarified that users can customize which buttons appear in the post menu, including removing them entirely. twofoursixeight suggested showing only the copy button for logged-out users to simplify sharing. sam noted users can still access the old share dialog by clicking the post timestamp, responding to feedback from darkpixlz. chapoi acknowledged the flexibility but recommended keeping the copy button as default for usability. Users are strongly advised to uninstall this component to avoid conflicts with core features.

:information_source: The functionality of this theme component is now included in core Discourse.

:warning: Please remove the theme component from your forum if you still have it installed.

:information_source: Summary Adds a direct-copy button to the post menu actions.

Install this theme component

A small component that will copy the link of a post directly to your clipboard, circumventing the original share modal popup.

Replaced the share functionality with a direct copy functionality. Same icon, different action.

On click it shows a toast notification and a little checkmark on the copy button, to indicate the copy action happened.

:warning: Desktop only – mobile has native copy popup support.

Only the post menu button is impacted, the timestamp and topic share button remain the same.

Previous version changes
  • The previous version had similar functionality on mobile, but decided to drop this in favor of the native support.
  • It also had the option to keep the original share-modal button in the post menu actions, but removed that for now to avoid confusion and complexity. So in the latest version, you choose either type A or type B functionality.
  • The toasty was shown in the bottom right corner, but on large screens this was too far from the action, so moved it closer
10 Likes

just to clarify, i believe the existing share button is also optional to show in admin-settings under post menu? (which of course is the same as clicking the timestamp in top right corner of a post)

5 Likes

Indeed, you can completely remove any of these shortcuts, both outside and inside the wrench icon. :slight_smile:

4 Likes

Oh cool TIL.

Regardless, I still think having it disabled in the component by default is probably useful?

3 Likes

When signed out, only the copy button should appear. It would make the anonymous sharing process easier for logged out users and two copy buttons arent needed

3 Likes

Feedback from @darkpixlz

(it) the old share dialog.

2 Likes

Note @darkpixlz you can still get the dialog today by clicking the time :slight_smile:

6 Likes

I worked with @chapoi to merge this into core this week, and it’s here now:

You should uninstall this theme component if you have it installed.

A new post_menu button, copyLink, is added and used as the default instead of share. If site owners want the old behaviour back, they just need to change the post_menu site setting to use the share button instead of copyLink.

On desktop, this button will copy the link of the post to the user’s clipboard and show a nice animation. On mobile the native share menu will be shown.

5 Likes

As the functionality of this theme component is now included as a core feature, please create Support Contribute > Feature Contribute > UX Contribute > Bug topics for any issues you encounter or any suggestions you may have.