Shopify / polaris-viz

A collection of React and React native components that compose Shopify's data visualization system
https://polaris-viz.shopify.dev
Other
335 stars 26 forks source link

Allow `ReactNode` in `annotation.content.content` #1725

Open philschoefer opened 2 months ago

philschoefer commented 2 months ago

Feature request summary

Allow annotations to contain ReactNodes in the content property. Currently we only allow for string.

Rationale

The admin is hacking react nodes into the annotation as part of the web vitals reports and we will also need this for the UA annotations feature @LevonCross is building out (hover over the "1" in the prototype).

We are also using this for annotations in UA to be able to group annotations that fall on to the same key.

Potential other solution to this could be to make Polaris Viz smarter in the sense that it can group annotations on the same key (e.g. if there are other concerns with changing it to ReactNode). In this case we would need to expand the existing Annotation type so it can take in all the props necessary for the updated designs.


🌟 Feature requests that are not yet planned will be closed. We then use the issue’s :+1: upvotes to track and set priorities. See the contribution guidelines for more information.