UX: enhances chat copy features (#23770)

- Allows to copy quotes from mobile
- Allows to copy text of a message from mobile
- Allows to select messages by clicking on it when selection has started

Note this commit is also now using toasts to show a confirmation of copy, and refactors system specs helpers concerning secondary actions.

<!-- NOTE: All pull requests should have tests (rspec in Ruby, qunit in JavaScript). If your code does not include test coverage, please include an explanation of why it was omitted. -->
This commit is contained in:
Joffrey JAFFEUX
2023-10-04 16:14:37 +02:00
committed by GitHub
parent 24feb20abc
commit 08df8fc1d1
20 changed files with 273 additions and 162 deletions

View File

@ -20,7 +20,9 @@ RSpec.describe "Quoting chat message transcripts", type: :system do
messages = Array.wrap(messages)
messages.each { |message| channel_page.messages.select(message) }
channel_page.selection_management.copy
expect(page).to have_css(".chat-selection-management[data-last-copy-successful]")
expect(PageObjects::Components::Toasts.new).to have_success(
I18n.t("js.chat.quote.copy_success"),
)
clip_text = cdp.read_clipboard
expect(clip_text.chomp).to eq(generate_transcript(messages, current_user))
clip_text