Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web-analytics): Hide persons for web analytics #18445

Merged
merged 9 commits into from
Nov 9, 2023

Conversation

robbie-c
Copy link
Member

@robbie-c robbie-c commented Nov 7, 2023

Problem

Web analytics won't have the concept of persons, so hide them from the UI.

Additionally, filtering by country could be easier

Changes

Make the world map clickable to filter for users of that country only, by adding chart-specific rendering options. Right now these only exists for the world map but could be expanded.

How did you test this code?

Ran manually

dashboardItemId: `new-AdHoc.${key}`,
query,
setQuery,
...(context?.insightProps || {}),
Copy link
Member Author

@robbie-c robbie-c Nov 7, 2023

Choose a reason for hiding this comment

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

Flagging this change - I don't have enough context to be 100% certain this is safe

Update: this change no longer exists

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure either... I see the main change is that you added three things to this insightLogicProps:

    hidePersonsModal?: boolean
    suppressSessionAnalysisWarning?: boolean
    chartRenderingMetadata?: ChartRenderingMetadata

The existing insight logic props have to do with just the insight ID or cached results, these are very specific toggles for some specific insights. My first reaction is that they feel out of place. Since they do affect how the insight is displayed, should/could they just be part of the query node itself?

Copy link
Member Author

@robbie-c robbie-c Nov 8, 2023

Choose a reason for hiding this comment

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

Do you think they make more sense as part of QueryContext? I initially started there, essentially being consistent with the UI-only props for DataTables. Otherwise they could potentially go on InsightQueryBase, if we wanted them as part of the actual query node. I could also put them on any of the children of that (like e.g. TrendsQuery), but I don't like that as much, because they are more about the chart than the insight type.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm I guess putting them on the InsightVizNode could also work

Copy link
Collaborator

Choose a reason for hiding this comment

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

Toggling these will not affect the fetched data, so the InsightVizNode seems like the better option indeed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah the chartRenderingMetadata contains a function so can't go inside the query node

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could that be passed in the context for the <Query> tag?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, we currently don't pass this into the Trends component, but some of the ActionX components can receive it as a prop, so I can change how this is wired up.

My plan is to split this, with the chart rendering functions moving to the context, and the other ones moving to the InsightViz node.

Sent from my iPhone

Copy link
Member Author

Choose a reason for hiding this comment

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

This re-wiring is done, I only touched the TrendInsight component and not the others e.g. FunnelInsight but it would be very simple to wire those up the same way if needed later

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@robbie-c robbie-c force-pushed the hide-persons-for-web-analytics branch from a704922 to 58c2840 Compare November 7, 2023 14:28
@robbie-c robbie-c changed the title Hide persons for web analytics feat(web-analytics): Hide persons for web analytics Nov 7, 2023
@robbie-c robbie-c marked this pull request as ready for review November 7, 2023 14:29
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@robbie-c robbie-c force-pushed the hide-persons-for-web-analytics branch from 50f560a to 6cd4140 Compare November 7, 2023 14:53
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@robbie-c robbie-c force-pushed the hide-persons-for-web-analytics branch 2 times, most recently from 5e2d9f3 to 8c2aded Compare November 8, 2023 17:43
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

3 snapshot changes in total. 0 added, 3 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

3 snapshot changes in total. 0 added, 3 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@robbie-c robbie-c force-pushed the hide-persons-for-web-analytics branch from 8546209 to 39a9ce1 Compare November 9, 2023 09:12
@robbie-c robbie-c force-pushed the hide-persons-for-web-analytics branch from 39a9ce1 to c0f4ad1 Compare November 9, 2023 09:23
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (wasn't pushed!)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@robbie-c robbie-c force-pushed the hide-persons-for-web-analytics branch from 184d4ae to 501bf9a Compare November 9, 2023 10:44
@robbie-c robbie-c enabled auto-merge (squash) November 9, 2023 10:44
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 0 modified, 0 deleted
  • webkit: 0 added, 1 modified, 0 deleted (wasn't pushed!)

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@robbie-c robbie-c merged commit 1f50637 into master Nov 9, 2023
73 checks passed
@robbie-c robbie-c deleted the hide-persons-for-web-analytics branch November 9, 2023 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants