Refactors get_recipient_label so that it's a bit clearer what the
recipient_information parameter is for and what we do when that
parameter is undefined.
In doing so, we no longer treat the constructed objects, that are
passed as the recipient_information parameter, and actual Message
objects, that we get from the current message list view, as the
same thing.
(cherry picked from commit 7d3b77e490)
Renames update_reply_recipient_label to
update_recipient_text_for_reply_button.
This better matches the function that sets the default text for
the closed compose box button: set_standard_text_for_reply_button.
(cherry picked from commit 94fe5fc173)
Instead of relying on different functions to get error messages,
we use `validate` to get the error message for the current compose
state.
This fixes a bug where compose tooltip was not defined when
compose state was not valid.
(cherry picked from commit 01c5197dd9)
We now use `disabled-message-send-controls` class to control
the disabled status of send button. So, this is not required.
(cherry picked from commit ad0b616bbd)
We were not using `filter_out_inactives` and `pin_to_top` when
sorting stream in the left sidebar.
These were incorrectly removed in
1aee0ef98b.
Restored the original function and the places where it was used
to bring back original functionality.
(cherry picked from commit 67ff430e45)
Earlier, when `realm_mandatory_topics` setting was getting toggled,
the topic input box in composebox was not being live-updated to
align with the correspondning setting's UX.
This commit fixes that bug by making sure that placeholder and
other UI elements are updated accordingly.
Earlier, with `realm_mandatory_topics=true` the topic required
error message was shown only when topic="".
The error message was missing for other topic names which are
also considered empty:
* "(no topic)"
* realm_empty_topic_display_name
This commit fixes the bug to show the error message for the
other two topic names too.
Earlier, the `is_topic_name_considered_empty` function
used to return true only if the topic_name is either:
* ""
* "(no topic)"
* `realm_empty_topic_display_name` value
The third condition is not precisely correct. This commit
replaces it with the displayed topic name for `""` topic.
The displayed topic name is not always the same as
`realm_empty_topic_display_name` value.
When I adjusted 4fbf91c135 to no longer
do a full re-validation on every character typed, that unmasked bugs
in how the compose_setup handler code and compose_validate split
responsibility for validating 0-length messages.
The user-facing result was the send button not enabling properly when
starting to type.
Fix this by moving the 0-length message validation into
compose_validate, where we already handle issues of too-long messages,
sharing the same basic logic for determining when to do a full
validate() call.
A benefit of this reworking is now all of the logic for handling the
`invalid` class is in one place in validate, rather than split with
the compose_setup module.
Compose send tooltip was not correctly displayed when the compose
box was in an invalid state.
We significanlty improve the logic for displaying the tooltip here
to provide a more robust experience to the user.
Previously, stream archive button was only shown to realm admins.
Now button is shown to all the users who can administer the
channel.
Fixes part of #33379.
Variable for storing the dropdown widget is now
declared in stream_settings_components and this
commit also adds some helper functions to get
and set the filter value.
This is a preparatory commit to avoid import
cycles in further commits for fixing live
update when channels are archived.
There is no need to store the archived status filter value in a
variable, instead value can just be derived by calling "value"
function on DropdownWidget.
This is a preparatory refactor for further commits which will fix
live-update behavior when archiving channels.
Add a warning banner when a user mentions a group (non-silent) where none
of the members are subscribed to the current stream. The banner informs
the user that the mention won't notify anyone.
Fixes#33545.
Fixes#31315.
We want to parse sender:me with the email when turning it into
a pill, but not before then so that "Sent by me" is still the
search string in the suggestions.
This commit separates the "resolve topic" permissions from the
topic editing permissions, through the introduction of setting -
"can_resolve_topics_group" which user group whose members
can resolve topics.
Fixes#21811
Add the `is:muted` search operator.
`-is:muted` is an alias for the `in:home` operator.
Co-authored-by: Kenneth <Kenneth012004@outlook.com>
Fixes#16943
Previously, mentions from muted channels were incorrectly excluded when
narrowing down to `-in:home`. Additionally, messages from all muted
topics were missing in the results.
This commit solves the above listed issues.
The relevant legacy logic being removed dates to when we didn't
support unmuting or following topics.
Use both the last_moved_timestamp and last_edit_timestamp to show
edited and moved indicators/tooltips in the message list view of
the web app, instead of parsing the message edit history array.
We still maintain and build the message edit history array as it's
used for calculating the narrow terms when there is a near operator
and a message has been moved to a different channel or topic.
Updates the tooltip for message edit indicators to include both
the moved and edited time if a message has been both moved and
edited.
Previously, all buttons within .subsection-changes-save were targeted,
potentially leading to multiple requests while a request was in
progress. This change ensures that the triggering element is properly
handled by preventing the default form submission action.
Previously, `is_spectator_compatible` in `hash_parser.ts` ignored all
operators and operands beyond the first pair in a narrow.
This was fixed by iterating through each operator-operand pair individually.
This commit hides sidebar menu option button instead of showing
it with "Mark all messages as read" option, for home view when
there are no unread messages.
This commit serves as the base commit for redesigning the alert banners
by migrating them to use the new banner component. We use a new name
to refer to these banners — "Popup banners", which is more descriptive
about their behavior.
The Popup banners are appended to the container in a stacking order,
i.e., the most recent popup banner appears on the top and the oldest one
is sent to the bottom of the stack. These banners also inherit the
animations from the alert banners for visual appeal.
This commit also fixes the bug where clicking on the "Try now" button
in the popup banner resulting from an error in the `/json/messages`
endpoint resulted in call to restart_get_events in server_events.js
instead of load_messages in message_fetch.ts.
Fixes#31282.
Removed `is_billing_admin` user property as it is no longer used since
billing permissions are now determined by `can_manage_billing_group`
realm setting.
Updates narrow_state.stream_id to have a boolean parameter, that
defaults to false. When true, the function will return an ID or
undefined based on the stream data that we have. When false, the
function will return the operand of the channel narrow term when
it's a valid number or undefined if it's not.
Replaces all uses of narrow_state.stream_sub()?.stream_id to
instead use the updated stream_id function with only_valid_id set
to true.
When the channel operand would return NaN for the ID value, we now
return undefined, so that there is only one invalid value being
returned by narrow_state.stream_id.