PERF: applies optimisations on chat-live pane (#20532)

- group writes when computing separators positions
- shows skeleton only on initial load
- forces date separator to be pinned when first message to prevent a pinned - not pinned - pinned sequence when loading more in past
- relies on `message.visible` property instead of checking `isElementInViewport`
- attempts to load next/prev messages earlier
- do not scroll to on fetch more
- hides `last visit` text while pinned
This commit is contained in:
Joffrey JAFFEUX
2023-03-06 16:42:11 +01:00
committed by GitHub
parent d28390054e
commit b5e736504a
29 changed files with 337 additions and 378 deletions

View File

@ -93,8 +93,6 @@ RSpec.describe "Quoting chat message transcripts", type: :system, js: true do
it "quotes the message" do
chat_page.visit_channel(chat_channel_1)
expect(chat_channel_page).to have_no_loading_skeleton
clip_text = copy_messages_to_clipboard(message_1)
topic_page.visit_topic_and_open_composer(post_1.topic)
topic_page.fill_in_composer("This is a new post!\n\n" + clip_text)
@ -117,8 +115,6 @@ RSpec.describe "Quoting chat message transcripts", type: :system, js: true do
it "quotes the messages" do
chat_page.visit_channel(chat_channel_1)
expect(chat_channel_page).to have_no_loading_skeleton
clip_text = copy_messages_to_clipboard([message_1, message_2])
topic_page.visit_topic_and_open_composer(post_1.topic)
topic_page.fill_in_composer("This is a new post!\n\n" + clip_text)
@ -149,8 +145,6 @@ RSpec.describe "Quoting chat message transcripts", type: :system, js: true do
it "works" do
chat_page.visit_channel(chat_channel_1)
expect(chat_channel_page).to have_no_loading_skeleton
clip_text = copy_messages_to_clipboard(message_1)
topic_page.visit_topic_and_open_composer(post_1.topic)
topic_page.fill_in_composer(clip_text)
@ -167,8 +161,6 @@ RSpec.describe "Quoting chat message transcripts", type: :system, js: true do
it "quotes the message" do
chat_page.visit_channel(chat_channel_1)
expect(chat_channel_page).to have_no_loading_skeleton
clip_text = copy_messages_to_clipboard(message_1)
click_selection_button("cancel")
chat_channel_page.send_message(clip_text)
@ -191,8 +183,6 @@ RSpec.describe "Quoting chat message transcripts", type: :system, js: true do
it "opens the topic composer with correct state" do
chat_page.visit_channel(chat_channel_1)
expect(chat_channel_page).to have_no_loading_skeleton
select_message_desktop(message_1)
click_selection_button("quote")
@ -219,8 +209,6 @@ RSpec.describe "Quoting chat message transcripts", type: :system, js: true do
mobile: true do
chat_page.visit_channel(chat_channel_1)
expect(chat_channel_page).to have_no_loading_skeleton
chat_channel_page.click_message_action_mobile(message_1, "selectMessage")
click_selection_button("quote")