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

Conversation

@DantrazTrev
Copy link
Contributor

@DantrazTrev DantrazTrev commented May 3, 2021

Fixes element-hq/element-web/issues/17016

The .mx_EventTile_bubbleContainer's .mx_EventTile_line overrides padding to zero

Which affects the m.room.verification if the sender is not the user

image

When the sender is defined as the user it renders correctly
image

However, the padding overriding could be removed and it provides the correct results for either case
image

Signed-off-by : Ayush Pratap Singh ayushpratap16@gmail.com

@turt2live turt2live requested a review from a team May 3, 2021 14:36
@t3chguy
Copy link
Member

t3chguy commented May 4, 2021

This looks to regress the centring which the line is there to do.

Before:
image

After:
image

The bubble tile is no longer centred.

@DantrazTrev
Copy link
Contributor Author

@t3chguy I think m.key.verification.___ and few more events weren't supposed to be rendered if the sender is not defined as the user but allowing hidden event adds the issue of them falling back to the default mx_EventTile_line. I'll add another CSS class to make sure they're rendered evenly.

Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like further changes are needed.

@t3chguy t3chguy requested a review from a team May 7, 2021 09:12
@DantrazTrev
Copy link
Contributor Author

Added the hidden class for the mx_EventTile_bubbleContainer for the events so they render correctly
image

@jryans
Copy link
Collaborator

jryans commented May 7, 2021

@DantrazTrev Could you merge develop into your branch? It looks like there's a conflict to resolve, and getting the latest code will also help the tests pass as well.

@DantrazTrev
Copy link
Contributor Author

@DantrazTrev Could you merge develop into your branch? It looks like there's a conflict to resolve, and getting the latest code will also help the tests pass as well.

Done ^-^

@DantrazTrev DantrazTrev requested review from jryans and removed request for a team May 10, 2021 10:27
@jryans jryans requested review from a team and removed request for jryans May 17, 2021 12:00
Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, rather than overriding bubble styling, I wonder if instead we should resolve this by disabling bubble mode when we're using the hidden event handler. In more detail, perhaps this block:

if (SettingsStore.getValue("showHiddenEventsInTimeline") && !haveTileForEvent(this.props.mxEvent)) {
tileHandler = "messages.ViewSourceEvent";
// Reuse info message avatar and sender profile styling
isInfoMessage = true;
}

should reset isBubbleMessage to false...?

@DantrazTrev
Copy link
Contributor Author

DantrazTrev commented May 20, 2021

Hmm, rather than overriding bubble styling, I wonder if instead we should resolve this by disabling bubble mode when we're using the hidden event handler. In more detail, perhaps this block:

if (SettingsStore.getValue("showHiddenEventsInTimeline") && !haveTileForEvent(this.props.mxEvent)) {
tileHandler = "messages.ViewSourceEvent";
// Reuse info message avatar and sender profile styling
isInfoMessage = true;
}

should reset isBubbleMessage to false...?

Not really sure about it, considering it is the fallback to a tile that is causing the error. Disabling it would totally remove the tile and we might need to design a new one. Just disabling it would also not have really good consequences for all hidden events

image

The messages that are causing the error don't get rendered at all in the timeline as they're a part of pair of verification events, however, explicitly sending them through the dev tools primarily causes this issue. Maybe we should not allow them to be rendered from there?

@DantrazTrev DantrazTrev requested a review from jryans June 11, 2021 21:34
@jryans
Copy link
Collaborator

jryans commented Jun 17, 2021

Not really sure about it, considering it is the fallback to a tile that is causing the error. Disabling it would totally remove the tile and we might need to design a new one. Just disabling it would also not have really good consequences for all hidden events

image

The messages that are causing the error don't get rendered at all in the timeline as they're a part of pair of verification events, however, explicitly sending them through the dev tools primarily causes this issue. Maybe we should not allow them to be rendered from there?

Sorry if I am being dense, but what do you mean "tile that is causing the error"? I thought this PR was only about alignment of certain tiles...? What is "the error"?

In the block I quoted above:

if (SettingsStore.getValue("showHiddenEventsInTimeline") && !haveTileForEvent(this.props.mxEvent)) { 

...there is no "error" when we fail to find a tile, if that's what you mean...? We just don't have a tile for some custom event. If hidden events are shown (which is intended for developers only), we go into this branch and show the hidden event view. I am suggesting we could potentially resolve the alignment by adding a line to that block which sets isBubbleMessage to false for such a case.

Are you saying that you tried that, and it causes the call tiles to soft crash with "can't load the message" errors? That seems very surprising to me, so I must be misunderstanding... I was expecting isBubbleMessage to mainly affect alignment and appearance only, since it controls whether some CSS classes are set.

@jryans jryans removed their request for review June 17, 2021 13:30
@DantrazTrev
Copy link
Contributor Author

DantrazTrev commented Jun 17, 2021

Not really sure about it, considering it is the fallback to a tile that is causing the error. Disabling it would totally remove the tile and we might need to design a new one. Just disabling it would also not have really good consequences for all hidden events
image
The messages that are causing the error don't get rendered at all in the timeline as they're a part of pair of verification events, however, explicitly sending them through the dev tools primarily causes this issue. Maybe we should not allow them to be rendered from there?

Sorry if I am being dense, but what do you mean "tile that is causing the error"? I thought this PR was only about alignment of certain tiles...? What is "the error"?

In the block I quoted above:

if (SettingsStore.getValue("showHiddenEventsInTimeline") && !haveTileForEvent(this.props.mxEvent)) { 

...there is no "error" when we fail to find a tile, if that's what you mean...? We just don't have a tile for some custom event. If hidden events are shown (which is intended for developers only), we go into this branch and show the hidden event view. I am suggesting we could potentially resolve the alignment by adding a line to that block which sets isBubbleMessage to false for such a case.

Are you saying that you tried that, and it causes the call tiles to soft crash with "can't load the message" errors? That seems very surprising to me, so I must be misunderstanding... I was expecting isBubbleMessage to mainly affect alignment and appearance only, since it controls whether some CSS classes are set.

I apologize @jryans , I seem to have forgotten what I did back then that caused that error ( Potentially could have disabled something else along with that , that might have caused the error ) But now that I rechecked yes it does fix the issue alignment.

And yes you're correct that disabling isBubbleMessage for fallback tiles in the block fixes the issue and renders them as user sent events .

@jryans jryans self-requested a review June 28, 2021 12:27
Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for working on this!

@jryans jryans merged commit a8f5b7e into matrix-org:develop Jun 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

some hidden events are rendered without any left margin

3 participants