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

Customise "Design (1)" addon tab with a count #107

Closed
5 tasks done
didoesdigital opened this issue Jun 16, 2021 · 2 comments · Fixed by #112
Closed
5 tasks done

Customise "Design (1)" addon tab with a count #107

didoesdigital opened this issue Jun 16, 2021 · 2 comments · Fixed by #112
Assignees
Labels
category: feature New feature or request good first issue Good for newcomers
Milestone

Comments

@didoesdigital
Copy link

Is your feature request related to a problem? Please describe.
Some stories contain design assets and some do not and the only way to know is to select the Design addon tab and see if it is empty or not. It would be more efficient to see the number of design assets linked as a count in the tab name.

Describe the solution you'd like
Let consumers customise the tab name.

Describe alternatives you've considered
By default, show the count of design assets i.e. show (1) when the tab contains 1 design asset and (0) when it contains none.

Design types

  • figma
  • experimental-figspec
  • link
  • image
  • iframe

Additional context
Add any other context or screenshots about the feature request here.

Current:

image

Desired:

design count

@didoesdigital didoesdigital added the category: feature New feature or request label Jun 16, 2021
@pocka pocka added the good first issue Good for newcomers label Jun 17, 2021
@pocka
Copy link
Collaborator

pocka commented Jun 18, 2021

It seems we can customize tab titles since Storybook v6.0. Here is the source code for Controls Addon.
https://github.com/storybookjs/storybook/blob/c6d9c7089e26549bd0a5f96a801a8757b6e961b7/addons/controls/src/register.tsx#L10-L15

Probably we can archive this feature request with the title() API and useParameters.

@pocka pocka added this to the v6.1 milestone Jul 3, 2021
@pocka pocka self-assigned this Jul 3, 2021
pocka added a commit that referenced this issue Jul 3, 2021
@pocka
Copy link
Collaborator

pocka commented Aug 21, 2021

v6.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: feature New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants