Discourse post direct copy link

:warning: This component is under active development and currently being tested on meta. Frequent changes will occur.

:information_source: Summary Adds a direct-copy button to the post menu actions.
:hammer_and_wrench: Repository GitHub - 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
9 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)

4 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:

4 Likes