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

chat-gui-112: Enhance message user info window #222

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

m-flo
Copy link

@m-flo m-flo commented Apr 13, 2023

Addresses issue 112: #112

When users right click on a username from the chat window, we now parse out all messages that are authored by selected username and display as a message history in the user info menu. As long as the user info menu remains open, an event listener will dynamically update the message history based on the chat ui. Older messages will disappear from the selected user message history as they disappear from chat and new messages will render as they're added to the chat.

Untitled.mp4

@m-flo m-flo requested a review from 11k April 13, 2023 08:13
@m-flo m-flo added the enhancement New feature or request label Apr 13, 2023
@m-flo m-flo linked an issue Apr 13, 2023 that may be closed by this pull request
Copy link
Contributor

@11k 11k left a comment

Choose a reason for hiding this comment

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

Clicking on a username in the user list menu didn't show the messages box because it didn't make sense contextually. Now that it's displaying the user's entire message history, you can show the message box in that situation, too.

@@ -49,6 +49,10 @@ export default class ChatUserInfoMenu extends ChatMenuFloating {
this.chat.output.on('mouseup', '.msg-user .user', (e) => {
e.stopPropagation();
});

this.chat.output.on('DOMSubtreeModified', (e) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

DOMSubtreeModified seems to be part of the MutationEvent family of APIs, which is deprecated according to MDN's docs. I think you should use MutationObserver instead.

Also, there's a bug where, if you have a DM window for the target open, you can see messages from both the DM window and the main chat window. You should monitor changes in the currently-visible window only.

@m-flo m-flo requested a review from 11k April 30, 2023 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance messages section in user info window
2 participants