Commit Graph

1701 Commits

Author SHA1 Message Date
Anders Kaseorg
b248e2d931 tests: Assume failure in case the async task vanishes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-04-29 13:42:40 -07:00
Lauryn Menard
d732a7b801 demo-orgs: Move helper function to get days remaining until deletion.
Moves the get_demo_organization_deadline_days_remaining helper from
"web/src/navbar_alerts.ts" to "web/src/demo_organizations_ui.ts".

Prep commit for updating the navbar alert for demo organization to
have a button that opens the modal for converting the organization
to a permanent organization.
2025-04-29 12:25:28 -07:00
Sahil Batra
52b20354e6 message_view: Live update on losing access to a stream.
This commit adds code to live update the message view when
user loses access to a stream and also remove the data of
messages from that stream.
2025-04-29 09:46:19 -07:00
Evy Kassirer
3383a69088 people: Remove stray console.logs that made it into main.
Introduced in 51d382f717.
2025-04-29 09:40:57 -07:00
Harsh
bdf2317b40 filter: Use specific title for DM conversation with self.
For the DM conversation with the current user, show "Messages with
yourself" for the title, which is determined by the filter for the
message list view.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2025-04-28 20:50:51 -07:00
Harsh
20e3262233 sidebars: Show "(you)" after user's own name in user lists.
Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2025-04-28 20:50:51 -07:00
Harsh
57ce1371a8 drafts: Use specific text for DM conversation with self.
Adds "You" and "Drafts from conversations with yourself" as
labels in the drafts overlay for the DM conversation with
the current user.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2025-04-28 20:50:51 -07:00
Harsh
c8763f919f compose-closed-ui: Use specific button label when composing to self.
When the compose box is closed, if the selected message is for the
direct conversation with the current user, then we show "Message
yourself" as the compose reply button text.

Adds `decode_dm_recipients_user_ids_from_url` helper function to
hash_util, which parses a narrow URL for DM recipient user IDs.
Checks that "dm" operand, which should be a string of user emails,
also passes the check for all the email addresses being valid
compose recipients.

Co-Authored-By: Lauryn Menard <lauryn@zulip.com>
2025-04-28 20:50:51 -07:00
Lauryn Menard
64cb3769ce drafts-test: Fix test data for direct message drafts.
The draft values for private_message_recipient and reply_to should
be set to the same string of comma separated email addresses.
2025-04-28 20:50:51 -07:00
Aman Agrawal
645850ccfa hotkey: Fix warning about unused login_to_access import. 2025-04-28 16:10:49 -07:00
Karl Stolley
142d1958a0 url_previews: Post-process embed links for performant CSS. 2025-04-28 16:10:13 -07:00
Sayam Samal
a4549ffaf5 alert_words: Update label in the alert words removal status banner.
This commit displays the removed alert word in the error banner, and
bolds the alert word in both success and error banners.
2025-04-25 12:26:02 -07:00
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