fix(desktop): collapse consecutive member removals into one system row - #5006
Open
tadeo-ctrl wants to merge 1 commit into
Open
fix(desktop): collapse consecutive member removals into one system row#5006tadeo-ctrl wants to merge 1 commit into
tadeo-ctrl wants to merge 1 commit into
Conversation
Desktop already collapses a run of contiguous `member_joined` events into a
single summary row ("… added by Alice, along with Bob and 3 others"), but the
matching `member_removed` case was never wired up. Every removal therefore
takes its own timeline row.
That is fine for the one-off case the copy was written for and poor for the
bulk case, which is ordinary: offboarding a team, or cleaning up the placeholder
identities left behind by a workspace import. Removing eleven members leaves
eleven near-identical rows pinned to the bottom of the channel, and there is no
way to clear them — deleting a system row publishes a `message_deleted` system
row in its place.
Group contiguous removals performed by the same administrator, reusing the
grouping window, barrier and avatar-stack machinery that already backs
`members_added`:
Alice Chen removed Erica Chapman, Peter Griffin, Marcia Thomas,
and 3 others from the channel
Removals only group with removals by the same actor, so an add/remove sequence
or two different moderators still render as separate rows.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Fizz <tadeo@villanuevak.com>
Author
Before — six removals by one admin, six rowsAfter — one rowCaptured from the Note: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Problem
Desktop already collapses a run of contiguous
member_joinedevents into one summary row —buildMembershipGroupsintimelineItems.tsplus themembers_added/members_joinedbranches inSystemMessageRow.tsx. The matchingmember_removedcase was never wired up, so each removal takes its own timeline row.That reads fine for the one-off removal the copy was written for. It reads badly for the bulk case, which is ordinary — offboarding a team, or clearing the placeholder identities left behind by a workspace import. Removing eleven members leaves eleven near-identical rows pinned to the bottom of the channel.
There is also no way to clean them up after the fact: deleting a system row publishes a
message_deletedsystem row in its place, so the row count never drops.Change
Group contiguous
member_removedevents performed by the same administrator, reusing the machinery that already backsmembers_added— the same one-hour adjacency window, the same day/unread barriers, the same avatar stack and "and N others" tooltip.timelineItems.ts—parseMembershipChangePayloadrecognisesmember_removedas a newremovalmode;membershipChangesCanGroupjoins removals only to removals by the same actor.SystemMessageRow.tsx—buildGroupedRemovalPayloademits amembers_removedpayload, with adescribeSystemEventbranch rendering it through the existingMemberNamesInlineList.Removals do not group with additions, and two different moderators still render separately, so no existing sequence changes shape.
Tests
timelineItems.test.mjs— three cases: contiguous removals by one actor group; removals by different actors do not; removals do not group with additions.mentions.spec.ts—groups contiguous removal activity with hidden names in the standard tooltip, mirroring the existing arrival-grouping spec, covering the collapsed copy, the avatar stack and the overflow tooltip.Gates run locally:
pnpm test(4390 passing),pnpm typecheck,pnpm check, and the fullsmokerun ofmentions.spec.ts(59 passing).Screenshots in a comment below.