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

feat(addon-notes): use @storybook/router <Link> to render links in notes #6398

Merged
merged 5 commits into from
Apr 26, 2019

Conversation

sto3psl
Copy link
Contributor

@sto3psl sto3psl commented Apr 3, 2019

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 in markdown-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

  • Is this testable with Jest or Chromatic screenshots?
    Yes, I added tests and an example in the svelte kitchen sink app.
  • Does this need a new example in the kitchen sink apps?
    I added a relative link in the svelte kitchen sink app but this is nothing where users have to do anything different.
  • Does this need an update to the documentation?
    No.

If your answer is yes to any of these, please make sure to include it in your PR.

@sto3psl sto3psl requested a review from alexandrebodin as a code owner April 3, 2019 09:51
@vercel
Copy link

vercel bot commented Apr 3, 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.storybook.now.sh

@codecov
Copy link

codecov bot commented Apr 3, 2019

Codecov Report

Merging #6398 into next will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
addons/notes/src/Panel.tsx 50% <100%> (+7.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2948c7b...eeb1264. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 3, 2019

Codecov Report

❗ No coverage uploaded for pull request base (next@8aae29d). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##             next    #6398   +/-   ##
=======================================
  Coverage        ?   40.85%           
=======================================
  Files           ?      616           
  Lines           ?     8523           
  Branches        ?      536           
=======================================
  Hits            ?     3482           
  Misses          ?     4949           
  Partials        ?       92
Impacted Files Coverage Δ
addons/notes/src/Panel.tsx 38.88% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8aae29d...d94a03a. Read the comment docs.

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.

Awesome!

@ndelangen ndelangen self-assigned this Apr 11, 2019
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.

3 participants