Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose "Copy link to post" menu item in Post Dropdown menu #6655

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HorusGoul
Copy link
Contributor

@HorusGoul HorusGoul commented Nov 23, 2024

Some Android users are having problems copying post links using the native app because Bluesky currently relies on using the native share dialog to provide such functionality. However, not all Android flavors allow you to copy links from the native share dialog.

Here's an example I shared in the original issue from a user with a Xiaomi device running HyperOS:

Screenshot of the HyperOS share dialog

image

To solve this UX issue, this PR adds a new "Copy link to post" for all platforms.

While this isn't needed on iOS and some Android flavors, it reduces the amount of presses the user needs to make to copy the link to a publication from 3 to 2.

Fixes #5912.

Manual tests

Android
https://github.com/user-attachments/assets/82c9733a-055a-4fc3-8e58-8530c7496a88

Web
https://github.com/user-attachments/assets/8a89b0a3-28d0-42d2-a4bd-408f18eedd4e

}
}

export function copyUrl(url: string) {
setStringAsync(url)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: setStringAsync could fail. Should we make this function async and await the setStringAsync(url) call to ensure we actually copy the url before showing the toast?

Comment on lines +715 to +723
<Prompt.Basic
control={copyPostUrlLoggedOutWarningPromptControl}
title={_(msg`Note about sharing`)}
description={_(
msg`This post is only visible to logged-in users. It won't be visible to people who aren't logged in.`,
)}
onConfirm={onCopyPostUrl}
confirmButtonCta={_(msg`Share anyway`)}
/>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I duplicated the prompt for simplicity, but we might want to change the copy here. Copying a link might not always result in sharing, but it's most likely the case.

</Menu.ItemText>
<Menu.ItemIcon icon={Share} position="right" />
<Menu.ItemText>{_(msg`Copy link to post`)}</Menu.ItemText>
<Menu.ItemIcon icon={ChainLink} position="right" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: I chose this icon because it's related to links, but Web used the Share icon before. Do we want to keep using the Share icon for web?

@HorusGoul HorusGoul marked this pull request as ready for review November 23, 2024 12:32
@surfdude29
Copy link
Contributor

As an iOS user, this would be great to have as it simply makes copying the URL easier and faster.

But of course more importantly, it seems like it would solve a big issue for some Android users.

I hope the team are able to take a look at this soon and hopefully get it merged 🙏

@mozzius
Copy link
Member

mozzius commented Nov 24, 2024

Thank you for this! We're actually planning on going a different route and adding a dedicated share menu, which would include the option to copy to clipboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose ‘Copy link to post’ list item on all platforms
3 participants