Skip to content

Commit 8d9129f

Browse files
committed
Bubble layout: Don't overlap read receipts
1 parent 8513eaa commit 8d9129f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/components/views/rooms/EventTile.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,8 +1247,9 @@ export class UnwrappedEventTile extends React.Component<IProps, IState> {
12471247
checkUnmounting={this.props.checkUnmounting}
12481248
suppressAnimation={this.suppressReadReceiptAnimation}
12491249
isTwelveHour={this.props.isTwelveHour}
1250-
maxReadAvatarsPlusN={this.props.layout == Layout.Bubble ? 8 : 3}
1251-
maxReadAvatars={this.props.layout == Layout.Bubble ? 9 : 4}
1250+
maxReadAvatarsPlusN={this.props.layout == Layout.Bubble ? 12 : 3}
1251+
maxReadAvatars={this.props.layout == Layout.Bubble ? 13 : 4}
1252+
layout={this.props.layout}
12521253
/>;
12531254
}
12541255
}

src/components/views/rooms/ReadReceiptGroup.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ import ContextMenu, { aboveLeftOf, MenuItem, useContextMenu } from "../../struct
3030
import { useTooltip } from "../../../utils/useTooltip";
3131
import { _t } from "../../../languageHandler";
3232
import { useRovingTabIndex } from "../../../accessibility/RovingTabIndex";
33+
import { Layout } from "../../../settings/enums/Layout";
3334

3435
// SC: Pass this as props
3536
// // #20547 Design specified that we should show the three latest read receipts
3637
// const MAX_READ_AVATARS_PLUS_N = 3;
3738
// // #21935 If we’ve got just 4, don’t show +1, just show all of them
3839
// const MAX_READ_AVATARS = MAX_READ_AVATARS_PLUS_N + 1;
3940

40-
const READ_AVATAR_OFFSET = 10;
41+
// const READ_AVATAR_OFFSET = 10;
4142
export const READ_AVATAR_SIZE = 16;
4243

4344
interface Props {
@@ -48,6 +49,7 @@ interface Props {
4849
isTwelveHour: boolean;
4950
maxReadAvatarsPlusN: number;
5051
maxReadAvatars: number;
52+
layout?: Layout;
5153
}
5254

5355
interface IAvatarPosition {
@@ -89,7 +91,7 @@ export function readReceiptTooltip(members: string[], hasMore: boolean): string
8991
export function ReadReceiptGroup(
9092
{
9193
readReceipts, readReceiptMap, checkUnmounting, suppressAnimation, isTwelveHour,
92-
maxReadAvatarsPlusN, maxReadAvatars,
94+
maxReadAvatarsPlusN, maxReadAvatars, layout,
9395
}: Props,
9496
) {
9597
const [menuDisplayed, button, openMenu, closeMenu] = useContextMenu();
@@ -104,6 +106,9 @@ export function ReadReceiptGroup(
104106
? MAX_READ_AVATARS_PLUS_N
105107
: MAX_READ_AVATARS;
106108

109+
// SC: Don't use offset for bubble layout
110+
const READ_AVATAR_OFFSET = layout == Layout.Bubble ? READ_AVATAR_SIZE-1 : 10;
111+
107112
const tooltipMembers: string[] = readReceipts.slice(0, maxAvatars)
108113
.map(it => it.roomMember?.name ?? it.userId);
109114
const tooltipText = readReceiptTooltip(tooltipMembers, hasMore);

0 commit comments

Comments
 (0)