-
Notifications
You must be signed in to change notification settings - Fork 13
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
triple click for one-line console copy ex console prompt #172
Comments
I think there are two pieces of feedback I can take from this issue: (1) Not obvious that clicking on the left-margin selects the line.@awdeorio brought up the same feedback (#131 (comment)). At the time, I argued that this is a common UX pattern (in VSCode, MS Word, etc.), but I think it makes sense to make the functionality more discoverable. Option 1a: Add a "help" button in every code block
Option 1b: Add a one-time dismissible NUX ("feature tour") using ShepherdJS
Option 2: Add a "copy" button next to each line when you hover over the left edge of each line
Right now, I'm leaning towards Option 1b, but I need to explore how distracting the experience would be. (I don't want students to get side-tracked by Primer Spec features, the spec content is much more important than the website theme!) (2) Need to copy a line after clicking itGood point, I didn't give this much though! I don't have an easy way to detect triple-clicks, but I can detect double clicks. So maybe double-clicking on a line-number should select and copy the entire line. That said, I feel like double-clicking the line may not be an intuitive way to copy to the clipboard. I wonder how we would make this work for multi-line code blocks. I can detect keyboard presses too, so shift+click, or shift+click+drag could trigger the copy-action. Alternatively, we could use the alt/option key instead of shift For copying the console-prompt: I would expect most people wouldn't need to do it. If they really need to, they can always select text the old-fashioned way by clicking-and-dragging on the text itself 😄 |
I think Option 1b and 2 are reasonable. Here's a slight variation. Option 2b Click to select a line. Click and drag to select multiple lines. Just like the GitHub PR interface. After selection, show click-to-copy button. Hovering over any part of an enhanced code block at any time shows a tooltip help text, possibly dismissible. |
I’m beginning to like Option 2b more (I was hesitant before). Thanks! Will prototype it this weekend. |
Is your feature request related to a problem? Please describe.
It's not obvious that clicking the line number copies a line on the console block. Plus if we choose the no-line-numbers variant, there's no line numbers to click.
Describe the solution you'd like
If you can detect triple click on the line, perhaps you can make a triple-click on a line to select the whole line without the console prompt.
If one wants to select the whole line with the console prompt, one can do drag to select or shift-triple-click or something else.
Describe alternatives you've considered
One could drag to select whole line without the console prompt, but it's easier to drag to select whole line than to start/stop at the console prompt, especially for those with accessibility issues.
The text was updated successfully, but these errors were encountered: