patternfly-react icon indicating copy to clipboard operation
patternfly-react copied to clipboard

feat(ClipboardCopy): 9712 allow alternative title

Open gitdallas opened this issue 2 years ago • 10 comments
trafficstars

Closes #9712

https://patternfly-react-pr-9713.surge.sh/components/clipboard-copy#expanded-with-alternate-title

unsure if my verbiage/naming was the best.

setting a title will force the title itself to be readOnly (disabled textinput), but a user can still edit the text that gets copied if there is expandable content for them to do it in the text area, unless isReadOnly is specified in which case they wouldn't be able to edit either place.

gitdallas avatar Oct 05 '23 17:10 gitdallas

Preview: https://patternfly-react-pr-9713.surge.sh

A11y report: https://patternfly-react-pr-9713-a11y.surge.sh

patternfly-build avatar Oct 05 '23 17:10 patternfly-build

@thatblindgeye - seems like we need some design input here? Personally I think the "label above" example you showed makes a lot of sense, and wouldn't even require any change from us. I'd want to make sure and run that idea across the product that brought up this issue though.

gitdallas avatar Oct 13 '23 18:10 gitdallas

@andrew-ronaldson @mmenestr Pinging for the design question above

Also needs a rebase

kmcfaul avatar Nov 14 '23 18:11 kmcfaul

Just to make sure I understand correctly, the suggestion is that instead of showing a truncated version of what you want to copy, you'd want to have some sort of label to say "hey, expand this to see what would be copied"?

mmenestr avatar Nov 14 '23 18:11 mmenestr

Eric's example that I liked was this one: image

It provides a label that describes what the text to copy is, and also a truncated version of what is being copied (that can be expanded).

this is basically default functionality of the clipboardcopy tool, adding a normal label above. so if design agrees this looks good, we could just say "do it this way" and close this PR without merging it.

the PR would allow for the top part (that gets truncated) to be something that is completely different than what gets copied, essentially replacing the label with something that becomes part of the clipboardcopy component: image

note that both examples can be expanded and collapsed to show that large text underneath.

gitdallas avatar Nov 28 '23 19:11 gitdallas

@mmenestr That was the original suggestion in the issue, yeah, which Dallas' second image above shows. There was some comments in the original issue with some worries about going that route (confusion as to what is actually getting copied). Dallas' first screenshot was one alternative mentioned in the original issue (there's also another alternative in there that would look similar to GitHub code blocks).

thatblindgeye avatar Nov 28 '23 20:11 thatblindgeye

I think this option makes the most sense to me: image

Personally, in the input field (pre-expansion), I would rather see a truncated version of what I will be copying rather than "this is what will be copied". I think that not seeing what you'll be copying at all unless you expand would be more confusing. We can add that added label if you think it would help, but I would hope that the context in which the copy to clipboard is placed would make that clear already

mmenestr avatar Nov 29 '23 19:11 mmenestr

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Jan 30 '24 03:01 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Apr 11 '24 07:04 stale[bot]

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Jun 10 '24 11:06 github-actions[bot]