Skip to content
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

CodeSnippet: allow more actions then copy #8322

Closed
guigueb opened this issue Apr 7, 2021 · 1 comment
Closed

CodeSnippet: allow more actions then copy #8322

guigueb opened this issue Apr 7, 2021 · 1 comment
Labels
component: code-snippet proposal: open This request has gone through triaging. We're determining whether we take this on or not. type: enhancement 💡

Comments

@guigueb
Copy link
Contributor

guigueb commented Apr 7, 2021

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

@johnbister
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: code-snippet proposal: open This request has gone through triaging. We're determining whether we take this on or not. type: enhancement 💡
Projects
None yet
Development

No branches or pull requests

3 participants