Commit Graph

1104 Commits

Author SHA1 Message Date
Aman Agrawal
b845ef5091 recent_view: Show empty text after rerenders too.
Fixes #26746

There was a bug which caused empty text to not appear after
rerender since tbody didn't have the `required-text` class on
rerenders as it was not part of the handlebars template.
2023-09-18 08:01:58 -07:00
Aman Agrawal
19056db88b inbox: Show text if inbox is empty. 2023-09-18 08:01:58 -07:00
Aman Agrawal
4791e9f2fa inbox: Remove unused variable. 2023-09-18 08:01:58 -07:00
Anders Kaseorg
88e9320fa5 list_widget: Rename unsafe modifier parameter to modifier_html.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-15 18:11:50 -07:00
Anders Kaseorg
500e6bfdef user_card_popover: Add missing $ prefix for jQuery object variable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-15 14:14:50 -07:00
Daniil Fadeev
91d2b5ed81 user_group_popover: Migrate popover to Tippy.
Fixes part of #23632.
2023-09-15 13:40:53 -07:00
Daniil Fadeev
e52188bd41 user_group_popover: Fix blueslip error messages. 2023-09-15 13:40:53 -07:00
Prakhar Pratyush
fa063e4afc typeahead: Suggest only the first matching wildcard mention.
We suggest only the first matching wildcard mention,
irrespective of how many equivalent wildcard mentions match.

This helps to avoid suggesting multiple wildcard mentions at
the same time that do the same thing but have different names.

Fixes #25613.
2023-09-15 13:22:35 -07:00
Hardik Dharmani
3c89fe222a refactor: Rename private_message to direct_message.
This commit renames all uses of `private_message` in `unread.js` to
`direct_message`. Renamed `private_message_count` to
`direct_message_count` and `right_sidebar_private_message_count` to
`right_sidebar_direct_message_count`.
2023-09-15 12:37:09 -07:00
Hardik Dharmani
b8d84abc47 unread: Fix double counting of mentions in direct messages.
Created a new set `direct_message_with_mention_count` which stores direct
messages containing mentions. In `new_message_count`, direct messages
with mention were added twice, once by res.mentioned_message_count
and once by res.private_message_count so subtracting intersection of
both `direct_message_with_mention_count` now gives accurate count.

Fixes #25453
2023-09-15 12:37:09 -07:00
Aman Agrawal
3c05bd94a4 inbox: Don't search if there is no change in text. 2023-09-15 12:34:59 -07:00
Aman Agrawal
a0e3f66dc1 inbox: Center focused element if off screen when using keyboard. 2023-09-15 12:34:59 -07:00
Aman Agrawal
55eb0e4e07 inbox: Use blue box to indicate focus. 2023-09-15 12:34:59 -07:00
Aman Agrawal
f16273c488 hotkey: Change inbox hotkey from shift + t to shift + i.
Also, add that as a tippy tooltip in left sidebar.
2023-09-15 12:34:59 -07:00
Daniil Fadeev
d96110590b playground_links: Migrate popover to Tippy.
Fixes part of #23632.
2023-09-15 12:25:26 -07:00
Daniil Fadeev
79e050b81b playground_links: Fix disappearing reference when popover is active. 2023-09-15 12:25:26 -07:00
Daniil Fadeev
79c6ff91d7 playground_links: Add popover keyboard handling. 2023-09-15 12:25:26 -07:00
Daniil Fadeev
76891ec9ee playground_links: Add is_open function. 2023-09-15 12:25:26 -07:00
Daniil Fadeev
d27448dcec popovers: Rename playground links popover hiding function. 2023-09-15 12:25:24 -07:00
Daniil Fadeev
1782fb6866 popovers: Rename toggle_playground_link_popover function. 2023-09-15 12:25:12 -07:00
Daniil Fadeev
4d41d8bd02 popovers: Extract playground_links_popover into separate module. 2023-09-15 12:25:11 -07:00
Daniil Fadeev
3773f17933 popovers: Remove unused clear_for_testing function. 2023-09-15 12:24:34 -07:00
Daniil Fadeev
f421ea5e0b user_card_popover: Fix comments that describe a block of functions. 2023-09-15 12:24:00 -07:00
Daniil Fadeev
d2bc1f1bcf user_card_popover: Rename focus_user_info_popover_itemfunction. 2023-09-15 12:24:00 -07:00
Daniil Fadeev
e66eeb4444 user_card_popover: Rename item getter functions.
Renamed functions:
`get_user_info_popover_items` -> `get_user_card_popover_items`
`get_user_info_popover_for_message_items` ->
`get_user_card_popover_for_message_items`
`get_user_info_popover_manage_menu_items` ->
`get_user_card_popover_manage_menu_items`
2023-09-15 12:24:00 -07:00
Daniil Fadeev
27eb545af2 user_card_popover: Rename hiding functions.
Renamed functions:
`hide_message_info_popover` -> `hide_message_user_card_popover`
`hide_all_user_info_popovers` -> `hide_all_user_card_popovers`
`hide_user_info_popover` -> `hide_user_card_popover`
`hide_user_info_popover_manage_menu` ->
`hide_user_card_popover_manage_menu`
2023-09-15 12:24:00 -07:00
Daniil Fadeev
626127451b user_card_popover: Rename toggling and rendering functions.
Renamed functions:
`toggle_user_info_popover` -> `toggle_user_card_popover`
`toggle_user_info_popover_for_message` ->
`toggle_user_card_popover_for_message`
`toggle_user_info_popover_manage_menu` ->
`toggle_user_card_popover_manage_menu`
`render_user_info_popover` -> `render_user_card_popover`
2023-09-15 12:24:00 -07:00
Daniil Fadeev
c579e5fffa user_card_popover: Rename popover elements.
Renamed elements:
`$current_user_info_popover_elem` -> `$current_user_card_popover_elem`
`$current_message_info_popover_elem` ->
`$current_message_user_card_popover_elem`
`$current_user_info_popover_manage_menu` ->
`$current_user_card_popover_manage_menu`
2023-09-15 12:24:00 -07:00
Daniil Fadeev
7b1abd108b user_card_popover: Rename keyboard handling functions.
Renamed functions:
`user_info_popover_handle_keyboard` ->
`user_card_popover_handle_keyboard`
`user_info_popover_manage_menu_handle_keyboard` ->
`user_card_popover_manage_menu_handle_keyboard`
`user_info_popover_for_message_handle_keyboard` ->
`user_card_popover_for_message_handle_keyboard`
2023-09-15 12:24:00 -07:00
Daniil Fadeev
4531386e99 user_card_popover: Rename "*_popped" functions.
Renamed functions:
`user_info_popped` -> `is_user_card_open`
`message_info_popped` -> `is_message_user_card_open`
`user_info_manage_menu_popped` -> `is_user_card_manage_menu_open`
2023-09-15 12:24:00 -07:00
Daniil Fadeev
e0a5d8dc49 user_card_popover: Rename user_info_popover_manage_menu class. 2023-09-15 12:24:00 -07:00
Daniil Fadeev
228a4eb8a2 user_card_popover: Rename user_info_popover class. 2023-09-15 12:24:00 -07:00
Daniil Fadeev
d5f731f0bd user_card_popover: Rename user-info-popover class. 2023-09-15 12:24:00 -07:00
Daniil Fadeev
ff892925ce user_card_popover: Rename info_popover_actions class. 2023-09-15 12:24:00 -07:00
Daniil Fadeev
7c3f79df0d user_card_popover: Rename user_info_popover_manage_menu_btn class. 2023-09-15 12:24:00 -07:00
Daniil Fadeev
d89cd1e241 user_card_popover: Rename Handlebars templates.
List of renamed templates:
`user_info_popover_content` -> `user_card_popover_content`
`user_info_popover_manage_menu` -> `user_card_popover_manage_menu`
`user_info_popover_title` -> `user_card_popover_title`
2023-09-15 12:24:00 -07:00
N-Shar-ma
54b399ce96 compose: Disable unneeded control buttons in preview mode while editing.
This is a follow up to #26728, which disables buttons in preview mode
for any message being edited.

Care is taken to pass the correct preview state (compose vs the message
row being edited) to the popover menu so the buttons in it too can be
disabled as needed.
2023-09-14 17:15:40 -07:00
Aman Agrawal
9098648d95 inbox_ui: Take into account unmuted topics when filtering topics. 2023-09-14 13:57:27 -07:00
Aman Agrawal
fa4f9c7eff unread: Remove the TODO statement with an explanation. 2023-09-14 13:57:27 -07:00
Karl Stolley
5737c558cb message_edit: Display GIF button when Giphy is enabled.
CZO discussion:
https://chat.zulip.org/#narrow/stream/9-issues/topic/no.20GIF.20button.20when.20editing/near/1639551
2023-09-14 13:41:02 -07:00
Daniil Fadeev
72fa8b568c timerender: Change relative_time_string_from_date signature. 2023-09-14 11:56:53 -07:00
Daniil Fadeev
84c1a7dc2e recent_view_util: Convert module to Typescript. 2023-09-14 11:56:53 -07:00
Daniil Fadeev
c33328abef recent_view: Remove unreachable code path.
The Message type can only be "private" or "stream," so there's no need
 to handle exceptions in this case.
2023-09-14 11:56:53 -07:00
Shashank Singh
b62f21e876
tooltips: Add a tippy tooltip to display name of status-emoji.
Inspired by #19821. The original proposal in #19821 got bogged down with
issues around multiple overlapping tooltips, but this seems like a useful step 
forward.
2023-09-14 10:41:53 -07:00
Lalit
0e73b5547c user_settings: Add new user setting to show/hide unread counts on streams.
Added a show_unread_counts personal user setting to the
Settings > Display settings > Advanced section which
lets user choose whether he/she wants to see unread messages
count on the left sidebar for streams.

This setting have three options,
"All Streams" - This will show unread messages count for all
streams.
"Unmuted Stream" - This will be default option and it will
only show unread messages count for unmuted streams.
"No Stream" - This option will not show unread messages count
on any stream.

Fixes #24149
2023-09-13 18:45:45 -07:00
Lalit
fb165f1901 ui_util: Use .show and .hide classes for unread counts visibility.
This is a prep commit for introducing new "Show unread counts for" user
display setting. We should use css classes like `.hide` to hide the unread
count from the DOM as opposed to using `$unread_count_span.hide()` because
this injects inline styles and hence we won't be able to change the `display`
style on hovering for unread counts.
2023-09-13 18:45:45 -07:00
Lalit
f36c9c255b stream_list: Add new class stream-expanded besides active-filter.
This is a prep commit for the new setting `stream_unreads_display`.
Before when a stream was active i.e. once you are viewing topics in
the stream we had a `active-filter` class applied to the stream `li`
but if we were viewing a topic then the `active-filter` was removed
even though the stream was still expanded.

Added a new class `stream-expanded` which persists even when we are
in a topic view, this is useful for knowing whether a stream is
expanded or not within css.
2023-09-13 18:45:45 -07:00
palashb01
574a87b87d search: Update search bar to display title when used sender:.
This commit introduces a new behavior for the search bar. Now, if
the search keyword is 'sender:', it displays the title of the user/me.
for example: sender:me
title: Messages sent by you

sender: Palash
title: Messages sent by Palash

for the implementation, we already have the check for 'dm:', which is
similar to this so just added a new if check for 'sender:' and return
the title accordingly.

Fixes: #18690
2023-09-13 18:17:07 -07:00
palashb01
3a4cb692fb filter: Create helper function that checks basic filter terms.
Currently, `is_common_narrow` relies on `calc_can_mark_messages_read`
to check a number of filters that are "common narrows" (which means
they have a special message header title and different behavior when
exiting a search view).

Creates a helper function,
`single_term_type_returns_all_messages_of_conversation`, that is
used in both the above functions.

The check for an empty array of term types is unnecessary for
`is_common_narrow` because the "All messages" view has an undefined
filter and the "in-home" term type used in the "zhome" message list
is covered. So that empty array check is not moved to the helper
function, and instead stays only in `calc_can_mark_messages_read`.

The helper function checks for a single term type (except in the case
of topic, which is checked in combination with stream) that will return
all the messages of a conversation.

To ensure consistency in the function, split the combined if
condition of in-home and in-all, further improved the comments, and
deleted the unnecessary ones.
2023-09-13 18:17:07 -07:00
yogesh sirsat
953f026487 compose: Disable unneeded control buttons in preview mode.
Buttons which change the content in the compose textarea were so far
enabled even in preview mode, and would work, but those changes would
not be reflected in the visible preview. This is extremely confusing,
and can lead to the possibility of a user accidentally changing the
content of the compose textarea while previewing, and sending that.

Now we disable those buttons in preview mode, both when composing a new
message and when editing an existing one. We still show the tooltips,
but grey them out and make them unclickable.

Fixes: #20962
2023-09-13 15:09:16 -07:00