Discourse post direct copy link

: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.
:hammer_and_wrench: Repository https://github.com/chapoi/discourse-post-direct-copy
:question: Install Guide How to install a theme or theme component

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:

5 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 feature ux bug topics for any issues you encounter or any suggestions you may have.