Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(MessageGroup) - group system messages #9777

Merged
merged 9 commits into from Aug 8, 2023

Conversation

Antreesy
Copy link
Contributor

@Antreesy Antreesy commented Jun 14, 2023

☑️ Resolves

  • Fix Frontend - Group system messages from calls #9678
  • New component and util for handling groups of system messages added
  • Combine messages for following actions:
    • participants being added to the conversations
    • participants promoted to / demoted from moderators
    • participants joined / left the call
    • participant reconnected to the call
  • Light sort of messages within one group:
    user added/removed => moderator promoted/demoted => call started => recording started => call joined/left => call ended

🖼️ Screenshots

🏚️ Before 🏡 After
Screenshot from 2023-08-03 12-52-48 image

🚧 Tasks

  • Design: appearance of header and collapsed messages, toggle button, animation
  • RFC: re-sorting system messages within one MessagesSystemGroup: define a list of system messages being sorted, and theirs order (sorting of related messages brings weird results , like call_left and call_joined in various combinations, so they're not sorted between each other)
  • Follow-up - test coverage
  • Follow-up - messages re-rendering

🏁 Checklist

@Antreesy Antreesy force-pushed the feat/9678/group-system-messages branch from 279a7c7 to 3d7f282 Compare June 21, 2023 12:59
@Antreesy Antreesy force-pushed the feat/9678/group-system-messages branch 2 times, most recently from 1d53c0f to 0f7d991 Compare July 3, 2023 15:56
@Antreesy Antreesy changed the title Group system messages [web draft] feat(MessageGroup) - group system messages Jul 3, 2023
@Antreesy Antreesy marked this pull request as ready for review July 3, 2023 16:00
Copy link
Member

@marcoambrosini marcoambrosini left a comment

Choose a reason for hiding this comment

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

Very nice, could we please always align the button with the date? Meaning to the first line of the system message

@Antreesy
Copy link
Contributor Author

Antreesy commented Jul 4, 2023

follow-up: messages are re-rendered on each fetch, so hidden messages collapse each time

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Very nice @Antreesy! One detail – as per design guidelines we never use italic font as it can be difficult to read for people. Since they are in a container already they do not need to be italic as well. :)

@Antreesy Antreesy force-pushed the feat/9678/group-system-messages branch from 571eb99 to 53fc88d Compare July 7, 2023 16:12
@Antreesy Antreesy marked this pull request as draft July 7, 2023 16:13
@Antreesy
Copy link
Contributor Author

Antreesy commented Jul 7, 2023

Rebased on top of refactor+bugfix PR #9897

@Antreesy Antreesy force-pushed the feat/9678/group-system-messages branch from 53fc88d to 209a8ec Compare July 21, 2023 11:13
@ShGKme
Copy link
Contributor

ShGKme commented Jul 22, 2023

Is it still work in progress, or ready for code review?

@Antreesy Antreesy marked this pull request as ready for review July 22, 2023 19:58
@Antreesy
Copy link
Contributor Author

Is it still work in progress, or ready for code review?

There still is a room for improvement, but mostly about error cleanup and refactoring.
Main Feature is working, so the code could be checked already

@marcoambrosini
Copy link
Member

Maybe underlying "and 7 more participants" and making it into an <a> that expands the content on click?

@nimishavijay
Copy link
Member

Looks really really nice! :)

we can hide this action until the group is hovered

If there are no a11y issues with this, then this sounds great! This would be the ideal solution. Maybe @Pytal or @JuliaKirschenheuter could help with figuring out if showing the button only on hover is okay? :)

Maybe underlying "and 7 more participants" and making it into an that expands the content on click?

I'm not too sure about this as it's not really a link at all, and we rarely (if at all) use link styling to indicate other actions.

@Pytal
Copy link
Member

Pytal commented Aug 2, 2023

Looks really really nice! :)

we can hide this action until the group is hovered

If there are no a11y issues with this, then this sounds great! This would be the ideal solution. Maybe @Pytal or @JuliaKirschenheuter could help with figuring out if showing the button only on hover is okay? :)

Hiding the action to reduce visual clutter sounds good but make sure that it is tabbable and visible when focused/hovered

@Antreesy
Copy link
Contributor Author

Antreesy commented Aug 3, 2023

@nimishavijay @marcoambrosini stylized toggle button asMessageButtonBar, which we have for normal message (with the same logic). Button is visible on hover, and in open state:

image

P.S. Updated screenshots in description

Copy link
Member

@nimishavijay nimishavijay left a comment

Choose a reason for hiding this comment

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

Looks really nice! :)

Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

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

Seems to works fine. Nothing blocking, but some naming/architecture comments

src/components/MessagesList/MessagesList.vue Outdated Show resolved Hide resolved
src/utils/createCombinedSystemMessage.js Outdated Show resolved Hide resolved
@nickvergessen
Copy link
Member

Conflicting files
src/components/MessagesList/MessagesGroup/Message/Message.vue

…equently

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
@Antreesy Antreesy force-pushed the feat/9678/group-system-messages branch from 81c6d9b to 1dfc54b Compare August 7, 2023 15:56
@Antreesy
Copy link
Contributor Author

Antreesy commented Aug 7, 2023

Rebased onto master
@ShGKme please take a look again - i've turned the utiil into composable

Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

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

Tested manually in basic cases ✅

These components and grouping logic has many edge cases. IMO, we should cover it with tests.

Comment on lines 31 to 52
<div v-for="messagesCollapsed of messagesGroupedBySystemMessage"
:key="messagesCollapsed.id"
class="message-group__system">
<ul v-if="messagesCollapsed.messages?.length > 1"
class="messages messages--header">
<Message v-bind="createCombinedSystemMessage(messagesCollapsed)"
is-combined-system-message
:is-combined-system-message-collapsed="messagesCollapsed.collapsed"
:next-message-id="getNextMessageId(messagesCollapsed.messages.at(-1))"
:previous-message-id="getPrevMessageId(messagesCollapsed.messages.at(0))"
@toggle-combined-system-message="toggleCollapsed(messagesCollapsed)" />
</ul>
<ul v-show="messagesCollapsed.messages?.length === 1 || !messagesCollapsed.collapsed"
class="messages"
:class="{'messages--collapsed': messagesCollapsed.messages?.length > 1}">
<Message v-for="message of messagesCollapsed.messages"
:key="message.id"
v-bind="message"
:next-message-id="getNextMessageId(message)"
:previous-message-id="getPrevMessageId(message)" />
</ul>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

This component has many methods calls in template (that a called during the re-rendering) and those methods are not small utils or formatting methods but data processing methods.

It won't be a problem if it doesn't have unnecessary re-renderings, but currently MessagesList re-renders each new message.

For example, a user has a chat with mostly only calls, but large calls, for example, 100 people. Then in the history there will be many groups with 100 system messages about leaving the call. And every message, reaction, poll update will re-render the list with recalculating all these methods looping over 100 messages for each group.

IMO, we can keep it in this way but then do one of:

  • Find a reason of re-renderings
  • Refactor all these components, remove unnecessary props
  • Remove these calculating inside rendering
  • Wait for Vue 3 migration =D

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I'd prefer to use in in v-for directives to use only one style. (v-for of is not very often used in our components).

Copy link
Contributor Author

@Antreesy Antreesy Aug 8, 2023

Choose a reason for hiding this comment

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

"of" is replaced with "in". Test coverage and components re-rendering moved to follow-up

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
…first message line

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
…r.vue

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
@Antreesy Antreesy force-pushed the feat/9678/group-system-messages branch from 1dfc54b to 9b1c9d0 Compare August 8, 2023 07:24
@Antreesy Antreesy enabled auto-merge August 8, 2023 07:24
@Antreesy Antreesy dismissed stale reviews from marcoambrosini and jancborchardt August 8, 2023 07:25

Blocking question has been resolved

@Antreesy
Copy link
Contributor Author

Antreesy commented Aug 8, 2023

/backport to stable27

@Antreesy Antreesy merged commit 5382b03 into master Aug 8, 2023
19 checks passed
@Antreesy Antreesy deleted the feat/9678/group-system-messages branch August 8, 2023 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Frontend - Group system messages from calls
7 participants