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

Add copy button for individual story #6719

Merged
merged 2 commits into from
Jun 4, 2019

Conversation

thollander
Copy link
Contributor

Issue: #6708

What I did

Add copy button to get individual story link.

How to test

There should be a copy button on all stories.

@vercel
Copy link

vercel bot commented May 5, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://monorepo-git-fork-thollander-6708-add-copy-button.storybook.now.sh

@thollander thollander force-pushed the 6708-add-copy-button branch from 13734e5 to cd34ea2 Compare May 5, 2019 22:55
@vercel vercel bot temporarily deployed to staging May 5, 2019 22:55 Inactive
@thollander thollander force-pushed the 6708-add-copy-button branch from cd34ea2 to a580bb6 Compare May 5, 2019 22:58
@shilman
Copy link
Member

shilman commented May 6, 2019

@thollander thanks for adding this! the snapshot tests are currently failing due to the change -- would you mind updating the snapshots with yarn test --core --update?

@thollander
Copy link
Contributor Author

@shilman, sure ! thanks for the tip.

@shilman shilman added this to the 5.1.0 milestone May 6, 2019
@ndelangen
Copy link
Member

@domyen WDYT?

Copy link
Member

@ndelangen ndelangen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me, would like @domyen design eye on this.

@ajitbohra
Copy link

ajitbohra commented May 9, 2019

Looks good, small suggestion would be good to have some visual feedback that link is copied.

@thollander
Copy link
Contributor Author

What kind of visual feedback would you put ?
Because you already have a visual feedback with the blue focus :
image

For instance on GitHub, you only have a blue border :
image

@storybookjs storybookjs deleted a comment from stale bot Jun 3, 2019
@ndelangen ndelangen modified the milestones: 5.1.0, 5.2.0 Jun 3, 2019
@domyen
Copy link
Member

domyen commented Jun 3, 2019

lgtm

@ndelangen ndelangen modified the milestones: 5.2.0, 5.1.0 Jun 3, 2019
@shilman
Copy link
Member

shilman commented Jun 4, 2019

Sneaking this into 5.1

@shilman shilman merged commit 6265d99 into storybookjs:next Jun 4, 2019
@ndelangen
Copy link
Member

Thanks for the contribution @thollander !

@thollander
Copy link
Contributor Author

No problem @ndelangen !

@Hypnosphi
Copy link
Member

Hypnosphi commented Jun 5, 2019

@thollander @domyen can we instead make the "Open canvas" control a link instead of a button? Then we would get all the benefits of native HTML links, which include:

– Ability to copy the href from context menu
– Ability to open it in new tab or window using context menu or cmd/ctrl/shift+click or mouse wheel click
– Href is displayed in a corner of browser window on hover
– Builtin support for assistive technologies

@ndelangen
Copy link
Member

That sounds like a good improvement indeed!

This would merge both use cases into a single piece of UI.
Maybe a tooltip would be in order?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants