Inbox can suddenly scroll to top due to a rerender when user
is trying to scroll down. A possible caues for this is
`move_focus_to_visible_area` being triggered on scroll but the
element located using:
```
document.elementFromPoint(inbox_center_x, inbox_row_below_filters);
```
being out of view. To fix it, we try to locate the element in the
same animation frame. This will remove the possibility of element
being out of view when we try to set focus to it.
The previous logic only worked correctly when user moved from
inbox view to channel topic list view and vice versa.
The logic failed if user moves out of inbox since then `save` state
is never called and hence when restore is called, the navigation
state gets reset.
Fixed by also saving state when inbox is hidden.
The call from the inbox code was asking the wrong question -- it wants
to know if we've fetched full topic data to know whether to ask for
it. The new name for the function moved in
7d55ad3c13 helped reveal it.
There also was a mention in a comment that was half-baked; wrote the
comment properly.
Fixed by hiding inbox view empty text when channel view is visible.
To ensure normal inbox view empty text is hidden, we make it think
there is visible unread topics.
When the compose box is closed, if the selected message is for the
direct conversation with the current user, then we show "Message
yourself" as the compose reply button text.
Adds `decode_dm_recipients_user_ids_from_url` helper function to
hash_util, which parses a narrow URL for DM recipient user IDs.
Checks that "dm" operand, which should be a string of user emails,
also passes the check for all the email addresses being valid
compose recipients.
Co-Authored-By: Lauryn Menard <lauryn@zulip.com>
Since inbox only has unread topics visible, rows having no
unread counter was not handled. Added that support so that
inbox style channel view can use it.
There is no difference in this case when a message object is
returned vs not. So, we just return as soon as we have the
requried data.
This will useful when won't have message ids associated with topic
easily when rendering inbox style channel view.
Instead of having two calls everywhere to show a view and hide other
views, we move the logic to hide the other views inside the show
function of the view.
This will help as we will add other views to the app to keep the
logic to hide other views in the `show` function of the view to show.
So, the logic calling `show` for a view
doesn't have to iterate through hiding all the other views first.
Renames ComposeClosedMessage to ReplyRecipientInformation, and
exports the type from compose_closed_ui.ts so that the functions
that construct these objects from the recent conversations and
inbox views have the type available.
Also, renames the variables for these objects to not be "message",
so that it's clear that these are not Message objects.
Renames update_reply_recipient_label to
update_recipient_text_for_reply_button.
This better matches the function that sets the default text for
the closed compose box button: set_standard_text_for_reply_button.
This commit updates the topic links obtained from clicking
the topics in the left sidebar, recent view and inbox, and
those obtained from "Copy link to topic" to use the new
topic permalinks.
Fixes part of #21505.
Earlier, only unread @-mentions in streams were shown in inbox view
while DMs lacked this indicators.
This commit introduces unread @-mention indicators for DM rows in inbox
view using `unread_mention_dms` which stores `user_ids_string` mapped to
`message_id`s having mention.
Fixes part of zulip#28849.
We show `realm_empty_topic_display_name` for empty string
topics in the inbox view.
This commit makes it possible for users to search for
the `realm_empty_topic_display_name` value to filter out empty
string topics.
This simplifies the StreamSubscription type, and parallels how we
always initialize every other property that isn’t in
NeverSubscribedStream (audible_notifications, desktop_notifications,
email_notifications, push_notifications, wildcard_mentions_notify,
color, is_muted). email_address was already optional.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Have one inbox row and focus on it. Mark the message as read in
another tab. Press `r` in the first tab will return an error as
the row_focus didn't change but there is no present. So, we
fix it by updating the row_focus if it can get out of bounds
when updating inbox view.
Using different punctuation for the aria-label from the tooltip is
silly. Additionally, we don't need to repeat the channel name in
aria-label; it essentially will never be seen and the message list
copy of getting the channel name was buggy.
Earlier tooltip info for the default topic menu notification option
had static string to display.
This commit changes the string info and includes channel name and its
corresponding privacy icon to display in the tooltip.
Changing the button text of one-time modals to introduce the recent and
inbox view to say "Got it" rather than "Continue" helps reinforce the
vocabulary we're using "Got it" = dismiss one-time content forever.