storybookjs / storybook

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

[Feature Request]: File Selection: Show coverage for all relevant files #28630

Open valentinpalkovic opened 1 month ago

valentinpalkovic commented 1 month ago

To provide comprehensive coverage information, we need to ensure that the coverage reports in the Storybook UI display coverage data for all relevant files associated with a component. This includes not only the main component file but also any related files such as utility modules and stylesheets. The goal is to aggregate and display a complete picture of coverage for each component.

Tasks

Define Relevant Files

Modify Coverage Data Collection

Integrate Coverage Data in Storybook

(Optional) Handle Edge Cases

Documentation

Acceptance Criteria:

greptile-apps[bot] commented 1 month ago

Disclaimer This information might be inaccurate, due to it being generated automatically To show coverage for all relevant files in the Measure addon, follow these steps:

  1. Update src/manager.tsx:

    • Modify the Tool component to include logic for displaying file coverage.
  2. Modify src/preview.tsx:

    • Ensure withMeasure decorator includes coverage data.
  3. Enhance src/util.ts:

    • Add utility functions to fetch and process coverage data.
  4. Extend src/box-model/visualizer.ts:

    • Update drawBoxModel to visualize coverage on the canvas.
  5. Adjust src/box-model/labels.ts:

    • Ensure labels reflect coverage information.
  6. Update src/box-model/canvas.ts:

    • Modify drawing functions to include coverage highlights.

References

/code/addons/measure /code/addons/measure/src /code/addons/measure/src/box-model /code/addons/measure/src/box-model/canvas.ts /code/addons/measure/src/box-model/labels.ts /code/addons/measure/src/box-model/visualizer.ts /code/addons/measure/src/index.ts /code/addons/measure/src/manager.tsx /code/addons/measure/src/preview.tsx /code/addons/measure/src/util.ts

#### About Greptile This response provides a starting point for your research, not a precise solution. Help us improve! Please leave a ๐Ÿ‘ if this is helpful and ๐Ÿ‘Ž if it is irrelevant. [Ask Greptile](https://app.greptile.com/chat/github/storybookjs/storybook/next) ยท [Edit Issue Bot Settings](https://app.greptile.com/apps/github)