Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compose: Quote part of a message (Fixes #19712) #21390

Closed
wants to merge 2 commits into from

Conversation

asah
Copy link
Collaborator

@asah asah commented Mar 11, 2022

Fixes #19712

Tested on FF, Chrome and Safari.

image

image

image

@zulipbot zulipbot added size: L area: compose (misc) rust community request Issues of interest to the Rust community labels Mar 11, 2022
@zulipbot
Copy link
Member

Hello @zulip/server-compose members, this pull request was labeled with the "area: compose" label, so you may want to check it out!

@asah asah force-pushed the issue-19712-quote-part-of-a-message branch 5 times, most recently from 7a38608 to b782236 Compare March 11, 2022 14:14
@alya
Copy link
Contributor

alya commented Mar 16, 2022

Thanks for working on this!

I played with the PR, and it mostly worked, but I did come across a case where it did not. When I copied selected just the "topics" file link on http://localhost:9991/#narrow/stream/3-Denmark/topic/LAST.20database.20was.20de-duping.20erratically/near/29, the whole message got quoted.

@asah
Copy link
Collaborator Author

asah commented Mar 16, 2022 via email

@asah
Copy link
Collaborator Author

asah commented Mar 16, 2022

Hmmm, struggling to repro this behavior - sorry to ask, but can you provide a screenshot?

Here's what I'm seeing:

image

In that example, quoting code worked:

image

as per design, quotes the complete current message when you try to quote-reply across multiple messages:

image

(note: the highlighting in the screenshots is artificial: I re-selected the text after initiating the quote-reply, for the purposes of showing what I selected... I looked into highlighting as a feature but it gets complicated because the selection can span "into" the middle of a DOM object, and we'd need to carefully insert <span class="highlight" in just the right places... definitely doable, but I figured let's get this feature shipped first and see how people like it, before making the additional investment...)

thx!

@asah asah force-pushed the issue-19712-quote-part-of-a-message branch 2 times, most recently from 7e0e3f6 to 8c03849 Compare March 17, 2022 17:05
@asah asah force-pushed the issue-19712-quote-part-of-a-message branch 3 times, most recently from 3352e41 to 59c7fa1 Compare March 19, 2022 14:37
@zulipbot zulipbot added size: XL and removed size: L labels Mar 19, 2022
@asah asah changed the title quote part of a message compose: Quote part of a message Mar 19, 2022
@asah asah changed the title compose: Quote part of a message compose: Quote part of a message (Fixes #19712) Mar 19, 2022
@asah asah closed this Mar 20, 2022
@asah asah force-pushed the issue-19712-quote-part-of-a-message branch from 7e60114 to 9e850b0 Compare March 20, 2022 23:53
@asah asah reopened this Mar 21, 2022
@alya
Copy link
Contributor

alya commented Apr 1, 2022

Oh, my bad, I didn't realize the link in my comment above is not stable!

Here's a gif:

2022-04-01 15 34 21

asah added a commit to asah/zulip that referenced this pull request Apr 2, 2022
@asah asah force-pushed the issue-19712-quote-part-of-a-message branch 4 times, most recently from f0ef09e to 6c724e0 Compare April 2, 2022 16:13
@asah
Copy link
Collaborator Author

asah commented Apr 2, 2022

@alya fixed - try it now. I also added support for capturing the selection if the user right-clicks / pulls up the context menu on Chrome/Safari/Brave. Firefox doesn't highlight the last element on right-click. keep 'em coming...
.oO( who knew there were so many corner cases? oh right, we're dealing with web browsers LOL )

chrome-capture (1)

chrome-capture (2)

chrome-capture (3)

@alya
Copy link
Contributor

alya commented Apr 5, 2022

Hmm, things are really going haywire when I try it:
2022-04-04 23 10 31

@alya
Copy link
Contributor

alya commented Apr 5, 2022

I also saw some differences in behavior between quote-and-reply with the mouse and quote-and-reply with >, so that's something to keep an eye on as well.

@asah
Copy link
Collaborator Author

asah commented Apr 5, 2022

@alya ugh sorry - not sure what happened, but I simplified the code and re-tested the cases:

  • selection: text, link, random text on the screen (eg. + invite users)
  • quote_and_reply trigger: shortcut, message menu
  • browser: chrome, firefox, safari

note: on menu-click, Safari loses focus (blur) and updates the selection to the empty string. I can ignore empty string, but then other blur events (e.g. clicking +invite user) will retain the old selection, which becomes weird when you then reply to a message. We could have Safari only support partial-quoting when using the keyboard (>) but not the menu?

@asah asah force-pushed the issue-19712-quote-part-of-a-message branch from 7d43e5d to 33d4075 Compare April 9, 2022 14:49
@asah asah closed this Apr 17, 2022
@asah asah deleted the issue-19712-quote-part-of-a-message branch April 17, 2022 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: compose (misc) rust community request Issues of interest to the Rust community size: XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quote part of a message
3 participants