discourse/plugins/chat/test/javascripts
Martin Brennan ea548292bc
DEV: Refactoring chat message actions for ChatMessage component usage in thread panel (#20756)
This commit is a major overhaul of how chat message actions work, to make it so they are reusable between the main chat channel and the chat thread panel, as well as many improvements and fixes for the thread panel.

There are now several new classes and concepts:

* ChatMessageInteractor -  This is initialized from the ChatMessage, ChatMessageActionsDesktop, and ChatMessageActionsMobile components. This handles permissions about what actions can be done for each
message based on the context (thread or channel), handles the actions themselves (e.g. copyLink, delete, edit),
and interacts with the pane of the current context to modify the UI
* ChatChannelThreadPane and ChatChannelPane services - This represents the UI context which contains the
messages, and are mostly used for state management for things like message selection.
* ChatChannelThreadComposer and ChatChannelComposer - This handles interaction between the pane, the
message actions, and the composer, dealing with reply and edit message state.
* Scrolling logic for the messages has now been moved to a helper so it can be shared between the main channel pane and the thread pane
* Various improvements with the emoji picker on both mobile and desktop. The DOM node of each component is now located outside of the message which prevents a large range of issues.

The thread panel now also works in the chat drawer, and the thread messages have less
actions than the main panel, since some do not make sense there (e.g. moving messages to
a different channel). The thread panel title, excerpt, and message sender have also been removed
for now to save space.

This gives us a solid base to keep expanding on and fixing up threads. Subsequent PRs will
make the thread MessageBus subscriptions work and disable echo mode
for the initial release of threads.

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2023-04-06 15:19:52 +02:00
..
acceptance FEATURE: Add CSS class generation for category colors and hashtags (#20951) 2023-04-05 13:02:35 +10:00
components DEV: Refactoring chat message actions for ChatMessage component usage in thread panel (#20756) 2023-04-06 15:19:52 +02:00
helpers DEV: rework the chat-live-pane (#20519) 2023-03-03 13:09:25 +01:00
integration/components/user-menu DEV: Modernize chat's component tests (#19577) 2022-12-22 14:35:18 +01:00
unit DEV: Refactoring chat message actions for ChatMessage component usage in thread panel (#20756) 2023-04-06 15:19:52 +02:00
widgets DEV: Pass messageId as a dynamic segment instead of a query param (#20013) 2023-02-01 12:39:23 -03:00
chat-fixtures.js FEATURE: channels can allow/disallow @all/@here mentions (#19317) 2022-12-05 17:03:51 +01:00