Commit Graph

4064 Commits

Author SHA1 Message Date
Karl Stolley b8037a9980 lightbox: Remove any video players when navigating thumbnails. 2024-09-27 13:22:05 -07:00
Karl Stolley c36c561f07 lightbox: Only open the first returned media element. 2024-09-27 13:22:05 -07:00
Karl Stolley cc877f9c83 lightbox: Use temporary class to track selected media. 2024-09-27 13:22:05 -07:00
Karl Stolley 2e26c3bb9d lightbox: Show first media element on hotkey activation. 2024-09-27 13:22:05 -07:00
Aman Agrawal 790d5c44a1 stripe: Allow customer to switch license management type.
Fixes #28633

Added a button to switch license management type on billing page.

Tested that the plan switch works correctly.

Tested that when switching from manual to automatic license
management, customer is only billed for billable users for the
next billing cycle.
2024-09-26 16:13:28 -07:00
Anders Kaseorg b7e02436b8 eslint: Avoid @typescript-eslint/no-deprecated for jQuery ‘on’.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-26 13:27:26 -07:00
Anders Kaseorg 2dce73ecfa bot_data: Avoid deprecated ZodObject.deepPartial().
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-26 13:16:12 -07:00
Sahil Batra 6ddaaa4ef9 signup: Show realm name in a tooltip on signup page.
This is needed to make sure that user can see the realm
name in case it does not fits into the UI and is shown
with ellipsis.

Fixes #31676.
2024-09-26 11:58:31 -07:00
Anders Kaseorg fb623f4450 eslint: Fix @typescript-eslint/no-duplicate-type-constituents.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-25 15:43:37 -07:00
Anders Kaseorg 890f9e67f4 settings_linkifiers: Fix zod import.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-25 15:40:04 -07:00
Tim Abbott 21ddd719e7 message_events: Fix move_message_stream_id type confusion. 2024-09-25 11:13:09 -07:00
evykassirer 76a602842d message_list: Make data required in the constructor. 2024-09-24 17:16:15 -07:00
evykassirer 28c3701677 message_list: Move comment from constructor to class definition. 2024-09-24 17:16:15 -07:00
evykassirer 35bb00a6e5 message_view: Rename TargetMessageIdInfo to be more specific. 2024-09-24 17:16:15 -07:00
evykassirer 608c5ee54a message_view: Make trigger required for changehash and update_hash_to_match_filter. 2024-09-24 17:16:15 -07:00
evykassirer af915523a7 message_view: Convert module to typescript. 2024-09-24 15:43:27 -07:00
evykassirer b0785f0f2c message_view: Name mutated opts separate from function params.
This will help with Typescript conversion.
2024-09-24 15:43:27 -07:00
evykassirer 5b151cff96 message_view: Rename show's original opts to show_opts.
This will help with Typescript conversion.
2024-09-24 15:43:27 -07:00
evykassirer 3da3661a34 message_view: Access window.history.state through browser_history. 2024-09-24 15:43:27 -07:00
evykassirer df03d65cad browser_history: Use zod to parse window.history.state. 2024-09-24 15:43:27 -07:00
evykassirer 7bff149325 filter: Fix bug where invalid stream name could throw an error. 2024-09-24 15:00:10 -07:00
Sahil Batra 758fdc87e0 group_setting_pill: Do not allow guest users for some settings.
For settings with allow_everyone_group is False, guest users
are not allowed to do the task controlled by that setting even
if the guest user is member of the group which is used for
that setting.

So, we do not show guest users in typeahead for such settings
and also not create a pill when someone types full email of
the guest user in the input.

There is no such restriction in the API and it is fine
since we eventually have the check to not give guest user
the permission.
And we still allow guests to be part of any group, so there is
no restriction on using groups containing guests as subgroups
of the anonymous groups and showing them in typeahead.
2024-09-24 14:36:45 -07:00
Sahil Batra d0fbad3250 group_setting_pill: Pass setting_type in pill_config.
We only use pills UI for can_manage_group setting currently,
but we can still pass setting_type in pill_config so that we
can use that while calling get_group_permission_setting_config
for checking if group is allowed to be used in the setting when
creating group pill from group name.
2024-09-24 14:36:45 -07:00
Sahil Batra c4026615ae user_group_pill: Accept setting_type as parameter in typeahead_source.
We currently use the pills UI only for can_manage_group setting so
it is fine to pass setting type as "group" directly to
get_realm_user_groups_for_setting, but it would be better to just
accept setting_type as parameter in typeahead_source and pass that
to get_realm_user_groups_for_setting as other settings will also
use the pills UI in future.
2024-09-24 14:36:45 -07:00
evykassirer b2e1c5aec4 message_fetch: Don't allow undefined narrow term operands. 2024-09-24 14:34:07 -07:00
Karl Stolley 87965d61f2 left_sidebar: Set new heading icon and effects. 2024-09-24 11:08:50 -07:00
Tim Abbott 08e04e2195 message_edit_notice_tooltip: Rewrite to fix inverted check.
Apparently, abece73c5a had misconverted
the case where edit history is disabled.
2024-09-23 18:13:17 -07:00
Pratik Chanda aeebbbb825 tooltips: Defer computing last_edit_timestr until tooltip renders.
Earlier, we used to compute last_edit_timestr as data-tippy-content
when rendering the whole message feed.

This commit changes the behaviour by computing the `last_edit_timestr`
when a user hovers over the message_edit_notice.

Fixes: zulip#27240.
2024-09-23 18:13:17 -07:00
tnmkr 23efb5cec7 custom_profile_fields: Support non editable profile fields.
This commit allows configuration of "editable_by_user" property from the
organization settings modal. It also adds support for non-editable
fields in profile settings modal.

Fixes #22883.

Co-Authored-By: Ujjawal Modi <umodi2003@gmail.com>
2024-09-23 18:09:38 -07:00
Pratik Chanda 34296ae505 message_header: Display current year in header on year change.
Earlier, when subsequent message had different year, date divider
would leave out year from `time_str` if it was from current year.

This commit adds year to time display if two adjacent messages have
different year and the second message is from current year.

Fixes: zulip#26673.
2024-09-23 17:57:21 -07:00
opmkumar 1ddc1d2d12
search: Refactor how close buttons are handled.
We refactor the following inputs to use a `placeholder-shown` CSS selector to
show/hide the close button, rather than custom JS logic:
- Filter topics field in the left sidebar
- Filter direct messages field under direct messages
- Stream message topic
2024-09-23 16:04:10 -07:00
Anders Kaseorg 5bde07c842 stats: Fix @typescript-eslint/explicit-function-return-type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-23 15:59:33 -07:00
Anders Kaseorg 18b8d0f1b2 bootstrap_typeahead: Address @typescript-eslint/no-floating-promises.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-23 15:42:31 -07:00
evykassirer e7f5e526bc buddy_list: Refactor maybe_remove_user_id for ease of adding user lists. 2024-09-23 15:41:00 -07:00
evykassirer 5c6e3a7aac buddy_list: Refactor render code for readability. 2024-09-23 15:41:00 -07:00
evykassirer cd5a61eb52 buddy_list: Rename list element to not be named container.
This was confusing because there are other elements named
e.g. "#buddy-list-users-matching-view-container", which are
distinct from "#buddy-list-users-matching-view", and the
elements with the latter id should not be named with container
in the variable name.
2024-09-23 15:41:00 -07:00
Sahil Batra 2094e899b8 user_groups: Show deactivation error in modal itself.
Previously, the error was shown besides the group name
after the modal was closed, but it did not look good
for long error messages like the one we get when the
group being deactivated is being used for a setting.

Updated the code to use dialog_widget.submit_api_request
since it takes care of showing the error inside the
modal and also added code to show loading spinner as
the modal is not closed immediately to show the error.
2024-09-23 11:05:17 -07:00
Aman Agrawal 521bb1f722 message_edit: Fix `save/cancel` on message edit form not working.
`Enter` keypress on `save/cancel` was not working for users without
`should_enter_send` user setting due to it being prevented from
triggering default behaviour.

Fixed by only handling enter keypress if pressed inside
`message_edit_content` textarea.`
2024-09-23 10:58:57 -07:00
joseph 89d29ae569 user_setting: Correct selector for channel input filter.
Previously, we were selecting the wrong input element, which caused an
unexpected undefined type error. This change corrects the selector to
properly select the input element.
2024-09-22 22:15:42 -07:00
evykassirer 9b8df679d7 buddy_list: Fetch *all* subscribers for small channels in big orgs.
Followup to #31645. I tweaked the filter in `maybe_shrink_list`, but
that function works with user ids originally fetched in
`get_filtered_user_id_list`, which was only fetching ids of users
that had been recently active.
2024-09-22 09:28:50 -07:00
Aman Agrawal 33a677f317 message_edit: Fix `tab + enter` broken for saving.
There is no `.message_edit_content` in `focus` when user does
`tab + enter` to save the message. We use the existing text
content edit object get identify the row being edited which is
more robust and efficient.
2024-09-20 18:40:18 -07:00
Varun Singh 7302499485 message_list_hover: Convert module to TypeScript. 2024-09-20 18:24:49 -07:00
Varun Singh afa741f248 message_list_hover: Replace use of non-existent `status_message` field.
The `Message` object does not contain any `status_message` field.
We instead use boolean state `is_me_message`.
2024-09-20 18:24:46 -07:00
Sayam Samal 9c5978e85b copy: Use redesigned copy button in codeblocks of /help docs.
Fixes #28700.
2024-09-20 15:44:20 -07:00
Sayam Samal 4afdb33906 copy: Use redesigned copy button in bot settings UI.
This commit just replaces the old fa copy icon with the custom Zulip
copy icon. Since all the bot related icons in Personal/Settings/Bots
uses different colors, this commit avoids only changing the copy icon
colors, since that would result in an unintended standout.
2024-09-20 15:44:20 -07:00
Sayam Samal 79e8cb60db copy: Use redesigned copy button in copy invite link alert. 2024-09-20 15:44:20 -07:00
Sayam Samal a743bb0eb6 copy: Use redesigned copy button in rendered codeblocks. 2024-09-20 15:44:20 -07:00
Sayam Samal 6c7b61e6f2 copy: Use redesigned copy button in the About Zulip modal. 2024-09-20 15:44:20 -07:00
Sayam Samal b57a261035 user_profile: Fix faulty custom profile field copy buttons.
This bug was introduced in 7232ff6, which while adding the
copy-to-clipboard support for the custom profile field links, removed
the ClipboardJS reference to the ".copy-custom-field-url" class.
2024-09-20 15:44:20 -07:00
Sayam Samal 2e4e017a18 copy: Use redesigned copy button in view original message UI.
This commit also updates the copy icon in the related /help docs.
2024-09-20 15:44:20 -07:00
Sayam Samal a95c6a610e copy: Indicate successful copy by displaying a check icon momentarily. 2024-09-20 15:44:20 -07:00
Pratik Chanda 41cd04a071 composebox_typeahead: Remove own user suggestion if recipients present.
Earlier, in compose recipient, if user adds own user pill in recipient,
DM message list would fade even though it was the correct view.

This commit prevents user from adding own user pill in DM recipient if
other recipients are already added.

Fixes: zulip#31629.
2024-09-20 15:31:09 -07:00
Pratik Chanda bc623369c3 compose_recipient: Remove own user pill if other recipients are added.
This commit removes own user pill from recipient box if other
recipients are added.

Fixes part of zulip#31629.
2024-09-20 15:31:09 -07:00
Yaswanth Kosuru 8e71806958 tooltips: Change tooltip for channels subscribe/unsubscribe button.
Previously, the tooltips for the subscribe and unsubscribe buttons
were static, showing the same tooltip regardless of the button's
state. This update improves the user experience by introducing
dynamic tooltips that reflect the current state of the button.

Changes include:
- Added multiple HTML tooltip templates for different button states
  subscribed, unsubscribed.
- Updated JavaScript to select and render the appropriate tooltip based on
  the button's state.
- Modified `data-tool-tip-id` prop to use state-specific tooltip
  templates.

Fixes zulip#31500.
2024-09-20 15:17:31 -07:00
Pratik Chanda 967243b2db composebox_typeahead: Move wildcard string to secondary in @-mention.
Earlier, in typeahead suggestions for wildcard mention, we rendered
wildcard string as primary text inside parentheses.

This commit separates the wildcard string as secondary_text to
be rendered without parentheses using styles like channel description.

Fixes: zulip#31245.
2024-09-20 15:16:21 -07:00
Pratik Chanda c84ff59dc9 composebox_typeahead: Add info field to slash command as secondary text.
Earlier, in typeahead suggestions for slash command, we render
supplementary info as primary text inside parentheses.

This commit separates the supplementary info as secondary text to
be rendered without parentheses using styles like channel description.

Fixes part of zulip#31245.
2024-09-20 15:16:21 -07:00
evykassirer 52440c1cff unread_ops: Convert stream ids to integers before sending request to server.
This bug was introduced in #31299, which replaced the channel name
with a string id. It's still valid to send the channel id to the
server, but it shouldn't be a string, it should be a number.
(See https://zulip.com/api/construct-narrow#channel-and-user-ids)

In the future, we hope to update NarrowTerm to allow for integer
operands for channel terms.
2024-09-20 14:55:50 -07:00
Anders Kaseorg 57c39fc257 stream_data: Simplify ApiGenericStreamSubscription type.
The removed alternative is a subtype of NeverSubscribedStream and thus
already included.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-20 14:46:32 -07:00
Lauryn Menard 137f4fccde billing: Highlight manual license management errors for admins.
In the billing portal UI for manual license management, limit
decreasing the number of licenses for the next billing period to
be less than the currently used licenses. If the customer is exempt
from license number checks, then this limit is not applied.

Also, visually highlight manual license management errors so that
the billing admin is aware of potential issues.

As of these changes, current licenses can be under the seat count
when a guest user is changed to a non-guest user. And next billing
period licenses can be under the seat cout when a user joins with a
currently available, purchased license after a billing admin has
decreased the number of licenses set for the next billing period.
2024-09-20 12:02:39 -07:00
Aman Agrawal ea4e48afa7 filter: Add function to check if we can show the next unread button.
These function will be used when we add `Next unread conversation`
button below message list.
2024-09-20 11:54:18 -07:00
Aman Agrawal 0fb63eeddf filter: Rename local variable.
`term_types` is consistently used to store return value of
sorted_term_types in the file.
2024-09-20 11:54:18 -07:00
Aman Agrawal a35c8a08de message_edit: Attach keydown to $form instead of textarea.
This allows any event handlers that are attached to textarea
like typeahead to handle the keypress and stop propagation if
they successfully handle it.

This fixes a bug where message edit form gets saved on enter keypress
instead of selecting the active item in the message edit typeahead.

Introduced in 0696e234bd.
2024-09-20 09:50:38 -07:00
Inge ffbf2aaaff right-sidebar: Others collapsed by default
"Others" will on default be collapsed. If it is expanded it will be preserved when switching view.

Fixes #31628
2024-09-20 09:09:03 -07:00
evykassirer 5ddcbb8516 buddy_list: Show offline subscribed users for small channels in big orgs.
Previously, for big orgs, we hid all offline users in the buddy list to cut down
its size. But this can be weird for small channels where you might want to see
who's in the channel. This commit makes a tweak to show offline users in big
orgs for channels of size <= 50.
2024-09-19 15:43:28 -07:00
Tim Abbott 9dd8de64a9 message_list: Add should_trigger_message_selected_event to type. 2024-09-19 15:43:28 -07:00
evykassirer deb5d90941 message_list: Convert module to typescript. 2024-09-19 15:31:16 -07:00
evykassirer 620db3057b message_list: Fix bug accessing filter incorrectly.
I checked this with Aman who wrote this originally, and he said
this is what he meant to write.
2024-09-19 15:31:16 -07:00
evykassirer c9f49cefdd message_list: Remove unused preserve_rendered_state attribute.
Aman said  we should be running this even if it wasn’t running before.
https://github.com/zulip/zulip/pull/31591#pullrequestreview-2300886181
2024-09-19 15:31:16 -07:00
Aman Agrawal fd441fd3d3 hashchange: Extract function to get home view hash. 2024-09-19 13:50:47 -07:00
Aman Agrawal 02f84bda34 message_list: Avoid recursive calls to message_selected event.
Note that even though we no longer trigger message selection
events from within the rerender calls with their different `opts`,
it doesn't effect the scroll position and selected id since
the events are triggered synchronously and the final message
selection event call has the opts of the initial caller.
2024-09-19 13:20:49 -07:00
Alex Vandiver 94dad72b75 upload: Use @uppy/tus to upload files through tusd.
Replace the XHRUpload plugin for Uppy with the Tus plugin, to make use
of the new tusd endpoint.  This allows for resumable files, as well as
files which are larger than comfortably fit in memory (the source of
the old 25MB limit).

MAX_FILE_UPLOAD_SIZE is still applied, but can safely be raised above
25MB.

Fixes: #9391.

Co-authored-by: Brijmohan Siyag <brijsiyag@gmail.com>
2024-09-19 11:37:29 -07:00
evykassirer 86564381cf message_view_header: Rename current_stream to more accurate current_sub. 2024-09-19 10:06:57 -07:00
Sahil Batra 63a7c9061b settings: Use new pills UI for can_manage_group setting.
This UI enables the user to set can_manage_group setting to a
combination of users and groups, replacing the old dropdown UI
which just allowed setting user to a single system group.

Fixes part of #28808.
2024-09-19 09:08:33 -07:00
Sahil Batra 8068b6e55e group_setting_pill: Add code for showing typeahead.
This commit adds code to show typeahead for group setting
pill container. We add a separate function as we only
want to show groups and users in the typeahead and the
options are also sorted in a different order compared
to other typeaheads.
2024-09-19 09:08:33 -07:00
Sahil Batra 053686669a composebox_typeahead: Use query_matches_group_name to match group.
Though we can use query_matches_name for groups as we do not allow
system groups in the composebox typeahead and the other groups have
same display_name and name values, but still would be better for
consistency.

And with this change, query_matches_name function is only used for
streams, so updated that accordingly.
2024-09-19 09:08:33 -07:00
Sahil Batra def78ddf09 user_groups: Do not show "role:" prefix for system groups.
Instead of showing the actual names like "role:everyone",
"role:moderators", etc. for system groups, we show
"Everyone", "Moderators", etc. for system user group in
pills, typeaheads and popovers.

Though system groups are not shown in typeahead as of
this commit, we update the typeahead code as well to
not conside "role:" prefix while matching with the
query as we would soon show system groups in typeahead
when we would add new UI for group-based settings.

Previously, only "role:everyone" group was shown as
"Everyone" in popover and pills but for other system
groups their original names for shown and this commit
changes that behavior to be same for all system groups.

The original display_name field for
settings_config.system_user_groups_list objects, which
was used for dropdown widgets, is also renamed so that
we can use display_name field for the names to be used
in other places.
2024-09-19 09:08:33 -07:00
Sahil Batra 2fff124ec9 settings: Add new module to handle pills for group settings.
This commit creates a new module similar to add_subscribers_pill
for handling the pill widget to be used for group settings.
2024-09-19 09:08:33 -07:00
Anders Kaseorg dc6ba1c9e2 localstorage: Remove unused expiry feature.
This was introduced by commit 8b22b94ab1
with no actual cleanup mechanism, and has never been used.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 15:32:07 -07:00
Anders Kaseorg 97ffccb45f reload: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 15:31:41 -07:00
Anders Kaseorg 0be5cc232c reload: Remove obsolete location.reload(true) usage.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 15:31:41 -07:00
Sahil Batra 5f3a8334be user_groups: Do not allow deleting user groups. 2024-09-18 13:41:13 -07:00
Sahil Batra 6a739e263f user_groups: Allow deactivating groups from webapp. 2024-09-18 13:41:13 -07:00
Sahil Batra c53563d0e7 user_groups: Handle deactivated groups in webapp. 2024-09-18 13:41:13 -07:00
Anders Kaseorg 782fa2a803 localstorage: Fix removeDataRegexWithCondition to check parsed data.
Commit bca41fd29f (#23028) introduced
this for reload.is_stale_refresh_token, which had always returned true
because it was operating on the raw JSON string rather than the parsed
data.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 13:16:25 -07:00
evykassirer dba1af84e0 filter: Use stream id instead of stream name. 2024-09-18 13:08:14 -07:00
evykassirer 2be181c367 stream_data: Check for null more explicitly.
Otherwise 0 is treated specially, different from other numbers.
2024-09-18 13:08:14 -07:00
evykassirer 2ad1dc7014 stream_data: Make slug regex a bit more readable.
This clarifies that the second group is purely for use internal
to the regexp (it's there for the ? to act on) and won't be saved
as a substring for the surrounding code to look at (like match[2]).
In a hot path that could be a performance savings; here it just
makes things a bit more explicit for the reader.
2024-09-18 13:08:14 -07:00
Sahil Batra 7a6135371e settings: Handle guests separately for group-based settings.
This commit adds code to handle guests separately for group
based settings, where guest will only have permission if
that particular setting can be set to "role:everyone" group
even if the guest user is part of the group which is used
for that setting. This is to make sure that guests do not
get permissions for actions that we generally do not want
guests to have.

Currently the guests do not have permission for most of them
except for "Who can delete any message", where guest could
delete a message if the setting was set to a user defined
group with guest being its member. But this commit still
update the code to use the new function for all the settings
as we want to have a consistent pattern of how to check whether
a user has permission for group-based settings.
2024-09-18 11:51:11 -07:00
sujal shah fcbb1cd558 todo_widget: Add `type`` as Optional in `new_task_inbound_data_schema`.
This commit corrects the `type` parameter in
`new_task_inbound_data_schema`, which was previously optional
but not added as such.
2024-09-18 10:06:00 -07:00
evykassirer 13e3ced486 message edit: Fix bug preventing messages from being edited.
More context in this thread on CZO:
https://chat.zulip.org/#narrow/stream/9-issues/topic/Blueslip.20error.20on.20editing.20a.20message/near/1943476
2024-09-17 15:50:33 -07:00
Karl Stolley 708d07a885 lightbox: Address edge case where media may be unavailable. 2024-09-17 11:55:18 -07:00
Aman Agrawal 5e084a2128 message_view: Fix load_local_messages called without superset_data.
This was missed in the migration that happend in #31326.

Fixes error when pressing `Home` button in message list.
2024-09-17 09:14:36 -07:00
Sahil Batra ccddbba7a3 user_groups: Extract code to check system groups allowed for setting. 2024-09-16 16:28:52 -07:00
Sahil Batra 5fda195eab user_groups: Refactor function to get groups to be used for settings.
This commit refactors the code to get groups to be used for settings
as we would now have two UIs for settings for some time - dropdown
widget and pills, so we can just have a single function which just
returns the valid UserGroup objects and then a separate function to
get the appropriate format to be used for dropdown widgets and pills.
2024-09-16 16:28:52 -07:00
Sahil Batra 6482f0c2ea user_groups: Pass correct group object for adding new group to UI.
We previously passed the UserGroupRaw type object received in
the user group creation event to user_group_edit.add_group_to_table
instead of the UserGroup type object.

The add_group_to_table function is called after receiving creation
event only, but other functions called later in the flow are called
at other times as well like when opening edit panel for a particular
group and they expect UserGroup type object, so this commit fixes it.
2024-09-16 16:28:52 -07:00
Sahil Batra f3fafc719f settings: Add function to check permission for anonymous setting group. 2024-09-16 16:28:52 -07:00
Sahil Batra ffeb542b22 settings_components: Remove unnecessary toString calls.
The value for which the toString is called is already a string, so
there is no need to call it. It would have been added to make sure
that linter does not complain, so added an assert statement for it.
2024-09-16 16:28:52 -07:00
Prakhar Pratyush 764083d31b settings: Add 'allow_private_data_export' user setting.
This commit adds a user-setting to allow users to decide
whether to let administrators export their private data.

Fixes part of #31201.
2024-09-16 15:48:40 -07:00
Sayam Samal b8d4bddacf echo: Fix handling of `locally_echoed` flag after successful msg resend.
The `on_success` function within `echo.resend_message` is executed when
the server successfully acknowledges a resent message. In this scenario,
the `locally_echoed` flag should be set to false, as the message has
been confirmed by the server.

This behavior is already correctly handled within the
`echo.reify_message_id()` function, which is triggered through the
`compose.send_message_success()` flow.

However, the on_success function incorrectly sets the `locally_echoed`
flag to true, which is unnecessary and likely a mistake. This led to
the bug where message controls would disappear from the resent messages
on slow networks.

This commit removes the erroneous line to ensure proper flag handling
during message resend.
2024-09-16 13:06:30 -07:00
Sayam Samal 5583ddd3bf echo: Update message controls dynamically for failed messages.
Previously, the message controls for failed messages was present for
all messages, regardless of their status, and was being rendered
unconditionally; only being hidden for successfully sent messages.

This commit adds dynamic rendering for the failed message controls,
only rendering them via the handlebars template when a message is
confirmed to be failed.

Fixes #31132.
2024-09-16 13:06:30 -07:00