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

fix(funnel): always use total step count for funnel chart label #14993

Merged
merged 4 commits into from
Apr 6, 2023

Conversation

EDsCODE
Copy link
Member

@EDsCODE EDsCODE commented Apr 5, 2023

Problem

  • on a breakdown, the funnel count label was tied to the "first" breakdown series data but this is faulty when breakdown funnel charts with baseline disabled were used

Changes

Before:
Screenshot 2023-04-05 at 2 16 46 PM

After:
Screenshot 2023-04-05 at 2 16 24 PM

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

How did you test this code?

@EDsCODE EDsCODE requested review from neilkakkar and liyiy April 5, 2023 18:17
@EDsCODE
Copy link
Member Author

EDsCODE commented Apr 5, 2023

Followup:

The experience is weird when you deselect specific breakdowns from the visualization. We're not subtracting from the aggregate which maybe we should as it leads to a confusing visualization

@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
  • firefox: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@@ -114,14 +114,14 @@ export function FunnelBarChartComponent({
<td key={stepIndex}>
{isUsingDataExploration ? (
<StepLegendDataExploration
step={step.nested_breakdown?.length ? step.nested_breakdown[0] : step}
step={step}
Copy link
Collaborator

Choose a reason for hiding this comment

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

wow this is clever!

I'm slightly scared this doesn't work for other existing use cases, but not sure, basic ones seem to all work

Copy link
Member Author

Choose a reason for hiding this comment

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

it should mirror how the logic is handled on horiztonal bar charts. (those don't have the same bug)

Copy link
Contributor

Choose a reason for hiding this comment

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

I hope this won't break anything but I think it might but let's see xD (why did we have step.nested_breakdown[0] originally ? )

Copy link
Contributor

Choose a reason for hiding this comment

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

I would assume for a funnel like this https://app.posthog.com/insights/IlZLZRIH it might break but I could be wrong

Copy link
Collaborator

@Twixes Twixes Apr 5, 2023

Choose a reason for hiding this comment

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

This PR is literally a pure revert of this one: #10750 – so I guess this might break the persons modal link. Can you give this a check?

Copy link
Member Author

@EDsCODE EDsCODE Apr 6, 2023

Choose a reason for hiding this comment

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

I think #11665 may have fixed #10691 so now the suggested changes here can work—but it's also not clear to me why. I just tested locally and breakdown persons on funnels work

Copy link
Collaborator

Choose a reason for hiding this comment

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

Awesome, seems to be correct. Let's replace this Chesterton's fence

@@ -114,14 +114,14 @@ export function FunnelBarChartComponent({
<td key={stepIndex}>
{isUsingDataExploration ? (
<StepLegendDataExploration
step={step.nested_breakdown?.length ? step.nested_breakdown[0] : step}
step={step}
Copy link
Collaborator

@Twixes Twixes Apr 5, 2023

Choose a reason for hiding this comment

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

This PR is literally a pure revert of this one: #10750 – so I guess this might break the persons modal link. Can you give this a check?

@@ -114,14 +114,14 @@ export function FunnelBarChartComponent({
<td key={stepIndex}>
{isUsingDataExploration ? (
<StepLegendDataExploration
step={step.nested_breakdown?.length ? step.nested_breakdown[0] : step}
step={step}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Awesome, seems to be correct. Let's replace this Chesterton's fence

@Twixes Twixes merged commit 2ab767f into master Apr 6, 2023
@Twixes Twixes deleted the funnel-chart-incorrect-number branch April 6, 2023 15:26
fuziontech added a commit that referenced this pull request Apr 7, 2023
* master:
  fix(flags): don't enclose in overall transaction so we get latest reads (#15003)
  fix(tests): make getEventsByPerson output stable to avoid flakes (#15009)
  feat(data-exploration): convert funnel correlation to data exploration (#14963)
  fix: Set hobby deployments to 'latest' by default (#14956)
  feat(hogql): lambdas (#14987)
  feat(hogql): arrays and tuples (#14986)
  fix(funnel): always use total step count for funnel chart label (#14993)
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.

5 participants