Skip to content

Conversation

annacmc
Copy link
Contributor

@annacmc annacmc commented Oct 15, 2025

fixes: #CHARTS-37

Proposed changes:

  • Add Dimensions category to shared chart argTypes for width/height controls
  • Create tooltipArgTypes configuration with Tooltips category for tooltip-related controls
  • Add Visual Style and Labels categories to pie chart controls
  • Add Data and Visual Style categories to line chart controls
  • Add Glyphs category to line chart glyph controls (withStartGlyphs, withEndGlyphs, withLegendGlyph, glyphType, glyphSize)
  • Add Data and Visual Style categories to bar chart controls (orientation, gridVisibility, seriesCount, withPatterns)

This PR organizes Storybook controls into logical categories (Data, Visual Style, Labels, Glyphs, Tooltips, Dimensions) to make the controls panel easier to navigate and use. All existing stories and exports are preserved - no consolidation or removal of stories.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Does this pull request change what data or activity we track or use?

No, it does not.

Testing instructions:

  • Open Storybook and navigate to any chart type (Bar Chart, Line Chart, Pie Chart)
  • In the Controls panel, verify that controls are now organized into categories:
    • Data: Controls like seriesCount, dataVariant
    • Visual Style: Controls like orientation, gridVisibility, smoothing, curveType, withGradientFill, withPatterns
    • Labels: Controls for label display and formatting
    • Glyphs: Controls for glyph display (withStartGlyphs, withEndGlyphs, withLegendGlyph, glyphType, glyphSize)
    • Tooltips: Controls for tooltip configuration
    • Dimensions: Controls for width, height, dimensionMode
    • Legend: Controls for legend configuration
  • Verify all existing stories still render correctly
  • Test interacting with categorized controls to ensure they work as expected
  • Confirm no TypeScript errors
  • Verify no visual regressions in any chart types

@annacmc annacmc added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. labels Oct 15, 2025
@annacmc annacmc self-assigned this Oct 15, 2025
Copy link
Contributor

github-actions bot commented Oct 15, 2025

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the charts-legend-control-cleanup branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack charts-legend-control-cleanup

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

Copy link
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

Copy link

jp-launch-control bot commented Oct 15, 2025

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

@annacmc annacmc requested a review from Copilot October 15, 2025 04:22
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR organizes Storybook controls for chart components into logical categories to improve usability and navigation. Instead of having scattered controls, they are now grouped into meaningful sections like Data, Visual Style, Labels, Glyphs, Tooltips, and Dimensions.

Key changes include:

  • Created a shared tooltip configuration module with categorized argTypes
  • Added category groupings to existing chart controls across pie, line, and bar chart stories
  • Organized dimension-related controls in the shared chart decorator

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tooltip-config.tsx New module providing shared tooltip argTypes with Tooltips category
index.ts Exports the new tooltip configuration
chart-decorator.tsx Adds Dimensions category to shared chart controls
pie-chart/stories/index.stories.tsx Categorizes pie chart controls into Visual Style, Labels, and Dimensions
line-chart/stories/index.stories.tsx Adds Data, Dimensions, and Visual Style categories to line chart controls
line-chart/stories/glyph.stories.tsx Groups glyph-related controls under Glyphs category
bar-chart/stories/index.stories.tsx Organizes bar chart controls into Data and Visual Style categories
changelog/charts-37-use-the-controls-to-put-similar-stories-together Documents the change

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@annacmc annacmc requested review from a team, adamwoodnz and kangzj October 15, 2025 10:17
@annacmc annacmc marked this pull request as ready for review October 15, 2025 10:17
description: 'Grid line visibility',
table: { category: 'Visual Style' },
},
seriesCount: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This arg doesn't work in my testing. It doesn't affect how many series displayed.

description: 'Show glyphs in legend',
table: { category: 'Glyphs' },
},
glyphType: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This arg doesn't work in my testing. It doesn't affect how many series displayed.

description: 'Glyph shape',
table: { category: 'Glyphs' },
},
glyphSize: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This arg doesn't work in my testing. It doesn't affect how many series displayed.

title: 'JS Packages/Charts/Types/Line Chart',
argTypes: {
...lineChartMetaArgs.argTypes,
seriesCount: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This arg doesn't work in my testing. It doesn't affect how many series displayed.

export { legendArgTypes } from './legend-config';

// Tooltip configuration
export { tooltipArgTypes, lineChartTooltipArgTypes } from './tooltip-config';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find where those two exports are used 🤔

Copy link
Contributor

@adamwoodnz adamwoodnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on the groupings! Noted mostly the same non-functional controls as @kangzj

description: 'Number of data series',
table: { category: 'Data' },
},
dimensionMode: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one has no effect for me either and isn't a LineChart prop, maybe we need some typing on these args (to help AI?)

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

Labels

[JS Package] Charts RNA [Status] In Progress [Status] Needs Review This PR is ready for review. [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants