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

Improve Past Groups table on Contact Groups tab #24705

Conversation

larssandergreen
Copy link
Contributor

@larssandergreen larssandergreen commented Oct 9, 2022

Overview

The Past groups table on the Contact Groups tab is somewhat confusing and sometimes provides unexpected results for Date Added or Date Removed. In general this table uses concepts that encourage misunderstandings of what it means for a contact to be removed from a group, doesn't differentiate between smart and regular groups even though these behave very differently here, and possibly leads to users doing something they don't intend to do (putting a contact back in a smart group by deleting them from a group, for example).

While group memberships concepts remain confusing, I hope these changes clarify the situation somewhat for users.

Before

image

Screen Shot 2022-10-09 at 4 46 29 PM

Screen Shot 2022-10-09 at 4 46 29 PM

After

Screen Shot 2022-10-09 at 4 10 39 PM

Changed heading to Removed Groups (some of the groups may not in fact be past groups, because a contact can be removed from a group they were never in). I think it's important not to encourage that misunderstanding (I know I misunderstood this for years).
Added * to indicate smart groups.
Changed "Rejoin Group" text for smart groups to "Manual Add" to indicate that this action has different results.

The less obvious change here is what the Date Added and Date Removed are in special cases.

  • If a contact has been removed more than once from a group since the most recent date they were added or deleted, the Date Removed is the earliest date after they were added or deleted. If they were never added or deleted, the date is the earliest removed date. In other words, we show the date that the contact was effectively removed from the group, not the most recent date their status was set to removed. I think this is much more in line with what removed intuitively means and I can't see much reason you'd want to know the date the contact was most recently removed again instead.
  • If a contact has been deleted from a group and then removed after that, they no longer show a Date Added (because at the time of removal, they were not in the group).

At some point, I plan to add a History link that will show the complete Subscription History for each group.

Added help text and Actions header to attach it to.
Screen Shot 2022-10-09 at 4 10 47 PM

For smart groups, changed the confirmation popup text:
Screen Shot 2022-10-09 at 4 46 29 PM

Screen Shot 2022-10-09 at 4 46 42 PM

Confirmation popups for regular groups are the same, except the delete one says "This group will no longer be listed under Removed Groups."

Unfortunately, this adds a number of translation strings, but I think the added clarity is worth it. I've tried to minimize this where possible.

@civibot
Copy link

civibot bot commented Oct 9, 2022

(Standard links)

@civibot civibot bot added the master label Oct 9, 2022
@larssandergreen larssandergreen force-pushed the improve-removed-groups-on-contact-groups-tab branch from 62eb2bb to fd7a66d Compare October 9, 2022 23:42
@larssandergreen larssandergreen changed the title WIP: Improve Past Groups table on Contact Groups tab Improve Past Groups table on Contact Groups tab Oct 10, 2022
@larssandergreen larssandergreen marked this pull request as ready for review October 10, 2022 16:30
@aydun
Copy link
Contributor

aydun commented Oct 14, 2022

These look like useful improvements, but maybe the effort would be better directed into creating a SearchKit replacement for the Groups tab?

@larssandergreen
Copy link
Contributor Author

@aydun Not sure I could come up with a search that would replicate the Removed Groups table. But if you can?

@colemanw
Copy link
Member

Like this:
image

@larssandergreen
Copy link
Contributor Author

@colemanw For sure, but the part that's not obvious to me is how we get the Date Added and Date Removed (and specifically the dates as discussed in After above).

@colemanw
Copy link
Member

It looks like SK then allows you to join on the Group Subscription History entity - have you tried that?
image

@larssandergreen
Copy link
Contributor Author

Yes, I think the thing that would be necessary would be being able to join on Contact_SubscriptionHistory_contact_id_01.date > (a different select) — and I can't see a way to do that with SK.

E.g. we want to find the earliest removed status row in subscription history that is later than the most recent added or deleted row and display that as the removed date.

@civicrm-builder
Copy link

Can one of the admins verify this patch?

@larssandergreen
Copy link
Contributor Author

jenkins test this please

@larssandergreen
Copy link
Contributor Author

@colemanw Do you want to look at my comment directly above here and see if you think this is possible in SK (in which case, I will happily redo this to use SK) or if it is not possible in SK, maybe we can merge this now? Could always be redone if this later becomes possible.

@colemanw
Copy link
Member

colemanw commented Jun 7, 2023

@larssandergreen sorry this PR has been in purgatory so long. I think the combination of 1) low-priority 2) confusing and 3) maybe-replaceable-by-SK have caused it to languish.

I was trying to understand your logic for which added and removed dates to show and wondering if I agreed with it, and then it occurred to me that maybe we don't have to pick a single date. By default when you do the join I illustrated in my previous comment and use grouping, then SK will aggregate using "list" which shows them all. Then you could see at a glance all the dates a contact was added and all the dates they were removed. That could actually be useful information.

So if we did it that way, then I think (haven't tried but I think) the table can be replaced with SK.

@larssandergreen
Copy link
Contributor Author

@colemanw No worries. I think we do want to have a single date for these as a list would be too confusing for general users, who just want to know when the contact was removed from the group in some kind of sane way. Part of the problem is that contacts can be removed from groups that they are not currently members of, so I don't think we actually want to show those removal dates - we just want the date that the contact went from being a member of the group to not being a member of the group.

My plan is actually to add a little pop-up that shows the subscription history (which would of course use SK), so you can actually see the full list of added, removed and deleted in order, which is kind of the same info you are talking about, but I think in a more useful format.

@colemanw
Copy link
Member

colemanw commented Jun 7, 2023

Ok, in that case I think the best you could do with SK is to show the most recent added and removal dates, and conditionally hide the removal date if there is no added date.
I think that's pretty much what you want, right?

@larssandergreen
Copy link
Contributor Author

larssandergreen commented Jun 7, 2023

What I've done here is to show the first removal date after the most recent added date. So if you have:

Added Jan 1
Removed Feb 1
Added Jun 1
Removed Sept 1
Removed Dec 1

The proposed table will show Added June 1, Removed Sept 1 (instead of Added Jan 1, Removed Dec 1).

I think that's much more helpful and more in line with what you would expect than the most recent removal date. For example, let's say I'm looking into why someone did or didn't receive our email newsletter and the current past groups table in this example says the contact was removed on Dec 1, so why didn't they get our Sept, Oct and Nov newsletters? Weird. Well, they were actually removed Sept 1, but that fact isn't apparent.

We wouldn't want to hide the removed date if there is no added date, as this is relevant for smart groups.

@colemanw
Copy link
Member

colemanw commented Jun 7, 2023

Ok I'm gonna go ahead and merge this since we don't have a ready alternative in SK.

@colemanw colemanw merged commit 1872a1d into civicrm:master Jun 7, 2023
@larssandergreen
Copy link
Contributor Author

larssandergreen commented Jun 7, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants