Add setting to hide call join/leave timeline messages (#705) - #1641
Add setting to hide call join/leave timeline messages (#705)#1641AsmitBhardwaj wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new hideCallEvents options are currently introduced as required in shared hook APIs, which will break existing callers/tests that don’t pass the flag and should be made backward-compatible (plus minor formatting fixes).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Adds a new user setting (hideCallEvents) to suppress frequent group call join/leave timeline entries so chat history isn’t drowned out in active rooms, while keeping default behavior unchanged unless opted in.
Changes:
- Introduces
hideCallEventsto settings state with a default offalse. - Threads the new flag through timeline renderer context and room timeline wiring.
- Filters
GroupCallMemberPrefixevents from the processed timeline and adds a renderer guard; exposes a new toggle in Settings → General → Messages.
File summaries
| File | Description |
|---|---|
| src/app/state/settings.ts | Adds hideCallEvents to settings interface + defaults. |
| src/app/hooks/timeline/useTimelineRendererContext.ts | Reads hideCallEvents from settings and includes it in renderer context settings. |
| src/app/hooks/timeline/useProcessedTimeline.ts | Adds an option to filter out GroupCallMemberPrefix events when enabled. |
| src/app/hooks/timeline/useTimelineEventRenderer.tsx | Adds a guard to skip rendering call join/leave events when enabled. |
| src/app/features/room/RoomTimeline.tsx | Plumbs hideCallEvents into timeline visibility logic and processed timeline hook options. |
| src/app/features/settings/general/General.tsx | Adds UI toggle “Hide Call Join/Leave Messages”. |
Review details
Suppressed comments (2)
src/app/hooks/timeline/useTimelineEventRenderer.tsx:383
- Default
hideCallEventswhen destructuring settings so callers that omit it keep the existing behavior (show call events).
hideCallEvents,
src/app/hooks/timeline/useProcessedTimeline.ts:602
- If
hideCallEventsis optional, it should be defaulted during destructuring so downstream processing always receives a boolean.
hideCallEvents,
- Files reviewed: 6/7 changed files
- Comments generated: 6
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
| hideMemberInReadOnly: boolean; | ||
| isReadOnly: boolean; | ||
| hideMembershipEvents: boolean; | ||
| hideCallEvents: boolean; |
| mxUserId: string | null; | ||
| readUptoEventId: string | undefined; | ||
| hideMembershipEvents: boolean; | ||
| hideCallEvents: boolean; |
| ); | ||
| }, | ||
| [EventType.GroupCallMemberPrefix]: (mEventId, mEvent, item, timelineSet, collapse) => { | ||
| if(hideCallEvents) return null; |
| hideMemberInReadOnly: boolean; | ||
| isReadOnly: boolean; | ||
| hideMembershipEvents: boolean; | ||
| hideCallEvents:boolean; |
| settingsAtom, | ||
| 'hideMembershipEvents' | ||
| ); | ||
| const[hideCallEvents, setHideCallEvents] = useSetting(settingsAtom, 'hideCallEvents'); |
| if (!membershipChanged && hideNickAvatarEvents) continue; | ||
| } | ||
|
|
||
| if (type === (EventType.GroupCallMemberPrefix as string) && hideCallEvents) continue; |
|
Please use pnpm and no npm |
Description
This PR adds a setting to let users hide "X joined the call" / "X ended the call"
timeline messages, addressing the issue where active rooms with frequent calls
get their message history buried under repeated call notifications.
Added a new
hideCallEventsboolean setting (falseby default, so existingbehavior is unchanged unless a user opts in). It follows the same pattern as
the existing
hideMembershipEventssetting:src/app/state/settings.ts— new setting + default valuesrc/app/hooks/timeline/useTimelineRendererContext.ts— added toTimelineRendererSettingssrc/app/hooks/timeline/useProcessedTimeline.ts— filtersGroupCallMemberPrefixevents out of the processed timeline when the setting is onsrc/app/hooks/timeline/useTimelineEventRenderer.tsx— early-return guard in theGroupCallMemberPrefixrender handlersrc/app/features/room/RoomTimeline.tsx— reads the setting and passes it to both hooks abovesrc/app/features/settings/general/General.tsx— new toggle: Settings → General → Messages → "Hide Call Join/Leave Messages"Manually tested: reproduced the original bug (a 2-minute test call produced 9
separate timeline messages), then verified the toggle suppresses new call
messages when on, and that toggling back off restores them.
Fixes #705
Type of change
Checklist:
AI disclosure:
I used AI to assist me in correcting some of my code and making sure everything is foolproof.