Previously, in presence of `dm` operators, the `with` operator
behaviour in the web client was not consistent with that of
the API. For instance, when `with` points to a stream message,
in presence of a `dm` term, then rather than narrowing to the
corresponding channel of `with` operand, the `with` term simply
used to be ignored, and narrowed to the corresponding `dm`
narrow.
Also, in cases when the `with` used to point to a direct message,
in presence of a `channel` term, then after correcting to the
right narrow, the `with` term used to be removed. The `with`
term would still be needed after correcting the narrow to
maintain consistency between channel and dm conversations.
This commit removes these inconsistencies of `with` in case
of `dm` operators, and makes it consistent to those mentioned
in the api documentation.
Shows a stream info popover whenever a channel pill is clicked (such
as in the pill widgets for adding subscribers to a channel or
invitations). The stream info popover contains channel icon and name,
channel description and a link to channel settings.
Fixes#30567.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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>.
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
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.
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.
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.
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.
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.
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.
This also removes the need for any min-width declarations on the
labels, which will behave as block elements and take up the
containing block's available width.
This seems to have been used with the `password_warning()` function
in `password_quality.ts`, but that function does not appear to be
called in the app--only in the portico.
This commit addresses an issue where the search query applied in
one tab was inadvertently affecting all tabs
(Users, Deactivated, Invitations).
Now, the search functionality is properly isolated to the active tab,
ensuring that users can filter results without interference
from other tabs.
(One change needed for this was included in the previous commit).
This moves the content inside `message_length_controller` to a new
handlerbars template `message_length_toggle.hbs`, and dynamically
renders the content based on the message length.
Since the majority of the messages aren't collapsed/condensed, this
change should improve the initial rendering of the message list.
Fixes#31133.
This commit removes the 'prev_rendered_content_version'
field from:
* the 'edit_history' object within message objects in the
API response of `GET /messages`, `GET /messages/{message_id}`
and `POST /zulip-outgoing-webhook`.
* the 'update_message' event type
as it is an internal server implementation detail not used
by any client.
Note: The field is still stored in the 'edit_history' column
of the 'Message' table as it will be helpful when making
major changes to the markup rendering process.
This commit moves the placeholder elements for the message edit form,
to `message_edit_form.hbs`, so they are conditionally rendered only
when a message is being edited, rather than being present for every
message in the list.
Fixes#31134.
Display "No channels match your filter" in the left panel
when no matches are found for filter queries in
"Subscribed", "All channels" and "Not subscribed" tabs.
Fixes#18332.
Adds a link to the plan ledger view in the current plan information
shown in the support views. Link is not shown if the plan is 100%
sponsored, e.g., the Community plan.
Adds a formatted header area to the activity table template so
that it's easy to add useful information to these activity views.
Previously the empty view banner for DM with any recipients
contained "Why not start the conversation".
For deactivated users/bots, we are now not displaying it.
The "Role" field previously only displayed "Bot" for the non-system
bot users, this commit adds the detailed bot role to the "Role" field
in the format "Bot ({role})".
This commit displays the bot owner card as an overlay in the middle of
the screen, like we do for mobile screen sizes where the reference
elements are hidden.
This also hides the bot user card when it's bot owner card is opened.
As a follow-up to the previous commit which repositions the bot owner
field, this commit adds the bot's role in the format "Bot ({role})" to
the previous position of the bot owner field in the bot user card.
This commit repositions the bot owner field from below the bot’s name to
align with the user fields, providing more space for the newly added
bot owner user pill.
Earlier when compose box was opened or narrowed to pm, the recipient
pills were sorted according to user email strings instead of their
full names which was inconsistent with compose box placeholder text,
recipient row and message header.
This commit fixes the behaviour by introducing a `sort_email`
function to sort emails according to their full names and display
sorted pills.
Fixes: zulip#27375.
Co-authored-by: richardshaju <richardshaju66@gmail.com>
Earlier in drafts overlay, the order of pm recipients for the draft
was sorted differently to that of the pm group title.
This commit fixes the behaviour by sorting the drafts pm recipients
using `make_strcmp`.
Fixes part of zulip#27375.
Co-authored-by: richardshaju <richardshaju66@gmail.com>
Earlier in left sidebar, the recipient names were not sorted
consistently with the message header of the pm.
This commit fixes the behaviour by sorting the recipient names in
left sidebar with `make_strcmp`.
Fixes part of zulip#27375.
Co-authored-by: richardshaju <richardshaju66@gmail.com>
Earlier, in group direct message, the full names of group pm recipients
were sorted incorrectly which is used for tooltip on hovering over
recipient row and text placeholder of collapsed compose box. That
resulted in different order of recipient names.
This commit fixes the behaviour by using the `make_strcmp` to sort
the names to show in the tooltip and collapsed compose box.
Fixes part of zulip#27375.
Co-authored-by: richardshaju <richardshaju66@gmail.com>
Earlier, when narrowed to a group direct message, the header title
was sorted with respect to its email instead of their names. This
would result in message header and recipient row having different
order of recipients.
This commit fixes the behaviour by changing the order of the names
passed for the group message header using `make_strcmp`.
Fixes part of zulip#27375.
Earlier, the order of recipients in recipient row of group direct
message weren't in the same sorting pattern as that of message
title which would result in inconsistent order of recipient names.
This commit fixes the behaviour in `private_message_header` in
recipient row to sort the names using `strcmp`.
Fixes part of zulip#27375.
Co-authored-by: richardshaju <richardshaju66@gmail.com>
This also moves the 2px of reduced lefthand padding to the overall
width of the left sidebar, which will keep the left sidebar at its
same width (in other words, the message area will not shift any
further to the left, either).
Fixes#27565
This is part of a bigger refactor to calculate message container
attributes just from the message, so that we can create the message
container all at once instead of piecewise, to be able to convert
to typescript.
Where "pure function" means that the group's value isn't changed
in this function.
This commit also modifies the function to just take a message.
This is part of a bigger refactor to calculate message list group
attributes and creating the group all at once instead of piecewise.
This is necessary to convert this module to typescript, since a
partially formed group is hard to type.
This is part of a bigger refactor to calculate message container
attributes just from the message, so that we can create the message
container all at once instead of piecewise, to be able to convert
to typescript.
This is part of a bigger refactor to calculate message container
attributes just from the message, so that we can create the message
container all at once instead of piecewise, to be able to convert
to typescript.
This is part of a bigger refactor to calculate message container
attributes just from the message, so that we can create the message
container all at once instead of piecewise, to be able to convert
to typescript.
We're going to need to be able to build the message list view
in pieces and put it all together in the end, instead of assigning
values directly to a half-formed object (which is hard to type).
This is part of the work towards that.
When we convert this module to typescript, the type of `rendered_date`
will need to be a valid input to `$element.html`. Elsewhere in this
file, the date is a string. Here it's a JQuery object, which isn't
a valid input, but HTMLElement is, so this commit converts it to that.
I tested this manually and it still renders correctly.
This commit adds '*' as a keyboard shortcut to navigate to the starred messages view and the shortcut is documented in various required locations accordingly.
Fixes#31397.
It is better to have stream dropdown option value, which is the ID
of the stream, to be of "number" type.
This fixes the assertion error which occurred when someone tried to
subscribe the user to a stream from user profile modal.
This commit updates code to live update the groups UI if
realm or group level setting to manage groups is changed.
This commit also does some refactoring to better organize the
code in different functions.
And also, the code to hide/disable the UI if the user does not
have permission to manage the group in JS such that the same code
is used for live-updating as well.
This commit fixes the live update of subscribers list
on changing can_remove_subscribers_group setting.
Previously, whole members panel, including the pill container
to add subscriebrs, is re-rendered. But the click and input
handlers for the add subscribers UI is not added again after
re-rendering and thus they do not work.
This commit updates the code to just re-render the subscribers
list which is only needed to update the "Unsubscribe" button.
This allows log in button in navbar for spectators to have more space
to be displayed in different languages without being truncated.
Login page already has 2 buttons for user to sign up from.
Preivously, the tooltip was shown only for first element
since initialize_disable_btn_hint_popover only added the
tooltip to first element. And then after d9f25d01a1, there
was an error shown as initialize_disable_btn_hint_popover
asserted that only single element list was passed.
This commit fixes it by calling initialize_disable_btn_hint_popover
for each setting element. Similarly the code to destroy the
tooltip on enabling the setting elements is called for each
element.
Reset event handlers attached to the dropdown widget and by removing
it from DOM.
User is unlikely to use the same dropdown multiple times, even if
they do, the operation is fast.