codedoc icon indicating copy to clipboard operation
codedoc copied to clipboard

Ability to copy multiple lines from codeblocks

Open kzshantonu opened this issue 3 years ago • 7 comments

Example: https://autorestic.vercel.app/config

kzshantonu avatar Feb 18 '22 00:02 kzshantonu

Like this?

ezgif com-video-to-gif-5

If that is the intention, then perhaps the user experience can be improved on that front?

loreanvictor avatar Feb 18 '22 06:02 loreanvictor

Oh, interesting. I tried to do that yesterday without success. I will try again and try to understand why I failed yesterday.

TysonMN avatar Feb 18 '22 13:02 TysonMN

@loreanvictor looks nice. Also a copy all button at the corner would be nice imho

kzshantonu avatar Feb 19 '22 00:02 kzshantonu

In that GIF, I think the copy happened when typing Ctrl+C. At least, that is one way it could have happened. I didn't realize that was possible. Single clicking a line copies it, so I was trying to highlight multiple lines and then click one of them to copy them. I think this inconsistency is the issue with the user experience.

Also, for the record, selecting multiple lines is accomplished by holding down Shift. That is standard enough. (I believe the typical behavior is Ctrl and then Shift to select a range.)

TysonMN avatar Feb 21 '22 01:02 TysonMN

Me neither. I can confirm ctrl+c does copy multiple lines

kzshantonu avatar Feb 21 '22 03:02 kzshantonu

@loreanvictor looks nice. Also a copy all button at the corner would be nice imho

@kzshantonu Yeah there is a component for that actualy:

https://codedoc.cc/docs/markdown/buttons#copy-button

loreanvictor avatar Feb 21 '22 09:02 loreanvictor

In that GIF, I think the copy happened when typing Ctrl+C. At least, that is one way it could have happened. I didn't realize that was possible. Single clicking a line copies it, so I was trying to highlight multiple lines and then click one of them to copy them. I think this inconsistency is the issue with the user experience.

@TysonMN this is an interesting design problem. On one hand, clicking on a single line, when multiple lines are selected, should deselect and select the line. On the other hand, it is, as you correctly pointed out, an inconsistent interaction with "single-line click copy" interaction. This interaction itself is non-standard (and hence the inconsistency), however it is extremely convenient IMO.

I should think further on to what the best resolution is, and would also appreciate any ideas on this front 😅

loreanvictor avatar Feb 21 '22 09:02 loreanvictor