zulip-flutter
zulip-flutter copied to clipboard
msglist/compose: In interleaved views, anticipate the right "destination narrow" for a reply
Contrast with #494, which is about letting the user specify the destination, which is different from anticipating the right one.
Users sometimes want to reply directly from an interleaved view, like a whole-stream view or the "All messages" view.
If the user hasn't already chosen a destination narrow by interacting with the compose box, we should anticipate what destination they might have in mind, and set the compose box accordingly, for example by prefilling the topic input.
A "destination narrow" is a conversation, and every message is in a conversation. So as long as there is at least one message in the interleaved view, there's at least one destination narrow that we might anticipate.
As a concrete example, we could store a pointer to the last message that's visible onscreen, if any, and update it as necessary. (Reasons for updating it include changes in scroll position; changes in which messages are included in the list; changes in the height of onscreen messages, whether from message edits or display-setting changes; there may be more reasons.) Then when we render the compose box, except when the user is already composing, we check that pointer and set the compose box to that message's conversation, by prefilling the topic input (for stream messages) or the DM recipients (for DMs).
In zulip-mobile, we used to do this in stream views by just choosing the latest message in the window of messages we had loaded. That message was frequently offscreen, and confusion would ensue when someone sent a message with an unintended topic. We addressed that by just never auto-filling the topic input in whole-stream views—
- zulip/zulip-mobile#4764
—but that caused unhappiness; people understandably felt it was too effortful to specify the right topic, when the right topic should have been obvious:
- zulip/zulip-mobile#5024
As with #494, if we don't think we'll ever have a compose box that lets you select DM recipients, we might narrow this issue's scope so that we're only helpful in the case of stream-message replies. Questions about how DM replies work shouldn't prevent us from being helpful in whole-stream views, anyway, even if we can't easily settle how "All messages" should work.
Related issue:
- #149
This came up in beta feedback:
https://chat.zulip.org/#narrow/channel/48-mobile/topic/mobile.20beta.20feedback/near/2002314
If you click on Channels, it brings you to recent Topic, but when you start type message it's not going to recent topic. You have to select Topic. Would be usefull if recent Topic is predefined, but editable. It would save few clicks
and from another user:
+1 for that! It happens all the time in my org with the current Zulip app that people start new conversations without a topic while they wanted to answer in the topic of the last message.