Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Don't render a bubble around emotes in bubble layout #7573

Merged
merged 4 commits into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions res/css/views/rooms/_EventBubbleTile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ limitations under the License.
width: fit-content;
}

.mx_EventTile_content {
margin-right: 0;
}

&.mx_EventTile_continuation {
margin-top: 2px;
}
Expand Down Expand Up @@ -408,6 +412,22 @@ limitations under the License.

.mx_EventTile.mx_EventTile_noBubble[data-layout=bubble] {
--backgroundColor: transparent;

.mx_EventTile_line.mx_EventTile_emote {
padding-right: 60px; // align with bubbles text
font-style: italic;

> a { // timestamp anchor wrapper
align-self: center;
bottom: unset;
top: unset;
font-style: normal; // undo italic above
}

.mx_MEmoteBody {
padding: 4px 0;
}
}
}

.mx_EventTile.mx_EventTile_bubbleContainer[data-layout=bubble],
Expand Down
4 changes: 4 additions & 0 deletions src/components/views/rooms/EventTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,10 @@ export default class EventTile extends React.Component<IProps, IState> {
const lineClasses = classNames("mx_EventTile_line", {
mx_EventTile_mediaLine: isProbablyMedia,
mx_EventTile_sticker: this.props.mxEvent.getType() === EventType.Sticker,
mx_EventTile_emote: (
this.props.mxEvent.getType() === EventType.RoomMessage &&
this.props.mxEvent.getContent().msgtype === MsgType.Emote
),
});

const isSending = (['sending', 'queued', 'encrypting'].indexOf(this.props.eventSendStatus) !== -1);
Expand Down
3 changes: 2 additions & 1 deletion src/utils/EventUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export function getEventDisplayInfo(mxEvent: MatrixEvent): {
// Info messages are basically information about commands processed on a room
let isBubbleMessage = (
eventType.startsWith("m.key.verification") ||
(eventType === EventType.RoomMessage && msgtype && msgtype.startsWith("m.key.verification")) ||
(eventType === EventType.RoomMessage && msgtype?.startsWith("m.key.verification")) ||
(eventType === EventType.RoomCreate) ||
(eventType === EventType.RoomEncryption) ||
(tileHandler === "messages.MJitsiWidgetEvent")
Expand All @@ -232,6 +232,7 @@ export function getEventDisplayInfo(mxEvent: MatrixEvent): {
);
// Some non-info messages want to be rendered in the appropriate bubble column but without the bubble background
const noBubbleEvent = (
(eventType === EventType.RoomMessage && msgtype === MsgType.Emote) ||
M_POLL_START.matches(eventType) ||
LOCATION_EVENT_TYPE.matches(eventType) ||
(
Expand Down