Commit Graph

1839 Commits

Author SHA1 Message Date
Sayam Samal
3974ddf548 alert_words: Use banner to indicate alert words removal status.
This commit converts the alert words removal status alert to a banner
component.
2025-04-25 12:26:02 -07:00
Sahil Batra
31175752a0 people: Fix is_active_user_for_popover for inaccessible users.
We consider all inaccessible users as active so this commit
fixes is_active_user_for_popover accordingly.

This fixes deactivated icon showing in message avatar for
inaccessible users even when they are active.
2025-04-25 12:13:33 -07:00
Sahil Batra
53cdfddf5b groups-ui: Add option to copy membership from group.
Instead of adding group as a subgroup, we now provide option
to add direct members and direct subgroups of a group to a
user group by providing an expand button in the group pill.

Fixes #32335.
2025-04-24 11:36:49 -07:00
Sahil Batra
592ee2de1c groups-ui: Fix order of members typeahead.
We previously showed "Everyone except guests" group at the
top for group members and stream subscribers typeahead. It
makes sense for stream subscribers typeahead but not for
group members typeahead, so this commit fixes that.
2025-04-24 11:36:49 -07:00
Sahil Batra
b63b484f8d typeahead_helper: Rename functions used for sorting.
d11537a8cd modified how we sort options in typeahead for stream
subscribers and group members. The function names added in that
commit were confusing since the names included "settings" when
the function is used to sort the typehead for adding and updating
stream subscribers and group members. This commit fixes the names
of these functions.

This commit also renames sort_setting_options since that function
is now used for adding and updating stream subscribers and group
members apart from being used for sorting typeahead for group
settings.
2025-04-24 11:36:49 -07:00
Sahil Batra
9ebc877bbe pill_typeahead: Refactor code for set_up_combined.
Since set_up_combined was only being called with
is_stream_subscriber_input as true, there is no
need to have this variable in opts as we use same
sorting function for all the cases.
2025-04-24 11:36:49 -07:00
Karl Stolley
ad75ab590a thumbnails: Structure adjacent images into galleries. 2025-04-23 10:53:05 -07:00
Karl Stolley
3671a6a39c decorated_channels: Rename privacy-icon class. 2025-04-22 11:26:12 -07:00
Karl Stolley
1c55004cda decorated_channels: Rename partial as 'decorated_channel'. 2025-04-22 11:26:12 -07:00
Shubham Padia
b8ba174455 users: Return true for admins for is_moderator.
This change is for consistency with how is_admin works.

API design discussion at https://chat.zulip.org/#narrow/channel/378-api-design/topic/Should.20is_moderator.20have.20admins
2025-04-22 11:24:49 -07:00
Ines Falcato
8d96b7879f keyboard_UI: Allow use of e hotkey for spectators.
Previously, when in anonymous login, pressing the "view original
message" button showed the original message and allowed copying it.
However, the corresponding keyboard shortcut ('e') did not work as
expected and a login pop-up appeared instead.

Now, by fixing the UI features' permissions for anonymous users, by
adding "edit_message" as a feature they can perform, they are allowed
to use the 'e' keyboard shortcut as intended.

Fixes #33838
2025-04-21 14:36:10 -07:00
Kislay Verma
e2e0603689 message_edit: Check previous message content to prevent races.
Similar to group based setting values, we expect
the client to send the previous content alongwith
the edited content to the edit message endpoint.
We reject the request incase the previous content
doesn't match the current message content, which
could happen in case two users simultaneously edit
a message - which will be implemented in #33051.
2025-04-16 14:05:12 -07:00
Sahil Batra
4f80823191 settings: Fix opening settings for guests who cannot access all users.
Opening settings and stream settings UI was not working for guests
if they could not access all users. This was because is_person_active
did not handle inaccessible users correctly, if they were not added in
the users data, when being called in get_group_members to render
group pills.
2025-04-14 11:44:11 -07:00
aditya.chaudhary1558@gmail.com
2e59bb0768 empty-feed: Show special banner if muted topics in channel.
If we're in the feed for a channel and it is visibly empty
because all of the messages are in topics that have been
muted by the user, we now show an empty narrow banner that
informs the user about why the feed is empty, how to view
muted topics and links to the help center article on muting
and unmuting topics.

If the channel feed is empty and there are no messages in
muted topics, then we show the default empty narrow banner.

Fixes #31601.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2025-04-13 20:32:11 -07:00
Aman Agrawal
cd439c0232 message_overlay: Fix restore tooltips detached with message content.
To avoid restore tooltip of message from being displayed outside
the overlay, we define a boundary, outside which the tooltip
cannot exist. Popper library is smart enough to render the tooltip
correctly by respecting the provided boundary and flipping the
tooltip placement if required.
2025-04-11 10:40:35 -07:00
Karl Stolley
72c89404f3 thumbnails: Audition darker borders on typical images. 2025-04-10 12:55:15 -07:00
Karl Stolley
356028729f thumbnails: Handle dinky thumbnail images.
Fixes: #31502
2025-04-10 12:55:15 -07:00
Karl Stolley
d22c6318db thumbnails: Add height and width attributes to images. 2025-04-10 12:55:15 -07:00
Karl Stolley
4e19e82f64 thumbnails: Reference media anchors, images, and video by class. 2025-04-10 12:55:15 -07:00
Aman Agrawal
c5425a6dab filter: Add more asserts for has_exactly_channel_topic_operators. 2025-04-10 11:52:04 -07:00
Aman Agrawal
f5714a0c55 topic_list: Generalize use of TopicListWidget.
We introduce a different class to be used for left sidebar which
inherits TopicListWidget. More specifically, we allow the
children classes of TopicListWidget to pass their own method to
filter topics. This will later be used by inbox view when showing
channel view in center pane.
2025-04-10 11:52:03 -07:00
Aman Agrawal
22b50e2312 hashchange: Hide other views when showing a view in the same call.
Instead of having two calls everywhere to show a view and hide other
views, we move the logic to hide the other views inside the show
function of the view.

This will help as we will add other views to the app to keep the
logic to hide other views in the `show` function of the view to show.
So, the logic calling `show` for a view
doesn't have to iterate through hiding all the other views first.
2025-04-10 11:51:58 -07:00
Aman Agrawal
5ea42823ba topic_list: Rename function to specify use for left sidebar. 2025-04-10 11:51:20 -07:00
Aman Agrawal
1b012f1eb3 filter: Add function to check if narrow has only 'channel' term.
s
2025-04-10 11:51:20 -07:00
Sahil Batra
9d15a11331 streams: Live update UI correctly when archiving streams.
Previously, "delete" event was sent for both archiving streams
and when user lost access to a stream. So, when user lost
access to a stream, the UI was live updated like the stream
was archived, which was not correct. But now "update" event
is sent when a stream is archived, so the webapp code is
changed accordingly to live-update the UI for both cases
correctly.

As a result, some of the changes in 43932cd6aa and a29b6485d6
are reverted as "update" event is sent when archiving and "delete"
event is sent only when a user loses access to a stream as before.
2025-04-08 12:41:09 -07:00
Sayam Samal
f496bd6350 settings: Remove unused "saved" state in save discard widget. 2025-04-07 18:22:16 -07:00
Sayam Samal
83c5733144 settings: Fix save discard widget closing before saved state.
Sometimes, in slower connections, Tornado long-polling callback can
reach the client at almost exactly the same time as the success
response, making the prediction of which arrives first
non-deterministic. Due to this, the server event call responsible for
syncing the realm settings across multiple users would sometimes take
over and hide and the save discard widget before the success callback
from `/json/realm` could show the "saved" state in the button.

This commit fixes this issue by blocking the "discarded" state from
hiding the save discard widget when the save button is already in the
"saving" or "succeeded" state, since in those conditions the visibility
of the save discard widget would anyways be handled by a "failed" or
"succeeded" state.
2025-04-07 18:22:16 -07:00
Sayam Samal
b115368a81 settings: Update save button style when "Saved" is shown.
This commit updates the save button style in the settings component to
ensure that the button appears as a borderless attention + success
intent action button alongside the "Saved" label, when an updated
setting is saved.
2025-04-07 18:22:16 -07:00
Sayam Samal
6bf2887991 settings: Update save and discard buttons to redesigned button styles.
This commit updates the save and discard buttons in the setting modals
to use redesigned button styles along with the new loading indicator.
2025-04-07 18:22:16 -07:00
Ritwik
9feba0f16f emoji: Remap ':smile' emoji and update the settings UI.
This commit remaps the ':smile' emoji to 😄 and
introduces ':slight_smile' which maps to `🙂`.

Fixes #32712
2025-04-07 17:34:52 -07:00
Shubham Padia
d11537a8cd streams: Change sorting order for add subscribers.
See
https://chat.zulip.org/#narrow/channel/101-design/topic/New.20channel.2Fgroup.20UX.20changes/with/2142992
for more details on the order.
We decided to have a common function called `sort_setting_options` which
accepts a compare function for `group` and `stream` settings each.
2025-04-07 16:26:30 -07:00
Sahil Batra
928c04df31 settings: Disable checkbox in permissions panel.
This commit adds code to disable checkbox in permissions panel
if unchecking the checkbox will set the setting to nobody group
and that setting can't be set to nobody group,

Fixes part of #33730.
2025-04-04 11:06:05 -07:00
Evy Kassirer
450fbb7f48 peer_data: Process partial_subscriber data.
Work towards #34244. This shouldn't change production at all,
since we only send partial_subscribers when a dev flag is set.
2025-04-04 11:01:03 -07:00
Aman Agrawal
b8651e78e7 upload: Fix send button disabled when compose is closed during upload.
While uploading a file, if you close the compose box, and reopen
it, compose send button remains disabled due to upload in progress
being true.

To fix it, we update upload status for compose when upload is
cancelled.
2025-04-03 12:57:14 -07:00
Evy Kassirer
9dc5d19082 stream_data: Remove undefined check for never undefined user_id. 2025-03-31 09:41:45 -07:00
Lauryn Menard
139fe3768b compose-closed-ui: Add assert for inbox or recent view.
Asserts that either the inbox or recent conversation view is
visible when a ReplyRecipientInformation object is passed as
a parameter to get_recipient_label.

Updates the related test to more clearly check the expected
reply button text for the inbox/recent conversations case.
2025-03-26 15:50:27 -07:00
Lauryn Menard
7d3b77e490 compose-closed-ui: Refactor get_recipient_label.
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.
2025-03-25 16:23:41 -07:00
Lauryn Menard
94fe5fc173 compose-closed-ui: Rename update_reply_recipient_label.
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.
2025-03-25 16:23:41 -07:00
Aman Agrawal
afbc6f2510 message_list: Fix just_unsubscribed for empty views.
This fixes a bug where wrong bookend is shown in empty views in
the next commit.
2025-03-25 16:04:55 -07:00
Aman Agrawal
01c5197dd9 compose_validate: Make validate single source for error messages.
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.
2025-03-25 11:28:43 -07:00
Aman Agrawal
ad0b616bbd compose: Remove old style compose send disable.
We now use `disabled-message-send-controls` class to control
the disabled status of send button. So, this is not required.
2025-03-25 11:28:43 -07:00
Harsh
dd45c3221d widgets: Remove author tip for polls without question. 2025-03-25 10:48:28 -07:00
Aman Agrawal
67ff430e45 stream_list_sort: Fix user setting for demote inactive stream ignored.
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.
2025-03-25 09:47:06 -07:00
Aman Agrawal
87864992a8 stream_list_sort: Remove unused function.
This function was introduced in c1b5021d84
but was never used.
2025-03-25 09:47:06 -07:00
Aman Agrawal
68dc868658 composebox_typeahead: Add "New" label to non existant topics.
We add a "New" label at the end of query which doesn't match
any of the existing topic to help user identify when they
are linking to a topic which doesn't exist.
2025-03-24 17:58:59 -07:00
Prakhar Pratyush
e95ee707a6 compose: Update topic input box when mandatory_topics setting changes.
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.
2025-03-20 10:32:31 -07:00
Prakhar Pratyush
f8bedf3e3a compose_validate: Fix topic required error message not shown.
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.
2025-03-18 11:18:37 -07:00
Prakhar Pratyush
0642c7a264 util: Fix is_topic_name_considered_empty function.
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.
2025-03-18 11:18:37 -07:00
Tim Abbott
a6c5ddf102 compose_validate: Fix buggy separated handling of empty compose box.
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.
2025-03-17 14:15:12 -07:00
Tim Abbott
4602a22057 compose: Remove unnecessary mocks in node tests.
These became unnecessary in my final bug fix to
4fbf91c135.
2025-03-17 11:48:44 -07:00