Commit Graph

5808 Commits

Author SHA1 Message Date
Tim Abbott ad890890f6 lint: Fix several duplicate word typos. 2024-09-10 15:59:00 -07:00
Aman Agrawal 21b6bb9887 message_list_data_cache: Update when receiving new messages.
If we receive a message that we can add to the data cache without
talking to the server, we do that, otherwise we remove it from the
cache to avoid us having wrong filter status cached.
2024-09-10 15:58:15 -07:00
Aman Agrawal 5b9a2584c5 message_list_data_cache: Cache MessageListData objects.
We start caching MessageListData objects for the narrows which
user has visited. We restore the cached objects if the filters
match. Also, the cached objects are updated based on events. One
major piece is update path the is pending implementation is the
message move code path.
2024-09-10 15:58:15 -07:00
Aman Agrawal 259e77fbf6 message_list_data: Track if the data is rendered using message list id.
This is an easy way to track if a MessageListData is rendered.
Storing MessageList object would make us liable to cleanup the
MessageList object when the data is no longer in use.

Note that this is more like "likely / past rendered message list id",
we will have to check currently rendered message list data to verify
if the data object is really rendered.
2024-09-10 15:58:15 -07:00
Aman Agrawal fee108949d messsage_lists: Extract method to delete a rendered list. 2024-09-10 15:58:15 -07:00
joseph 65893292b5 channel_subscribe: Use IDs instead of emails when processing results.
As part of our todo in the code, we want to use the unique user IDs
instead of emails when processing the results of subscribing users to a
channel. These changes apply those changes and streamlines the use of IDs.
2024-09-10 15:37:38 -07:00
opmkumar 62f74fcb83 search: Hide close button in empty filter streams and filter topics.
Fixes #21297.
2024-09-10 15:36:30 -07:00
Karl Stolley 8ff3fb5fec message_row: Reduce space above collapsed Show More button.
This only impacts collapsed Show More buttons in a message with a
sender.

Fixes #31221
2024-09-10 14:06:58 -07:00
adnan-td eaaf26e182 buddy_list: Remove deactivated users from right sidebar.
Filter out inactive people from the buddy list in the right
sidebar.
2024-09-10 14:04:26 -07:00
Mateusz Mandera a36f906d1a presence: Add history_limit_days param to the API.
This param allows clients to specify how much presence history they want
to fetch. Previously, the server always returned 14 days of history.
With the recent migration of the presence API to the much more efficient
system relying on incremental fetches via the last_update_id param added
in #29999, we can now afford to provide much more history to clients
that request it - as all that historical data will only be fetched once.

There are three endpoints involved:
- `/register` - this is the main useful endpoint for this, used by API
clients to fetch initial data and register an events queue. Clients can
pass the `presence_history_limit_days` param here.
- `/users/me/presence` - this endpoint is currently used by clients to
update their presence status and fetch incremental data, making the new
functionality not particularly useful here. However, we still add the
new `history_limit_days` param here, in case in the future clients
transition to using this also for the initial presence data fetch.
- `/` - used when opening the webapp. Naturally, params aren't passed
here, so the server just assumes a value from
`settings.PRESENCE_HISTORY_LIMIT_DAYS_FOR_WEB_APP` and returns
information about this default value in page_params.
2024-09-10 13:15:35 -07:00
Aman Agrawal 93f0581197 messages_overlay: Fix multiple IDs selected accidentally.
Since `success_message_scheduled_banner` and scheduled message overlay
both use `data-scheduled-message-id`, `get_element_by_id` needs
to be more specific which selector it wants.
2024-09-10 09:51:18 -07:00
Prakhar Pratyush 00fb8f3014 settings: Move the user-privacy settings related code at one place.
This commit makes small refactoring to place all the user-privacy
settings code in 'server_events_dispatch.js' at one place and use
a common function 'settings_account.update_privacy_settings_box' to
update the UI.

This also helps in early return instead of executing a lot
of `if` statements related to user-preferences settings.
2024-09-10 09:34:24 -07:00
Prakhar Pratyush 75f6ae6d20 settings: Fix live-update bug for privacy settings.
The following three privacy settings weren't being live
updated across multiple browser tabs/windows:
* send_stream_typing_notifications
* send_private_typing_notifications
* send_read_receipts

This commit fixes the bug.
2024-09-10 09:34:24 -07:00
Prakhar Pratyush 340140954b settings: Use the generic code block to set 'enter_sends' value.
This commit performs a minor code restructuring to use the
generic code block for updating all the user_preferences
settings values.

No need to use a separate code block for 'enter_sends' setting.
2024-09-10 09:34:24 -07:00
Alex Vandiver 8bd94b82bf upload: Name the link based on the uploaded filename.
We previously parsed the filename as stored on disk, which is rather
sanitized.  Use as close to the original filename as possible.
2024-09-09 12:40:17 -07:00
Alex Vandiver 8e5cdcc174 upload: Remove impossible undefined-url test and code.
This came in during the initial conversion to Uppy in 5bab2a3762,
but it tests a case which should not be possible according to Uppy's
API, and ours.
2024-09-09 12:40:17 -07:00
Sanchit Sharma 48b60db4a4 settings_config: Use `kbd` for `realm_enter_send` label.
Fixes: #29083.
2024-09-06 11:47:04 -07:00
Sanchit Sharma 671946351c settings: Improve visibility of "Enter Sends Message" setting.
Addresses user research feedback by duplicating the "Enter Sends
Message" setting in the Settings > Preferences menu, specifically within
the General section, ensuring users can easily locate and configure
this option.

server_events_dispatch: Remove break statement.
The settings page needs to be updated when
`enter_sends` property is updated.

css: Update vertical-align to middle for the checkbox element.

Co-authored-by: Akarsh Jain<akarsh.jain.790@gmail.com>.
2024-09-06 11:47:04 -07:00
sanchi-t a8acd0ce25 compose_box: Remove non-existent classes.
The .enter_sends_true and .enter_sends_false classes were originally
removed in commit b4b71880e1.
2024-09-06 11:47:04 -07:00
joseph 5d3edf06c8 message_edit: Ask users to delete attachments after editing.
currently, after a user edits a message and removes an reference to the
uploaded file, the uploaded file stays on the storage taking up space.
We want to ask the user to possibly delete the removed attachments if
they are no longer needed. These changes applies a modal that will appear
prompting the user to delete the attachments.

Fixes: #25525.

Co-authored-by: brijsiyag
Co-authored-by: wandrew0
2024-09-06 11:40:51 -07:00
joseph 5133f34a05 attachments: Reuse base attachments schemas.
This is a prepatory commit to reuse the base attachments schemas in
other schemas that are expecting attachments as a field.
2024-09-06 11:40:51 -07:00
Karl Stolley e1e9ab0d06 portico: Ensure comparison tabs take precedence over plans. 2024-09-06 09:35:32 -07:00
Anders Kaseorg 7515cb8c6e invite: Avoid slow jQuery :input selector extension.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-06 09:33:31 -07:00
Anders Kaseorg cf186a4d86 sponsorship: Avoid slow jQuery :selected selector extension.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-06 09:33:31 -07:00
Anders Kaseorg 081c0dc97f signup: Avoid slow jQuery :selected selector extension.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-06 09:33:31 -07:00
Sahil Batra 6efa6b354c stream-settings: Check if overlay is opened when removing stream.
This commit adds code to add a check if overlay is opened before
executing the code for removing stream from UI on receiving the
stream deletion event. This makes sure that the we do not
call code which expects certain UI elements to be present in the
DOM and thus avoid errors in cases where the stream settings UI
is not opened and the related elements are not in DOM.
2024-09-06 09:32:53 -07:00
Jaimin Godhani 731575344e settings: Rename display_settings to preferences.
Fixes zulip#26874.
2024-09-05 16:17:36 -07:00
Alya Abbott 9933165e75 help modal: Remove small_hotkey style. 2024-09-03 20:52:16 -07:00
Alya Abbott b65e02ed98 help: Add missing line to Navigation section of keyboard shortcuts. 2024-09-03 20:52:16 -07:00
evykassirer ec43b41c2f move_topic: Remove extraneous classname on hidden input, fixes bug.
We initialize the topic typeahead in the modal with the element
`$("#move_topic_form .move_messages_edit_topic")`, which previously
was capturing two elements, the second one being a hidden input
element.

This wasn't causing issues, but once we added `util.the` in the
typeahead code we were getting errors for having multiple elements
where we expected one.

The fix is removing `move_messages_edit_topic` from the hidden
element's classnames, since that class is only used for input
and styling things.
2024-09-03 20:50:34 -07:00
roanster007 519614ffbb narrow: Fix last unread when narrowed to a `dm` message using `with`.
Previously, on narrowing to a direct message using the `with`
operator, we used to end up at the last message rather than
the last unread message.

This was because while correcting the narrow using the `with`
operand, we used to consider all the users of `display_recipient`.
This would also include the `current_user`. This is not right because
the unread messages for direct messages are bucketed with a
`user_ids_string`, that does not include the user id of the current
user. Hence, when looked up for the last unread id by the `with`
operator, it used to return undefined.

This is fixed by removing the current user's user id from the user ids
string if current user is not the only display recipient to the
direct message.
2024-09-03 16:35:35 -07:00
evykassirer 58bc98afb5 util: Use blueslip error for util.the instead of an assert. 2024-09-03 13:49:30 -07:00
Aman Agrawal 240c870815 typeahead: Fix compose topic typeahead partially hidden.
The `flip` popper function is not working properly here since
we migrated to use Simplebar (Can be verified by removing
`data-simplebar`).

To fix it, we need to force trigger the function as soon as tippy
is attached to DOM.
2024-09-03 12:37:33 -07:00
Shubham Padia 1ec4539550 css: Rename .icon to .sidebar-item-icon for the name to be unique.
See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1901490
for more details.
2024-09-03 12:20:42 -07:00
Shubham Padia 2f120d2572 settings: Make show more tab look similar to other tabs.
Fixes https://chat.zulip.org/#narrow/stream/101-design/topic/org.20settings.20-.20show.20more.20-.20icon.20alignment/near/1935512
Also renames `.collapse-settings-btn` to `.collapse-settings-button`.
2024-09-03 12:20:42 -07:00
Shubham Padia 4a7983fad3 css: Use a class for spoiler header text.
Having the :not() rule there affected the performance, see
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1920156
for more details.
2024-09-03 10:24:40 -07:00
Shubham Padia 28d9c02479 css: Have `move-handle` for every movable row instance.
The original motivation was to remove the `+ i` instances because of
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1934360.
But it seemed better to have similar html structure and css across all
movable rows.
2024-09-03 10:22:44 -07:00
Shubham Padia 77ebdfac77 css: Use classname for show_my_user_profile_modal icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia a764e80a1b css: Use classname for scroll-to-bottom icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia fe44ce3e24 css: Use classname for all-messages-search-caution icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia 82b68e9bdb css: Use classname for play_notification_sound icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
Also does some refactoring to account for the fact that
.setting_notification_sound does not have any icons as children.
2024-09-03 10:22:44 -07:00
Shubham Padia 6ec1b89502 css: Use classname for navbar_icon_and_title icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia ea60fee0ac css: Use classname for subscribe-to-more-streams icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia 9de064dc3e css: Use classname for setting-disabled-option icon.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:18:29 -07:00
Vector73 b2a07971ec dropdown_widget: Allow more than one click on dropdown.
The new saved replies feature requires removing saved replies by clicking on
trash icon on dropdown item. So dropdown widget should allow more than
one click without closing it to delete multiple saved replies.
2024-09-03 09:20:27 -07:00
Aditya Kumar Kasaudhan b2ab77746b compose: Fix disabled buttons after exiting preview mode in edit UI.
This commit fixes the issue by ensuring that the `clear_preview_area` function is called within the `end_message_row_edit` method. This ensures that when the edit UI is reopened, it resets to the correct state, with all buttons enabled and functioning as expected.

Fixes #31503.
2024-09-03 09:19:10 -07:00
Karl Stolley a8ecba8ab8 settings: Remove .new-style, unused .button ul selector. 2024-08-30 14:06:27 -07:00
Karl Stolley 7a94d484ff settings: Remove unused or unnecessary center classes from .new-style cluster. 2024-08-30 14:06:27 -07:00
Karl Stolley f98551f128 settings: Remove unnecessary .block from .new-style cluster. 2024-08-30 14:06:27 -07:00
Karl Stolley 0cfddc9874 settings: Remove .w-200 class from .new-style cluster.
All elements that use this have their width already superseded by
other selectors.
2024-08-30 14:06:27 -07:00