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: Sidebar cohorts and annotations movement #18200

Merged
merged 111 commits into from
Nov 8, 2023

Conversation

benjackwhite
Copy link
Contributor

@benjackwhite benjackwhite commented Oct 26, 2023

Problem

The sidebar is crowded to say the least. We want to consolidate a couple of things, one of them being Annotations -> Data Management which is what this PR does as well as Cohorts -> Persons.

Changes

  • Moves annotations into data management
  • Refactors the scenes so that Data management is a proper scene.
  • Adds groups to the default models thing as otherwise it was causing a lot of issues.
  • Called it "PersonsManagement" for now to mimic DataManagement - maybe People makes more sense?
  • Adds a popup to show, based on a flag which we can have for all users after who joined before the change
  • No notice for cohorts as it is in the sidebar name

It was a bit messy so I don't think we should do this as 3000-only, but rather make the change already.

Before After 3000
Screenshot 2023-11-02 at 14 58 06 Screenshot 2023-11-07 at 17 56 54 Screenshot 2023-11-07 at 17 57 43

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

How did you test this code?

@benjackwhite benjackwhite requested a review from a team October 26, 2023 09:21
@benjackwhite benjackwhite marked this pull request as ready for review October 26, 2023 09:29
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

44 snapshot changes in total. 0 added, 44 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 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Twixes
Twixes previously requested changes Oct 26, 2023
Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

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

Looks great overall. I just want to bring up two important points before we merge this:

  1. We absolutely must point out to users that Annotations have moved. Probably just a closable tooltip on the Data Management item. This should only show up for users who signed up before Annotations have moved, and every user should only see this once (if they acknowledge it, the notice should never again show up for them, e.g. on other devices).
  2. There's also the plan of moving cohorts into persons and groups. I think it's less disruptive if both changes happen at once. Otherwise product direction will seem a bit more chaotic.

@benjackwhite
Copy link
Contributor Author

  1. We absolutely must point out to users that Annotations have moved. Probably just a closable tooltip on the Data Management item. This should only show up for users who signed up before Annotations have moved, and every user should only see this once (if they acknowledge it, the notice should never again show up for them, e.g. on other devices).

Agreed, just not sure where this would go? By "closeable tooltip" you mean something that immediately shows up pointing at the data management that they can then dismiss? If so - i agree and will try it out.

  1. There's also the plan of moving cohorts into persons and groups. I think it's less disruptive if both changes happen at once. Otherwise product direction will seem a bit more chaotic.

Totally happy with this. I guess we can merge this into a holding branch, whilst we do the same for Persons and cohorts and then get it all in together. I could also feature flag it but given that it affects scenes and things like that, my vote would just be to have one PR that solves both.

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@Twixes
Copy link
Member

Twixes commented Oct 26, 2023

By "closeable tooltip" you mean something that immediately shows up pointing at the data management that they can then dismiss?

Yeah, I think a <Tooltip> can be pretty good for that, the only extra thing is that it acknowledgement should work in two ways: either by clicking into Data Management, or by clicking an "X" on the tooltip. I don't think we currently have an onClose pattern on Tooltip, but it'd be great.

I could also feature flag it but given that it affects scenes and things like that, my vote would just be to have one PR that solves both.

Agreed. Pulling Cohorts into Persons & Groups is more tricky UX-wise though, because the way I see the hierarchy there is like this:

  • <actors as a feature of PostHog>
    • concrete persons and groups
      • list of persons
      • list of groups of one type
      • list of groups of another type
      • ...
    • list of cohorts

Thinking about it broader, Cohorts are to Persons what Actions are to Events. But the Event Explorer has its own navbar item, while Actions are stashed under Data Management. So perhaps in some way Cohorts belong to Data Management, and Persons & Groups should still be their own item?

@benjackwhite
Copy link
Contributor Author

Thinking about it broader, Cohorts are to Persons what Actions are to Events. But the Event Explorer has its own navbar item, while Actions are stashed under Data Management. So perhaps in some way Cohorts belong to Data Management, and Persons & Groups should still be their own item?

I think Cohorts definitely makes sense with Persons and Groups from a user perspective. There is definitely an argument for it being in data management as it is technically more like an Action, but I don't think people think that way (or at least it feels very off to me)

@neilkakkar
Copy link
Collaborator

agree it feels off as a user. One big reason I think why is the mechanism: An action can be seen as a group of events with filters, but here you're defining what the group should be and what the filters should be. So it's a lot more like an alias, and hence might make sense to be in data management.

Cohorts on the other hand end up being a group of users as well, buuut they are a computation, and usually not an alias. It's more like saving the persons for a specific trend query, or computing users who've done X and Y and Z, where you don't know apriori who these users are. Feels much closer to insights in this sense.

Although, some parts do fit into the action paradigm, but I think that's a very small part (like PostHog Team cohort) - which makes a bit more sense to be in data management.

# Conflicts:
#	frontend/__snapshots__/scenes-app-surveys--survey-view.png
#	frontend/src/layout/navigation-3000/navigationLogic.tsx
#	frontend/src/scenes/data-management/DataManagementPageTabs.tsx
benjackwhite and others added 2 commits November 7, 2023 18:00
# Conflicts:
#	frontend/__snapshots__/scenes-app-notebooks--recordings-playlist.png
#	frontend/src/scenes/persons/Persons.tsx
@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 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

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

  • chromium: 0 added, 1 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

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

  • chromium: 0 added, 1 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.

benjackwhite and others added 2 commits November 8, 2023 09:03
# Conflicts:
#	frontend/__snapshots__/scenes-app-notebooks--recordings-playlist.png
@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-contributions-bot
Copy link
Contributor

This issue has 2043 words at 33 comments. Issues this long are hard to read or contribute to, and tend to take very long to reach a conclusion. Instead, why not:

  1. Write some code and submit a pull request! Code wins arguments
  2. Have a sync meeting to reach a conclusion
  3. Create a Request for Comments and submit a PR with it to the meta repo or product internal repo

Is this issue intended to be sprawling? Consider adding label epic or sprint to indicate this.

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

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.

@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

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.

benjackwhite and others added 2 commits November 8, 2023 15:27
# Conflicts:
#	frontend/__snapshots__/scenes-app-insights--trends-line-edit.png
@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.

@benjackwhite benjackwhite merged commit e118f3b into master Nov 8, 2023
70 checks passed
@benjackwhite benjackwhite deleted the feat/annotations-in-data-management branch November 8, 2023 15:16
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.

6 participants