UX: remove last reply from My Threads preview + restyle (#25568)

On mobile, when viewing the My Threads area, each thread will show:

- The avatar of the last responder in the thread, overlaid with the chat thread symbol to visually distinguish this area from DMs.
- Either the thread title, where applicable, or the first message of the thread, truncated to fit on one line.
- The channel where the thread originated.
- The last message sent in the thread, truncated to fit on one line.
- When the last message was sent in the thread.

---------

Co-authored-by: David Battersby <info@davidbattersby.com>
This commit is contained in:
chapoi
2024-03-11 11:59:40 +02:00
committed by GitHub
parent 0e3a8b15f5
commit cfd72fa65c
6 changed files with 155 additions and 19 deletions

View File

@ -244,4 +244,22 @@ RSpec.describe "User threads", type: :system do
expect(user_threads_page).to have_threads
end
end
context "when in mobile", mobile: true do
before do
chat_thread_chain_bootstrap(channel: channel_1, users: [current_user, Fabricate(:user)])
end
it "has the expected UI elements" do
chat_page.visit_user_threads
expect(user_threads_page).to have_threads(count: 1)
expect(user_threads_page).to have_css(".chat-user-avatar")
expect(user_threads_page).to have_css(".chat__thread-title__name")
expect(user_threads_page).to have_css(".chat-channel-name")
expect(user_threads_page).to have_css(".c-user-thread__excerpt")
expect(user_threads_page).to have_css(".c-user-thread__excerpt-poster")
expect(user_threads_page).to have_css(".c-user-thread .relative-date")
end
end
end