Skip to content

Combining successive Chat Messages #70

Description

@minotalen

there's space and legibility wasted by displaying names multiple times.
We can omit the name if a user sends multiple messages in a row.

vanilla js removal for illustration:

function removeDuplicateChatMessages() {
    let chatHead = document.getElementsByClassName('message-header');
    let prevName = null;
    for(let i= 0; i < chatHead.length; i++){
        if(prevName == chatHead[i].children[0].innerText) {
            chatHead[i].style.display = "none";
            prevName = chatHead[i];
        } 
        if(prevName = null) prevName = chatHead.children[0].innerText;
        else prevName = chatHead[i].children[0].innerText;
    }
}
  • proper implementation will need to be done directly in vue.
  • instead of removing the header it'd be better to just combine the messages from the same person to 1 message from this person with line breaks inbetween

Considerations:

  • it might make sense to preserve timestamp (especially if messages are a while apart)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfrontendAnything that's in the frontendpriority:lowWould be quite nice in the future but no hassle to get there

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions