Commit Graph

64342 Commits

Author SHA1 Message Date
bedo
c0a9ca8e9a tests: Pass update_fields to all stream.save().
A prep PR to 34308.

Explicitly pass the fields to be updated,
This increases performance but most importantly
prevents overwriting the db-saved value of
"subscriber_count" field (added in an upcoming PR)
with the in-memory default value of 0,
since "subscriber_count" will only be updted
via the db.

Migrate some tests to use do_ functions instead of
direclty modifying the state.
2025-04-15 10:28:18 -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
Sahil Batra
3739081792 typeahead: Fix typeahead showing for disabled inputs.
When user cannot type in the input, because of contenteditable
being set to "false", typeahead should not be shown when clicking
on the input element.
2025-04-14 09:24:53 -07:00
Sahil Batra
722d501107 streams: Don't show confirmation modal if user can subscribe.
Previously, we showed confirmation modal when user was unsubscribing
themselves from the private stream from "Unsubscribe" button in
subscribers list, even when user had the permission to subscribe
to the stream again.

This commit fixes it to not show the confirmation modal if user
has permission to subscribe again. We already have same behavior
when user tries to unsubscribe from the button present at the
right of tabs.
2025-04-14 09:24:53 -07:00
Sahil Batra
d3c06234e2 streams: Fix warning shown when unsubscribing from private stream.
We no longer archive the stream when private stream becomes
vacant, so removed that part from the warning.

When a private stream becomes vacant, everyone in the organization
can lose content access to it if no one has permission to subscribe
themselves or others to the stream. So, the warning is updated to
mention this.
2025-04-14 09:24:53 -07:00
bedo
51dab09c69 doc: Add an error explanation in schema migrations.
It wasn't clear enough the stated cause behind the following error:

"django.db.utils.OperationalError:
cannot ALTER TABLE "table_name" because it has pending trigger events"

So I add the detailed cause.
2025-04-14 09:10:34 -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
Harsh
f2b33fc3ee compose: Add banner when topic is moved and recipient is updated.
This commit adds the INFO compose banner for new channel/topic when the
recipient is updated when topic is moved.

fixes: #33445.
2025-04-13 20:29:58 -07:00
Sayam Samal
3701c99b0a popup_banners: Update connection error banner label.
This commit updates the connection error banner label to
"Unable to connect to Zulip. Trying to reconnect soon…" when the user
manually retries the connection via the "Try now" button and when the
retry time is less than 5 seconds. And updates the countdown label of
the same banner to "Unable to connect to Zulip. Trying to reconnect in
{retry_delay_secs} seconds…".
2025-04-13 20:25:01 -07:00
Tim Abbott
70e36ef16a help: Document copy-pasting LaTeX.
Fixes: https://chat.zulip.org/#narrow/channel/9-issues/topic/.E2.9C.94.20.F0.9F.93.82.20pasting.20LaTeX/near/2129200.

Co-authored-by: Apoorva Pendse <apoorvavpendse@gmail.com>
2025-04-13 20:24:27 -07:00
Vector73
b3efb901fc tools: Use .md extension for temporary API changelog files. 2025-04-13 20:22:53 -07:00
Shubham Padia
349e88adc6 settings: Exclude nobody from channel and group settings typeahead.
We have filtered the group in the get_user_groups argument of
set_up_pill_typeahead. We could have done it in `set_up_combined` but
that would have made that function non-generic and specific to these two
settings. We could also have filtered it in get_all_realm_user_groups by
adding an argument on whether to exclude it or not, but that would have
been very hard to read and track. This seemed like the better of the
options we had.

Fixes https://chat.zulip.org/#narrow/channel/9-issues/topic/.22Nobody.22.20group.20in.20UI.20to.20add.20subscribers.2Fgroup.20members
2025-04-13 20:22:26 -07:00
Sahil Batra
c5b005833c groups: Do not prefetch can_access_all_users_group setting.
This commit updates code to not prefetch can_access_all_users_group
and can_access_all_users_group__named_user_group fields using
select_related. We can just use get_realm_system_groups_name_dict
function to check if setting is set to "Everyone" group when
needed and can avoid unnecessarily fetching groups for every user
query.
2025-04-11 17:37:06 -07:00
Sahil Batra
7e77100433 users: Remove unused variable in get_user_dicts_in_realm. 2025-04-11 17:37:06 -07:00
Sahil Batra
7ebea853be user_groups: Refactor user_has_permission_for_group_setting.
This commit refactors user_has_permission_for_group_setting
to accept setting group ID instead of UserGroup object.

We only need ID in checking the permission and this helps in
further commit to avoid prefetching can_access_all_users_group
setting.
2025-04-11 17:37:06 -07:00
Jitendra Kumar
8682db5573 message_feed UI: Update logo dimensions for better scalability.
Change 'z' logo dimensions so that it scales according to chosen font
size.

Fix: #34266
2025-04-11 17:02:08 -07:00
Prakhar Pratyush
68b7deac72 messages: Clarify comment on zerver_message_edit_history_id idx.
This commit removes a misleading comment regarding
'zerver_message_edit_history_id' index.

We added the index in 0679 to use in 0680 but later the 0680 migration
was reworked resulting in the index not being used in 0680.

We didn't drop the index as we expect it to be helpful for other
things.

The comment was misleading hence removed.
2025-04-11 12:38:11 -07:00
Alex Vandiver
e1aa8b1cb0 tusd: Use GCS upload backend when the endpoint matches.
This works around tus/tusd#322, which in turn is caused by
aws/aws-sdk-go-v2#1816.  This requires separate authentication via
service account key.

Fixes: #34186.
2025-04-11 12:16:03 -07:00
Alex Vandiver
cf51013bb7 tusd: Reject tusd terminations after we insert them into our database.
The tusd protocol allows DELETE requests ("terminations") at any
point, including after a file has successfully been uploaded.  This
can allow tusd to remove a file from the bucket, out from under Zulip.

We use the new-in-2.7.0 pre-terminate hook to look up the file which
the client is requesting to terminate, and reject the termination if
it is a file that the Zulip database is already aware of.
2025-04-11 12:13:07 -07:00
Alex Vandiver
21eff33875 puppet: Upgrade tusd to 2.8.0. 2025-04-11 12:13:07 -07:00
Karl Stolley
c24d935f7c left_sidebar: Keep filter box from touching highlihted edge. 2025-04-11 12:08:00 -07:00
Karl Stolley
faa56e5f67 left_sidebar: Remove unnecessary high-specifity selectors.
These were introduced in #34340, but removing them does not seem
to affect sidebar display--and it also restores the specifity of
selectors for hiding the grouping brackets in the zoomed-in view.
2025-04-11 12:08:00 -07:00
Karl Stolley
1025fd559e left_sidebar: Correct stale #filter-topic-input refs. 2025-04-11 12:08:00 -07:00
Alex Vandiver
309876796e kandra: Add a couple useful command-line tools. 2025-04-11 11:25:58 -07:00
Alya Abbott
f4a337c656 contributor docs: Update info on icons in the help center. 2025-04-11 11:21:52 -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
Alex Vandiver
b11cbbab01 smokescreen: Move metrics port from the default 9810, to 4760.
This prevents errors if Smokescreen is running on a host with more
than 10 Tornado shards.
2025-04-11 10:29:26 -07:00
evykassirer
8d57bf30ac settings: Split CSS for two-pane-overlay and settings.
No changes, just shuffling things around for ease of reading
future commits.
2025-04-11 10:27:25 -07:00
evykassirer
3be4951e5e subscriptions: Move 40% width to just the left style block.
This is overwritten to ~60% in the .right style block and
shouldn't be in the shared style block.
2025-04-11 10:27:25 -07:00
evykassirer
e84c318e10 settings: Move stream_sorter_toggle CSS to subscriptions stylesheet.
It's only used for subscriptions so it makes more sense for it to
live there.
2025-04-11 10:27:25 -07:00
evykassirer
3539142479 settings: Remove margin for subheader title.
The margin doesn't scale with font size, so it looks
extra weird at small font sizes, and also the text
is already being centered with flex so we don't need
margin.
2025-04-11 10:27:25 -07:00
evykassirer
6b0dd9e063 settings: Move subheader CSS out of main CSS block.
In a future commit in (#34125) we'll add a classname for the
subheader and use that to scope these rules.

This commit has no changes in CSS rules. It only moves them around.
2025-04-11 10:27:25 -07:00
Sanchit Sharma
d5c83e02c3 streams: Return archived web-public channels. 2025-04-11 08:12:53 -07:00
Kartikay5849
32e6383779 settings: Show desktop notifications warning when permissions needed.
Display a warning banner in the desktop notifications settings
when browser permissions are not granted.
Hide "Send test notification" button unless permissions are granted.

Fixes: #33222.
2025-04-10 16:46:40 -07:00
Harsh
6f0ae8633f left_sidebar: Fix Enter key behavior on "Show all topics" link.
This commits adds href attribute so that pressing down
Enter key works on the anchor element and also makes the focus styling same topic names.
2025-04-10 16:23:01 -07:00
Anders Kaseorg
ad31ef22f2 narrow: Fix get_base_query_for_search access restrictions.
The type_id is the id of a UserProfile, Stream, or DirectMessageGroup,
not the id of a type.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-04-10 15:26:57 -07:00
Shubham Padia
de7efd23bc streams: Simplify send_peer_subscriber_events logic.
Earlier, we used to check whether the length of altered_user_ids was 1
and then create a dict of that user id and the streams that they were
added/removed to/from, and optimise our event sending that way. But that
was making the code harder to read.
Now, we just keep the key of user_streams as a concanated list of
user_ids and then add streams accordingly to user_streams.
Furthermore we do not check for peer_user_ids before modifying
user_streams anymore, since it is very highly unlikely that it will be
empty and if it is, send_event can handle it just fine.
2025-04-10 15:08:48 -07:00
Shubham Padia
1014de23a8 streams: Send different peer events for web & non-web public streams.
Earlier, we used to send a single event for all web-public and public
streams. But public streams can have guests, which means the peer user
ids for each of them can be different based on which guests are
subscribed to which channel.
In the previous code, we were using the last stream id from another loop
to get subscribers, which was causing a lot of non-deterministic
failures in our test, since that stream id could keep on changing.
Moreover, it doesn't make much sense to use that id here.
This commit still keeps around the optimisation for public channels with
non-guest users. It will send one event for all public channels with
non-guest users, one for web public channels and for the rest of the
channels it will send an event for each channel with a different set of
peer user ids.
2025-04-10 15:08:48 -07:00
Anders Kaseorg
bdd11577bf webpack: Use CORS requests for stylesheets.
This seems to be required for webpack-dev-server 5.2.1, for reasons
that have not yet been made public.  This relies on the
Access-Control-Allow-Origin: * header that we already set for static
content in both development and production.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-04-10 15:02:27 -07:00
Karl Stolley
ab24eea83e thumbnails: Place play button on all media with grid. 2025-04-10 12:55:15 -07:00
Karl Stolley
162a9ce29a thumbnails: Bump contrast higher on thumbnail hovers. 2025-04-10 12:55:15 -07:00
Karl Stolley
72c89404f3 thumbnails: Audition darker borders on typical images. 2025-04-10 12:55:15 -07:00
Karl Stolley
2421ddfb6e thumbnails: Audition thicker borders. 2025-04-10 12:55:15 -07:00
Karl Stolley
9392a1c8a6 cleanup: Move thumbnail values to CSS variables. 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
d9f0fe882d thumbnails: Restore legacy values on video thumbnails. 2025-04-10 12:55:15 -07:00
Karl Stolley
61e8aef597 thumbnails: Style for portrait or landscape orientation. 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
Karl Stolley
1dc87be1db thumbnails: Remove unnecessary margin on media first-children.
This was made unnecessary by a patch submitted and merged
in #34271.
2025-04-10 12:55:15 -07:00