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: Improve path cleaning UI/UX #27997

Merged
merged 13 commits into from
Feb 1, 2025

Conversation

rafaeelaudibert
Copy link
Member

@rafaeelaudibert rafaeelaudibert commented Jan 28, 2025

Paths displayed on Web Analytics/Web Vitals table now properly render them using the new readable format for them, assuming people use the suggested <slug> format

image
image

I've also made path cleaning a top-level filter on Web Analytics because I want to push people to use it to increase adoption. Once people have them set-up, the toolbar will be a no-brainer to explore Web Vitals

image
image

We've also changed how filtering works so that if someone has path cleaning enabled and clicks in one of the cleaned paths, we'll properly display results for that filter 🎉. To make things even, we've added this feature to Web Vitals as well.

@rafaeelaudibert
Copy link
Member Author

@robbie-c In case you're wondering where I'm going with this, I need the capability to, when looking from the toolbar, see all of the events from that page after it's been aliased, so I need whatever I'm implementing in the following PR, this one is just cleaning this up and making the feature slightly more useful

Copy link
Contributor

github-actions bot commented Jan 28, 2025

Size Change: +123 B (+0.01%)

Total Size: 1.16 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.16 MB +123 B (+0.01%)

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

  • chromium: 0 added, 4 modified, 0 deleted (diff for shard 1)
  • 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 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@rafaeelaudibert rafaeelaudibert force-pushed the path-cleaning-on-filters-for-web-analytics branch from 7ca5470 to 247bfc8 Compare January 29, 2025 18:43
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@rafaeelaudibert rafaeelaudibert enabled auto-merge (squash) January 30, 2025 21:51
@rafaeelaudibert
Copy link
Member Author

Thanks for merging with master @robbie-c, would love a review :)

Copy link
Member

@robbie-c robbie-c left a comment

Choose a reason for hiding this comment

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

Apologies that this is a partial review - will finish the review tomorrow morning my time

Rules that you set here will be applied before wildcarding and other regex replacement if the toggle
is switched on.
Rules that you set here will be applied before wildcarding and other regex replacement if path
cleaning is switched on in Product and Web Analytics.
Copy link
Member

Choose a reason for hiding this comment

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

I went through the other products to see if I could find somewhere else that used this - for some reason I thought replay did too - but it's really just these :)

<Tooltip
title={
<span>
Path Breakdown is more useful when path cleaning is turned on.{' '}
Copy link
Member

Choose a reason for hiding this comment

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

Aggressive copy but I like it :)

@@ -234,10 +234,33 @@ def _expr_to_compare_op(
return ast.CompareOperation(op=ast.CompareOperationOp.LtEq, left=expr, right=ast.Constant(value=value))
elif operator == PropertyOperator.GTE:
return ast.CompareOperation(op=ast.CompareOperationOp.GtEq, left=expr, right=ast.Constant(value=value))
elif operator == PropertyOperator.IS_CLEANED_PATH_EXACT:
Copy link
Member

Choose a reason for hiding this comment

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

I need to think about this a bit more, but it seems like if we were going the route of adding new PropertyOperators, there's a few more along similar lines that would be really useful. Obviously the negated version. Also maybe a startsWith?

My worry is that this approach would lead to an explosion of operators. Is there a good way of having this power without making it too hard for people to find it?

Copy link
Member Author

Choose a reason for hiding this comment

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

The thing is, Im not adding it as an operator that can be selected in the UI at the moment, Im dynamically translating it to this operator when needed.

I see the benefit to creating them "for real" eventually, but it's not something we need now.

I couldnt come up with a more elegant solution, any ideas?

Copy link
Member

Choose a reason for hiding this comment

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

Ah if it's not in the UI then I'm less worried, that makes sense

@robbie-c robbie-c self-requested a review January 31, 2025 13:26
@@ -689,7 +706,7 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([
}
: undefined

// the queries don't currently revenue when the conversion goal is an action
// the queries don't currently include revenue when the conversion goal is an action
Copy link
Member

Choose a reason for hiding this comment

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

🙃

Copy link
Member

@robbie-c robbie-c left a comment

Choose a reason for hiding this comment

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

Broadly, this looks great! I approve, and props for improving this.

I haven't had a chance to run this locally yet - but one thing I am concerned about is backwards compatability. I would like to see something that shows that this has been considered. Either:

  • put it behind a FF so we can roll out slowly and revert if a customer's use case breaks
  • write some tests to show that backwards compat is fine
  • write a big comment explaining why everything is backwards compatible

Copy link
Member

@robbie-c robbie-c left a comment

Choose a reason for hiding this comment

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

Approved but add a FF :)

rafaeelaudibert and others added 12 commits January 31, 2025 13:46
Ideally we'd want a smaller button, but people aren't familar with path cleaning yet, so let's make it slightly exaggerated
This is now much cleaner, and we also have a way to test what the path will look like once cleaned
Paths displayed on Web Analytics/Web Vitals table now properly render them using the new readable format for them, assuming people use the suggested `<slug>` format

In a future PR we'll enable people to filter by cleaned paths, making cleaned paths much more powerful for WA/WV
We're now allowing us to filter by cleaned path, which makes our UI slightly more powerful. If you select a cleaned path and `doPathCleaning` is set, we can see results from a specific cleaned path. The UX isn't great because it looks kinda wonky, and I'm pretending it's a `EXACT` match (which kinda is?) and you can't get into that state unless you click on a path in the UI, but it does work, so I think this is a win. Eventually once we have `$pathname` a high-level filter (rather than just another filter) we'll be able to make this behave better.

Web Vitals is coming in the next commit
Now, if path cleaning is enabled and I filter by a path that would be
cleaned, we display data from the filtered path instead
You can now click on a path on web vitals path breakdown to add it to the filter
We don't need to calculate that before hand, we can simply pass the metric to the function and it knows how to handle it
We don't believe we'll need to disable this in the future, but let's keep this around as a safety switch
@rafaeelaudibert rafaeelaudibert force-pushed the path-cleaning-on-filters-for-web-analytics branch from d27ad19 to 16c0621 Compare January 31, 2025 17:08
@rafaeelaudibert
Copy link
Member Author

FF added on 16c0621, will merge this with 100% turned on, will act as a kill-switch, thanks!

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@rafaeelaudibert rafaeelaudibert changed the title feat: Improve path cleaning UI feat: Improve path cleaning UI/UX Feb 1, 2025
@rafaeelaudibert rafaeelaudibert merged commit 1253d96 into master Feb 1, 2025
101 checks passed
@rafaeelaudibert rafaeelaudibert deleted the path-cleaning-on-filters-for-web-analytics branch February 1, 2025 03:28
thmsobrmlr pushed a commit that referenced this pull request Feb 3, 2025
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Robbie <robbie.coomber@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants