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(retention): filters on start/return event #27770

Merged
merged 11 commits into from
Jan 22, 2025
Merged

Conversation

anirudhpillai
Copy link
Contributor

@anirudhpillai anirudhpillai commented Jan 22, 2025

Problem

Closes #13235

Changes

  • Support filtering the start/return event in retention insight.
  • Some UX changes. Soon we'll be adding more features to retention insight to be able to calculate property values so eventually the UI will look similar to below (minus the number of days option in 'condition')
image

But for now to make incremental upgrades, I've only changed things to be like below
image

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

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

Added tests

@anirudhpillai anirudhpillai requested a review from a team January 22, 2025 11:03
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

github-actions bot commented Jan 22, 2025

Size Change: +703 B (+0.06%)

Total Size: 1.16 MB

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

compressed-size-action

Copy link
Contributor

@thmsobrmlr thmsobrmlr left a comment

Choose a reason for hiding this comment

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

Works great!

I'd personally want something like "Retention Condition" instead of just "Condition" in the filters heading.

And it would be great to fix the feature that keeps the insight configuration when navigating between insights for the retention entities at some point:

// // set series (first two entries) from retention target and returning entity
// if (isRetentionQuery(query)) {
// const { targetEntity, returningEntity } = query.retentionFilter || {}
// const series = actionsAndEventsToSeries({
// events: [
// ...(targetEntity?.type === 'events' ? [targetEntity as ActionFilter] : []),
// ...(returningEntity?.type === 'events' ? [returningEntity as ActionFilter] : []),
// ],
// actions: [
// ...(targetEntity?.type === 'actions' ? [targetEntity as ActionFilter] : []),
// ...(returningEntity?.type === 'actions' ? [returningEntity as ActionFilter] : []),
// ],
// })
// if (series.length > 0) {
// newCache.series = [...series, ...(cache?.series ? cache.series.slice(series.length) : [])]
// }
// }

@thmsobrmlr
Copy link
Contributor

Also it looks like my colors changes broke the retention modal - working on a fix.

@anirudhpillai anirudhpillai merged commit 97b2fba into master Jan 22, 2025
99 checks passed
@anirudhpillai anirudhpillai deleted the feat/retention-2025 branch January 22, 2025 14:36
fuziontech added a commit that referenced this pull request Jan 22, 2025
* master: (103 commits)
  feat(postgres-estimated-rows): pg Estimated Rows on Data Warehouse Sync (#27634)
  fix: revert darkmode class toggle, updated content on fills (#27783)
  chore: upgrade posthog-js (#27790)
  chore(editor-3001): add back join actions (#27740)
  feat: Add person distinct ID overrides squash job (as dagster job) (#27710)
  fix(created-by-sources): Adding `created_by` to sources (#27751)
  Revert "feat(data-warehouse): V2 pipeline release " (#27791)
  fix: typo for feature flags (#27786)
  fix(defer-unmounting): Defer unmounting of react elements (#27742)
  feat(data-warehouse): V2 pipeline release (#27732)
  fix(data-warehouse): Ensure dates are actual datetime formats (#27777)
  fix: enable hot reload for the products dir (#27746)
  fix: assignee selector when null (#27737)
  chore: clarify rrweb imports (#27776)
  chore(deps): Update posthog-js to 1.207.3 (#27779)
  feat(retention): filters on start/return event (#27770)
  fix(experiments): only show supported math functions (#27589)
  feat(web-analytics): Set unique conversions graph when adding conversions goal (#27774)
  chore: color design system part 1: banner and accents (#27756)
  chore(experiments): Add tests for funnel attribution options (#27752)
  ...
Copy link

sentry-io bot commented Jan 24, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ SyntaxError: mismatched input 's' expecting posthog.tasks.tasks.process_query_task View Issue

Did you find this useful? React with a 👍 or 👎

timgl pushed a commit that referenced this pull request Jan 28, 2025
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
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.

Add filters for retention steps
3 participants