Commit Graph

1651 Commits

Author SHA1 Message Date
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
Karl Stolley 89ce2c112c vdots: Place new more-vertical icon in compose box. 2023-09-14 17:13:58 -07:00
Karl Stolley b86b7ab067 vdots: Place new more-vertical icon on user card. 2023-09-14 17:13:58 -07:00
Karl Stolley 679f95214c vdots: Place new more-vertical icon in sidebars. 2023-09-14 17:13:58 -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
Karl Stolley 5708b57acd compose: Present banners with intrinsic layout.
By implementing a careful flexbox declaration on a new banner-
element container, this presents banners accessibly across the full
range of possible viewports--and relies only on a single, small
media query to do so.

Fixes: #25847

Co-Authored-By: Hardik Dharmani <Ddharmani99@gmail.com>
2023-09-14 10:13:29 -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
Aman Agrawal aaf3369d39 recent_view: Add table header to sort by unread count.
Fixes: #22790
2023-09-13 14:58:13 -07:00
Vector73 5a88e4f6cb notifications: Remove realm-default-sound-audio initialization.
This commit removes the code to initialize
"realm-default-notification-sound-audio" element from
"notifications.initialize", because we do not need this
now as the previous commit added code to initialize it
in "settings_realm_user_settings_default.set_up".

This change works because the realm default notification sound
can only be played from the settings UI and so it is fine to
initialize it only when opening the default user settings panel.
2023-09-13 13:07:10 -07:00
Vector73 f384eb67a9 default-user-settings: Fix play button not playing selected sound.
Fixes #26598.
2023-09-13 13:07:10 -07:00
Aman Agrawal 0723c56246 emoji_picker: Improve rendering time of emoji picker by ~30%.
Fixes #25744

By rendering the emojis after initializing the simplebar container,
the rendering time is decreased by ~30% as observed at 6x CPU
cooldown on mac i7.
2023-09-13 12:39:13 -07:00
Daniil Fadeev 2f1561e3b8 giphy: Fix giphy popover rendering on narrow screens.
We should render the giphy popover as a centered overlay for
mobile-sized screens.
2023-09-13 12:20:35 -07:00
Daniil Fadeev b7c2570933 giphy: Refactor the giphy popover to use toggle_popover_menu.
This change is needed so we can use the `use_as_overlay` option on
mobile screens.
2023-09-13 12:20:35 -07:00
Daniil Fadeev 5b0e74c940 user_card_popover: Rename `show_*` functions to `toggle_*`.
This naming more accurately reflects the functionality of these types
of functions. They are not only responsible for displaying the
popovers but also for toggling them off.
2023-09-13 11:49:12 -07:00
Daniil Fadeev e5da3d9900 user_card_popover: Extract user card popover data into a new function.
The purpose of this change is to simplify the
`render_user_card_popover` function, so it has the single
responsibility of just rendering.
2023-09-13 11:49:12 -07:00
Daniil Fadeev c5f6c00a81 popovers: Extract user info popovers into their own module.
The intent behind this commit is to tidy up how we handle user info
popovers. The first step is to move everything related to them into
its own module. This commit should not have any functional changes.
2023-09-13 11:49:08 -07:00
Daniil Fadeev 64f77b1dee popovers: Stop exporting `toggle_playground_link_popover` function.
This function is only used in the `popovers.js` module, so there's no
need to export it.
2023-09-13 11:48:31 -07:00
Daniil Fadeev 7bcb868f9a popovers: Use a special function to check if the popover is open. 2023-09-13 11:48:31 -07:00
Daniil Fadeev 257c327f39 user_profile: Move event registration to the correct place.
The event callback that was moved is part of `user_info_popover` and
should be registered along with the other actions of this popover.
2023-09-13 11:48:31 -07:00
Daniil Fadeev 523b5a0877 popovers: Remove unused functions from `popovers.js` module. 2023-09-13 11:48:31 -07:00
Daniil Fadeev 0a11a4b983 notifications: Extract notification title retrieval.
This commit aims to extract all logic related to obtaining
notification title from the `process_notification` function into
a separate `get_notification_title` function.
2023-09-13 11:18:35 -07:00
Daniil Fadeev fe5d680f27 notifications: Refactor `process_notification` function.
Turned multiple if statements into a switch/case and rearranged
variable declarations.
2023-09-13 10:55:59 -07:00
Daniil Fadeev 8b8f95b6f5 notifications: Extract sender name removal from recipients list. 2023-09-13 10:55:59 -07:00
Daniil Fadeev 53ef273665 notifications: Extract notification key retrieval.
This commit aims to extract all logic related to obtaining
notification key from the `process_notification` function into a
separate `get_notification_key` function.
2023-09-13 10:55:59 -07:00
Daniil Fadeev fdac13ba24 notifications: Extract `notification_source` debugging logic.
This commit aims to extract all logic related to debugging the value
of `notification_source` from the `process_notification` function into
 a separate `debug_notification_source_value` function.
2023-09-13 10:55:59 -07:00
Daniil Fadeev a11dedd393 notifications: Extract notification content retrieval.
This commit aims to extract all logic related to obtaining
notification content from the `process_notification` function into a
separate `get_notification_content` function.
2023-09-13 10:55:59 -07:00
Daniil Fadeev 8d0a70b6b9 notifications: Simplify if statement.
Since `pm_content_in_desktop_notifications` is a boolean, there's no
need to check if it's undefined.
2023-09-13 10:55:59 -07:00
Tim Abbott ba22433dd9 stream_popover: Inline register_stream_handlers.
Also register these click handlers just on the popover itself directly
in the onMount helper, like we do with all the other popover_menus.js
functions.
2023-09-13 10:55:40 -07:00
Daniil Fadeev 08aec5ac41 stream_popover: Migrate from Bootstrap to Tippy. 2023-09-13 10:55:40 -07:00
Daniil Fadeev f2f0462e09 stream_popover: Rename stream_popped to is_open.
stream_popover.is_open() much more accurately describes what this
does, and in particular the fact that the function applies to all
places the stream popover might be.
2023-09-13 10:55:40 -07:00
Daniil Fadeev 35d97160bc stream_popover: Use currentTarget as reference to the stream popover.
Using currentTarget as a reference element guarantees us that the
relative placement will be the same every time.
2023-09-13 10:55:40 -07:00
Daniil Fadeev e0f72de75c stream_popover: Update the comment that describes the module. 2023-09-13 10:55:40 -07:00
Daniil Fadeev 71de1c2a66 popovers: Use `media_breakpoint_num` instead of a constant value. 2023-09-13 10:55:40 -07:00
Aman Agrawal a8e1c22687 inbox: Add support for vim keys. 2023-09-12 09:20:33 -07:00
Aman Agrawal 6c179bcc48 inbox: Show focus underline for non-dm rows. 2023-09-12 09:20:33 -07:00
Aman Agrawal 58c5701e5e css: Assign a variable to focus underline color of recent view. 2023-09-12 09:20:33 -07:00
Aman Agrawal f12fe219d9 inbox: Sort pinned streams at the top. 2023-09-12 09:20:33 -07:00
Aman Agrawal 4559a9fbf3 inbox: Save collapsed state of streams in localstorage. 2023-09-12 09:20:33 -07:00
Aman Agrawal 6ef0753a51 inbox: Add new narrow. 2023-09-12 09:20:33 -07:00