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

Commit bc0bfa6

Browse files
turt2livet3chguy
andauthored
Iterate on search results for message bubbles (#7047)
* PSFD-455: Iterate on search results for message bubbles Though not perfect, this is a bit better than it was before. Specifically, we ensure our matching for `isOwnEvent` correctly identifies the user and that the results don't look *awful*. There's still room for improvement, but this should be a measurable improvement itself. Most notably, this doesn't fix a couple obvious bugs due to complexity: * Message bubbles have the wrong corners for the display format (pre-existing). * The sender's own messages are missing avatars/names. This is just way too complex to fix. **Requires matrix-org/matrix-js-sdk#2004 * Tweak opacity Co-authored-by: Michael Telatynski <[email protected]>
1 parent 6d6cfcd commit bc0bfa6

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

res/css/views/rooms/_EventBubbleTile.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,27 @@ limitations under the License.
3131
margin-right: 60px;
3232
}
3333

34+
.mx_RoomView_searchResultsPanel {
35+
.mx_EventTile[data-layout=bubble] {
36+
.mx_SenderProfile {
37+
// Group layout adds a 64px left margin, which we really don't want on search results
38+
margin-left: 0;
39+
}
40+
41+
&[data-self=true] {
42+
// The avatars end up overlapping, so just hide them
43+
.mx_EventTile_avatar {
44+
display: none;
45+
}
46+
}
47+
48+
// Mirror rough designs for "greyed out" text
49+
&.mx_EventTile_contextual .mx_EventTile_line {
50+
opacity: 0.4;
51+
}
52+
}
53+
}
54+
3455
.mx_EventTile[data-layout=bubble] {
3556
position: relative;
3657
margin-top: var(--gutterSize);

src/components/views/rooms/EventTile.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,8 @@ export class UnwrappedEventTile extends React.Component<IProps, IState> {
12351235
/>;
12361236
}
12371237

1238-
const isOwnEvent = this.props.mxEvent?.sender?.userId === MatrixClientPeg.get().getUserId();
1238+
// Use `getSender()` because searched events might not have a proper `sender`.
1239+
const isOwnEvent = this.props.mxEvent?.getSender() === MatrixClientPeg.get().getUserId();
12391240

12401241
switch (this.context.timelineRenderingType) {
12411242
case TimelineRenderingType.Notification: {

0 commit comments

Comments
 (0)