storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.72k stars 9.32k forks source link

Manager: Add tags property to GroupEntry objects #29672

Open Sidnioulz opened 2 days ago

Sidnioulz commented 2 days ago

What I did

I edited the code converting the story index to story hashes for use in the manager (transformStoryIndexToStoriesHash), to add a tags property for 'group' entries, which is the intersection of all their stories' hashes.

This is the 'group' counterpart of https://github.com/storybookjs/storybook/pull/29343. I am opening the PR because users of my addon have come to me requesting support for badges in group entries of the sidebar, which requires that tags are also computed for these: https://github.com/Sidnioulz/storybook-addon-tag-badges/issues/20.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

Still not sure how/where to document this, like I pointed out in the component PR.

Checklist for Maintainers

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

_core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>_

Greptile Summary

Added support for tags in GroupEntry objects within the Storybook manager's sidebar, computing them as the intersection of child stories' tags.

nx-cloud[bot] commented 2 days ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 247e65cde81b6a4f5707ed610f4b42cfe1727c43. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target - [`nx run-many -t build --parallel=3`](https://cloud.nx.app/runs/gDXz3ZIjq8?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.