PostHog / posthog

🦔 PostHog provides open-source product analytics, session recording, feature flagging and A/B testing that you can self-host.
https://posthog.com
Other
21.23k stars 1.26k forks source link

feat(insights): add support for query based insights to insight icon #23484

Closed thmsobrmlr closed 3 months ago

thmsobrmlr commented 3 months ago

Problem

The <InsightIcon /> component doesn't support query based "regular" insights and renders all of them as trends insights. All other insights are rendered as "brackets" icon.

Changes

This PR adapts the component to use the icon from the query based metadata. Meaning "regular" insights work as before and other insights have the same icon they use elsewhere in the app.

~Note: This means HogQL insights aren't rendered as "brackets" any more, but as a "table chart". While this is more consistent throughout the app, I kind of liked the icon from before.~ A couple of icons have been adapted, see screenshots:

Before

Screenshot 2024-07-05 at 09 53 37

After

Screenshot 2024-07-05 at 09 41 51

How did you test this code?

Locally, with :eyes:

github-actions[bot] commented 3 months ago

Size Change: 0 B

Total Size: 1.07 MB

ℹ️ View Unchanged | Filename | Size | | :--- | :---: | | `frontend/dist/toolbar.js` | 1.07 MB |

compressed-size-action