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): Add mini-version of the retention cohort analysis #18586

Merged
merged 5 commits into from
Nov 16, 2023

Conversation

robbie-c
Copy link
Member

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

Problem

No retention cohort analysis on web analytics, and the UI that does exist is hard to fit in a small space.

Changes

I added some options to the retention table, to make it work better in a smaller space.

  • Hide the line graph
  • Reduce the font size and some margin sizes
  • Hide the size count

iPhone SE
Screenshot 2023-11-14 at 15 02 27

iPad
Screenshot 2023-11-14 at 15 03 29

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

How did you test this code?

@robbie-c robbie-c force-pushed the add-retention-insight branch from fde40b0 to 3cfb4b8 Compare November 14, 2023 13:02
@robbie-c robbie-c changed the title Add mini-version of the retention cohort analysis feat(web-analytics): Add mini-version of the retention cohort analysis Nov 14, 2023
@robbie-c robbie-c marked this pull request as ready for review November 14, 2023 15:05
Copy link
Contributor

@benjackwhite benjackwhite left a comment

Choose a reason for hiding this comment

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

Couple of small things but overall looks good!

Would be cool if we could get my big refactor in first... #18570

frontend/src/scenes/web-analytics/WebDashboard.tsx Outdated Show resolved Hide resolved
frontend/src/scenes/web-analytics/WebDashboard.tsx Outdated Show resolved Hide resolved
frontend/src/scenes/web-analytics/webAnalytics.scss Outdated Show resolved Hide resolved
@robbie-c robbie-c force-pushed the add-retention-insight branch 2 times, most recently from 7ffe706 to c7cb871 Compare November 15, 2023 20:06
Copy link
Contributor

github-actions bot commented Nov 15, 2023

Size Change: 0 B

Total Size: 2.01 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 2.01 MB

compressed-size-action

@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.

Copy link
Contributor

@benjackwhite benjackwhite left a comment

Choose a reason for hiding this comment

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

Looks good. The one exception is the "small layout" thing. I think this is the kind of property that over time becomes hard to manage and rather the component itself should just do this with container queries

frontend/src/scenes/web-analytics/webAnalytics.scss Outdated Show resolved Hide resolved
[InsightType.RETENTION]?: {
hideLineGraph?: boolean
hideSizeColumn?: boolean
useSmallLayout?: boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the only property I don't think makes sense.
We should do this with container queries given that it looks nicer regardless of the setting, it's more based on the container size anyways which applies no matter where it is rendered right?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't 100% agree, you might want to use this with a large container to show a ton of data, e.g. if you had 54 columns to show weekly retention over a year. We could do something smart like try to figure out whether what the user has asked for fits inside the container, and use the small layout if it doesn't, but I don't want to overengineer this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough. Then lets go with it for now

@robbie-c robbie-c force-pushed the add-retention-insight branch from 2c028e9 to f48eec8 Compare November 16, 2023 10:18
@robbie-c robbie-c merged commit d5204ae into master Nov 16, 2023
73 checks passed
@robbie-c robbie-c deleted the add-retention-insight branch November 16, 2023 14:37
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