Commit Graph

290 Commits

Author SHA1 Message Date
Martin Brennan
f47ee8fd40
WIP: Figuring out messages in thread panel 2023-02-13 12:51:39 +10:00
Martin Brennan
ff90a56f5b
DEV: Test fix 2023-02-13 11:03:20 +10:00
Martin Brennan
dd9059917f
DEV: Review fixes 2023-02-13 10:40:14 +10:00
Martin Brennan
176070cd78
Merge branch 'main' into chat-side-panel-initial-skeleton-threads 2023-02-13 10:30:42 +10:00
Gerhard Schlager
71658e63f7 DEV: Fix typo
@discourse-translator-bot keep_translations_and_approvals
2023-02-13 00:46:33 +01:00
Joffrey JAFFEUX
e4738cb1bc
FIX: correctly listens to chat notifications (#20246)
This change will ensure we enter and subscribe to presence channels on start and will use the correct "change" events from presence channel to update state.
2023-02-12 23:26:11 +01:00
Kris
8bc9acc414
A11Y: Header icons should be buttons, not links (#20242) 2023-02-10 13:55:51 -05:00
Joffrey JAFFEUX
1a9cb0914c re-adds @tracked activeChannel 2023-02-10 12:47:10 +01:00
Joffrey JAFFEUX
074e7ad4ed
Merge branch 'main' into chat-side-panel-initial-skeleton-threads 2023-02-10 12:25:59 +01:00
Jan Cernik
8121565631
FIX: Chat's user autocomplete threw errors (#20236) 2023-02-10 11:41:46 +01:00
Martin Brennan
c9776fe84d
DEV: Change setActiveChannel to get/set in services/chat (#20237)
Per PR comment in #20209, we don't need to do setActiveChannel,
we can just use native get/set instead.
2023-02-10 11:41:29 +01:00
Martin Brennan
bf2a9063f6 DEV: Fix tracking for activeThread 2023-02-10 16:05:32 +10:00
Martin Brennan
54a4251b8e DEV: Fix lint 2023-02-10 15:41:31 +10:00
Martin Brennan
eaa49e3764 DEV: Use @tracked for activeThread 2023-02-10 15:33:15 +10:00
chapoi
00ddfd761a UX: apply grid for chat-view only 2023-02-10 12:31:29 +07:00
Martin Brennan
be8968b05b DEV: Add mainOutletModifierClasses for chat main outlet
The main outlet needs different styles based on the route,
and whether the sidebar is expanded.
2023-02-10 15:16:05 +10:00
Martin Brennan
218dbc249a
DEV: Fix routing not nulling channel/thread 2023-02-10 10:16:25 +10:00
Martin Brennan
f6081a9277
DEV: Review fixes 2023-02-10 09:25:02 +10:00
Martin Brennan
c19394c184
Merge branch 'main' into chat-side-panel-initial-skeleton-threads 2023-02-10 08:23:47 +10:00
Andrei Prigorshnev
0dcfd7ddec
DEV: correct a relationship – a chat message may have several mentions (#20219)
This change only makes the model reflect correctly what's 
already happening in the database. Note that there are no calls 
to chat_message.chat_mention in Core and plugins so this 
change should be safe.

Also note, that at the moment we use the chat_mentions db 
table only to support notifications about mentions, but 
we're going to start using it for other cases. This commit is 
the first step in that direction.
2023-02-09 17:44:04 +04:00
Martin Brennan
b21664aee1
DEV: Test fix 2023-02-09 16:55:21 +10:00
Martin Brennan
9810c9aba5
DEV: Fix mobile thread full style 2023-02-09 16:47:21 +10:00
Martin Brennan
f341fa9b01 DEV: Register side panel mobile asset 2023-02-09 16:23:00 +10:00
Martin Brennan
77fb4fb2f2 DEV: Fix mobile thread spec 2023-02-09 15:50:22 +10:00
chapoi
81cd3d32f9 UX: side-panel on mobile 2023-02-09 12:25:37 +07:00
Martin Brennan
b33883db2c DEV: Spec for opening thread on mobile 2023-02-09 15:11:44 +10:00
chapoi
d93cdec8bb UX: BEM 2023-02-09 12:09:59 +07:00
chapoi
4a633597f4 UX: moved padding to different level 2023-02-09 12:06:13 +07:00
chapoi
c9f6cfce62 FIX: moved msg out header div 2023-02-09 12:05:55 +07:00
chapoi
769648652e UX: add missing flex prop 2023-02-09 12:02:36 +07:00
chapoi
827980903f UX: remove flex from side-panel 2023-02-09 12:02:01 +07:00
chapoi
fc65cdacc3 UX: add grid-area 2023-02-09 12:00:17 +07:00
chapoi
e7b810e0f9 Merge branch 'chat-side-panel-initial-skeleton-threads' of https://github.com/discourse/discourse into chat-side-panel-initial-skeleton-threads 2023-02-09 11:40:17 +07:00
chapoi
ca7b55d368 UX: use BEM modifier format 2023-02-09 11:22:46 +07:00
Martin Brennan
588e812d33 DEV: Add started by and avatar align and more specs 2023-02-09 14:07:31 +10:00
Martin Brennan
5699facfca
DEV: Start thread system specs 2023-02-09 13:33:38 +10:00
Martin Brennan
b598635753
Merge branch 'main' into chat-side-panel-initial-skeleton-threads 2023-02-09 11:15:41 +10:00
Martin Brennan
9108ef0383 WIP: Chat side panel skeleton 2023-02-08 17:01:12 +10:00
chapoi
d33d98f9c1
FIX: changed classname for YT images (#20212) 2023-02-08 05:57:36 +01:00
Martin Brennan
9a45b59fb5
FEATURE: Automatically create chat threads in background (#20206)
Whenever we create a chat message that is `in_reply_to` another
message, we want to lazily populate the thread record for the
message chain.

If there is no thread yet for the root message in the reply chain,
we create a new thread with the appropriate details, and use that
thread ID for every message in the chain that does not yet have
a thread ID.

* Root message (ID 1) - no thread ID
    * Message (ID 2, in_reply_to 1) - no thread ID
    * When I as a user create a message in reply to ID 2, we create a thread and apply it to ID 1, ID 2, and the new message

If there is a thread for the root message in the reply chain, we
do not create one, and use the thread ID for the newly created chat
message.

* Root message (ID 1) - thread ID 700
    * Message (ID 2, in_reply_to 1) - thread ID 700
    * When I as a user create a message in reply to ID 2, we use the existing thread ID 700 for the new message

We also support passing in the `thread_id` to `ChatMessageCreator`,
which will be used when replying to a message that is already part of
a thread, and we validate whether that `thread_id` is okay in the context
of the channel and also the reply chain.

This work is always done, regardless of channel `thread_enabled` settings
or the `enable_experimental_chat_threaded_discussions` site setting.

This commit does not include a large data migration to backfill threads for
all existing reply chains, its unnecessary to do this so early in the project,
we can do this later if necessary.

This commit also includes thread considerations in the `MessageMover` class:

* If the original message and N other messages of a thread is moved,
   the remaining messages in the thread have a new thread created in
   the old channel and are moved to it.
* The reply chain is not preserved for moved messages, so new threads are
   not created in the destination channel.

In addition to this, I added a fix to also clear the `in_reply_to_id` of messages
in the old channel which are moved out of that channel for data cleanliness.
2023-02-08 10:22:07 +10:00
Martin Brennan
1a6f6d1dc4
Revert "FEATURE: Automatically create chat threads in background (#20132)" (#20205)
This reverts commit 37e6e3be7f.
2023-02-08 09:59:18 +10:00
Martin Brennan
37e6e3be7f
FEATURE: Automatically create chat threads in background (#20132)
Whenever we create a chat message that is `in_reply_to` another
message, we want to lazily populate the thread record for the
message chain.

If there is no thread yet for the root message in the reply chain,
we create a new thread with the appropriate details, and use that
thread ID for every message in the chain that does not yet have
a thread ID.

* Root message (ID 1) - no thread ID
    * Message (ID 2, in_reply_to 1) - no thread ID
    * When I as a user create a message in reply to ID 2, we create a thread and apply it to ID 1, ID 2, and the new message

If there is a thread for the root message in the reply chain, we
do not create one, and use the thread ID for the newly created chat
message.

* Root message (ID 1) - thread ID 700
    * Message (ID 2, in_reply_to 1) - thread ID 700
    * When I as a user create a message in reply to ID 2, we use the existing thread ID 700 for the new message

We also support passing in the `thread_id` to `ChatMessageCreator`,
which will be used when replying to a message that is already part of
a thread, and we validate whether that `thread_id` is okay in the context
of the channel and also the reply chain.

This work is always done, regardless of channel `thread_enabled` settings
or the `enable_experimental_chat_threaded_discussions` site setting.

This commit does not include a large data migration to backfill threads for
all existing reply chains, its unnecessary to do this so early in the project,
we can do this later if necessary.

This commit also includes thread considerations in the `MessageMover` class:

* If the original message and N other messages of a thread is moved,
   the remaining messages in the thread have a new thread created in
   the old channel and are moved to it.
* The reply chain is not preserved for moved messages, so new threads are
   not created in the destination channel.

In addition to this, I added a fix to also clear the `in_reply_to_id` of messages
in the old channel which are moved out of that channel for data cleanliness.
2023-02-08 09:50:42 +10:00
Joffrey JAFFEUX
a04201ae01
UX: implements a random and auto generated skeleton (#20202)
UI is not modified much besides removing the border-bottom, and using only message body.

However instead of having a fix template, this is all automatically generated and random, resulting in a more natural experience.
2023-02-07 22:48:10 +01:00
Joffrey JAFFEUX
b755b45029
FIX: apply max-height on the outer container (#20199)
This change allow to correctly work with the topic composer height changing.
2023-02-07 22:00:00 +01:00
Joffrey JAFFEUX
7dcaaec90c
UX: allows drawer to take most of height space (#20197)
Only the header's height and 15px spacing are removed from the height of the viewport.

Previously it was limited to 90vh and there was also a useless property on a child node limiting it to 85vh. We now use only one property.
2023-02-07 19:49:00 +01:00
Joffrey JAFFEUX
b89df3ca9d
DEV: refactors routes to simplify using outlet (#20179)
This work will allow us to have an {{outlet}} chat.channel route and use it for threads as a sidepanel.
2023-02-07 13:59:32 +01:00
Joffrey JAFFEUX
f4b56ea455
UX: orders public channels by slug instead of title (#20188)
Public channels were previously sorted by name, however, channels with a leading emoji in the name would always appear first in the list. By using slug we avoid this issue.
2023-02-07 10:36:28 +01:00
Joffrey JAFFEUX
19ff8210bc
DEV: fixes failing spec (#20191)
Broken in #25f2fb61b829edb7d60499c80648e06cca71fdbf
2023-02-07 09:53:29 +01:00
Dan Ungureanu
25f2fb61b8
DEV: Add 'chat_message_trashed' Discourse event (#20170)
Triggers a DiscourseEvent when a message is deleted, similar to
`:chat_message_created` and `:chat_message_edited`. This is not used
in this plugin, but can be used by other plugins to act when a message
is trashed.
2023-02-06 21:52:43 +01:00
Discourse Translator Bot
8b4d571b9b
Update translations (#20183) 2023-02-06 16:49:27 +01:00