addon-info works poorly with nesting & titles
See original GitHub issueDescribe 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
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:
- Created 4 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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. 🙂
FYI
addon-info
is being superceded byaddon-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