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

Make manual selection of text close to the copy button more easy #136

Open
Jackenmen opened this issue Jul 7, 2021 · 2 comments
Open

Make manual selection of text close to the copy button more easy #136

Jackenmen opened this issue Jul 7, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@Jackenmen
Copy link

Is your feature request related to a problem? Please describe.

I find it a bit frustrating when the copy button interferes with me moving my mouse towards the end of the code block.

Here's a GIF I took on the sphinx-copybutton's documentation where I'm trying to present my frustration:
2021-07-08_00-30-37

What I'm trying to do here is select the end of the text in the code block in order to copy it.

First, I try to start selecting from the right but the copy button gets in the way. After I figure out that I can't do that, I try from the left side though I first run my cursor into the copy button and its tooltip which requires me to move the cursor even further so that I can actually the text behind the copy button. I finally succeed (sort of, as it selects one character more than I wanted) to select the text and so I try to copy it by right-clicking which well, wasn't very successful because I ran my cursor into the copy button again. To not let the copy button win this battle as well, I use Ctrl+C to still succeed in copying it :)

After looking into the usability of the copy button a bit more, I've also noticed that there's an issue with the whole text being selected when I move the mouse on the copy button:
2021-07-08_00-43-31

Describe the solution you'd like

I feel it would be best if the copy button was outside of the code block's text area entirely.

GitHub's clone instructions are a good example of how it can look:
image
I'm guessing that's not of much use since it's a single line text area, so here's also a simple example of how I think it could look more or less:
image

Describe alternatives you've considered

I think that some padding inside the code block could aid with this problem. It wouldn't be as good as making it separate from the textbox as it would still selecting Perhaps the "Copy" tooltip shouldn't keep the copy button unhidden too? I guess that's part of its appeal though so probably that will need to remain unfixed.

Additional context

Tested on https://sphinx-copybutton.readthedocs.io/en/latest/

@Jackenmen Jackenmen added the enhancement New feature or request label Jul 7, 2021
@welcome
Copy link

welcome bot commented Jul 7, 2021

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@choldgraf
Copy link
Member

I agree that in general it would be useful to have the copy button outside the block of code. However, I think it would be really hard to do this in a way that was theme-agnostic (it is hard enough as it is to do this in a theme-agnostic way, and keeping the copy button overlaid within the code block seems much easier than modifying the code block's structure itself).

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

No branches or pull requests

2 participants