镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(messages): show each run of join/leave notices as two lines - #2153

Closed
loganj wants to merge 3 commits into
mainfrom
larry/coalesce-membership-runs
Closed

loganj wants to merge 3 commits into
mainfrom
larry/coalesce-membership-runs

Conversation

@loganj

@loganj loganj commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

🤖

Summary

  • Channels with a lot of people coming and going filled up with join and leave notices. The app started a new notice line every time the activity switched between joining and leaving, every new day, and after every quiet hour. Busy channels stacked dozens of these lines between real messages, so readers had to scroll a long way to get back to where they had stopped reading.
  • Now, a stretch of join and leave activity that has no message in it shows as at most two lines: one for the people who arrived and one for the people who left. Each person shows once, on the line that matches their last change, so the two lines tell you who is in the channel after the stretch. Only a real message starts a new stretch.

Screenshots

The same test channel after two additions, then seven mixed leaves, joins and a removal.

Before (7 lines):

Before: seven notice lines

After (2 lines):

After: two notice lines

Details

  • Arrivals line: joins and additions. It reads "joined", "added by X", or "arrived" when the stretch has both.
  • Departures line: leaves and removals. It reads "left the channel", "was removed by X", "was removed" when different people removed members, or "departed" when the stretch has both leaves and removals.
  • Each person appears once, described by their latest change in the stretch. Joined → left → joined reads "Pinky joined"; joined → left reads "Pinky left the channel". The old "joined and left the channel" wording is gone. All of a person's changes stay attached to their line, so a saved reading position on any of them still finds its line.
  • The line that holds the stretch's first change comes first, and each line sits under the day of its oldest change. Each line keeps the identity of its newest change, so loading older history makes a line longer without replacing it. When an older page brings in an earlier change of the other kind, the two lines swap places; a test covers this.
  • Code: membershipRows and membershipDescription in src/features/messages/membership-rows.ts. The browser test tests/browser/membership.spec.mjs now expects a removal to merge into the existing departures line.

🤖 Generated with Claude Code

loganj and others added 2 commits November 2, 2026 12:17
…es row

A channel with steady join and leave traffic showed a membership row for
every switch between joins and leaves, every local day and every gap over
one hour. Busy channels stacked dozens of these rows between messages and
readers had to scroll past them to reach the last read message.

Now only a message breaks a run of membership changes. Each run shows at
most two rows: arrivals (joins and additions) and departures (leaves and
removals). Each row keeps its newest change as its key, so loading older
history does not rename it, and its oldest change as its time, so rows and
day dividers stay in order. A run that mixes leaves and removals reads
"departed", like "arrived" for mixed joins and additions.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Logan Johnson <loganj@squareup.com>
A person who joined, left and joined again in one run showed on both rows
("Pinky joined", then "Pinky left the channel"), so the rows could not tell
who was still in the channel. Each person now shows once, on the row of
their latest change in the run, and is described by that change. All of
their changes stay in that row, so anchors on any of them still resolve.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Logan Johnson <loganj@squareup.com>
@loganj
loganj force-pushed the larry/coalesce-membership-runs branch from d7e88b6 to 2b5c114 Compare November 2, 2026 17:18
@loganj
loganj marked this pull request as ready for review November 3, 2026 15:41
@loganj
loganj requested a review from a team as a code owner November 3, 2026 15:41
kalvinnchau

This comment was marked as resolved.

wesbillman

This comment was marked as resolved.

When the newest arrival in a membership run leaves, the run regroups
and both of its rows get new keys, so a reader above the bottom saw
two new messages for one event. Count unseen underlying event IDs.

Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Logan Johnson <loganj@squareup.com>
@loganj

This comment has been minimized.

@loganj

loganj commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Superseded by #2258, which hides self-joins and leaves and shows each membership run as one row.

@loganj loganj closed this Nov 3, 2026
mahanti added a commit that referenced this pull request Nov 3, 2026
Port the latest-change-per-person summary from #2153 and align membership documentation with the current grouping rules.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Arjun Mahanti <arjun@squareup.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.

3 participants