Commit Graph

2434 Commits

Author SHA1 Message Date
Aman Agrawal 4db331ed21 empty_list_widget: Use class instead of id.
We were using id before to increase their specificity, but
since it is possible for multiple empty_list_widget_for_list/table
to be in DOM at the same time, we should use a class here. Used
`!important` here so that we can force our padding where these
classes are used.
2023-10-17 11:55:41 -07:00
Aman Agrawal 62c78d5ad5 inbox: Remove side borders. 2023-10-17 10:34:48 -07:00
Aman Agrawal 742b985de0 compose_actions: Warn callers if msg_type is not defined. 2023-10-17 10:34:48 -07:00
Aman Agrawal c54e84cb9b compose_reply: Fix msg_type being not defined triggering errors.
When focused on filters, `r` keypress to open compose had
`msg_type` set to undefined which shouldn't be the case ever as
we always expect msg_type to be defined when compose is open.
2023-10-17 10:34:48 -07:00
Aman Agrawal a814b4f320 inbox: Use app background color.
Search input still has the same background color.
2023-10-17 10:34:48 -07:00
Aman Agrawal c152cb55a5 inbox: Fix empty text visible with visible unread rows.
If the last returned value of `insert_stream` was false, `has_topics_post_filter`
was false and hence this empty text was visible.

We only need one of the inserted streams to visible to hide the empty text.

Reproducer:

* Mark all messages as read.
* mark one message in denmark as unread.
* mute #support (any stream that would come later to denmak alphabetically)
* sent a message support from a different user while inbox is open.
2023-10-17 10:29:45 -07:00
Sahil Batra 7b3fda696d css: Rename CSS variables for heights in subscriptions overlay.
The CSS variables for heights in subscriptions overlay uses
"modal" word but we actually use overlays for subscriptions
UI, so this commit renames those variables to better names.
2023-10-17 10:28:50 -07:00
Sahil Batra 0c146d21e3 overlays: Rename "modal-bg" class to "overlay-container".
This commit renames "modal-bg" class to "overlay-container"
since we use this class only for overlays and this seems a
better name.
2023-10-17 10:28:50 -07:00
Sahil Batra b3d9f5a419 overlays: Rename "modal-body" class.
We use "modal-body" class in informational overlays and
"About Zulip" overlay. For informational overlays, the
class is used on the element acting as scroll container
so we just rename the class to "overlay-scroll-container".

For "About Zulip" overlay, we do not support scrolling
so "overlay-body" seems a better class name.
2023-10-17 10:28:50 -07:00
Sahil Batra eeb3b5715f settings: Rename modal-footer class.
We only use "modal-footer" class in stream and user group
creation forms which is actually not a modal, so this commit
renames the class to a better name "settings-sticky-footer".
2023-10-17 10:28:50 -07:00
Anders Kaseorg 858f8f1e48 settings_profile_fields: Remove wrong $ prefix for non-jQuery variable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-16 17:03:53 -07:00
Anders Kaseorg 8a837320a9 e2e-tests: Remove now-unnecessary StackFrame cast.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-16 15:00:55 -07:00
Anders Kaseorg ccb492a75a e2e-tests: Fix stack traces from Puppeteer page errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-16 15:00:55 -07:00
Anders Kaseorg 8ebcaddfd9 Revert "recent_view_ui: Avoid non-contiguous rows in recent view."
This reverts commit 2348d6f1f9.
2023-10-16 13:57:02 -07:00
Sahil Batra effc9c366a user_profile: Show tooltip when removing last user from private stream.
We now show tooltip on "Unsubscribe" button in user profile modal
if the stream is private and the user is last user in the stream
mentioning that user should use stream settings to unsubscribe.
2023-10-16 13:37:23 -07:00
Akarsh Jain 545c4caa05 stream: Show warning when admin removes last user from a private stream.
This commit adds a confirmation modal that appears when an administrator
attempts to unsubscribe the only user currently subscribed to a private
stream. The modal includes a warning message explaining that the private
stream will be automatically archived after unsubscription.

Fixes #24025.
2023-10-16 13:37:23 -07:00
Sahil Batra 052299f056 streams: Update modals shown on removing user from private stream.
This commit adds "?" to the heading of modal shown when unsubscribing
user from private stream and adds a link to help documentation for
archiving streams. This commit also refactors the code such that we
can use the same template to show modal when unsubscribing others
from private streams.
2023-10-16 13:37:23 -07:00
Aman Agrawal 03ea1ce528 recent_view_ui: Fix quick multiple page downs resulting in errors.
Fixes #27209

Since post_scroll__pre_render_callback is called to set
the correct focus, we don't need to set focus again here.

This was happening because `set_table_focus` relies on rows
being already rendered in the DOM which is not the case with
page down since rows are still being rendered by list widget
as we scroll down.

This code was the source of the error:
```
    if (new_scrollTop >= table_height) {
        row_focus = topics_widget.get_current_list().length - 1;
    }
```

row_focus set here is not rendered yet, hence making set focus
on search box.

But, since we set focus on table if user is scrolling, this
sets focus back on the table.
2023-10-16 13:25:16 -07:00
Aman Agrawal 2348d6f1f9 recent_view_ui: Avoid non-contiguous rows in recent view.
Fixes #27207

The recent view's data sources are mainly all_messages_data,
but if you click into a stream via the left sidebar that has
no recent conversation history, one can reliably reproduce that
some of those conversations will end up being displayed in the
recent view, despite not being temporally contiguous with what
it has data for.

To avoid it, we only process messages fetched for all message data.
2023-10-16 13:25:15 -07:00
Aman Agrawal 2d4d4b86eb left_sidebar: Fix click handler selector for all private messages.
The previous logic did not correctly handle clicks that were in the
tiny spaces inside the link tag but outside the icon element.

Fixes #25647.
2023-10-16 13:13:19 -07:00
Bhavesh Vasnani eb81a4f21f left_sidebar: Make toggle DM section keyboard accessible. 2023-10-16 13:11:42 -07:00
Anders Kaseorg b86b91f96d global: Remove type stub for Bootstrap modal.
Commit 747b62d050 (#27124) removed the
code.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-16 13:07:47 -07:00
Anders Kaseorg d8dcec6853 user_deactivation_ui: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-16 13:06:54 -07:00
Anders Kaseorg 4d6a36ecec people: Sharpen User type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-16 13:06:54 -07:00
Anders Kaseorg 94934f49f9 webpack_public_path: Replace with webpack 5 publicPath: "auto" setting.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-16 10:36:27 -07:00
Aman Agrawal b605042312 compose_setup: Hide compose formatting popover clicking an option.
Fixes #27015
2023-10-15 19:51:04 -07:00
evykassirer 34ceafadd5 recent view: Add button to fetch more conversations.
We add a new timerender format for this context, where there's plenty
of space.

Fixes: #18461
2023-10-13 16:14:55 -07:00
Prakhar Pratyush e01ffba143 settings: Add default typing indicator user settings.
This commit adds two settings to 'SETTINGS / DEFAULT USER SETTINGS':
* Let recipients see when a user is typing direct messages
* Let recipients see when a user is typing stream messages
2023-10-13 15:30:49 -07:00
Sahil Batra 0c357f990d stream_settings: Fix tooltip behavior on subscription button.
The tooltip was shown on the "Unsubscribe" button even after
closing the modal without unsubscribing when trying to
unsubscribe from a private stream. This commit fixes it by
setting the trigger to "mouseenter".

We fixed similar issue in #25381.
2023-10-13 11:08:54 -07:00
m-e-l-u-h-a-n 69b2c1143a stream settings: Fix tooltip for sub_unsub_button on right pane.
There was no tooltip shown for toggle subscription button
when it was disabled.

A tooltip with appropriate message is added to this button
when it is disabled in case of private streams and user
cannot use it to toggle subscription.
2023-10-13 11:08:54 -07:00
m-e-l-u-h-a-n 3d1b846d86 streams: Change color of the checkmark to blue.
This is a UI experiment which change the regular and on-hover
colors of the green checkmark in All Streams UI to match the send
button of the compose box.

Co-authored-by: Raghav Luthra <rluthra2002@gmail.com>
2023-10-13 11:08:54 -07:00
m-e-l-u-h-a-n 2585fe5c41 streams: Improve subscription toggle buttons on stream rows.
This commit changes the UI for subscribing to streams on stream rows
to be more like the mobile version (zulip/zulip-mobile#5333).
The current design made it hard to discover how to subscribe to
streams via left panel and is not very clear on the fact that
its not possible to subscribe to private streams.

To address this the following changes have been made:
- For unsubscribed streams, the on hover-checkmark is replaced by
a "+" which is always displayed and has on-hover highlighting.

- For unsubscribed private streams, the "+" is disabled.

- Tooltips with appropriate messages are added on the "+" sign for the
above 2 cases.

- A tooltip has also been for the on-hover checkmark for subscribed
streams.

Fixes: #22217.
Co-authored-by: Raghav Luthra <rluthra2002@gmail.com>
2023-10-13 11:08:54 -07:00
Ganesh Pawar 4491756845 stream_edit: Disable add button when input field is empty.
Fixes #19507.
2023-10-12 18:24:05 -07:00
Tim Abbott 2ce3f52030 gear_menu: Remove logout button, moved to new personal menu. 2023-10-12 15:31:01 -07:00
Hardik Dharmani 49f7f02a0a personal_menu: Add tippy personal_menu dropdown.
Add a personal menu dropdown that opens on clicking user avatar icon
in navbar added in previous commit.

The args passed to render_personal_menu() in onShow() are returned by
get_personal_menu_content_context() in popover_menus_data.js so that
they can be unit tested.

Additionally, added CSS to get a custom arrow for dropdown menu.

Added a `?` hotkey in keyboard shortcuts option in personal_menu
dropdown in a style similar to our tooltip's hotkey by adding
? in a span with class .tooltip-hotkey-hint and adding some CSS.

Fixes part of #22802.
2023-10-12 15:31:01 -07:00
Hardik Dharmani 5fd8b95454 navbar: Add user avatar icon for personal_menu dropdown.
This commit adds user avatar icon in navbar. This new avatar icon
will be used as dropdown toggle button. Made `.column-right` a flex,
every element in right-side navbar is in this div now rather than all
elements positioned absolutely with hardcoded values like before.
Fixed some CSS as per new flex layout if `.column-right`.

Fixes part of #22802
2023-10-12 15:31:01 -07:00
Hardik Dharmani a4680f3681 personal_menu: Add new SVGs.
The new SVGs added in this commit will be used in next commits.

Fixes part of #22802
2023-10-12 15:31:01 -07:00
Joelute c7ef2555fd compose_typeahead: Add new indicator to topic items in typeahead.
With the autocomplete dropdown, some users face trouble or uncertainty
while selecting topics. These changes adds a new indicator to the topic
typeahead dropdown while typing to the topic box. This ensures users
that they are on track and they are doing the right things. We also
suggest the current query even if it doesn't match a topic to continue
providing the new indicator.

Fixes: #23296.
2023-10-12 14:44:40 -07:00
David Rosa 69b8dbeb28 help: Document Inbox view.
- Adds desktop/web instructions.
- Adds #inbox relative link for logged-in users.
- Moves Inbox up in the left sidebar just under "Reading strategies".
- Moves Inbox article content to Markdown include.
- Adds "From the Inbox view" section to "Finding a topic to read",
  "Getting started with Zulip", and "Reading strategies".
- Documents Inbox as a new option for the default web app view.
- Removes unused Markdown link.
- Tweaks subheading to better match help center patterns.
- Add Inbox option in "Configure default settings for new users".
- Adds new tabbed section and instructions for marking messages as
  read and reading topics via the Inbox view.

Fixes #26903.

Co-authored-by: Alya Abbott <alya@zulip.com>
2023-10-12 12:58:20 -07:00
lapaz 417b29638c messages: Add support to allow bot-owners to delete messages.
This commit adds support to allow bot-owners to delete messages
sent by their bots if they are allowed to delete their own messages
as per "delete_own_message_policy" setting and the message delete
time limit has not passed.
2023-10-12 12:13:39 -07:00
Sahil Batra 59d025c570 people: Add "(guest)" for muted users as well.
This commit adds code to show "(guest)" for muted users
as well if the muted user is guest and the realm setting
is enabled.
2023-10-12 12:06:10 -07:00
Sahil Batra 8196e09013 message_list_view: Italicize "(guest)" in recipient row.
This commit updates code to italicize "(guest)" shown for guest
users in header row. We do not italicize "(guest)" in tooltip
shown on hovering over the header row for now.

We pass the user objects to template file instead of passing
the complete string to it to handle this correctly.
2023-10-12 12:06:10 -07:00
Sahil Batra a88acc4642 users: Add ellipsis only on names and show the indicator always.
We now show the guest indicator even for long names and only
truncate the names in right sidebar and the message feed.
2023-10-12 12:06:10 -07:00
Sahil Batra 7d7698930a compose_ui: Add "(guest)" to user names in compose box placeholder.
This commit adds "(guest)" indicator to guest user names in
compose box placeholder if enable_guest_user_indicator setting
is enabled in the organization.
2023-10-12 12:06:10 -07:00
Sahil Batra 127378f0ec users: Add "(guest)" to user name at various places.
This commit adds code to get_display_full_name function
to add "(guest)" indicator to guest user names if
enable_guest_user_indicator setting is enabled in the
organization.

The get_display_full_name function is used in many parts
of the code and thus this commit adds the indicator in
following places -
- Message recipient row for DMs including the messages
shown in scheduled messages overlay.
- DMs list in left sidebar and its tooltips.
- DMs info recent conversations view.
- "other senders" tooltip in recent conversations view.
- Compose button text.
- User names shown on reaction element and its tooltip.
- Desktop notifications and the browser title.
- Results for a poll.
2023-10-12 12:06:10 -07:00
Sahil Batra 268aab3cda narrow: Add "(guest)" to user names in narrow title.
This commit adds "(guest)" to user names in the narrow title when
enable_guest_user_indicator setting is enabled in the organization.
The indicator, based on the setting, is added for DM narrows and
for "sender:" narrows.
2023-10-12 12:06:10 -07:00
Sahil Batra 70c9d0765f rendered_markdown: Add "(guest)" to user name in mention pill.
This commit adds "(guest)" indicator to user names of guests
in mention pill if the enable_guest_user_indicator setting is
enabled for the organization. Note that the actual message
content does not include the indicator.
2023-10-12 12:06:10 -07:00
Sahil Batra 49a047c27f users: Add "(guest)" to names for guest users.
This commit adds code to add "(guest)" to user names of guest
users in the following places -
- right sidebar
- user pills, including the pills in search suggestion typehaead
- typeaheads for user
- sender names in message feed
- user profile popover and modals.
- user name in not subscribed warning banner.

Note that the indicator is shown only if enable_guest_user_indicator
setting is set to true.

As a result of this change, we now translate "deactivated" text
shown in user pills for deactivated users.

Fixes part of #26700.
2023-10-12 12:06:10 -07:00
Sahil Batra c51c1d5135 realm: Add setting to control adding "(guest)" indicator to name.
This commit adds new realm setting to control adding "(guest)"
indicator to names of guest users in the UI.

Fixes part of #26700.
2023-10-12 12:06:10 -07:00
evykassirer 77fc836edf stream_id: Replace empty string with undefined.
This commit also limits `stream_bar.decorate` to only
be able to be called for stream messages, since it's
an undefined string_id is no longer a sign that
you're dealing with a DM.
2023-10-12 11:03:49 -07:00
Aman Agrawal 9d6dcb9a9d communities: Copy code from integrations to toggle_categories_dropdown.
This is used on mobile widths to toggle categories dropdown.
2023-10-12 09:58:47 -07:00
Aman Agrawal 7c0edf356c communities: Allow user to filter orgs by type.
Org category filters were hidden in
60eb408bb0.
2023-10-12 09:58:47 -07:00
Aman Agrawal 9112b0d5d4 lightbox: Fix video playing in background after closing.
If the video was playing, it didn't stop playing even after the
lightbox was closed. We could pause it but removing it from DOM
seems like the better thing to do.
2023-10-12 09:57:21 -07:00
Prakhar Pratyush c520a96354 typing_indicator: Add a 'stream_id' parameter to 'POST /typing'.
This commit adds a 'stream_id' parameter to the 'POST /typing'
endpoint.

Now, 'to' is used only for "direct" type. In the case of
"stream" type, 'stream_id' and 'topic' are used.
2023-10-12 09:53:09 -07:00
Anders Kaseorg 92a9f0a679 desktop-login: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-12 09:28:47 -07:00
Anders Kaseorg 82e4250592 electron_bridge: Declare Zulip Desktop binding types.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-12 09:28:47 -07:00
Anders Kaseorg c6618c9e55 stream_settings_data.ts 2023-10-12 09:11:10 -07:00
Anders Kaseorg d505baf0f3 stream_settings_data: Avoid mutation in get_sub_for_settings.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-12 09:11:10 -07:00
Hemant Umre 655cb51980 templates: Make the empty list messages consistent.
This commit makes the empty list messages of certain tables more
descriptive and consistent with the others.
2023-10-11 18:03:53 -07:00
Hemant Umre 0f5f7109b4 templates: Display a different message for empty search results.
In this commit, we introduce the `data-search-results-empty`
dataset to certain templates. This dataset, along with `data-empty`,
is used by `render_empty_list_message_if_needed` to present different
messages when there are no items matching the applied filter and
no items to display, respectively.

Co-authored-by: Akarsh Jain <akarsh.jain.790@gmail.com>
2023-10-11 18:03:53 -07:00
Hemant Umre eeec8f06e9 templates: Stop using `::after` to render empty list message.
This commit removes all instances of the `required-text` class,
which utilizes the `::after` pseudo-element to render empty list
message. To avoid inserting non-decorative content using a pseudo-
element, we will now use `list_widget.render_empty_list_message_
if_needed` introduced a few commits back to display the empty list
message.

Fixes #23072.
2023-10-11 18:03:53 -07:00
Hemant Umre b387ca49ab right_sidebar: Add functionality to render empty user list message.
In order to eliminate the usage of `::after` pseudo-element for
rendering the empty list message, this commit introduces a new function
for displaying the empty user list message on the right sidebar.
2023-10-11 18:03:53 -07:00
Hemant Umre c87cf3c252 settings: Use `render_empty_list_message_if_needed` for empty bot list.
In order to eliminate the usage of `::after` pseudo-element for
rendering the empty list message, we now incorporate `list_widget.
render_empty_list_message_if_needed` to display the empty bot list
message on `#setting/your-bots`.
2023-10-11 18:03:53 -07:00
Hemant Umre 2ec4b002b1 settings_emoji: Pass active emoji data to the ListWidget.
Deactivated emojis will not be rendered by ListWidget, so it might be
better to pass only active emoji data to the ListWidget. This will also
facilitate the proper functioning of rendering an empty list message by
ListWidget when needed.
2023-10-11 18:03:53 -07:00
Hemant Umre 5eb784a652 list_widget: Add functionality to display empty list message.
This commit introduces a function in list_widget.js that allows
displaying a message when the list is empty using the `data-empty`
dataset. The function checks the container type to determine the
appropriate wrapper for the message and appends it to the container
body.

Fixes a part of #23072.
2023-10-11 18:03:53 -07:00
Joelute 2cbf65b1f2 scheduled_messages: Indicate scheduled messages in conversation views.
These changes adds a new scheduled message indicator in conversation views
which informs the user of the number of messages that are scheduled to be
sent to the current view.

Fixes: #25584.
2023-10-11 17:53:07 -07:00
Aman Agrawal c16d727fd4 stream_settings_ui: Avoid two scrollbars.
Fixes #26823

Fixes user card not displayed on last item in the subscribers list.
This was happening because there wan not enough space below the
user name for the popover to be displayed (as far as I understand this).

Regardless of the fix above, this seems like a nice change.
2023-10-11 16:25:27 -07:00
Sayam Samal 1cf2c4134e tooltips: Add period (.) to last edited/moved notice. 2023-10-11 16:23:16 -07:00
Sahil Batra ea05755431 settings: Live update lock icon on changing bot creation policy.
This commit adds code to live-update the lock icon for "Bots"
panel in organization settings when "Who can add bots" setting
changes.

Fixes #24393.
2023-10-11 16:22:37 -07:00
Sahil Batra 1080da08f0 settings: Fix live-update of text on the bots admin page.
We did not live-update the text on the top of admin bots page
correctly when changing the bot creation policy. This commit
fixes it.
2023-10-11 16:22:37 -07:00
Sahil Batra 4b23ac2743 settings: Update lock icon when "Who can add emoji" setting changes.
This commit adds code to live-update the lock icon for "Custom emoji"
panel in settings when "Who can add custom emoji" setting changes.
2023-10-11 16:22:37 -07:00
Sahil Batra 0bd2d0b6a9 settings: Add code to live-update lock icon on changing role.
This commit adds code to live-update the lock icon in settings
left sidebar when a user's role changes.
2023-10-11 16:22:37 -07:00
Sahil Batra e14b9e368a settings: Use tippy for tooltips on lock icons.
This commit update tooltips shown on lock icons in settings
sidebar to use tippy instead of using html title attribute.
2023-10-11 16:22:37 -07:00
Sahil Batra 17e0b6621b settings: Update tooltip on lock icon shown for custom emoji panel.
This commit updates the tooltip for icon shown for custom emoji panel
to change the text to "You do not have permission to add custom emoji"
instead of just mentioning always that only admins can add them
even when we have other options like "Admins and moderators".

This also fixes the condition of showing or hiding the lock icon
to use the correct setting value and not the old setting
add_emoji_by_admins_only.
2023-10-11 16:22:37 -07:00
Tim Abbott 66bbf35df4 settings: Adjust label for stream typing notifications setting. 2023-10-11 10:16:24 -07:00
Prakhar Pratyush 43789cac58 stream_typing_indicator: Remove the dev environment guard in settings.
This commit removes the 'page_params.development_environment' guard
for the setting 'send_stream_typing_notifications' and makes it
available outside the development environment.
2023-10-11 10:16:24 -07:00
Aman Agrawal 229dcce217 overlays_modals: Replace with inline use of overlays/modals.any_active. 2023-10-11 09:45:37 -07:00
Aman Agrawal 2aab74049d overlays: Rename is_active to any_active. 2023-10-11 09:45:37 -07:00
Aman Agrawal 089886245d modals: Rename is_open to any_active. 2023-10-11 09:45:37 -07:00
Anders Kaseorg cac5778e70 stream_edit_toggler: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 18:26:57 -07:00
Anders Kaseorg 97f4847c71 email_log: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 17:41:03 -07:00
Karl Stolley f98570704d compose: Present Start new topic button adjacent the reply button.
Fixes: #24889.

Co-Authored-By: Daniil Fadeev <shameondev@gmail.com>
2023-10-10 17:37:03 -07:00
Karl Stolley 2fac5fb08c compose: Hide New direct message button in DM views.
This avoids the situation where the contextually aware
Start new conversation button duplicates the functionality of the
dedicated New direct message button.

Additionally, it gives a sense of what the UI would be like if
only the Start new conversation button were displayed.
2023-10-10 17:37:03 -07:00
Karl Stolley 1f77e4a892 compose: Enable New conversation contextual function in DM narrows. 2023-10-10 17:37:03 -07:00
Karl Stolley 654469b29f compose: Make DM identifiers align with new conversations. 2023-10-10 17:37:03 -07:00
Karl Stolley 0f084587e0 compose: Make stronger, more readable button-update logic. 2023-10-10 17:37:03 -07:00
Karl Stolley c73de34f32 compose: Introduce 'Start new conversation' button. 2023-10-10 17:37:03 -07:00
Daniil Fadeev 9303339810 compose: Remove the unused span wrapper for buttons. 2023-10-10 17:37:03 -07:00
Daniil Fadeev e861b16911 compose: Show or hide the clear-topic button as needed at compose start. 2023-10-10 17:37:03 -07:00
Karl Stolley 5b830a226c compose: Name triggers for clearing the topic. 2023-10-10 17:37:03 -07:00
Karl Stolley 5b82a62b26 compose: Add button to clear topic box.
Fixes part of #24889.

Co-Authored-By: Daniil Fadeev <shameondev@gmail.com>
2023-10-10 17:37:03 -07:00
Dinesh 61d30b7aef muted_users: Hide muted typists in streams.
Filters muted users in get_topic_typists().
2023-10-10 17:36:55 -07:00
Dinesh fccdc054a1 typing_notifications: Frontend work to display notifs for streams.
Display/hide "X is typing" notification
on receiving start/stop typing event for streams.

Co-authored-by: Prakhar Pratyush <prakhar841301@gmail.com>
2023-10-10 17:36:55 -07:00
Prakhar Pratyush dab92a4ae8 typing_data: Rename 'typist_dct' to 'typists_dict'.
'typists' to represent multiple typists.
'dict' is a better-known abbreviation for dictionary than dct.
2023-10-10 17:36:55 -07:00
Dinesh cb4957fa26 narrow_state: Add stream_id() function.
Returns `stream_id` if narrowed to stream else `undefined`.

Required for displaying stream typing notifications.
2023-10-10 17:36:55 -07:00
Dinesh 3bc448c1e0 refactor: Extract 'get_key' out of functions in 'typing_data.ts'.
These existing typing related functions are re-usable in the
case of stream typing, except that the key differs. So, to make
it possible to re-use the code in these functions, this commit
removes the `get_key` call in those functions and instead passes
the key directly.

Also, renamed `get_key` to `get_direct_message_conversation_key`
to differentiate it from the `get_topic_key` that we'll add later
for stream typing.
2023-10-10 17:36:55 -07:00
Dinesh c453a784e2 typing_data: Rename get_all_typists to get_all_direct_message_typists.
We use this function to show who's typing in the
direct messages narrow.

Renamed it because, with the addition of stream typists to
`typist_dct` in the next commit, this might be confusing.

This commit addresses the discussed issue by renaming
'get_all_typists()' to 'get_all_direct_message_typists'.
2023-10-10 17:36:55 -07:00
Dinesh 91f03e0d38 typing_notifications: Send ajax requests for stream typing too.
For the timing part of sending requests, it will be the same
as DMs, as the code in 'typing_status.ts' is being reused
for that purpose.

As a note, 'state.current_recipient_ids' and 'new_recipient_ids'
of update() in 'typing_status.ts' used to be an array of recipient ids.

Renamed them to 'state.current_recipient' and 'new_recipient' as they
can now be either of:
1) An object of format {stream_id: 2, topic:'hello'}
2) an array of recipient user IDs like previously

Also, made required changes in 'typing_status.ts' and
'typing_status.js.flow', i.e., documenting the new format of
new_recipient.

Co-authored-by: Prakhar Pratyush <prakhar841301@gmail.com>
2023-10-10 17:36:55 -07:00
Anders Kaseorg 820dcc50a0 sent_messages: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 17:18:37 -07:00
Anders Kaseorg 082a291bd1 sent_messages: Remove trivial initialize function.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 17:18:37 -07:00
Prakhar Pratyush a22f637769 typing_indicator: Replace private with direct in 'message_type' field.
This commit replaces the value `private` with `direct` in the
`message_type` field for the `typing` events sent when a user
starts or stops typing a message.
2023-10-10 17:15:28 -07:00
N-Shar-ma 5817da709c compose: Refactor and generalise functions for formatting.
The logic for formatting code is generalised to make it reusable for
multiple styles of formatting (added in the next commits).

Co-authored-by: N-Shar-ma <bablinaneh@gmail.com>
2023-10-10 16:54:33 -07:00
N-Shar-ma e24689a1ce compose: Rename formatting methods and arguments for generalisation.
This is a prep commit for extracting general functions for adding and
removing formatting.
2023-10-10 16:54:33 -07:00
N-Shar-ma 6537004ae9 compose: Move bold formatting code into separate functions.
This is a prep commit for refactoring formatting code to make future
format button additions need minimal code duplication.
2023-10-10 16:54:33 -07:00
Anders Kaseorg b396573acf hello: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 16:51:14 -07:00
Anders Kaseorg 2163cb7770 popovers: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 16:50:48 -07:00
Anders Kaseorg 0006f4a90c audible_notifications: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 16:50:07 -07:00
Anders Kaseorg 41c64ee8bb audible_notifications: Add missing $ prefix to parameter.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 16:50:07 -07:00
Anders Kaseorg 340b0a1181 compose_call: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 16:48:57 -07:00
Anders Kaseorg 71ac1c880b page_params: Fix alphabetical order of page_params type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 16:48:57 -07:00
Karl Stolley b19986b777 left_sidebar: Use custom Zulip star icons.
This commit replaces all previous Font Awesome references in the
left side bar and relevant popovers with the custom Zulip star
icon.

Co-Authored-By: Hardik Dharmani <Ddharmani99@gmail.com>
2023-10-10 16:48:20 -07:00
Karl Stolley fd0dd3acd8 left_sidebar: Refactor left_sidebar.hbs structures for readability.
This commit renames the classes and IDs in the views area
(formerly global filters) to a set of flexible values all
prefixed in some way with `left-sidebar-navigation`.

This is meant to make the styles and structures in the area
more readable, while also keeping things flexible into the
future as this area's elements change.

Co-Authored-By: Hardik Dharmani <Ddharmani99@gmail.com>
2023-10-10 16:48:20 -07:00
Hardik Dharmani 7e776b9c76 refactor: Make variable for unread counter's background colors.
This is Prep commit that introduces 2 new CSS variable
`--color-background-unread-counter` and
`--color-background-unread-counter-popover-menu` that has value
`hsl(105deg 2% 50% / 50%)` in dark theme and `hsl(105deg 2% 50%)`
in light theme for unread counter and `hsl(200deg 100% 40%)`
for unread counter in popover menus to match its blue theme.
2023-10-10 16:48:20 -07:00
Hardik Dharmani a61d291ca4 left_sidebar: Correct the color of BACK TO STREAMS in dark theme.
This is a Prep commit. This commit fixes the color of
`BACK TO STREAMS` label in the dark theme to be equal to other labels
in left sidebar such as `STREAMS` label.
2023-10-10 16:48:20 -07:00
Aman Agrawal 3498b07379 modals: Rename open_modal to open. 2023-10-10 16:43:57 -07:00
Aman Agrawal 1d4797834e modals: Rename close_modal to close. 2023-10-10 16:43:57 -07:00
Aman Agrawal c809abf07f modals: Rename close_modal_if_open to close_if_open. 2023-10-10 16:43:57 -07:00
Aman Agrawal 0c7184aaa0 modals: Rename close_modal_active to close_active. 2023-10-10 16:43:57 -07:00
Aman Agrawal d54a917104 modals: Rename is_modal_open to is_open. 2023-10-10 16:43:57 -07:00
Aman Agrawal 577a384845 overlays: Extract modal methods in separate file. 2023-10-10 16:43:57 -07:00
Aman Agrawal 6713ad9d4d overlays: Extract function checking if overlays or modals are open. 2023-10-10 16:43:57 -07:00
Aman Agrawal 63c1c9a37a overlays: Extract enable / disable scrolling to a util module. 2023-10-10 16:43:57 -07:00
Aman Agrawal 065420853f overlays: Fix spelling. 2023-10-10 16:43:57 -07:00
Anders Kaseorg 325b308ed5 about_zulip: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 13:20:31 -07:00
Aman Agrawal ce48aac3db inbox: Fix stream name wrapping to next line. 2023-10-10 13:06:46 -07:00
Aman Agrawal e4252f8f08 settings_config: Change order of option for default view.
Inbox > Recent conversations > All messages
2023-10-10 13:06:46 -07:00
Aman Agrawal 3a2fbfc2fd inbox_ui: Fix mute / unmute not working.
This is fix for the old version of mute / unmute buttons.
Code borrowed from click_handlers.
2023-10-10 12:47:42 -07:00
Anders Kaseorg 881da05cd3 stream_settings_ui: Extract stream_settings_components module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 12:09:15 -07:00
Aman Agrawal 22f4ecdad6 message_fetch: Don't use MessageList to fetch data for recent view.
Since load_messages now supports fetching data with only
MessageListData, we can just use it and avoid calling
MessageListView which also caused our polls and TODO widgets to
not render occasionally.
2023-10-10 11:11:19 -07:00
Aman Agrawal 69e10b4dae message_fetch: Handle MessageListData directly passed to load_messages.
This will allow us to use load_messages to fetch data using it
without initializing a MessageList.
2023-10-10 11:11:19 -07:00
Karl Stolley 88f4ecc943 compose_banner: Restore CSS overzealously removed in #27097.
This also includes a comment for future contributors, explaining
why these styles are necessary.
2023-10-10 10:01:11 -07:00
Anders Kaseorg 521cb15a07 stream_ui_updates: Cut import of stream_settings_ui.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 09:08:53 -07:00
Anders Kaseorg b9bb0d5aa8 settings_org: Cut import of settings_realm_user_settings_defaults.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 09:06:28 -07:00
Anders Kaseorg 1d43a4cccb stream_edit: Extract toggler to new stream_edit_toggler module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 23:19:59 -07:00
Anders Kaseorg 3cac29a8e1 settings_org: Extract settings_components module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 17:26:49 -07:00
Aman Agrawal 9ab1a726a0 inbox: Add page up/down support similar to recent topics.
Leaving page up / down to browser doesn't work very well due to
our custom header, filters and compose.
2023-10-09 16:36:24 -07:00
Aman Agrawal 9fc6af220e inbox: Handle latest message not fetched when replying.
Since inbox is populated based on unread data which is part
of /register request, it is possible that we don't have the
actual message in our message_store. In that case, we return
a fake message object.
2023-10-09 16:36:24 -07:00
Aman Agrawal 2c4156e239 compose_reply: Remove unnecessary pm_recipient being set.
`pm_recipient` is already set in `else` case unconditionally,
so setting it early is not required.
2023-10-09 16:36:24 -07:00
Aman Agrawal bb740ca65e inbox: Fill compose with dm/stream info for `reply` on inbox-header. 2023-10-09 16:36:24 -07:00
Aman Agrawal 2561e7f2d8 inbox: Set compose recipient according to focused row on `reply`.
Fill compose recipient based on the latest message of the focused
row.
2023-10-09 16:36:24 -07:00
Aman Agrawal 50a356389c inbox: Update closed compose text based on focused element.
For header rows, search and filters we just show default text.
2023-10-09 16:36:24 -07:00
Aman Agrawal 3ac6f447d9 inbox_ui: Change current_focus_id when clicking on inbox search. 2023-10-09 16:36:24 -07:00
Aman Agrawal 64cc24722f inbox_ui: Rename function to reflect it only works for focus in list. 2023-10-09 16:36:24 -07:00
Aman Agrawal 3cbd772b8d inbox: Make focus outline around unread count wider. 2023-10-09 16:36:24 -07:00
Aman Agrawal 80a7e995af inbox: Fix spelling mistakes.
Found a good spell checker, hopefully no more of those.
2023-10-09 16:36:24 -07:00
Aman Agrawal e9c86dc524 inbox: Add topic visibility indicator. 2023-10-09 16:36:24 -07:00
Aman Agrawal 8c619d6938 inbox: Rename variable for readability. 2023-10-09 16:36:24 -07:00
Aman Agrawal 49f553ebfc inbox: Add rectangle focus border around inbox header name. 2023-10-09 16:36:24 -07:00
Anders Kaseorg 50928314f2 settings_users: Remove get_status_field.
It’s effectively unused since commit
2d5c678614 (#25061), as predicted by
commit d45f0171cb (#14919).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 16:05:31 -07:00
Anders Kaseorg 95b9d6f7e2 settings: Move set_settings_header to settings_panel_menu.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 16:04:30 -07:00
Aman Agrawal 9abc2cb3fd signup: Add link to redirect user to login page in the form. 2023-10-09 14:36:54 -07:00
Anders Kaseorg 8f564749bb dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 14:16:23 -07:00
Anders Kaseorg 835ee69c80 docs: Fix grammar errors found by mwic.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 13:24:09 -07:00
Anders Kaseorg 4cb2eded68 typos: Fix typos caught by typos.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 11:55:16 -07:00
Anders Kaseorg 7b4a74cc4d codespell: Fix typos caught by codespell.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 11:55:15 -07:00
Karl Stolley eea59e2edc compose_banners: Hide upload progress banner on error. 2023-10-09 11:55:01 -07:00
Karl Stolley d887fb57e7 compose_banners: Better align action and cancel buttons.
This uses the banner message's line-height to set a
max-height on the action and cancel buttons to maintain
a consistent vertical spacing.

Additional uses of flexbox here:

1. help the button to remain shorter when it's adjacent a
   single-line banner message, and
2. center the closing X icon relative to the current size
   of the action button, when one is present
2023-10-09 11:55:01 -07:00
Karl Stolley fe8fc98912 compose_banners: Structure innner <p> elements with .banner_message class.
This also styles those inner .banner_message elements to lose
margin inherited from Bootstrap. (This is now also applied to
the upload-message banner.)

It's better to achieve that with a class selector; using a `p`
element selector would mean that such a style would be evaluated
for all `<p>` elements in the DOM. Which is of course a whole lot,
thanks to Markdown alone.

Fixes: #26922
2023-10-09 11:55:01 -07:00
Karl Stolley 1581c6f847 compose_banners: Add .banner_content to elements that need it. 2023-10-09 11:55:01 -07:00
Karl Stolley 3fdf85872e compose_banners: Remove unnecessary upload-message styles. 2023-10-09 11:55:01 -07:00
Tim Abbott 756b465b47 bootstrap: Remove last vestiges of bootstrap-tooltip library.
Everything but this sliver of CSS has been deleted previously as part
of our migration off Bootstrap.
2023-10-09 11:39:12 -07:00
Aman Agrawal c69fe4b6a0 popover: Remove `.popover` class.
Since we are not using bootstrap popover, we don't have popovers
with that class.
2023-10-09 11:39:12 -07:00
Aman Agrawal 8430674aee popovers: Remove unused popover-content class.
Fixes #26821
2023-10-09 11:39:12 -07:00
Aman Agrawal a04117b6d3 user_group_info_popover: Remove bootstrap popover classes.
Added a `group-info-content` inplace of them and added the required
CSS.
2023-10-09 11:39:12 -07:00
Aman Agrawal 04c4b6e8b8 giphy: Move `popover-content` styles to `giphy-scrolling-container`. 2023-10-09 11:39:12 -07:00
Aman Agrawal 094ac010fb user_card_popover: Remove popover content class.
Added CSS styles that were removed due to this back. No visual
changes.
2023-10-09 11:39:12 -07:00
Aman Agrawal ce656da8d7 emoji_popover: Remove popover-content div.
`popover-content` class had no effect on emoji popover since
it was resetting `padding: 0` and background color was
already applied by tippy theme.

In short, removing `popover-content` had no visual changes.
2023-10-09 11:39:12 -07:00
Aman Agrawal 5cd2b0ed86 giphy: Remove old comment.
Destroying popover_instance is now part of how tippy popovers work.
2023-10-09 11:39:12 -07:00
Aman Agrawal 0976b9006e popover-title: Remove class.
Remove bootstrap-tooltip class `popover-title` from code.

It was only used in user_card_popover for showing user avatar,
so cleaned up properties that were duplicated or not required.
2023-10-09 11:39:12 -07:00
Anders Kaseorg b9fe1947f8 navigate: Move scroll_to_selected to message_viewport.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 11:32:16 -07:00
Anders Kaseorg 18bdfde9e7 recent_view_ui: Cut import of unread_ops.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 11:32:16 -07:00
Anders Kaseorg 95785739ac navbar_alerts: Move resize_app to resize.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 11:32:16 -07:00
Sahil Batra 7ffdeecd86 styles: Remove CSS for ".modal-header".
We do not use "modal-header" on any elements now, so
we can remove the redundant CSS rules defined for it.
2023-10-09 11:25:26 -07:00
Sahil Batra 747b62d050 bootstrap: Remove code for bootstrap modals.
We use micromodal library for all the modals now and thus
we no longer require the bootstrap modal code.
2023-10-09 11:25:26 -07:00
Sahil Batra 37d12250ed modal: Re-add required bootstrap CSS for ".modal-body".
This commit adds the required bootstrap CSS rules for
".modal-body" elements to modal.css so that we can remove
them from bootstrap.css.
2023-10-09 11:25:26 -07:00
Sahil Batra 5e263fc4ed subscriptions: Re-add bootstrap CSS for modal-footer elements.
We use "modal-footer" class in stream and user group creation form
and this commit adds bootstrap CSS rules for it to subscriptions.css
so that we can remove the CSS from bootstrap.css.
2023-10-09 11:25:26 -07:00
Prakhar Pratyush 5b7014e7d6 server_history: Prevent concurrent requests for the same stream_id.
This commit updates the 'get_server_history' function to return
early if a request is already in progress for a given stream_id,
thus preventing concurrent requests for a single stream_id.

We maintain a set 'request_pending_stream_ids', which contains all
the stream IDs for whom requests are in progress.

Using this set, we return early.

Fixes #26915.
2023-10-09 11:17:03 -07:00
N-Shar-ma 0cdb54cf65 compose: Ensure cursor is scrolled into view after content is inserted.
This fixes the bug where on pressing enter after the last line in a
textarea, the cursor would go to the new line but the textarea would
not scroll it into view unless more was typed. This was observed on
chromium browsers.

A new function `insert_and_scroll_into_view` is added to `compose_ui.js`
which blurs and refocuses the textarea after inserting the content, then
autosizes the textarea.
2023-10-09 11:13:53 -07:00
Aman Agrawal acdae9eae2 reload: Don't reload on 403 error for spectators.
Fixes #26280
2023-10-09 11:00:33 -07:00
Aman Agrawal 8299506e7a reload: Handle early attempts at reload when loading the app.
Trying to preserve state when app modules like message_lists
haven't been init results in errors.
2023-10-09 11:00:33 -07:00
Anders Kaseorg 5327bcc5ac user_group_settings_ui: Merge into user_group_edit.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 10:58:50 -07:00
Anders Kaseorg 63b4e74cea views_util: Cut import of narrow.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 10:54:00 -07:00
Aman Agrawal e8ced3e74a hello: Fix google analytics not working.
Since GA was only imported in portico bundle which we don't use
in hello page due to bootstrap, GA was not loaded.
2023-10-08 17:30:02 -07:00
Anders Kaseorg 70748181da recent_view_ui: Cut import of user_card_popover.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 19:45:13 -07:00
Anders Kaseorg 27991bd5b0 topic_zoom: Merge into stream_list.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 19:43:55 -07:00
Anders Kaseorg a43ea3efaa pm_list: Cut import of topic_zoom.
topic_zoom.is_zoomed_in() can’t be true in pm_list.zoom_in, because
“more conversations” would not be visible in that state.  And it can’t
be true when pm_list.handle_narrow_activated calls pm_list.expand,
because “more topics” would not be visible in an all-DM view.  So the
only non-inert call is via click_handlers; move it there.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 19:43:55 -07:00
Anders Kaseorg 564e91f3a8 narrow: Cut import of hashchange.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 19:41:59 -07:00
evykassirer 4adfd57378 message_fetch: Rename batch size constants to specify narrow views.
This is in preparation for introducing a batch size constant for
the recent view.
2023-10-06 17:30:33 -07:00
Anders Kaseorg ba1895cb1c notifications: Rename to desktop_notifications.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 16:22:40 -07:00
Anders Kaseorg fcaf1fe7d5 notifications: Split out audible_notifications module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 16:22:40 -07:00
Anders Kaseorg 6ef08873d8 notifications: Split out compose_notifications module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 16:22:40 -07:00
Anders Kaseorg db20fd12e0 notifications: Split out message_notifications module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 16:22:40 -07:00
Anders Kaseorg e48771993b widgetize: Move widget registration to new widgets module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 13:17:51 -07:00
Anders Kaseorg 0c991d813f sent_messages: Lift event loop restarting to transmit.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 13:17:51 -07:00
Anders Kaseorg 339b1351f8 echo: Pass transmit.send_message as a callback.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 13:17:51 -07:00
Aman Agrawal b9dd4a14c9 hello: Write better variable names. 2023-10-06 12:51:57 -07:00
Aman Agrawal cbb09f4ee6 hello: Fix client logos not changing on hello page.
Since `zulip.com` doesn't has `/hello` in URL, the JS code
for hello page events was not running. We extract it to a new
file and just always run it.
2023-10-06 12:51:57 -07:00
Prakhar Pratyush b274169ccc util: Fix the 'find_wildcard_mentions' function.
The function considers @**all**, @**everyone**, @**stream**,
and @**topic** as wildcard mentions.

Earlier, the function didn't have a check to match @**topic**
in the message_content.
2023-10-06 11:38:37 -07:00
Aman Agrawal 1a867a43a7 left_sidebar_inbox_popover: Move to new popovers folder. 2023-10-06 11:24:40 -07:00
Aman Agrawal 115de0e847 inbox_ui: Fix unable to insert new stream.
There were 2 issues:
* Wrong format for creating new Map object used.
* Use of `topic_dict` instead of `topics_dict`, which resulted
in `stream_key` being present in `topics_dict` even after stream
has been marked as read. This made inbox believe that the
stream was already rendered even though it was not.
2023-10-06 10:50:34 -07:00