Repository navigation
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Premium Analytics plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Stats Data plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryThis 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. 🤷 |
Fixes WOOA7S-2544
Proposed changes
Fix a hidden legend item, such as Prev. 7 days, showing on top of a chart tooltip that reaches down over the legend. Visible legend items were already covered.
The cause: a dimmed legend item is its own paint layer, and it comes after the plot, so it painted over the plot's tooltip. The plot now sits above its legend, and the chart as a whole is isolated instead of just the plot, so a sticky page header still paints over the chart and its tooltip.
This is in the shared chart layout of
@automattic/charts, so every bar, line and area chart gets it. Line chart annotations stay above the plot, and pie, semi-circle and heatmap charts drop their own isolation, which the layout now provides.Notice the bottom row of the tooltip: before, Prev. 7 days paints through it. The visible Views and Visitors items are covered in both.
Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Setup
pnpm install, then start the monorepo Storybook:cd projects/js-packages/storybook && pnpm run storybook:dev.Hidden legend item under the tooltip
width: 260px; height: 265px, so the tooltip reaches the legend.Page chrome still paints over the chart
const h = document.createElement('div'); Object.assign(h.style, { position: 'fixed', left: 0, right: 0, top: document.querySelector('.visx-tooltip').getBoundingClientRect().top + 20 + 'px', height: '40px', background: 'gold', zIndex: 1 }); document.getElementById('storybook-root').prepend(h);Annotations and other charts