-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
feat(addon-notes): use @storybook/router <Link> to render links in notes #6398
Conversation
…relative urls in markdown notes
This pull request is automatically deployed with Now. Latest deployment for this branch: https://monorepo.storybook.now.sh |
Codecov Report
@@ Coverage Diff @@
## next #6398 +/- ##
==========================================
+ Coverage 38.31% 38.35% +0.03%
==========================================
Files 649 649
Lines 9857 9863 +6
Branches 388 389 +1
==========================================
+ Hits 3777 3783 +6
Misses 6020 6020
Partials 60 60
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## next #6398 +/- ##
=======================================
Coverage ? 40.85%
=======================================
Files ? 616
Lines ? 8523
Branches ? 536
=======================================
Hits ? 3482
Misses ? 4949
Partials ? 92
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Issue: #6394
What I did
Links in the notes addon cause storybook to reload. This is not the best user experience when the link points to a different story. Since storybook uses a client side router already, I used the
overrides
option inmarkdown-to-jsx
to use a custom<NotesLink />
component for all markdown links. It basically uses normal<a>
tags for absolute links (external) and the@storybook/router
<Link />
for internal links (relative). That way, nothing breaks and storybook uses the
@reach/router
in addon notes when it can.How to test
Yes, I added tests and an example in the svelte kitchen sink app.
I added a relative link in the svelte kitchen sink app but this is nothing where users have to do anything different.
No.
If your answer is yes to any of these, please make sure to include it in your PR.