discourse/plugins/chat/test/javascripts
Martin Brennan 9953a6edd9
DEV: Rearchitect chat tracking state (#21550)
This moves chat tracking state calculation for channels
and threads into a central Chat::TrackingStateManager service, that
serves a similar purpose to the TopicTrackingState model
in core.

This service calls down to these query classes:

* ThreadUnreadsQuery
* ChannelUnreadsQuery

To get the unread_count and mention_count for the appropriate
channels and threads.

As well as this, this commit refactors the client-side chat
tracking state.

Now, there is a central ChatTrackingStateManager Ember Service
so all tracking is accessible and can be counted from one place,
which can also initialize tracking from an initial payload.

The actual tracking counts are now maintained in a ChatTrackingState
class that is initialized on the `.tracking` property of both channel and
thread objects.

This removes the attributes on UserChatChannelMembership and decoration
of said membership from ChannelFetcher, preferring instead to have an additional
object for tracking in the JSON.
2023-05-16 14:51:13 +02:00
..
acceptance DEV: Rearchitect chat tracking state (#21550) 2023-05-16 14:51:13 +02:00
components DEV: Rearchitect chat tracking state (#21550) 2023-05-16 14:51:13 +02:00
helpers DEV: Rearchitect chat tracking state (#21550) 2023-05-16 14:51:13 +02:00
integration/components/user-menu DEV: Modernize chat's component tests (#19577) 2022-12-22 14:35:18 +01:00
unit DEV: converts models to native classes (#21418) 2023-05-08 18:24:41 +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 DEV: Rearchitect chat tracking state (#21550) 2023-05-16 14:51:13 +02:00