question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

addon-info works poorly with nesting & titles

See original GitHub issue

Describe the bug If you use a title or a nested folder in your story name, addon-info shows an ugly title and does not show the documentation for the component

To Reproduce Create a story with metadata in the title such as Components/ExampleComponent and then look at the story info pane

Expected behavior The title should not include any metadata and the class documentation should be visible

Screenshots Screenshot 2019-08-01 at 14 06 47 Screenshot 2019-08-01 at 14 06 56 Screenshot 2019-08-01 at 14 07 07

Code snippets example-component.jsx

import PropTypes from "prop-types";
import React from "react";

/**
 * This is an example component that displays words
 */
export function ExampleComponent({ words }) {
    return <p>{words}</p>;
}

ExampleComponent.propTypes = {
    /** What to show in the component */
    words: PropTypes.string,
};

ExampleComponent.defaultProps = {
    words: "Hello, World!",
};

example-component.stories.js

import { storiesOf } from "@storybook/react";
import React from "react";
import { ExampleComponent } from "./example-component";


let storyA = storiesOf("Components|ExampleComponent", module);
storyA.add("Example #1", () => <ExampleComponent />);

let storyB = storiesOf("Components/ExampleComponent", module);
storyB.add("Example #2", () => <ExampleComponent />);

let storyC = storiesOf("ExampleComponent", module);
storyC.add("Example #3", () => <ExampleComponent />);

System:

  System:
    OS: macOS 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i5-4308U CPU @ 2.80GHz
  Binaries:
    Node: 10.16.0 - /usr/local/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 75.0.3770.142
    Safari: 12.1.2

(ps: I also have Firefox 68.0.1 installed)

Additional context Story._getComponentDescription checks for a fulltext match against the story title, rather than a partial.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Lexicalitycommented, Aug 26, 2019

I’m aware, but unfortunately my team’s pretty busy right now and I’d vastly prefer to just fix what we’re currently using with a patch version update rather than spend any extra time changing things to a new system. 🙂

1reaction
shilmancommented, Aug 26, 2019

FYI addon-info is being superceded by addon-docs, which fixes a bunch of bugs and is easier to maintain. It’s reached release candidate (RC) status and will be properly released soon. Please give it a try! https://medium.com/storybookjs/storybook-docspage-e185bc3622bf

Read more comments on GitHub >

github_iconTop Results From Across the Web

@nlabs/storybook-addon-info NPM | npm.io
This addon works with Storybook for: React. Screenshot. Installation. Install the following npm module: npm i -D @nlabs/storybook-addon-info ...
Read more >
@storybook/addon-actions | Yarn - Package Manager
Features. CSF3: Add title prefix support for stories with custom titles (#17724) ... UI: Fix nesting issue for refs in sidebar component (#17726) ......
Read more >
Skinning Manual - Official Kodi Wiki
The nested element can be used as a placeholder for elements (controls) defined between the start-tag and end-tag of an include element. The ......
Read more >
L4D AddonInfo Authoring - Valve Developer Community
Title of the addon. Mind that the default addon menu can't show long titles in full. addonAuthor, Name of the author. addonURL0, Home...
Read more >
Answers Developer Questions | Atlassian Community
Managing nested groups via Crowd Rest API. After reviewing the rest api documentation for ... Hi, I'm working on a project where we...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found