Closed guigueb closed 3 years ago
Hi @guigueb We’re comfortable with code snippet only having the copy action for now. There are existing patterns like the text toolbar that could be used in conjunction with this to give you more functionality or you can always override if you really need to. If we receive more requests like this in the future we may reconsider.
I’m closing this issue out, but please know we’re still working on how to best address #7574. Thank you for bringing these issues involving code snippet to our attention.
Summary
Currently CodeSnippet supports the action to copy. Consider adding actions like print, share, and client supplied actions.
This will need design than development.
Justification
To allow more actions than copy. IBM Cognos had the ability to launch a product with the contents of the snippet.
Desired UX and success metrics
A client may want to give the user the ability to print the snippet. Rather than making the user copy/paste in order to print lets supply a print button.
Discussions on this topic brought up the idea of a CodeSnippet Toolbar. The toolbar could contain actions - copy, print, share, etc. The toolbar could also have a 'wrapText' button which would likely address CodeSnippet: the scrollable content needs to be WCAG 1.4.10 compliant, initial setting based on the wrapText prop. The toolbar could also have a 'include line numbers' button which would likely address [code snippet] add number line modifier, initial setting based on a prop.
Along with standard opt-in out-of-the-box actions, there should be a way for clients to insert their own actions.
"Must have" functionality
unknown
Specific timeline issues / requests
IBM Cognos has already shipped by overloading the Copy button with an action to Copy and Share.
Available extra resources
unknown