UI/UX Paradigm for copying plain text or markdown
@DouweM and @rspeicher had mentioned that they would like to copy diffs (and comments maybe?) into the clipboard as markdown from the HTML they are presented as.
We talked briefly about altering clipboard text as a solution. I posit that the user will want to choose what they copy. As @DouweM mentioned he wants the diff to be copied with +
and -
and I do not think it necessary. Therefore I propose the following solution.
In the screenshot
-
M
would be a markdown copy button. -
P
would copy as plaintext (which would be the same as regular copying, so people wouldn't say "I just copy want it!"), in a diff we can have options to copy the diff if necessary. They can also just press Command + C to get the same result. -
C
Would add a comment between those lines as have been request in another issue. As a first step it can open the comment box for the top line. Would be an easy win. -
L
Would copy a link (to your clipboard and put it in the address bar) to that line with top line as a first step, lines from-to as a second step.
Benefits of this method:
- All tools exist already (we have the copy to clipboard buttons available, wouldn't only need to populate their contents).
- No partially supported JS API's needed. Would work on all browsers as we already use everything this needs.
- Would look super duper cool and make commenting/copying/pasting easier.
- Existing comment methods can stay so nothing changes except when they highlight text.
- Text selection API is widely supported.