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

Remove bubble from around location events #7459

Merged
merged 5 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Tidy implementation
  • Loading branch information
t3chguy committed Jan 4, 2022
commit 62dcb40e65ba7a34b453e9e7272768b9d160df2c
8 changes: 2 additions & 6 deletions res/css/views/rooms/_EventBubbleTile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ limitations under the License.
padding: 4px 8px;
bottom: 0;
right: 0;
z-index: 1; // above media
z-index: 3; // above media and location share maps
}

//noinspection CssReplaceWithShorthandSafely
Expand All @@ -181,16 +181,12 @@ limitations under the License.
}
}

.mx_EventTile_line:not(.mx_EventTile_mediaLine):not(.mx_EventTile_locationLine) {
&:not(.mx_EventTile_noBubble) .mx_EventTile_line:not(.mx_EventTile_mediaLine) {
padding: var(--gutterSize);
padding-right: 60px; // space for the timestamp
background: var(--backgroundColor);
}

.mx_EventTile_locationLine > a {
z-index: 3; // render atop the map
}

&.mx_EventTile_continuation[data-self=false] .mx_EventTile_line {
border-top-left-radius: 0;

Expand Down
5 changes: 0 additions & 5 deletions src/components/views/rooms/EventTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1086,15 +1086,10 @@ export default class EventTile extends React.Component<IProps, IState> {

const EventTileType = sdk.getComponent(tileHandler);
const isProbablyMedia = MediaEventHelper.isEligible(this.props.mxEvent);
const isLocationEvent = (
LOCATION_EVENT_TYPE.matches(this.props.mxEvent.getType()) ||
(this.props.mxEvent.getType() === EventType.RoomMessage && msgtype === MsgType.Location)
) && SettingsStore.getValue("feature_location_share");

const lineClasses = classNames({
mx_EventTile_line: true,
mx_EventTile_mediaLine: isProbablyMedia,
mx_EventTile_locationLine: isLocationEvent,
});

const isSending = (['sending', 'queued', 'encrypting'].indexOf(this.props.eventSendStatus) !== -1);
Expand Down
8 changes: 7 additions & 1 deletion src/utils/EventUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { EventType, MsgType, RelationType } from "matrix-js-sdk/src/@types/event
import { MatrixClient } from 'matrix-js-sdk/src/client';
import { logger } from 'matrix-js-sdk/src/logger';
import { POLL_START_EVENT_TYPE } from "matrix-js-sdk/src/@types/polls";
import { LOCATION_EVENT_TYPE } from 'matrix-js-sdk/src/@types/location';

import { MatrixClientPeg } from '../MatrixClientPeg';
import shouldHideEvent from "../shouldHideEvent";
Expand Down Expand Up @@ -148,7 +149,12 @@ 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 = (
POLL_START_EVENT_TYPE.matches(eventType)
POLL_START_EVENT_TYPE.matches(eventType) ||
LOCATION_EVENT_TYPE.matches(eventType) ||
(
eventType === EventType.RoomMessage &&
LOCATION_EVENT_TYPE.matches(msgtype)
)
);

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