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

Commit 8b88b48

Browse files
authored
Remove bubble from around location events (#7459)
1 parent dbd7949 commit 8b88b48

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

res/css/views/rooms/_EventBubbleTile.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ limitations under the License.
163163
padding: 4px 8px;
164164
bottom: 0;
165165
right: 0;
166-
z-index: 1; // above media
166+
z-index: 3; // above media and location share maps
167167
}
168168

169169
//noinspection CssReplaceWithShorthandSafely
@@ -181,7 +181,7 @@ limitations under the License.
181181
}
182182
}
183183

184-
.mx_EventTile_line:not(.mx_EventTile_mediaLine) {
184+
&:not(.mx_EventTile_noBubble) .mx_EventTile_line:not(.mx_EventTile_mediaLine) {
185185
padding: var(--gutterSize);
186186
padding-right: 60px; // space for the timestamp
187187
background: var(--backgroundColor);
@@ -190,29 +190,29 @@ limitations under the License.
190190
&.mx_EventTile_continuation[data-self=false] .mx_EventTile_line {
191191
border-top-left-radius: 0;
192192

193-
.mx_MImageBody .mx_MImageBody_thumbnail {
193+
.mx_MImageBody .mx_MImageBody_thumbnail, .mx_MLocationBody_map {
194194
border-top-left-radius: 0;
195195
}
196196
}
197197
&.mx_EventTile_lastInSection[data-self=false] .mx_EventTile_line {
198198
border-bottom-left-radius: var(--cornerRadius);
199199

200-
.mx_MImageBody .mx_MImageBody_thumbnail {
200+
.mx_MImageBody .mx_MImageBody_thumbnail, .mx_MLocationBody_map {
201201
border-bottom-left-radius: var(--cornerRadius);
202202
}
203203
}
204204

205205
&.mx_EventTile_continuation[data-self=true] .mx_EventTile_line {
206206
border-top-right-radius: 0;
207207

208-
.mx_MImageBody .mx_MImageBody_thumbnail {
208+
.mx_MImageBody .mx_MImageBody_thumbnail, .mx_MLocationBody_map {
209209
border-top-right-radius: 0;
210210
}
211211
}
212212
&.mx_EventTile_lastInSection[data-self=true] .mx_EventTile_line {
213213
border-bottom-right-radius: var(--cornerRadius);
214214

215-
.mx_MImageBody .mx_MImageBody_thumbnail {
215+
.mx_MImageBody .mx_MImageBody_thumbnail, .mx_MLocationBody_map {
216216
border-bottom-right-radius: var(--cornerRadius);
217217
}
218218
}

src/components/views/rooms/EventTile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ export default class EventTile extends React.Component<IProps, IState> {
11231123
mx_EventTile_unverified: !isBubbleMessage && this.state.verified === E2EState.Warning,
11241124
mx_EventTile_unknown: !isBubbleMessage && this.state.verified === E2EState.Unknown,
11251125
mx_EventTile_bad: isEncryptionFailure,
1126-
mx_EventTile_emote: msgtype === 'm.emote',
1126+
mx_EventTile_emote: msgtype === MsgType.Emote,
11271127
mx_EventTile_noSender: this.props.hideSender,
11281128
mx_EventTile_clamp: this.props.tileShape === TileShape.ThreadPanel,
11291129
mx_EventTile_noBubble: noBubbleEvent,

src/utils/EventUtils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { EventType, MsgType, RelationType } from "matrix-js-sdk/src/@types/event
1919
import { MatrixClient } from 'matrix-js-sdk/src/client';
2020
import { logger } from 'matrix-js-sdk/src/logger';
2121
import { POLL_START_EVENT_TYPE } from "matrix-js-sdk/src/@types/polls";
22+
import { LOCATION_EVENT_TYPE } from 'matrix-js-sdk/src/@types/location';
2223

2324
import { MatrixClientPeg } from '../MatrixClientPeg';
2425
import shouldHideEvent from "../shouldHideEvent";
@@ -148,7 +149,12 @@ export function getEventDisplayInfo(mxEvent: MatrixEvent): {
148149
);
149150
// Some non-info messages want to be rendered in the appropriate bubble column but without the bubble background
150151
const noBubbleEvent = (
151-
POLL_START_EVENT_TYPE.matches(eventType)
152+
POLL_START_EVENT_TYPE.matches(eventType) ||
153+
LOCATION_EVENT_TYPE.matches(eventType) ||
154+
(
155+
eventType === EventType.RoomMessage &&
156+
LOCATION_EVENT_TYPE.matches(msgtype)
157+
)
152158
);
153159

154160
// If we're showing hidden events in the timeline, we should use the

0 commit comments

Comments
 (0)