Skip to content

Storybook: Missing stories for components #36128

Closed

Description

@mirka

Some @wordpress/components components don't have any stories in the Storybook, making it hard to audit or discover.

A quick list of the missing ones

$ cd packages/components/src && comm -23 <(find . -maxdepth 1 -type d | sort) <(find . -type d -name  'stories' | sed -E 's/(.+)\/stories/\1/g' | sort)
./animation
./autocomplete
./circular-option-picker
./clipboard-button
./color-control
./color-list-picker
./composite
./dashicon
./dimension-control
./disclosure
./focusable-iframe
./footer-message-control
./higher-order
./isolated-event-container
./menu-group
./menu-item
./mobile
./palette-edit
./shortcut
./style-provider
./ui
./utils

We should try to add stories when appropriate.

Activity

  1. added
    Storybook
    [Feature] Component System
    on Nov 1, 2021
  2. added
    [Package] Components
    [Type] Tracking Issue
    on Feb 16, 2022
  3. bangank36 commented on Jul 23, 2023

    @bangank36
    Contributor

    @mirka can external contributor contribute to the missing story? I am working with Gutenberg components and notice some missing components' story as well. thx

  4. mirka commented on Jul 24, 2023

    @mirka
    MemberAuthor

    @bangank36 Thanks for the offer! Which one specifically are you planning to add?

  5. bangank36 commented on Jul 25, 2023

    @bangank36
    Contributor

    I re-run your suggested commands for the list of the missing stories again

    Detail status of Storybook stories

    Edited on 08-Aug-2023

    Component TypeScript Storybook
    ./animation ✅ ➖
    ./autocomplete ✅ ❌
    ./clipboard-button ✅ ❌ Deprecated
    ./color-control ➖ ➖
    ./composite ➖ ➖
    ./dashicon ✅ ❌
    ./disclosure ➖ ➖
    ./focusable-iframe ❌ ❌
    ./footer-message-control ➖ ➖
    ./higher-order ➖ ➖
    ./isolated-event-container ✅ ❌
    ./menu-group ✅ ✅ PR
    ./menu-item ✅ PR ✅ PR
    ./mobile ➖ ➖
    ./shortcut ✅ ✅ 53627
    ./style-provider ✅ ➖
    ./ui ➖ #52953 ➖
    ./utils ➖ ➖

    Though there are some components I am not sure wether they should have stories or not, so I use ➖ to mark them as unknown, maybe a Gutenberg code owner can provide insights for them


    I think I can add stories for menu-group and menu-item, so far only menu-item-choice has story

    • Other side notes on /ui, which is referred as Next Component System, it has some stories on storybook
    1. FormGroup
    2. Spinner
    3. Tooltip
      Should ui be placed on separated category like Next Component? When first working with components I tried to import FormGroup from @wordpress/componets only to find out that it is part of other packages @wordpress/components/ui
  6. mirka commented on Jul 25, 2023

    @mirka
    MemberAuthor

    I think I can add stories for menu-group and menu-item, so far only menu-item-choice has story

    Yes, I think menu-group might be a good one to start. menu-item also needs a story, but in general it will be more efficient to migrate it to TypeScript first (part of #35744).

    • Other side notes on /ui, which is referred as Next Component System, it has some stories on storybook

    Thanks for reminding me about these, we've been meaning to clean them up a bit 😅 (#52953)

  7. bangank36 commented on Jul 27, 2023

    @bangank36
    Contributor

    menu-item

    I can see prevous effort of converting menu-item to typescript here #37020, will keep track on this.
    So menu-group as the start for amending story 👍

    cc: @mirka for the pending PR for menu-group story

  8. bangank36 commented on Aug 2, 2023

    @bangank36
    Contributor

    @mirka I submitted the PR and there is ⚠️ Type of PR label error, which should be adding by the code owner right? Thnks

  9. skorasaurus commented on Aug 4, 2023

    @skorasaurus
    Member

    @mirka I submitted the PR and there is ⚠️ Type of PR label error, which should be adding by the code owner right? Thnks

    @bangank36 I took care of this for you and added the label to the PR.

  10. bangank36 commented on Aug 5, 2023

    @bangank36
    Contributor

    @bangank36 I took care of this for you and added the label to the PR.

    I noticed, thank you so much @skorasaurus 🙇

  11. mirka commented on Aug 10, 2023

    @mirka
    MemberAuthor

    FYI our Storybook is very broken right now ☹️ #53502

    We'll try to get it fixed as soon as possible.

  12. mirka commented on Aug 10, 2023

    @mirka
    MemberAuthor

    FYI our Storybook is very broken right now ☹️ #53502

    Should be fixed soon by #53520 🎉

    Some related follow-up work is need on #53541

  13. bangank36 commented on Aug 14, 2023

    @bangank36
    Contributor

    Should be fixed soon by #53520 🎉

    That's great news, then I can contribute to the stories of MenuItem as followed up of the merged PR #53132, WIP Stories can be found on draft PR #53613

    • There is some issue with parsing JSDoc and Types controls on Storybook, I guess it is related to forwardRef, working on it...

    Some related follow-up work is need on #53541

    Per my understanding, it's the removal of subcomponents tab on Storybook V7 that leads to this task?
    image

    I also noticed some ongoing discussions and complains about this feature is removed upon upgrading as well
    developer questions , [Feature Request]: Subcomponents support

    Do you think it worth follow the workaround suggestions to bring back the subcomponents while waiting for the #53541 to be completed? As I can see some V7 Storybook that support the subcomponents eg:
    @psui preview.tsx / HoverCard stories

  14. bangank36 commented on Aug 25, 2023

    @bangank36
    Contributor

    @mirka Thanks for your valuable feedback on the recent PRs of MenuItem and Shortcut 🙇 , I'd like to keep contributing to Gutenberg, so far Text has not migrated to type and has no stories, I followed the checklist and I found some notes to get started

    Text (packages/components/src/text) (check truncate behaviors noted in this #38842 (review), try #38842 (comment) from adjustLineHeightForInnerControls)

  15. mirka commented on Aug 28, 2023

    @mirka
    MemberAuthor

    I'd like to keep contributing to Gutenberg, so far Text has not migrated to type and has no stories, I followed the checklist and I found some notes to get started

    Text (packages/components/src/text) (check truncate behaviors noted in this #38842 (review), try #38842 (comment) from adjustLineHeightForInnerControls)

    @bangank36 Wonderful. Let us know if you have any questions.

  16. ciampo commented on Oct 3, 2023

    @ciampo
    Contributor

    Hey @bangank36 , just wanted to note that the Text component is being refactored to TypeScript in #54953 — although I'm not sure we'll also look at improving the truncate behaviour (like suggested in the notes that you quoted above).

    I can see that a few more components now have stories. In the meantime, we've also tidied up (and removed) the ui folder.

    What's left to track in this issue?

  17. bangank36 commented on Oct 3, 2023

    @bangank36
    Contributor

    @ciampo I just updated the tracking table here #36128 (comment)
    On the Storybook column there are some leftovers components with no Stories, do you think these worth invest to?

  18. ciampo commented on Oct 3, 2023

    @ciampo
    Contributor

    Probably the only component that we could add stories for is Autocomplete — every other component listed there is deprecated or discouraged (as it is the case for dashicons).

    Do you have capacity to look into it?

  19. bangank36 commented on Oct 10, 2023

    @bangank36
    Contributor

    I will look into it if there is no PR currently! @ciampo

  20. ciampo commented on Oct 10, 2023

    @ciampo
    Contributor

    I will look into it if there is no PR currently! @ciampo

    Thank you! I'm not sure it's going to be easy to do so, because I vaguely remember the component being quite tightly coupled with other areas of Gutenberg. But please do give it a try and let me know how it goes!

  21. mirka commented on Dec 22, 2023

    @mirka
    MemberAuthor

    Closing this out since we basically have full coverage now, and a story for Autocomplete may be impractical. Thank you for all your help @bangank36!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Storybook[Feature] Component System[Package] Components[Type] Tracking Issue

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions